All pastes #250148 Raw Edit

Anonymous

public c v1 · immutable
#250148 ·published 2006-11-16 17:35 UTC
rendered paste body
#include <stdio.h>static voidswap1 (int *a, int *b){	int c;	c = *a;	*a = *b;	*b = c;}int main (int argc, char **argv){	int a, b;	a = 4;	b = 3;	printf ("a: %d, b: %d\n", a, b);	swap1 (&a, &b);	printf ("a: %d, b: %d\n", a, b);	return 0;}// -O0	.file	"swap.c"	.text	.type	swap1, @functionswap1:	pushl	%ebp	movl	%esp, %ebp	subl	$16, %esp	movl	8(%ebp), %eax	movl	(%eax), %eax	movl	%eax, -4(%ebp)	movl	12(%ebp), %eax	movl	(%eax), %edx	movl	8(%ebp), %eax	movl	%edx, (%eax)	movl	12(%ebp), %edx	movl	-4(%ebp), %eax	movl	%eax, (%edx)	leave	ret	.size	swap1, .-swap1	.section	.rodata.LC0:	.string	"a: %d, b: %d\n"	.text.globl main	.type	main, @functionmain:	leal	4(%esp), %ecx	andl	$-16, %esp	pushl	-4(%ecx)	pushl	%ebp	movl	%esp, %ebp	pushl	%ecx	subl	$36, %esp	movl	$4, -8(%ebp)	movl	$3, -12(%ebp)	movl	-12(%ebp), %eax	movl	-8(%ebp), %edx	movl	%eax, 8(%esp)	movl	%edx, 4(%esp)	movl	$.LC0, (%esp)	call	printf	leal	-12(%ebp), %eax	movl	%eax, 4(%esp)	leal	-8(%ebp), %eax	movl	%eax, (%esp)	call	swap1	movl	-12(%ebp), %eax	movl	-8(%ebp), %edx	movl	%eax, 8(%esp)	movl	%edx, 4(%esp)	movl	$.LC0, (%esp)	call	printf	movl	$0, %eax	addl	$36, %esp	popl	%ecx	popl	%ebp	leal	-4(%ecx), %esp	ret	.size	main, .-main	.ident	"GCC: (GNU) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)"	.section	.note.GNU-stack,"",@progbits// -03	.file	"swap.c"	.section	.rodata.str1.1,"aMS",@progbits,1.LC0:	.string	"a: %d, b: %d\n"	.text	.p2align 4,,15.globl main	.type	main, @functionmain:	leal	4(%esp), %ecx	andl	$-16, %esp	pushl	-4(%ecx)	pushl	%ebp	movl	%esp, %ebp	pushl	%ecx	subl	$20, %esp	movl	$3, 8(%esp)	movl	$4, 4(%esp)	movl	$.LC0, (%esp)	call	printf	movl	$4, 8(%esp)	movl	$3, 4(%esp)	movl	$.LC0, (%esp)	call	printf	addl	$20, %esp	xorl	%eax, %eax	popl	%ecx	popl	%ebp	leal	-4(%ecx), %esp	ret	.size	main, .-main	.ident	"GCC: (GNU) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)"	.section	.note.GNU-stack,"",@progbits