#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 /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ init(int *, int);
int pick(int *, int, int /*<<< orphan*/);
int /*<<< orphan*/ print(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  if (argc != 2)
    return (0);
  int x[1024];
  init(x, 1024);
  printf("%d\n", pick(x, 1024, atoi(argv[1])));
  print(x, 1024);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     117f <main+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    11e4 <main+0x94>
lea    -0x1010(%rbp),%rdi
mov    $0x400,%esi
call   1060 <init@plt>
lea    -0x1010(%rbp),%rax
mov    %rax,-0x1018(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    -0x1018(%rbp),%rdi
mov    %eax,%edx
mov    $0x400,%esi
call   1040 <pick@plt>
mov    %eax,%esi
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
lea    -0x1010(%rbp),%rdi
mov    $0x400,%esi
call   1050 <print@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    11af <main+0x5f>
push   %r14
push   %rbx
sub    $0x1008,%rsp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x400,%esi
call   1060 <init@plt>
mov    0x8(%rbx),%rdi
call   1070 <atoi@plt>
mov    %r14,%rdi
mov    $0x400,%esi
mov    %eax,%edx
call   1040 <pick@plt>
lea    0xe6f(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x400,%esi
call   1050 <print@plt>
add    $0x1008,%rsp
pop    %rbx
pop    %r14
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i32]
%4 = icmp eq i32 %0, 2
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = bitcast [1024 x i32]* %3 to i8*
%7 = getelementptr inbounds [1024 x i32], [1024 x i32]* %3, i64 0, i64 0
%8 = call i32 @init(i32* %7, i32 1024)
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
%12 = call i32 @pick(i32* %7, i32 1024, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 @print(i32* %7, i32 1024)
br label %15
15: ; preds = %2, %5
ret i32 0
}