#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 first(char *);
int second(char *);
int main(int argc, char *argv[]) {
  int status;
  if (argc == 1) {
    status = first(argv[0]);
    return (status == 0 ? 0 : 8 + status);
  }
  switch (argv[1][0]) {
  case '1':
    status = second(argv[0]);
    return (status == 0 ? 0 : 16 + status);
  case '2':
    break;
  default:
    return (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)
jne    1177 <main+0x57>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <first@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1163 <main+0x43>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    116c <main+0x4c>
mov    -0x14(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11f3 <main+0xd3>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x31,%eax
je     11a4 <main+0x84>
jmp    1193 <main+0x73>
mov    -0x1c(%rbp),%eax
sub    $0x32,%eax
je     11db <main+0xbb>
jmp    11e0 <main+0xc0>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <second@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    11c7 <main+0xa7>
xor    %eax,%eax
mov    %eax,-0x20(%rbp)
jmp    11d0 <main+0xb0>
mov    -0x14(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11f3 <main+0xd3>
jmp    11ec <main+0xcc>
movl   $0x1,-0x4(%rbp)
jmp    11f3 <main+0xd3>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jne    1135 <main+0x15>
mov    (%rsi),%rdi
call   1040 <first@plt>
mov    %eax,%ecx
lea    0x8(%rcx),%eax
jmp    1158 <main+0x38>
mov    0x8(%rsi),%rax
movsbl (%rax),%ecx
cmp    $0x32,%ecx
je     115f <main+0x3f>
mov    $0x1,%eax
cmp    $0x31,%ecx
jne    1161 <main+0x41>
mov    (%rsi),%rdi
call   1030 <second@plt>
mov    %eax,%ecx
lea    0x10(%rcx),%eax
test   %ecx,%ecx
cmove  %ecx,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
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 eq i32 %7, 1
br i1 %8, label %9, label %22
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @first(i8* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %9
br label %20
17: ; preds = %9
%18 = load i32, i32* %6
%19 = add nsw i32 8, %18
br label %20
20: ; preds = %17, %16
%21 = phi i32 [ 0, %16 ], [ %19, %17 ]
store i32 %21, i32* %3
br label %45
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = getelementptr inbounds i8, i8* %25, i64 0
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
switch i32 %28, label %43 [
i32 49, label %29
i32 50, label %42
]
29: ; preds = %22
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 0
%32 = load i8*, i8** %31
%33 = call i32 @second(i8* %32)
store i32 %33, i32* %6
%34 = load i32, i32* %6
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %29
br label %40
37: ; preds = %29
%38 = load i32, i32* %6
%39 = add nsw i32 16, %38
br label %40
40: ; preds = %37, %36
%41 = phi i32 [ 0, %36 ], [ %39, %37 ]
store i32 %41, i32* %3
br label %45
42: ; preds = %22
br label %44
43: ; preds = %22
store i32 1, i32* %3
br label %45
44: ; preds = %42
store i32 0, i32* %3
br label %45
45: ; preds = %44, %43, %40, %20
%46 = load i32, i32* %3
ret i32 %46
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @first(i8* %5)
%7 = icmp eq i32 %6, 0
%8 = add nsw i32 %6, 8
%9 = select i1 %7, i32 0, i32 %8
br label %22
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
switch i32 %14, label %22 [
i32 49, label %15
i32 50, label %21
]
15: ; preds = %10
%16 = load i8*, i8** %1
%17 = tail call i32 @second(i8* %16)
%18 = icmp eq i32 %17, 0
%19 = add nsw i32 %17, 16
%20 = select i1 %18, i32 0, i32 %19
br label %22
21: ; preds = %10
br label %22
22: ; preds = %10, %21, %15, %4
%23 = phi i32 [ %9, %4 ], [ 0, %21 ], [ %20, %15 ], [ 1, %10 ]
ret i32 %23
}