#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 */
struct option {
  char *member_0;
  char member_3;
  int /*<<< orphan*/ *member_2;
  int /*<<< orphan*/ member_1;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int getopt_long(int, char **, char *, struct option *, int *);
int optind;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ usage(char *);
int /*<<< orphan*/ version();
int main(int argc, char *argv[]) {
  if (argc <= 1) {
    usage(argv[0]);
    ;
    exit(1);
  }
  int c;
  int digit_optind = 0;
  int aopt = 0, bopt = 0;
  char *copt = 0, *dopt = 0;
  static struct option long_options[] = {{"help", 0, 0, 'h'},
                                         {"version", 0, 0, 'V'},
                                         {"verbose", 0, 0, 'v'},
                                         {"set-vcp", 0, 0, 'S'},
                                         {NULL, 0, NULL, 0}};
  int option_index = 0;
  char op = -1;
  while ((c = getopt_long(argc, argv, "-hvVS", long_options, &option_index)) !=
         -1) {
    int this_option_optind = optind ? optind : 1;
    switch (c) {
    case 'h':
      usage(argv[0]);
      exit(0);
      break;
    case 'V':
      version();
      exit(0);
      break;
    case 'v':
      break;
    case 'S':
      printf("TODO\n");
      break;
    case '?':
      printf("unknown");
      break;
    default:
      printf("?? getopt returned character code 0%o ??\n", c);
    }
  }
  if (optind < argc) {
    printf("non-option ARGV-elements: ");
    while (optind < argc)
      printf("%s ", argv[optind++]);
    printf("\n");
  }
  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)
cmpl   $0x1,-0x8(%rbp)
jg     1186 <main+0x36>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <usage@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movb   $0xff,-0x35(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe59(%rip),%rdx
lea    0x2e85(%rip),%rcx
lea    -0x34(%rbp),%r8
call   1030 <getopt_long@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     12ce <main+0x17e>
mov    0x2e01(%rip),%rax
cmpl   $0x0,(%rax)
je     1201 <main+0xb1>
mov    0x2df1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
jmp    120e <main+0xbe>
mov    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    120e <main+0xbe>
mov    -0x40(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x44(%rbp)
sub    $0x3f,%eax
je     12a5 <main+0x155>
jmp    1228 <main+0xd8>
mov    -0x44(%rbp),%eax
sub    $0x53,%eax
je     1292 <main+0x142>
jmp    1239 <main+0xe9>
mov    -0x44(%rbp),%eax
sub    $0x56,%eax
je     127f <main+0x12f>
jmp    124a <main+0xfa>
mov    -0x44(%rbp),%eax
sub    $0x68,%eax
je     126c <main+0x11c>
jmp    125b <main+0x10b>
mov    -0x44(%rbp),%eax
sub    $0x76,%eax
je     128d <main+0x13d>
jmp    12b8 <main+0x168>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <usage@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    $0x0,%al
call   1050 <version@plt>
xor    %edi,%edi
call   1070 <exit@plt>
jmp    12c9 <main+0x179>
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12c9 <main+0x179>
lea    0xd7d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12c9 <main+0x179>
mov    -0x14(%rbp),%esi
lea    0xd6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11b6 <main+0x66>
mov    0x2d13(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    1343 <main+0x1f3>
lea    0xd74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2cf3(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    1335 <main+0x1e5>
mov    -0x10(%rbp),%rax
mov    0x2cdd(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    0x2ccf(%rip),%rdx
mov    %esi,(%rdx)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xd4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12ee <main+0x19e>
lea    0xd1d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     1195 <main+0x25>
mov    (%rbx),%rdi
call   1080 <usage@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    %edi,%ebp
movl   $0x0,0x4(%rsp)
lea    0xf07(%rip),%r14
lea    0x2eb3(%rip),%r15
lea    0x4(%rsp),%r12
lea    0xe47(%rip),%r13
jmp    11cc <main+0x5c>
nopl   0x0(%rax,%rax,1)
lea    0xf3d(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %r12,%r8
call   1050 <getopt_long@plt>
lea    -0x53(%rax),%ecx
cmp    $0x23,%ecx
ja     1200 <main+0x90>
movslq 0x0(%r13,%rcx,4),%rcx
add    %r13,%rcx
jmp    *%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x3f,%eax
je     121c <main+0xac>
cmp    $0xffffffff,%eax
je     1249 <main+0xd9>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    11cc <main+0x5c>
lea    0xe90(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    11cc <main+0x5c>
xor    %eax,%eax
call   1070 <version@plt>
xor    %edi,%edi
call   1090 <exit@plt>
mov    (%rbx),%rdi
call   1080 <usage@plt>
xor    %edi,%edi
call   1090 <exit@plt>
mov    0x2d98(%rip),%r15
cmp    %ebp,(%r15)
jge    12a7 <main+0x137>
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%r15),%eax
cmp    %ebp,%eax
jge    129d <main+0x12d>
lea    0xe8f(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rax),%ecx
mov    %ecx,(%r15)
cltq
mov    (%rbx,%rax,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%r15),%eax
cmp    %ebp,%eax
jl     1280 <main+0x110>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
%struct.option = type { i8*, i8, i32*, i32 }
@main.long_options = internal global [5 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8 0, i32* null, i32 104 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8 0, i32* null, i32 86 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i8 0, i32* null, i32 118 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i8 0, i32* null, i32 83 }, %struct.option zeroinitializer]
@.str = [5 x i8] c"help\00"
@.str.1 = [8 x i8] c"version\00"
@.str.2 = [8 x i8] c"verbose\00"
@.str.3 = [8 x i8] c"set-vcp\00"
@.str.4 = [6 x i8] c"-hvVS\00"
@optind = global i32 0
@.str.5 = [6 x i8] c"TODO\0A\00"
@.str.6 = [8 x i8] c"unknown\00"
@.str.7 = [42 x i8] c"?? getopt returned character code 0%o ??\0A\00"
@.str.8 = [27 x i8] c"non-option ARGV-elements: \00"
@.str.9 = [4 x i8] c"%s \00"
@.str.10 = [2 x i8] c"\0A\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 i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp sle i32 %15, 1
br i1 %16, label %17, label %23
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 @usage(i8* %20)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %2
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i8* null, i8** %10
store i8* null, i8** %11
store i32 0, i32* %12
store i8 -1, i8* %13
br label %24
24: ; preds = %55, %23
%25 = load i32, i32* %4
%26 = load i8**, i8*** %5
%27 = call i32 @getopt_long(i32 %25, i8** %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), %struct.option* getelementptr inbounds ([5 x %struct.option], [5 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %12)
store i32 %27, i32* %6
%28 = icmp ne i32 %27, -1
br i1 %28, label %29, label %56
29: ; preds = %24
%30 = load i32, i32* @optind
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = load i32, i32* @optind
br label %35
34: ; preds = %29
br label %35
35: ; preds = %34, %32
%36 = phi i32 [ %33, %32 ], [ 1, %34 ]
store i32 %36, i32* %14
%37 = load i32, i32* %6
switch i32 %37, label %52 [
i32 104, label %38
i32 86, label %44
i32 118, label %47
i32 83, label %48
i32 63, label %50
]
38: ; preds = %35
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 0
%41 = load i8*, i8** %40
%42 = call i32 @usage(i8* %41)
%43 = call i32 @exit(i32 0)
unreachable
44: ; preds = %35
%45 = call i32 (...) @version()
%46 = call i32 @exit(i32 0)
unreachable
47: ; preds = %35
br label %55
48: ; preds = %35
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %55
50: ; preds = %35
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %55
52: ; preds = %35
%53 = load i32, i32* %6
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %52, %50, %48, %47
br label %24
56: ; preds = %24
%57 = load i32, i32* @optind
%58 = load i32, i32* %4
%59 = icmp slt i32 %57, %58
br i1 %59, label %60, label %76
60: ; preds = %56
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
br label %62
62: ; preds = %66, %60
%63 = load i32, i32* @optind
%64 = load i32, i32* %4
%65 = icmp slt i32 %63, %64
br i1 %65, label %66, label %74
66: ; preds = %62
%67 = load i8**, i8*** %5
%68 = load i32, i32* @optind
%69 = add nsw i32 %68, 1
store i32 %69, i32* @optind
%70 = sext i32 %68 to i64
%71 = getelementptr inbounds i8*, i8** %67, i64 %70
%72 = load i8*, i8** %71
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %72)
br label %62
74: ; preds = %62
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %76
76: ; preds = %74, %56
%77 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.option = type { i8*, i8, i32*, i32 }
@main.long_options = internal global [5 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8 0, i32* null, i32 104 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8 0, i32* null, i32 86 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i8 0, i32* null, i32 118 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i8 0, i32* null, i32 83 }, %struct.option zeroinitializer]
@.str = [5 x i8] c"help\00"
@.str.1 = [8 x i8] c"version\00"
@.str.2 = [8 x i8] c"verbose\00"
@.str.3 = [8 x i8] c"set-vcp\00"
@.str.4 = [6 x i8] c"-hvVS\00"
@optind = global i32 0
@.str.6 = [8 x i8] c"unknown\00"
@.str.7 = [42 x i8] c"?? getopt returned character code 0%o ??\0A\00"
@.str.8 = [27 x i8] c"non-option ARGV-elements: \00"
@.str.9 = [4 x i8] c"%s \00"
@str = [5 x i8] c"TODO\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = icmp slt i32 %0, 2
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = tail call i32 @usage(i8* %6)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = bitcast i32* %3 to i8*
store i32 0, i32* %3
br label %11
11: ; preds = %13, %9
%12 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), %struct.option* getelementptr inbounds ([5 x %struct.option], [5 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %3)
switch i32 %12, label %25 [
i32 -1, label %27
i32 104, label %14
i32 86, label %18
i32 118, label %13
i32 83, label %21
i32 63, label %23
]
13: ; preds = %11, %25, %23, %21
br label %11
14: ; preds = %11
%15 = load i8*, i8** %1
%16 = call i32 @usage(i8* %15)
%17 = call i32 @exit(i32 0)
unreachable
18: ; preds = %11
%19 = call i32 (...) @version()
%20 = call i32 @exit(i32 0)
unreachable
21: ; preds = %11
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %13
23: ; preds = %11
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %13
25: ; preds = %11
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0), i32 %12)
br label %13
27: ; preds = %11
%28 = load i32, i32* @optind
%29 = icmp slt i32 %28, %0
br i1 %29, label %30, label %45
30: ; preds = %27
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
%32 = load i32, i32* @optind
%33 = icmp slt i32 %32, %0
br i1 %33, label %34, label %43
34: ; preds = %30, %34
%35 = phi i32 [ %41, %34 ], [ %32, %30 ]
%36 = add nsw i32 %35, 1
store i32 %36, i32* @optind
%37 = sext i32 %35 to i64
%38 = getelementptr inbounds i8*, i8** %1, i64 %37
%39 = load i8*, i8** %38
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %39)
%41 = load i32, i32* @optind
%42 = icmp slt i32 %41, %0
br i1 %42, label %34, label %43
43: ; preds = %34, %30
%44 = call i32 @putchar(i32 10)
br label %45
45: ; preds = %43, %27
%46 = call i32 @exit(i32 0)
unreachable
}