#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int EXIT_SUCCESS;
int fact(int);
int /*<<< orphan*/ printf(char *, int, int, ...);
int /*<<< orphan*/ swap(int, int);
int main(int argc, char **argv) {
  int a, b;
  a = 10;
  b = 20;
  printf("Avant : a=%d,b=%d\n", a, b);
  swap(a, b);
  printf("Après a=%d,b=%d fact(3)=%d code=%d\n", a, b, fact(3), EXIT_SUCCESS);
  return (10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
movl   $0x14,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <swap@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x3,%edi
call   1040 <fact@plt>
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    0x2e48(%rip),%rax
mov    (%rax),%r8d
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xa,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1050 <swap@plt>
mov    $0x3,%edi
call   1040 <fact@plt>
mov    0x2e77(%rip),%rcx
mov    (%rcx),%r8d
lea    0xea0(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Avant : a=%d,b=%d\0A\00"
@.str.1 = [37 x i8] c"Apr\C3\A8s a=%d,b=%d fact(3)=%d code=%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
store i32 20, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %7
%10 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i32 @swap(i32 %11, i32 %12)
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = call i32 @fact(i32 3)
%17 = load i32, i32* @EXIT_SUCCESS
%18 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15, i32 %16, i32 %17)
ret i32 10
}

LLVM IR (-O2):
@.str = [19 x i8] c"Avant : a=%d,b=%d\0A\00"
@.str.1 = [37 x i8] c"Apr\C3\A8s a=%d,b=%d fact(3)=%d code=%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 10, i32 20)
%4 = tail call i32 @swap(i32 10, i32 20)
%5 = tail call i32 @fact(i32 3)
%6 = load i32, i32* @EXIT_SUCCESS
%7 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 20, i32 %5, i32 %6)
ret i32 10
}