#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-ld version %s\n", "0.2");
      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     11dc <ucfront_main+0x9c>
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     11bd <ucfront_main+0x7d>
jmp    11cb <ucfront_main+0x8b>
lea    0xe69(%rip),%rdi
lea    0xe79(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6f(%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     1198 <ucfront_main+0x48>
cmp    $0x56,%eax
jne    11a6 <ucfront_main+0x56>
lea    0xe8c(%rip),%rdi
lea    0xe9c(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe92(%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 = [23 x i8] c"ucfront-ld version %s\0A\00"
@.str.2 = [4 x i8] c"0.2\00"
@.str.3 = [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 %23
11: ; preds = %6
%12 = load i32, i32* %5
switch i32 %12, label %20 [
i32 86, label %13
i32 104, label %17
]
13: ; preds = %11
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 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 ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @exit(i32 0)
unreachable
17: ; preds = %11
%18 = call i32 (...) @usage()
%19 = call i32 @exit(i32 0)
unreachable
20: ; preds = %11
%21 = call i32 (...) @usage()
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"Vh\00"
@.str.1 = [23 x i8] c"ucfront-ld version %s\0A\00"
@.str.2 = [4 x i8] c"0.2\00"
@str = [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 %11 [
i32 -1, label %14
i32 86, label %4
i32 104, label %8
]
4: ; preds = %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 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 ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %2
%9 = tail call i32 (...) @usage()
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %2
%12 = tail call i32 (...) @usage()
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %2
ret i32 0
}