#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*/ test1d(int, int);
int main(int argc, char **argv) {
  if (argc > 1) {
    int k;
    for (k = 1; k < argc; ++k) {
      test1d(atoi(argv[k]), 0);
      test1d(atoi(argv[k]), 1);
    }
  } else {
    test1d(32, 0);
    test1d(32, 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)
cmpl   $0x1,-0x8(%rbp)
jle    119d <main+0x7d>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1198 <main+0x78>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <test1d@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <test1d@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <main+0x27>
jmp    11b8 <main+0x98>
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <test1d@plt>
mov    $0x20,%edi
mov    $0x1,%esi
call   1030 <test1d@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1172 <main+0x52>
mov    %rsi,%r15
mov    %edi,%r14d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%rbx,8),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <test1d@plt>
mov    (%r15,%rbx,8),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <test1d@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <main+0x20>
jmp    118d <main+0x6d>
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <test1d@plt>
mov    $0x20,%edi
mov    $0x1,%esi
call   1030 <test1d@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %33
9: ; preds = %2
store i32 1, i32* %6
br label %10
10: ; preds = %29, %9
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %32
14: ; preds = %10
%15 = load i8**, i8*** %5
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
%21 = call i32 @test1d(i32 %20, i32 0)
%22 = load i8**, i8*** %5
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = call i32 @atoi(i8* %26)
%28 = call i32 @test1d(i32 %27, i32 1)
br label %29
29: ; preds = %14
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
br label %10
32: ; preds = %10
br label %36
33: ; preds = %2
%34 = call i32 @test1d(i32 32, i32 0)
%35 = call i32 @test1d(i32 32, i32 1)
br label %36
36: ; preds = %33, %32
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %15, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = tail call i32 @test1d(i32 %10, i32 0)
%12 = load i8*, i8** %8
%13 = tail call i32 @atoi(i8* %12)
%14 = tail call i32 @test1d(i32 %13, i32 1)
%15 = add nuw nsw i64 %7, 1
%16 = icmp eq i64 %15, %5
br i1 %16, label %20, label %6
17: ; preds = %2
%18 = tail call i32 @test1d(i32 32, i32 0)
%19 = tail call i32 @test1d(i32 32, i32 1)
br label %20
20: ; preds = %6, %17
ret i32 0
}