#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*/ check32();
int /*<<< orphan*/ paramdump();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ speed32();
scalar_t__ strncmp(char *, char *, int);
int main(int argc, char *argv[]) {
  int i;
  int speed = 0;
  int bit32 = 0;
  int param = 0;
  for (i = 1; i < argc; i++) {
    if (strncmp(argv[1], "-s", 2) == 0) {
      speed = 1;
    }
    if (strncmp(argv[1], "-b32", 4) == 0) {
      bit32 = 1;
    }
    if (strncmp(argv[1], "-p", 2) == 0) {
      param = 1;
    }
  }
  if (speed + bit32 + param == 0) {
    printf("usage:\n%s [-s | -b32 | -p]\n", argv[0]);
    return 0;
  }
  if (speed) {
    speed32();
  }
  if (bit32) {
    check32();
  }
  if (param) {
    paramdump();
  }
  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)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    121f <main+0xcf>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe63(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11b8 <main+0x68>
movl   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3c(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11e2 <main+0x92>
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe17(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    120c <main+0xbc>
movl   $0x1,-0x20(%rbp)
jmp    1211 <main+0xc1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1182 <main+0x32>
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
cmp    $0x0,%eax
jne    1250 <main+0x100>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdcc(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    128a <main+0x13a>
cmpl   $0x0,-0x18(%rbp)
je     1261 <main+0x111>
mov    $0x0,%al
call   1070 <speed32@plt>
cmpl   $0x0,-0x1c(%rbp)
je     1272 <main+0x122>
mov    $0x0,%al
call   1060 <check32@plt>
cmpl   $0x0,-0x20(%rbp)
je     1283 <main+0x133>
mov    $0x0,%al
call   1040 <paramdump@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x2,%edi
jl     11ee <main+0x9e>
mov    %edi,%ebp
add    $0xffffffff,%ebp
xor    %r12d,%r12d
xor    %r13d,%r13d
xor    %r15d,%r15d
jmp    1188 <main+0x38>
nopw   0x0(%rax,%rax,1)
mov    %r14d,%r12d
add    $0xffffffff,%ebp
je     11e5 <main+0x95>
mov    0x8(%rbx),%rdi
lea    0xe6d(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
mov    $0x1,%r14d
cmove  %r14d,%r15d
mov    0x8(%rbx),%rdi
lea    0xe4e(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
cmove  %r14d,%r13d
mov    0x8(%rbx),%rdi
lea    0xe37(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1180 <main+0x30>
mov    %r12d,%r14d
jmp    1180 <main+0x30>
lea    (%r15,%r13,1),%eax
add    %r14d,%eax
jne    120e <main+0xbe>
mov    (%rbx),%rsi
lea    0xe13(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
test   %r15d,%r15d
je     121a <main+0xca>
xor    %eax,%eax
call   1070 <speed32@plt>
test   %r13d,%r13d
je     1226 <main+0xd6>
xor    %eax,%eax
call   1060 <check32@plt>
test   %r14d,%r14d
je     11fd <main+0xad>
xor    %eax,%eax
call   1040 <paramdump@plt>
jmp    11fd <main+0xad>

LLVM IR (-O0):
@.str = [3 x i8] c"-s\00"
@.str.1 = [5 x i8] c"-b32\00"
@.str.2 = [3 x i8] c"-p\00"
@.str.3 = [28 x i8] c"usage:\0A%s [-s | -b32 | -p]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 1, i32* %6
br label %10
10: ; preds = %36, %2
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %39
14: ; preds = %10
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i64 @strncmp(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %14
store i32 1, i32* %7
br label %21
21: ; preds = %20, %14
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i64 @strncmp(i8* %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %21
store i32 1, i32* %8
br label %28
28: ; preds = %27, %21
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i64 @strncmp(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %28
store i32 1, i32* %9
br label %35
35: ; preds = %34, %28
br label %36
36: ; preds = %35
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %6
br label %10
39: ; preds = %10
%40 = load i32, i32* %7
%41 = load i32, i32* %8
%42 = add nsw i32 %40, %41
%43 = load i32, i32* %9
%44 = add nsw i32 %42, %43
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %51
46: ; preds = %39
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 0
%49 = load i8*, i8** %48
%50 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i8* %49)
store i32 0, i32* %3
br label %67
51: ; preds = %39
%52 = load i32, i32* %7
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %51
%55 = call i32 (...) @speed32()
br label %56
56: ; preds = %54, %51
%57 = load i32, i32* %8
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %56
%60 = call i32 (...) @check32()
br label %61
61: ; preds = %59, %56
%62 = load i32, i32* %9
%63 = icmp ne i32 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %61
%65 = call i32 (...) @paramdump()
br label %66
66: ; preds = %64, %61
store i32 0, i32* %3
br label %67
67: ; preds = %66, %46
%68 = load i32, i32* %3
ret i32 %68
}

LLVM IR (-O2):
@.str = [3 x i8] c"-s\00"
@.str.1 = [5 x i8] c"-b32\00"
@.str.2 = [3 x i8] c"-p\00"
@.str.3 = [28 x i8] c"usage:\0A%s [-s | -b32 | -p]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %29
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ 0, %4 ], [ %22, %6 ]
%8 = phi i32 [ 0, %4 ], [ %18, %6 ]
%9 = phi i32 [ 0, %4 ], [ %14, %6 ]
%10 = phi i32 [ 1, %4 ], [ %23, %6 ]
%11 = load i8*, i8** %5
%12 = tail call i64 @strncmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%13 = icmp eq i64 %12, 0
%14 = select i1 %13, i32 1, i32 %9
%15 = load i8*, i8** %5
%16 = tail call i64 @strncmp(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%17 = icmp eq i64 %16, 0
%18 = select i1 %17, i32 1, i32 %8
%19 = load i8*, i8** %5
%20 = tail call i64 @strncmp(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%21 = icmp eq i64 %20, 0
%22 = select i1 %21, i32 1, i32 %7
%23 = add nuw nsw i32 %10, 1
%24 = icmp eq i32 %23, %0
br i1 %24, label %25, label %6
25: ; preds = %6
%26 = add nsw i32 %18, %14
%27 = sub i32 0, %22
%28 = icmp eq i32 %26, %27
br i1 %28, label %29, label %32
29: ; preds = %2, %25
%30 = load i8*, i8** %1
%31 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i8* %30)
br label %44
32: ; preds = %25
%33 = icmp eq i32 %14, 0
br i1 %33, label %36, label %34
34: ; preds = %32
%35 = tail call i32 (...) @speed32()
br label %36
36: ; preds = %34, %32
%37 = icmp eq i32 %18, 0
br i1 %37, label %40, label %38
38: ; preds = %36
%39 = tail call i32 (...) @check32()
br label %40
40: ; preds = %38, %36
%41 = icmp eq i32 %22, 0
br i1 %41, label %44, label %42
42: ; preds = %40
%43 = tail call i32 (...) @paramdump()
br label %44
44: ; preds = %40, %42, %29
ret i32 0
}