#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*/ solve_part_1();
int /*<<< orphan*/ solve_part_2();
scalar_t__ strcmp(char const *, char *);
int main(int argc, const char *argv[]) {
  if (argc != 2) {
    return 1;
  }
  if (strcmp(argv[1], "1") == 0) {
    solve_part_1();
  } else if (strcmp(argv[1], "2") == 0) {
    solve_part_2();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     115c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    11b7 <main+0x87>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe95(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1186 <main+0x56>
mov    $0x0,%al
call   1030 <solve_part_1@plt>
jmp    11b0 <main+0x80>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11ab <main+0x7b>
mov    $0x0,%al
call   1050 <solve_part_2@plt>
jmp    11b0 <main+0x80>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
cmp    $0x2,%edi
jne    1181 <main+0x51>
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
lea    0xeb4(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1178 <main+0x48>
mov    0x8(%r14),%rdi
lea    0xea1(%rip),%rsi
call   1040 <strcmp@plt>
xor    %ebx,%ebx
test   %rax,%rax
jne    1181 <main+0x51>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <solve_part_2@plt>
jmp    1181 <main+0x51>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <solve_part_1@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"2\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 ne i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %27
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = call i32 (...) @solve_part_1()
br label %26
17: ; preds = %9
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %17
%24 = call i32 (...) @solve_part_2()
br label %25
25: ; preds = %23, %17
br label %26
26: ; preds = %25, %15
store i32 0, i32* %3
br label %27
27: ; preds = %26, %8
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"2\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %17
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 ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 (...) @solve_part_1()
br label %17
11: ; preds = %4
%12 = load i8*, i8** %5
%13 = tail call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = tail call i32 (...) @solve_part_2()
br label %17
17: ; preds = %9, %15, %11, %2
%18 = phi i32 [ 1, %2 ], [ 0, %11 ], [ 0, %15 ], [ 0, %9 ]
ret i32 %18
}