#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*/ exit(int);
int getopt(int, char **, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ usage();
int ucfront_main(int argc, char *argv[]) {
  extern int optind;
  int c;
  while ((c = getopt(argc, argv, "Vh")) != -1) {
    switch (c) {
    case 'V':
      printf("ucfront version %s\n", "0.1");
      printf("Copyright Steve Bennett 2005\n");
      printf("Released under the GNU GPL v2 or later\n");
      exit(0);
    case 'h':
      usage();
      exit(0);
    default:
      usage();
      exit(1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<ucfront_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xea3(%rip),%rdx
call   1050 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     11ea <ucfront_main+0xaa>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x56,%eax
je     1193 <ucfront_main+0x53>
jmp    1182 <ucfront_main+0x42>
mov    -0x18(%rbp),%eax
sub    $0x68,%eax
je     11cb <ucfront_main+0x8b>
jmp    11d9 <ucfront_main+0x99>
lea    0xe69(%rip),%rdi
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
mov    $0x0,%al
call   1040 <usage@plt>
xor    %edi,%edi
call   1060 <exit@plt>
mov    $0x0,%al
call   1040 <usage@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucfront_main>:
push   %rax
lea    0xea8(%rip),%rdx
call   1060 <getopt@plt>
cmp    $0xffffffff,%eax
jne    1166 <ucfront_main+0x16>
xor    %eax,%eax
pop    %rcx
ret
cmp    $0x68,%eax
je     11a4 <ucfront_main+0x54>
cmp    $0x56,%eax
jne    11b2 <ucfront_main+0x62>
lea    0xe8c(%rip),%rdi
lea    0xe99(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8f(%rip),%rdi
call   1030 <puts@plt>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1070 <exit@plt>
xor    %eax,%eax
call   1050 <usage@plt>
xor    %edi,%edi
call   1070 <exit@plt>
xor    %eax,%eax
call   1050 <usage@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"Vh\00"
@.str.1 = [20 x i8] c"ucfront version %s\0A\00"
@.str.2 = [4 x i8] c"0.1\00"
@.str.3 = [30 x i8] c"Copyright Steve Bennett 2005\0A\00"
@.str.4 = [40 x i8] c"Released under the GNU GPL v2 or later\0A\00"
define i32 @ucfront_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
br label %6
6: ; preds = %2
%7 = load i32, i32* %3
%8 = load i8**, i8*** %4
%9 = call i32 @getopt(i32 %7, i8** %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 %9, i32* %5
%10 = icmp ne i32 %9, -1
br i1 %10, label %11, label %24
11: ; preds = %6
%12 = load i32, i32* %5
switch i32 %12, label %21 [
i32 86, label %13
i32 104, label %18
]
13: ; preds = %11
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 @exit(i32 0)
unreachable
18: ; preds = %11
%19 = call i32 (...) @usage()
%20 = call i32 @exit(i32 0)
unreachable
21: ; preds = %11
%22 = call i32 (...) @usage()
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"Vh\00"
@.str.1 = [20 x i8] c"ucfront version %s\0A\00"
@.str.2 = [4 x i8] c"0.1\00"
@str = [29 x i8] c"Copyright Steve Bennett 2005\00"
@str.5 = [39 x i8] c"Released under the GNU GPL v2 or later\00"
define i32 @ucfront_main(i32 %0, i8** %1) {
%3 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
switch i32 %3, label %12 [
i32 -1, label %15
i32 86, label %4
i32 104, label %9
]
4: ; preds = %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.5, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %2
%10 = tail call i32 (...) @usage()
%11 = tail call i32 @exit(i32 0)
unreachable
12: ; preds = %2
%13 = tail call i32 (...) @usage()
%14 = tail call i32 @exit(i32 1)
unreachable
15: ; preds = %2
ret i32 0
}