int main(int argc, char **argv) {
  printf("%x \n", &argv[1]);
  int i = atol(argv[1]);
  printf("%x \n", &i);
  unsigned int j = 0;
  if (i < 10) {
    j = i;
    if (j > 50) {
      printf("Surprise! \n");
      return 1;
    }
  }
  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)
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1040 <atol@plt>
mov    %eax,-0x14(%rbp)
lea    0xe9b(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    11b0 <main+0x90>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x32,-0x18(%rbp)
jbe    11ab <main+0x8b>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11b7 <main+0x97>
jmp    11b0 <main+0x90>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
add    $0x8,%rsi
lea    0xeba(%rip),%r14
xor    %ebp,%ebp
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%rdi
xor    %eax,%eax
call   1050 <atol@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jns    1188 <main+0x58>
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%x \0A\00"
@.str.1 = [12 x i8] c"Surprise! \0A\00"
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
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %9)
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @atol to i32 (i8*, ...)*)(i8* %13)
store i32 %14, i32* %6
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %6)
store i32 0, i32* %7
%16 = load i32, i32* %6
%17 = icmp slt i32 %16, 10
br i1 %17, label %18, label %25
18: ; preds = %2
%19 = load i32, i32* %6
store i32 %19, i32* %7
%20 = load i32, i32* %7
%21 = icmp ugt i32 %20, 50
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %26
24: ; preds = %18
br label %25
25: ; preds = %24, %2
store i32 0, i32* %3
br label %26
26: ; preds = %25, %22
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@.str = [5 x i8] c"%x \0A\00"
@str = [11 x i8] c"Surprise! \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %4)
%6 = bitcast i32* %3 to i8*
%7 = load i8*, i8** %4
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atol to i32 (i8*, ...)*)(i8* %7)
store i32 %8, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %14
14: ; preds = %2, %12
%15 = phi i32 [ 1, %12 ], [ 0, %2 ]
ret i32 %15
}