#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 extA;
int /*<<< orphan*/ fa(int, int);
int /*<<< orphan*/ printVar();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
int main(void) {
  int i = 3;
  printf("i = %d\n", i);
  fa(i, ++i);
  printf("i = %d\n", i);
  fa(i, i--);
  putchar('\n');
  printVar();
  putchar('\n');
  extern extA;
  printf("extA = %d\n", extA);
  putchar('\n');
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x8(%rbp)
call   1060 <fa@plt>
mov    -0x8(%rbp),%esi
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
call   1060 <fa@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1050 <printVar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e26(%rip),%rax
mov    (%rax),%esi
lea    0xe45(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2dff(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <printf@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1060 <fa@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
mov    $0x4,%edi
mov    $0x4,%esi
call   1060 <fa@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <printVar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%esi
lea    0xe5d(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e17(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"i = %d\0A\00"
@.str.1 = [11 x i8] c"extA = %d\0A\00"
@extA = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = call i32 @fa(i32 %5, i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
%12 = load i32, i32* %2
%13 = add nsw i32 %12, -1
store i32 %13, i32* %2
%14 = call i32 @fa(i32 %11, i32 %12)
%15 = call i32 @putchar(i8 signext 10)
%16 = call i32 (...) @printVar()
%17 = call i32 @putchar(i8 signext 10)
%18 = load i32, i32* @extA
%19 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = call i32 @putchar(i8 signext 10)
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}

LLVM IR (-O2):
@.str = [8 x i8] c"i = %d\0A\00"
@.str.1 = [11 x i8] c"extA = %d\0A\00"
@extA = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @fa(i32 3, i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i32 @fa(i32 4, i32 4)
%5 = tail call i32 @putchar(i8 signext 10)
%6 = tail call i32 (...) @printVar()
%7 = tail call i32 @putchar(i8 signext 10)
%8 = load i32, i32* @extA
%9 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = tail call i32 @putchar(i8 signext 10)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}