#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 */
struct option {
  char *member_0;
  char member_3;
  int /*<<< orphan*/ *member_2;
  int /*<<< orphan*/ member_1;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int getopt_long(int, char **, char *, struct option *, int *);
int /*<<< orphan*/ help(char *);
#define no_argument 128
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ subdivideK33(int);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  int c;
  char *name = argv[0];
  static struct option long_options[] = {{"help", no_argument, NULL, 'h'}};
  int option_index = 0;
  while ((c = getopt_long(argc, argv, "h", long_options, &option_index)) !=
         -1) {
    switch (c) {
    case 'h':
      help(name);
      return EXIT_SUCCESS;
    case '?':
      usage(name);
      return EXIT_FAILURE;
    default:
      fprintf(stderr, "Illegal option %c.\n", c);
      usage(name);
      return EXIT_FAILURE;
    }
  }
  int times = atoi(argv[argc - 1]);
  subdivideK33(times);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe6f(%rip),%rdx
lea    0x2ec3(%rip),%rcx
lea    -0x24(%rbp),%r8
call   1030 <getopt_long@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     123d <main+0xdd>
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x3f,%eax
je     11f1 <main+0x91>
jmp    11c6 <main+0x66>
mov    -0x2c(%rbp),%eax
sub    $0x68,%eax
jne    120b <main+0xab>
jmp    11d7 <main+0x77>
mov    -0x20(%rbp),%rdi
call   1070 <help@plt>
mov    0x2de9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    126a <main+0x10a>
mov    -0x20(%rbp),%rdi
call   1050 <usage@plt>
mov    0x2dd7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    126a <main+0x10a>
mov    0x2dce(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xde9(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1050 <usage@plt>
mov    0x2da5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    126a <main+0x10a>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%edi
call   1060 <subdivideK33@plt>
mov    0x2d6b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%r14
movl   $0x0,0xc(%rsp)
lea    0xe86(%rip),%rdx
lea    0x2eda(%rip),%rcx
lea    0xc(%rsp),%r8
call   1030 <getopt_long@plt>
cmp    $0xffffffff,%eax
je     11a9 <main+0x49>
cmp    $0x3f,%eax
je     11dd <main+0x7d>
cmp    $0x68,%eax
jne    11c6 <main+0x66>
mov    %r14,%rdi
call   1070 <help@plt>
jmp    11bd <main+0x5d>
movslq %ebp,%rax
mov    -0x8(%rbx,%rax,8),%rdi
call   1080 <atoi@plt>
mov    %eax,%edi
call   1060 <subdivideK33@plt>
mov    0x2e0c(%rip),%rax
jmp    11ec <main+0x8c>
mov    0x2e13(%rip),%rcx
mov    (%rcx),%edi
lea    0xe31(%rip),%rsi
mov    %eax,%edx
call   1040 <fprintf@plt>
mov    %r14,%rdi
call   1050 <usage@plt>
mov    0x2dec(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.option = type { i8*, i8, i32*, i32 }
@main.long_options = internal global [1 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8 -128, i32* null, i32 104 }]
@.str = [5 x i8] c"help\00"
@.str.1 = [2 x i8] c"h\00"
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
@stderr = global i32 0
@.str.2 = [20 x i8] c"Illegal option %c.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
store i8* %12, i8** %7
store i32 0, i32* %8
br label %13
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i8**, i8*** %5
%16 = call i32 @getopt_long(i32 %14, i8** %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %struct.option* getelementptr inbounds ([1 x %struct.option], [1 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %8)
store i32 %16, i32* %6
%17 = icmp ne i32 %16, -1
br i1 %17, label %18, label %35
18: ; preds = %13
%19 = load i32, i32* %6
switch i32 %19, label %28 [
i32 104, label %20
i32 63, label %24
]
20: ; preds = %18
%21 = load i8*, i8** %7
%22 = call i32 @help(i8* %21)
%23 = load i32, i32* @EXIT_SUCCESS
store i32 %23, i32* %3
br label %46
24: ; preds = %18
%25 = load i8*, i8** %7
%26 = call i32 @usage(i8* %25)
%27 = load i32, i32* @EXIT_FAILURE
store i32 %27, i32* %3
br label %46
28: ; preds = %18
%29 = load i32, i32* @stderr
%30 = load i32, i32* %6
%31 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%32 = load i8*, i8** %7
%33 = call i32 @usage(i8* %32)
%34 = load i32, i32* @EXIT_FAILURE
store i32 %34, i32* %3
br label %46
35: ; preds = %13
%36 = load i8**, i8*** %5
%37 = load i32, i32* %4
%38 = sub nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8*, i8** %36, i64 %39
%41 = load i8*, i8** %40
%42 = call i32 @atoi(i8* %41)
store i32 %42, i32* %9
%43 = load i32, i32* %9
%44 = call i32 @subdivideK33(i32 %43)
%45 = load i32, i32* @EXIT_SUCCESS
store i32 %45, i32* %3
br label %46
46: ; preds = %35, %28, %24, %20
%47 = load i32, i32* %3
ret i32 %47
}

LLVM IR (-O2):
%struct.option = type { i8*, i8, i32*, i32 }
@main.long_options = internal global [1 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8 -128, i32* null, i32 104 }]
@.str = [5 x i8] c"help\00"
@.str.1 = [2 x i8] c"h\00"
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
@stderr = global i32 0
@.str.2 = [20 x i8] c"Illegal option %c.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = load i8*, i8** %1
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %struct.option* getelementptr inbounds ([1 x %struct.option], [1 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %3)
switch i32 %6, label %11 [
i32 -1, label %15
i32 104, label %7
i32 63, label %9
]
7: ; preds = %2
%8 = call i32 @help(i8* %4)
br label %22
9: ; preds = %2
%10 = call i32 @usage(i8* %4)
br label %22
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%14 = call i32 @usage(i8* %4)
br label %22
15: ; preds = %2
%16 = add nsw i32 %0, -1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %1, i64 %17
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
%21 = call i32 @subdivideK33(i32 %20)
br label %22
22: ; preds = %15, %11, %9, %7
%23 = phi i32* [ @EXIT_FAILURE, %11 ], [ @EXIT_FAILURE, %9 ], [ @EXIT_SUCCESS, %7 ], [ @EXIT_SUCCESS, %15 ]
%24 = load i32, i32* %23
ret i32 %24
}