#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*/ errx(int, char *);
int /*<<< orphan*/ gcrepo(int, char *);
int main(int argc, char **argv) {
  int LotNr;
  char *subname;
  if (argc < 2)
    errx(1, "Usage: ./gcrepo subname [ lotnr ]");
  subname = argv[1];
  if (argc == 3) {
    LotNr = atoi(argv[2]);
    gcrepo(LotNr, subname);
  } else {
    for (LotNr = 1; LotNr < 10000; LotNr++) {
      gcrepo(LotNr, subname);
    }
  }
  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   $0x2,-0x8(%rbp)
jge    1161 <main+0x31>
mov    $0x1,%edi
lea    0xea4(%rip),%rsi
call   1040 <errx@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    1198 <main+0x68>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1030 <gcrepo@plt>
jmp    11cb <main+0x9b>
movl   $0x1,-0x14(%rbp)
cmpl   $0x2710,-0x14(%rbp)
jge    11c6 <main+0x96>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1030 <gcrepo@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119f <main+0x6f>
jmp    11cb <main+0x9b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
cmp    $0x1,%edi
jg     1153 <main+0x23>
lea    0xebd(%rip),%rsi
mov    $0x1,%edi
call   1040 <errx@plt>
mov    0x8(%r14),%rbx
jmp    1171 <main+0x41>
mov    0x8(%r14),%rbx
cmp    $0x3,%edi
jne    1171 <main+0x41>
mov    0x10(%r14),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <gcrepo@plt>
jmp    1195 <main+0x65>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <gcrepo@plt>
add    $0x1,%ebp
cmp    $0x2710,%ebp
jne    1180 <main+0x50>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Usage: ./gcrepo subname [ lotnr ]\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @errx(i32 1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
store i8* %15, i8** %7
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 3
br i1 %17, label %18, label %26
18: ; preds = %12
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 2
%21 = load i8*, i8** %20
%22 = call i32 @atoi(i8* %21)
store i32 %22, i32* %6
%23 = load i32, i32* %6
%24 = load i8*, i8** %7
%25 = call i32 @gcrepo(i32 %23, i8* %24)
br label %38
26: ; preds = %12
store i32 1, i32* %6
br label %27
27: ; preds = %34, %26
%28 = load i32, i32* %6
%29 = icmp slt i32 %28, 10000
br i1 %29, label %30, label %37
30: ; preds = %27
%31 = load i32, i32* %6
%32 = load i8*, i8** %7
%33 = call i32 @gcrepo(i32 %31, i8* %32)
br label %34
34: ; preds = %30
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %27
37: ; preds = %27
br label %38
38: ; preds = %37, %18
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Usage: ./gcrepo subname [ lotnr ]\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
br label %12
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i32 %0, 3
br i1 %11, label %14, label %12
12: ; preds = %4, %8
%13 = phi i8* [ %7, %4 ], [ %10, %8 ]
br label %19
14: ; preds = %8
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = tail call i32 @gcrepo(i32 %17, i8* %10)
br label %24
19: ; preds = %12, %19
%20 = phi i32 [ %22, %19 ], [ 1, %12 ]
%21 = tail call i32 @gcrepo(i32 %20, i8* %13)
%22 = add nuw nsw i32 %20, 1
%23 = icmp eq i32 %22, 10000
br i1 %23, label %24, label %19
24: ; preds = %19, %14
ret i32 0
}