main(int argc, char *argv[], char *env[]) {
  int a, b, c;
  printf("enter main\n");
  printf("&argc=%x\nargv=%x\nenv=%x\n", &argc, argv, env);
  printf("&a=%x\n%b=%x\n&c=%x\n", &a, &b, &c);
  a = 1;
  b = 2;
  c = 3;
  A(a, b);
  printf("exit main\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xebc(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x1c(%rbp)
movl   $0x2,-0x20(%rbp)
movl   $0x3,-0x24(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    $0x0,%al
call   1040 <A@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,0x14(%rsp)
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x14(%rsp),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
xor    %eax,%eax
call   1040 <printf@plt>
movl   $0x1,0x10(%rsp)
movl   $0x2,0xc(%rsp)
movl   $0x3,0x8(%rsp)
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <A@plt>
lea    0xe84(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"enter main\0A\00"
@.str.1 = [25 x i8] c"&argc=%x\0Aargv=%x\0Aenv=%x\0A\00"
@.str.2 = [19 x i8] c"&a=%x\0A%b=%x\0A&c=%x\0A\00"
@.str.3 = [11 x i8] c"exit main\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%11 = load i8**, i8*** %5
%12 = load i8**, i8*** %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32* %4, i8** %11, i8** %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32* %7, i32* %8, i32* %9)
store i32 1, i32* %7
store i32 2, i32* %8
store i32 3, i32* %9
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = call i32 (i32, i32, ...) bitcast (i32 (...)* @A to i32 (i32, i32, ...)*)(i32 %15, i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c"&argc=%x\0Aargv=%x\0Aenv=%x\0A\00"
@.str.2 = [19 x i8] c"&a=%x\0A%b=%x\0A&c=%x\0A\00"
@str = [11 x i8] c"enter main\00"
@str.4 = [10 x i8] c"exit main\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
%8 = bitcast i32* %5 to i8*
%9 = bitcast i32* %6 to i8*
%10 = bitcast i32* %7 to i8*
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32* %4, i8** %1, i8** %2)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32* %5, i32* %6, i32* %7)
store i32 1, i32* %5
store i32 2, i32* %6
store i32 3, i32* %7
%14 = call i32 (i32, i32, ...) bitcast (i32 (...)* @A to i32 (i32, i32, ...)*)(i32 1, i32 2)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}