#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 execvp(char *, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  char *progname = argv[0];
  char toolname[32];
  int ret;
  if (argc < 2) {
    usage(progname);
  } else {
    if (!strncmp(argv[1], "-v", 2) || !strncmp(argv[1], "version", 7) ||
        !strncmp(argv[1], "--version", 9)) {
      printf("oggz version "
             "0.9.8"
             "\n");
    } else if (!strncmp(argv[1], "-h", 2) || !strncmp(argv[1], "help", 4) ||
               !strncmp(argv[1], "--help", 6)) {
      if (argc == 2) {
        usage(progname);
      } else {
        sprintf(toolname, "oggz-%s", argv[2]);
        argv[1] = "man";
        argv[2] = toolname;
        ret = execvp("man", &argv[1]);
        argv[1] = toolname;
        argv[2] = "--help";
        ret = execvp(toolname, &argv[1]);
        if (ret == -1) {
          perror(toolname);
        }
      }
    } else {
      sprintf(toolname, "oggz-%s", argv[1]);
      argv[1] = toolname;
      ret = execvp(toolname, &argv[1]);
      if (ret == -1) {
        perror(toolname);
      }
    }
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11a9 <main+0x39>
mov    -0x18(%rbp),%rdi
call   1050 <usage@plt>
jmp    138e <main+0x21e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe48(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     120f <main+0x9f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2b(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     120f <main+0x9f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe07(%rip),%rsi
mov    $0x9,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1220 <main+0xb0>
lea    0xdf7(%rip),%rdi
call   1040 <printf@plt>
jmp    1389 <main+0x219>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdf2(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     1286 <main+0x116>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdd5(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     1286 <main+0x116>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdb1(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1334 <main+0x1c4>
cmpl   $0x2,-0x8(%rbp)
jne    129e <main+0x12e>
mov    -0x18(%rbp),%rdi
call   1050 <usage@plt>
jmp    132f <main+0x1bf>
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xd7a(%rip),%rsi
call   1080 <sprintf@plt>
mov    -0x10(%rbp),%rax
lea    0xd72(%rip),%rcx
mov    %rcx,0x8(%rax)
lea    -0x40(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
lea    0xd53(%rip),%rdi
call   1070 <execvp@plt>
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rax
lea    0xd25(%rip),%rcx
mov    %rcx,0x10(%rax)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1070 <execvp@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0xffffffff,-0x44(%rbp)
jne    132a <main+0x1ba>
lea    -0x40(%rbp),%rdi
call   1060 <perror@plt>
jmp    132f <main+0x1bf>
jmp    1384 <main+0x214>
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xce4(%rip),%rsi
call   1080 <sprintf@plt>
lea    -0x40(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1070 <execvp@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0xffffffff,-0x44(%rbp)
jne    137f <main+0x20f>
lea    -0x40(%rbp),%rdi
call   1060 <perror@plt>
jmp    1384 <main+0x214>
jmp    1389 <main+0x219>
jmp    138e <main+0x21e>
xor    %edi,%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    (%rsi),%r15
cmp    $0x1,%edi
jle    12c0 <main+0x150>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xe6a(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     12ad <main+0x13d>
lea    0x8(%rbx),%r14
mov    (%r14),%rdi
lea    0xe4f(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     12ad <main+0x13d>
mov    (%r14),%rdi
lea    0xe31(%rip),%rsi
mov    $0x9,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     12ad <main+0x13d>
mov    (%r14),%rdi
lea    0xe1f(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     122c <main+0xbc>
mov    (%r14),%rdi
lea    0xe0c(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     122c <main+0xbc>
mov    (%r14),%rdi
lea    0xdf2(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1290 <main+0x120>
cmp    $0x2,%ebp
je     12c0 <main+0x150>
mov    0x10(%rbx),%rdx
lea    0xdd7(%rip),%rsi
mov    %rsp,%rbp
mov    %rbp,%rdi
call   1080 <sprintf@plt>
lea    0xdcd(%rip),%rdi
mov    %rdi,0x8(%rbx)
mov    %rbp,0x10(%rbx)
mov    %r14,%rsi
call   1070 <execvp@plt>
mov    %rbp,0x8(%rbx)
lea    0xda3(%rip),%rax
mov    %rax,0x10(%rbx)
mov    %rbp,%rdi
mov    %r14,%rsi
call   1070 <execvp@plt>
cmp    $0xffffffff,%eax
jne    1289 <main+0x119>
mov    %rsp,%rdi
call   1060 <perror@plt>
xor    %edi,%edi
call   1090 <exit@plt>
mov    (%r14),%rdx
lea    0xd7d(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1080 <sprintf@plt>
mov    %rbx,(%r14)
mov    %rbx,%rdi
jmp    1274 <main+0x104>
lea    0xd6f(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1090 <exit@plt>
mov    %r15,%rdi
call   1050 <usage@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-v\00"
@.str.1 = [8 x i8] c"version\00"
@.str.2 = [10 x i8] c"--version\00"
@.str.3 = [20 x i8] c"oggz version 0.9.8\0A\00"
@.str.4 = [3 x i8] c"-h\00"
@.str.5 = [5 x i8] c"help\00"
@.str.6 = [7 x i8] c"--help\00"
@.str.7 = [8 x i8] c"oggz-%s\00"
@.str.8 = [4 x i8] c"man\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [32 x i8]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
store i8* %11, i8** %6
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 2
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = call i32 @usage(i8* %15)
br label %112
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32 @strncmp(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %35
23: ; preds = %17
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @strncmp(i8* %26, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %35
29: ; preds = %23
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32 @strncmp(i8* %32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 9)
%34 = icmp ne i32 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %29, %23, %17
%36 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %111
37: ; preds = %29
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = call i32 @strncmp(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %55
43: ; preds = %37
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 1
%46 = load i8*, i8** %45
%47 = call i32 @strncmp(i8* %46, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %55
49: ; preds = %43
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 1
%52 = load i8*, i8** %51
%53 = call i32 @strncmp(i8* %52, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 6)
%54 = icmp ne i32 %53, 0
br i1 %54, label %91, label %55
55: ; preds = %49, %43, %37
%56 = load i32, i32* %4
%57 = icmp eq i32 %56, 2
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i8*, i8** %6
%60 = call i32 @usage(i8* %59)
br label %90
61: ; preds = %55
%62 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 2
%65 = load i8*, i8** %64
%66 = call i32 @sprintf(i8* %62, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* %65)
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8** %68
%69 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 2
store i8* %69, i8** %71
%72 = load i8**, i8*** %5
%73 = getelementptr inbounds i8*, i8** %72, i64 1
%74 = call i32 @execvp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8** %73)
store i32 %74, i32* %8
%75 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%76 = load i8**, i8*** %5
%77 = getelementptr inbounds i8*, i8** %76, i64 1
store i8* %75, i8** %77
%78 = load i8**, i8*** %5
%79 = getelementptr inbounds i8*, i8** %78, i64 2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8** %79
%80 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%81 = load i8**, i8*** %5
%82 = getelementptr inbounds i8*, i8** %81, i64 1
%83 = call i32 @execvp(i8* %80, i8** %82)
store i32 %83, i32* %8
%84 = load i32, i32* %8
%85 = icmp eq i32 %84, -1
br i1 %85, label %86, label %89
86: ; preds = %61
%87 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%88 = call i32 @perror(i8* %87)
br label %89
89: ; preds = %86, %61
br label %90
90: ; preds = %89, %58
br label %110
91: ; preds = %49
%92 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%93 = load i8**, i8*** %5
%94 = getelementptr inbounds i8*, i8** %93, i64 1
%95 = load i8*, i8** %94
%96 = call i32 @sprintf(i8* %92, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* %95)
%97 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%98 = load i8**, i8*** %5
%99 = getelementptr inbounds i8*, i8** %98, i64 1
store i8* %97, i8** %99
%100 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%101 = load i8**, i8*** %5
%102 = getelementptr inbounds i8*, i8** %101, i64 1
%103 = call i32 @execvp(i8* %100, i8** %102)
store i32 %103, i32* %8
%104 = load i32, i32* %8
%105 = icmp eq i32 %104, -1
br i1 %105, label %106, label %109
106: ; preds = %91
%107 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%108 = call i32 @perror(i8* %107)
br label %109
109: ; preds = %106, %91
br label %110
110: ; preds = %109, %90
br label %111
111: ; preds = %110, %35
br label %112
112: ; preds = %111, %14
%113 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"-v\00"
@.str.1 = [8 x i8] c"version\00"
@.str.2 = [10 x i8] c"--version\00"
@.str.4 = [3 x i8] c"-h\00"
@.str.5 = [5 x i8] c"help\00"
@.str.6 = [7 x i8] c"--help\00"
@.str.7 = [8 x i8] c"oggz-%s\00"
@.str.8 = [4 x i8] c"man\00"
@str = [19 x i8] c"oggz version 0.9.8\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [32 x i8]
%4 = load i8*, i8** %1
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%6 = icmp slt i32 %0, 2
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @usage(i8* %4)
br label %56
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%13 = icmp eq i32 %12, 0
br i1 %13, label %22, label %14
14: ; preds = %9
%15 = load i8*, i8** %10
%16 = tail call i32 @strncmp(i8* %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%17 = icmp eq i32 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8*, i8** %10
%20 = tail call i32 @strncmp(i8* %19, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 9)
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %18, %14, %9
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %56
24: ; preds = %18
%25 = load i8*, i8** %10
%26 = tail call i32 @strncmp(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%27 = icmp eq i32 %26, 0
br i1 %27, label %36, label %28
28: ; preds = %24
%29 = load i8*, i8** %10
%30 = tail call i32 @strncmp(i8* %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%31 = icmp eq i32 %30, 0
br i1 %31, label %36, label %32
32: ; preds = %28
%33 = load i8*, i8** %10
%34 = tail call i32 @strncmp(i8* %33, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 6)
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %49
36: ; preds = %32, %28, %24
%37 = icmp eq i32 %0, 2
br i1 %37, label %38, label %40
38: ; preds = %36
%39 = tail call i32 @usage(i8* %4)
br label %56
40: ; preds = %36
%41 = getelementptr inbounds i8*, i8** %1, i64 2
%42 = load i8*, i8** %41
%43 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* %42)
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8** %10
store i8* %5, i8** %41
%44 = call i32 @execvp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8** %10)
store i8* %5, i8** %10
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8** %41
%45 = call i32 @execvp(i8* %5, i8** %10)
%46 = icmp eq i32 %45, -1
br i1 %46, label %47, label %56
47: ; preds = %40
%48 = call i32 @perror(i8* %5)
br label %56
49: ; preds = %32
%50 = load i8*, i8** %10
%51 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* %50)
store i8* %5, i8** %10
%52 = call i32 @execvp(i8* %5, i8** %10)
%53 = icmp eq i32 %52, -1
br i1 %53, label %54, label %56
54: ; preds = %49
%55 = call i32 @perror(i8* %5)
br label %56
56: ; preds = %22, %49, %54, %38, %47, %40, %7
%57 = call i32 @exit(i32 0)
unreachable
}