#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 atoi(char *);
int /*<<< orphan*/ printf(char *, int, int, int, int);
int some_function_with_a_really_long_name_that_must_be_longer_than_64_bytes(
    int);
int some_normal_function(int);
int main(int argc, char **argv) {
  int x = 20, y, z;
  if (argc > 1)
    x = atoi(argv[1]);
  y = some_function_with_a_really_long_name_that_must_be_longer_than_64_bytes(
      x);
  z = some_normal_function(x);
  printf("f1(%i) = %i\nf2(%i) = %i\n", x, y, x, z);
  return 0;
}


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   $0x14,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1177 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <some_function_with_a_really_long_name_that_must_be_longer_than_64_bytes@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <some_normal_function@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x14,%ebx
cmp    $0x2,%edi
jl     1158 <main+0x18>
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
mov    %ebx,%edi
call   1050 <some_function_with_a_really_long_name_that_must_be_longer_than_64_bytes@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <some_normal_function@plt>
lea    0xe91(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"f1(%i) = %i\0Af2(%i) = %i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 20, i32* %6
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %6
br label %16
16: ; preds = %11, %2
%17 = load i32, i32* %6
%18 = call i32 @some_function_with_a_really_long_name_that_must_be_longer_than_64_bytes(i32 %17)
store i32 %18, i32* %7
%19 = load i32, i32* %6
%20 = call i32 @some_normal_function(i32 %19)
store i32 %20, i32* %8
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %8
%25 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %21, i32 %22, i32 %23, i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"f1(%i) = %i\0Af2(%i) = %i\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ %7, %4 ], [ 20, %2 ]
%10 = tail call i32 @some_function_with_a_really_long_name_that_must_be_longer_than_64_bytes(i32 %9)
%11 = tail call i32 @some_normal_function(i32 %9)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %9, i32 %11)
ret i32 0
}