#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int initiate(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (argc >= 3 && strcmp(argv[1], "initiate") == 0) {
    return initiate(atoi(argv[2]), argc > 3 ? atoi(argv[3]) : 0);
  }
  fprintf(stderr, "Usage:\n");
  fprintf(stderr, "  %s initiate <count> [<delay in ms>]\n", argv[0]);
  return 1;
}


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   $0x3,-0x8(%rbp)
jl     11ca <main+0x8a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe91(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11ca <main+0x8a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x3,-0x8(%rbp)
jle    11ad <main+0x6d>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    11b7 <main+0x77>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    11b7 <main+0x77>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1060 <initiate@plt>
mov    %eax,-0x4(%rbp)
jmp    1206 <main+0xc6>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
lea    0xe2f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe19(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
cmp    $0x3,%edi
jl     1163 <main+0x23>
mov    %edi,%ebp
mov    0x8(%rbx),%rdi
lea    0xea7(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1199 <main+0x59>
mov    0x2e76(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xe95(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    (%rbx),%rdx
lea    0xe89(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x10(%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%r14d
xor    %esi,%esi
cmp    $0x4,%ebp
jb     11b7 <main+0x77>
mov    0x18(%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%esi
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <initiate@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"initiate\00"
@stderr = global i32 0
@.str.1 = [8 x i8] c"Usage:\0A\00"
@.str.2 = [39 x i8] c" %s initiate <count> [<delay in ms>]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sge i32 %6, 3
br i1 %7, label %8, label %30
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %30
14: ; preds = %8
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
%19 = load i32, i32* %4
%20 = icmp sgt i32 %19, 3
br i1 %20, label %21, label %26
21: ; preds = %14
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 3
%24 = load i8*, i8** %23
%25 = call i32 @atoi(i8* %24)
br label %27
26: ; preds = %14
br label %27
27: ; preds = %26, %21
%28 = phi i32 [ %25, %21 ], [ 0, %26 ]
%29 = call i32 @initiate(i32 %18, i32 %28)
store i32 %29, i32* %3
br label %38
30: ; preds = %8, %2
%31 = load i32, i32* @stderr
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%33 = load i32, i32* @stderr
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 0
%36 = load i8*, i8** %35
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %36)
store i32 1, i32* %3
br label %38
38: ; preds = %30, %27
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
@.str = [9 x i8] c"initiate\00"
@stderr = global i32 0
@.str.1 = [8 x i8] c"Usage:\0A\00"
@.str.2 = [39 x i8] c" %s initiate <count> [<delay in ms>]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %21
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %4
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = icmp ugt i32 %0, 3
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = getelementptr inbounds i8*, i8** %1, i64 3
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
br label %18
18: ; preds = %9, %14
%19 = phi i32 [ %17, %14 ], [ 0, %9 ]
%20 = tail call i32 @initiate(i32 %12, i32 %19)
br label %27
21: ; preds = %4, %2
%22 = load i32, i32* @stderr
%23 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = load i8*, i8** %1
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %25)
br label %27
27: ; preds = %21, %18
%28 = phi i32 [ %20, %18 ], [ 1, %21 ]
ret i32 %28
}