#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 getopt_long(int, char **, char *, struct option *, int *);
int /*<<< orphan*/ no_argument;
scalar_t__ opterr;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ required_argument;
int main(int c, char **v) {
  opterr = 0;
  int opindex = 0;
  int opchar = 0;
  struct option opts[] = {{"query", required_argument, 0, 'q'},
                          {"longinformationrequest", no_argument, 0, 'i'},
                          {"version", no_argument, 0, 'v'}};
  while (-1 != (opchar = getopt_long(c, v, "q:iv", opts, &opindex))) {
    switch (opchar) {
    case 'q':
      break;
    case 'i':
      break;
    case 'v':
      break;
    default:
      printf("-\n");
      return 0;
      break;
    }
  }
  printf("+\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e93(%rip),%rax
movq   $0x0,(%rax)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xea7(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
mov    %al,-0x58(%rbp)
movl   $0x0,-0x54(%rbp)
movl   $0x71,-0x50(%rbp)
lea    0xe88(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0x2e4f(%rip),%rax
mov    (%rax),%eax
mov    %al,-0x40(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x69,-0x38(%rbp)
lea    0xe7a(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2e2a(%rip),%rax
mov    (%rax),%eax
mov    %al,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x76,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x60(%rbp),%rcx
lea    0xe52(%rip),%rdx
lea    -0x14(%rbp),%r8
call   1030 <getopt_long@plt>
mov    %eax,%ecx
mov    %ecx,-0x18(%rbp)
mov    $0xffffffff,%eax
cmp    %ecx,%eax
je     1250 <main+0x130>
mov    -0x18(%rbp),%eax
mov    %eax,-0x64(%rbp)
sub    $0x69,%eax
je     1229 <main+0x109>
jmp    1202 <main+0xe2>
mov    -0x64(%rbp),%eax
sub    $0x71,%eax
je     1224 <main+0x104>
jmp    1213 <main+0xf3>
mov    -0x64(%rbp),%eax
sub    $0x76,%eax
je     122e <main+0x10e>
jmp    1233 <main+0x113>
jmp    124b <main+0x12b>
jmp    124b <main+0x12b>
jmp    124b <main+0x12b>
lea    0xdf0(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1263 <main+0x143>
jmp    11c1 <main+0xa1>
lea    0xdd6(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2e96(%rip),%rax
movq   $0x0,(%rax)
movl   $0x0,0xc(%rsp)
lea    0xeb0(%rip),%rax
mov    %rax,0x10(%rsp)
mov    0x2e8c(%rip),%rax
mov    (%rax),%al
mov    %al,0x18(%rsp)
movabs $0x7100000000,%rax
mov    %rax,0x1c(%rsp)
lea    0xe8e(%rip),%rax
mov    %rax,0x28(%rsp)
mov    0x2e54(%rip),%rax
mov    (%rax),%al
mov    %al,0x30(%rsp)
movabs $0x6900000000,%rcx
mov    %rcx,0x34(%rsp)
lea    0xe7d(%rip),%rcx
mov    %rcx,0x40(%rsp)
mov    %al,0x48(%rsp)
movabs $0x7600000000,%rax
mov    %rax,0x4c(%rsp)
lea    0xe66(%rip),%r14
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r12
mov    $0x2101,%r13d
nop
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %r12,%r8
call   1040 <getopt_long@plt>
lea    -0x69(%rax),%ecx
cmp    $0xd,%ecx
ja     11f1 <main+0xd1>
bt     %ecx,%r13d
jb     11d0 <main+0xb0>
cmp    $0xffffffff,%eax
jne    11ff <main+0xdf>
lea    0xe2d(%rip),%rdi
jmp    1206 <main+0xe6>
lea    0xe26(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.option = type { i8*, i8, i32, i32 }
@opterr = global i64 0
@.str = [6 x i8] c"query\00"
@required_argument = global i32 0
@.str.1 = [23 x i8] c"longinformationrequest\00"
@no_argument = global i32 0
@.str.2 = [8 x i8] c"version\00"
@.str.3 = [5 x i8] c"q:iv\00"
@.str.4 = [3 x i8] c"-\0A\00"
@.str.5 = [3 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 [3 x %struct.option]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* @opterr
store i32 0, i32* %6
store i32 0, i32* %7
%9 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %8, i64 0, i64 0
%10 = getelementptr inbounds %struct.option, %struct.option* %9, i32 0, i32 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds %struct.option, %struct.option* %9, i32 0, i32 1
%12 = load i32, i32* @required_argument
%13 = trunc i32 %12 to i8
store i8 %13, i8* %11
%14 = getelementptr inbounds %struct.option, %struct.option* %9, i32 0, i32 2
store i32 0, i32* %14
%15 = getelementptr inbounds %struct.option, %struct.option* %9, i32 0, i32 3
store i32 113, i32* %15
%16 = getelementptr inbounds %struct.option, %struct.option* %9, i64 1
%17 = getelementptr inbounds %struct.option, %struct.option* %16, i32 0, i32 0
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8** %17
%18 = getelementptr inbounds %struct.option, %struct.option* %16, i32 0, i32 1
%19 = load i32, i32* @no_argument
%20 = trunc i32 %19 to i8
store i8 %20, i8* %18
%21 = getelementptr inbounds %struct.option, %struct.option* %16, i32 0, i32 2
store i32 0, i32* %21
%22 = getelementptr inbounds %struct.option, %struct.option* %16, i32 0, i32 3
store i32 105, i32* %22
%23 = getelementptr inbounds %struct.option, %struct.option* %16, i64 1
%24 = getelementptr inbounds %struct.option, %struct.option* %23, i32 0, i32 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %24
%25 = getelementptr inbounds %struct.option, %struct.option* %23, i32 0, i32 1
%26 = load i32, i32* @no_argument
%27 = trunc i32 %26 to i8
store i8 %27, i8* %25
%28 = getelementptr inbounds %struct.option, %struct.option* %23, i32 0, i32 2
store i32 0, i32* %28
%29 = getelementptr inbounds %struct.option, %struct.option* %23, i32 0, i32 3
store i32 118, i32* %29
br label %30
30: ; preds = %43, %2
%31 = load i32, i32* %4
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %8, i64 0, i64 0
%34 = call i32 @getopt_long(i32 %31, i8** %32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %struct.option* %33, i32* %6)
store i32 %34, i32* %7
%35 = icmp ne i32 -1, %34
br i1 %35, label %36, label %44
36: ; preds = %30
%37 = load i32, i32* %7
switch i32 %37, label %41 [
i32 113, label %38
i32 105, label %39
i32 118, label %40
]
38: ; preds = %36
br label %43
39: ; preds = %36
br label %43
40: ; preds = %36
br label %43
41: ; preds = %36
%42 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %3
br label %46
43: ; preds = %40, %39, %38
br label %30
44: ; preds = %30
%45 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %3
br label %46
46: ; preds = %44, %41
%47 = load i32, i32* %3
ret i32 %47
}

LLVM IR (-O2):
%struct.option = type { i8*, i8, i32, i32 }
@opterr = global i64 0
@.str = [6 x i8] c"query\00"
@required_argument = global i32 0
@.str.1 = [23 x i8] c"longinformationrequest\00"
@no_argument = global i32 0
@.str.2 = [8 x i8] c"version\00"
@.str.3 = [5 x i8] c"q:iv\00"
@str = [2 x i8] c"+\00"
@str.6 = [2 x i8] c"-\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca [3 x %struct.option]
store i64 0, i64* @opterr
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = bitcast [3 x %struct.option]* %4 to i8*
%7 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 0
%8 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 0, i32 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 0, i32 1
%10 = load i32, i32* @required_argument
%11 = trunc i32 %10 to i8
store i8 %11, i8* %9
%12 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 0, i32 2
store i32 0, i32* %12
%13 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 0, i32 3
store i32 113, i32* %13
%14 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 1, i32 0
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8** %14
%15 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 1, i32 1
%16 = load i32, i32* @no_argument
%17 = trunc i32 %16 to i8
store i8 %17, i8* %15
%18 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 1, i32 2
store i32 0, i32* %18
%19 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 1, i32 3
store i32 105, i32* %19
%20 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 2, i32 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %20
%21 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 2, i32 1
store i8 %17, i8* %21
%22 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 2, i32 2
store i32 0, i32* %22
%23 = getelementptr inbounds [3 x %struct.option], [3 x %struct.option]* %4, i64 0, i64 2, i32 3
store i32 118, i32* %23
br label %24
24: ; preds = %26, %2
%25 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %struct.option* %7, i32* %3)
switch i32 %25, label %28 [
i32 -1, label %27
i32 113, label %26
i32 105, label %26
i32 118, label %26
]
26: ; preds = %24, %24, %24
br label %24
27: ; preds = %24
br label %28
28: ; preds = %24, %27
%29 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0), %27 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0), %24 ]
%30 = call i32 @puts(i8* dereferenceable(1) %29)
ret i32 0
}