#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 cmd_commit(char *, int, int, char *);
int getopt(int, char **, char *);
int /*<<< orphan*/ init_ur();
char *optarg;
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  bool all = false, recursive = false;
  char *msg = NULL;
  int ch;
  init_ur();
  while ((ch = getopt(argc, argv, "arm:")) != -1) {
    switch (ch) {
    case 'a':
      all = true;
      break;
    case 'r':
      recursive = true;
      break;
    case 'm':
      msg = optarg;
      break;
    case '?':
      printf("usage: ur-commit [-ar] [-m <msg>]\n");
      return -1;
      break;
    }
  }
  return cmd_commit(".", recursive, all, msg);
  return 0;
}


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)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    $0x0,%al
call   1060 <init_ur@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe7f(%rip),%rdx
call   1040 <getopt@plt>
mov    %eax,-0x24(%rbp)
cmp    $0xffffffff,%eax
je     1221 <main+0xe1>
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
sub    $0x3f,%eax
je     1204 <main+0xc4>
jmp    11a6 <main+0x66>
mov    -0x28(%rbp),%eax
sub    $0x61,%eax
je     11d9 <main+0x99>
jmp    11b7 <main+0x77>
mov    -0x28(%rbp),%eax
sub    $0x6d,%eax
je     11f1 <main+0xb1>
jmp    11c8 <main+0x88>
mov    -0x28(%rbp),%eax
sub    $0x72,%eax
je     11e5 <main+0xa5>
jmp    121c <main+0xdc>
movl   $0x1,-0x14(%rbp)
jmp    121c <main+0xdc>
movl   $0x1,-0x18(%rbp)
jmp    121c <main+0xdc>
mov    0x2e00(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    121c <main+0xdc>
lea    0xdfa(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    123a <main+0xfa>
jmp    1173 <main+0x33>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    0xdf6(%rip),%rdi
call   1050 <cmd_commit@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%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
mov    %edi,%ebp
xor    %r14d,%r14d
xor    %eax,%eax
call   1060 <init_ur@plt>
lea    0xe9f(%rip),%r12
xor    %r13d,%r13d
xor    %r15d,%r15d
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1040 <getopt@plt>
cmp    $0x60,%eax
jle    11a0 <main+0x60>
cmp    $0x61,%eax
je     11ac <main+0x6c>
cmp    $0x72,%eax
je     11b4 <main+0x74>
cmp    $0x6d,%eax
jne    1170 <main+0x30>
mov    0x2e60(%rip),%rax
mov    (%rax),%r15
jmp    1170 <main+0x30>
nopl   (%rax)
cmp    $0xffffffff,%eax
je     11bc <main+0x7c>
cmp    $0x3f,%eax
jne    1170 <main+0x30>
jmp    11df <main+0x9f>
mov    $0x1,%r14d
jmp    1170 <main+0x30>
mov    $0x1,%r13d
jmp    1170 <main+0x30>
lea    0xe42(%rip),%rdi
mov    %r13d,%esi
mov    %r14d,%edx
mov    %r15,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <cmd_commit@plt>
lea    0xe21(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"arm:\00"
@optarg = global i8* null
@.str.1 = [35 x i8] c"usage: ur-commit [-ar] [-m <msg>]\0A\00"
@.str.2 = [2 x i8] c".\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 i8*
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i8* null, i8** %8
%10 = call i32 (...) @init_ur()
br label %11
11: ; preds = %24, %2
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 @getopt(i32 %12, i8** %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %14, i32* %9
%15 = icmp ne i32 %14, -1
br i1 %15, label %16, label %25
16: ; preds = %11
%17 = load i32, i32* %9
switch i32 %17, label %24 [
i32 97, label %18
i32 114, label %19
i32 109, label %20
i32 63, label %22
]
18: ; preds = %16
store i32 1, i32* %6
br label %24
19: ; preds = %16
store i32 1, i32* %7
br label %24
20: ; preds = %16
%21 = load i8*, i8** @optarg
store i8* %21, i8** %8
br label %24
22: ; preds = %16
%23 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %30
24: ; preds = %16, %20, %19, %18
br label %11
25: ; preds = %11
%26 = load i32, i32* %7
%27 = load i32, i32* %6
%28 = load i8*, i8** %8
%29 = call i32 @cmd_commit(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %26, i32 %27, i8* %28)
store i32 %29, i32* %3
br label %30
30: ; preds = %25, %22
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
@.str = [5 x i8] c"arm:\00"
@optarg = global i8* null
@.str.2 = [2 x i8] c".\00"
@str = [34 x i8] c"usage: ur-commit [-ar] [-m <msg>]\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @init_ur()
br label %4
4: ; preds = %13, %2
%5 = phi i32 [ 0, %2 ], [ 1, %13 ]
%6 = phi i32 [ 0, %2 ], [ %9, %13 ]
%7 = phi i8* [ null, %2 ], [ %12, %13 ]
br label %8
8: ; preds = %13, %4
%9 = phi i32 [ %6, %4 ], [ 1, %13 ]
%10 = phi i8* [ %7, %4 ], [ %12, %13 ]
br label %11
11: ; preds = %8, %15
%12 = phi i8* [ %10, %8 ], [ %16, %15 ]
br label %13
13: ; preds = %11, %13
%14 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
switch i32 %14, label %13 [
i32 -1, label %19
i32 97, label %4
i32 114, label %8
i32 109, label %15
i32 63, label %17
]
15: ; preds = %13
%16 = load i8*, i8** @optarg
br label %11
17: ; preds = %13
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %21
19: ; preds = %13
%20 = tail call i32 @cmd_commit(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %5, i8* %12)
br label %21
21: ; preds = %19, %17
%22 = phi i32 [ -1, %17 ], [ %20, %19 ]
ret i32 %22
}