#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ help(char *);
scalar_t__ parse(char *);
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  printf("Can bridge - version 2.0\n");
  int i;
  for (i = 1; i < argc && i < 8; i++) {
    if (parse(argv[i]) < 0) {
      fprintf(stderr, "error with argument: \"%s\"\n", argv[i]);
      help(argv[0]);
      return EXIT_FAILURE;
    }
  }
  if (i == 8) {
    fprintf(stderr, "Warning: too many arguments, some was ignored\n");
  } else if (i == 1) {
    help(argv[0]);
    return EXIT_SUCCESS;
  }
  printf("Working …\n");
  pause();
}


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)
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x15(%rbp)
jge    1194 <main+0x44>
cmpl   $0x8,-0x14(%rbp)
setl   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    11a4 <main+0x54>
jmp    1212 <main+0xc2>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1070 <parse@plt>
cmp    $0x0,%rax
jge    11ff <main+0xaf>
mov    0x2e1a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe3f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <help@plt>
mov    0x2de3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1277 <main+0x127>
jmp    1204 <main+0xb4>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1179 <main+0x29>
cmpl   $0x8,-0x14(%rbp)
jne    1238 <main+0xe8>
mov    0x2dbd(%rip),%rax
mov    (%rax),%edi
lea    0xe09(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1264 <main+0x114>
cmpl   $0x1,-0x14(%rbp)
jne    125f <main+0x10f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <help@plt>
mov    0x2d7b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1277 <main+0x127>
jmp    1264 <main+0x114>
lea    0xdf9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <pause@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %edi,%r14d
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x2,%r14d
jl     11dc <main+0x8c>
add    $0xfffffffe,%r14d
cmp    $0x6,%r14d
mov    $0x6,%ebp
cmovb  %r14d,%ebp
add    $0x1,%rbp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    0x8(%r15,%rbx,8),%rdi
call   1070 <parse@plt>
test   %rax,%rax
js     11ed <main+0x9d>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1190 <main+0x40>
cmp    $0x6,%r14d
jb     11c5 <main+0x75>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
lea    0xe5d(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <pause@plt>
jmp    121a <main+0xca>
mov    (%r15),%rdi
call   1060 <help@plt>
mov    0x2de5(%rip),%rax
jmp    1218 <main+0xc8>
mov    0x2dec(%rip),%rax
mov    (%rax),%edi
mov    0x8(%r15,%rbx,8),%rdx
lea    0xdfe(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%rdi
call   1060 <help@plt>
mov    0x2dc0(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Can bridge - version 2.0\0A\00"
@stderr = global i32 0
@.str.1 = [27 x i8] c"error with argument: \22%s\22\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [47 x i8] c"Warning: too many arguments, some was ignored\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.3 = [13 x i8] c"Working \E2\80\A6\0A\00"
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 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %6
br label %8
8: ; preds = %39, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 8
br label %15
15: ; preds = %12, %8
%16 = phi i1 [ false, %8 ], [ %14, %12 ]
br i1 %16, label %17, label %42
17: ; preds = %15
%18 = load i8**, i8*** %5
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = call i64 @parse(i8* %22)
%24 = icmp slt i64 %23, 0
br i1 %24, label %25, label %38
25: ; preds = %17
%26 = load i32, i32* @stderr
%27 = load i8**, i8*** %5
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %27, i64 %29
%31 = load i8*, i8** %30
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %31)
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 0
%35 = load i8*, i8** %34
%36 = call i32 @help(i8* %35)
%37 = load i32, i32* @EXIT_FAILURE
store i32 %37, i32* %3
br label %61
38: ; preds = %17
br label %39
39: ; preds = %38
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %8
42: ; preds = %15
%43 = load i32, i32* %6
%44 = icmp eq i32 %43, 8
br i1 %44, label %45, label %48
45: ; preds = %42
%46 = load i32, i32* @stderr
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
br label %58
48: ; preds = %42
%49 = load i32, i32* %6
%50 = icmp eq i32 %49, 1
br i1 %50, label %51, label %57
51: ; preds = %48
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 0
%54 = load i8*, i8** %53
%55 = call i32 @help(i8* %54)
%56 = load i32, i32* @EXIT_SUCCESS
store i32 %56, i32* %3
br label %61
57: ; preds = %48
br label %58
58: ; preds = %57, %45
%59 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%60 = call i32 (...) @pause()
br label %61
61: ; preds = %58, %51, %25
%62 = load i32, i32* %3
ret i32 %62
}

LLVM IR (-O2):
@stderr = global i32 0
@.str.1 = [27 x i8] c"error with argument: \22%s\22\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [47 x i8] c"Warning: too many arguments, some was ignored\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [25 x i8] c"Can bridge - version 2.0\00"
@str.4 = [12 x i8] c"Working \E2\80\A6\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %33
5: ; preds = %2
%6 = add nsw i32 %0, -2
%7 = call i32 @llvm.umin.i32(i32 %6, i32 6)
%8 = add nuw nsw i32 %7, 2
%9 = zext i32 %8 to i64
br label %10
10: ; preds = %5, %25
%11 = phi i64 [ 1, %5 ], [ %26, %25 ]
%12 = getelementptr inbounds i8*, i8** %1, i64 %11
%13 = load i8*, i8** %12
%14 = tail call i64 @parse(i8* %13)
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %25
16: ; preds = %10
%17 = and i64 %11, 4294967295
%18 = getelementptr inbounds i8*, i8** %1, i64 %17
%19 = load i32, i32* @stderr
%20 = load i8*, i8** %18
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = load i8*, i8** %1
%23 = tail call i32 @help(i8* %22)
%24 = load i32, i32* @EXIT_FAILURE
br label %40
25: ; preds = %10
%26 = add nuw nsw i64 %11, 1
%27 = icmp eq i64 %26, %9
br i1 %27, label %28, label %10
28: ; preds = %25
%29 = icmp ugt i32 %6, 5
br i1 %29, label %30, label %37
30: ; preds = %28
%31 = load i32, i32* @stderr
%32 = tail call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
br label %37
33: ; preds = %2
%34 = load i8*, i8** %1
%35 = tail call i32 @help(i8* %34)
%36 = load i32, i32* @EXIT_SUCCESS
br label %40
37: ; preds = %28, %30
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.4, i64 0, i64 0))
%39 = tail call i32 (...) @pause()
br label %40
40: ; preds = %37, %33, %16
%41 = phi i32 [ %24, %16 ], [ 0, %37 ], [ %36, %33 ]
ret i32 %41
}