#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 const *, struct option const *, int *);
int /*<<< orphan*/ no_argument;
int /*<<< orphan*/ *optarg;
scalar_t__ opterr;
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ required_argument;
int main(int argc, char *argv[]) {
  opterr = 0;
  const char *short_options = "q:iv";
  const struct option long_options[] = {
      {"query", required_argument, NULL, 'q'},
      {"longinformationrequest", no_argument, NULL, 'i'},
      {"version", no_argument, NULL, 'v'},
      {NULL, 0, NULL, 0}};
  bool succ = true;
  int rez;
  int option_index;
  while ((rez = getopt_long(argc, argv, short_options, long_options,
                            &option_index)) != -1) {
    switch (rez) {
    case 'q': {
      if (NULL == optarg)
        succ = false;
      break;
    };
    case 'i':
    case 'v': {
      break;
    };
    case '?':
    default: {
      succ = false;
      break;
    };
    };
  };
  printf("%s\n", succ ? "+" : "-");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e78(%rip),%rax
movq   $0x0,(%rax)
lea    0xea2(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0xa0(%rbp),%rdi
lea    0xe95(%rip),%rax
mov    %rax,-0xa0(%rbp)
mov    0x2e62(%rip),%rax
mov    (%rax),%eax
mov    %al,-0x98(%rbp)
movq   $0x0,-0x90(%rbp)
movl   $0x71,-0x88(%rbp)
add    $0x20,%rdi
lea    0xe65(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0x2e1f(%rip),%rax
mov    (%rax),%eax
mov    %al,-0x78(%rbp)
movq   $0x0,-0x70(%rbp)
movl   $0x69,-0x68(%rbp)
add    $0x20,%rdi
lea    0xe52(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0x2df5(%rip),%rax
mov    (%rax),%eax
mov    %al,-0x58(%rbp)
movq   $0x0,-0x50(%rbp)
movl   $0x76,-0x48(%rbp)
add    $0x20,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1050 <memset@plt>
movl   $0x1,-0xa4(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0xa0(%rbp),%rcx
lea    -0xac(%rbp),%r8
call   1030 <getopt_long@plt>
mov    %eax,-0xa8(%rbp)
cmp    $0xffffffff,%eax
je     12c6 <main+0x196>
mov    -0xa8(%rbp),%eax
mov    %eax,-0xb0(%rbp)
sub    $0x3f,%eax
je     12b2 <main+0x182>
jmp    1250 <main+0x120>
mov    -0xb0(%rbp),%eax
sub    $0x69,%eax
je     12ad <main+0x17d>
jmp    1264 <main+0x134>
mov    -0xb0(%rbp),%eax
sub    $0x71,%eax
je     128c <main+0x15c>
jmp    1278 <main+0x148>
mov    -0xb0(%rbp),%eax
sub    $0x76,%eax
je     12ad <main+0x17d>
jmp    12b7 <main+0x187>
xor    %eax,%eax
mov    0x2d63(%rip),%rcx
cmp    (%rcx),%rax
jne    12a8 <main+0x178>
movl   $0x0,-0xa4(%rbp)
jmp    12c1 <main+0x191>
jmp    12c1 <main+0x191>
jmp    12b7 <main+0x187>
movl   $0x0,-0xa4(%rbp)
jmp    1209 <main+0xd9>
mov    -0xa4(%rbp),%ecx
lea    0xd5d(%rip),%rsi
lea    0xd54(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xd42(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2e8b(%rip),%rax
movq   $0x0,(%rax)
lea    0xeba(%rip),%rax
mov    %rax,0x10(%rsp)
mov    0x2e89(%rip),%rax
mov    (%rax),%al
mov    %al,0x18(%rsp)
movq   $0x0,0x20(%rsp)
movl   $0x71,0x28(%rsp)
lea    0xe96(%rip),%rax
mov    %rax,0x30(%rsp)
mov    0x2e4f(%rip),%rax
mov    (%rax),%al
mov    %al,0x38(%rsp)
movq   $0x0,0x40(%rsp)
movl   $0x69,0x48(%rsp)
lea    0xe83(%rip),%rcx
mov    %rcx,0x50(%rsp)
mov    %al,0x58(%rsp)
movq   $0x0,0x60(%rsp)
movl   $0x76,0x68(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x80(%rsp)
mov    $0x1,%r13d
lea    0xe2a(%rip),%r14
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r12
jmp    11f5 <main+0xd5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x76,%eax
jne    1219 <main+0xf9>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %r12,%r8
call   1030 <getopt_long@plt>
cmp    $0x70,%eax
jg     11f0 <main+0xd0>
cmp    $0x69,%eax
je     11f5 <main+0xd5>
cmp    $0xffffffff,%eax
je     1239 <main+0x119>
jmp    1234 <main+0x114>
cmp    $0x71,%eax
jne    1234 <main+0x114>
mov    0x2dd3(%rip),%rax
cmpq   $0x0,(%rax)
mov    $0x0,%eax
cmove  %eax,%r13d
jmp    11f5 <main+0xd5>
xor    %r13d,%r13d
jmp    11f5 <main+0xd5>
test   %r13d,%r13d
lea    0xded(%rip),%rax
lea    0xde4(%rip),%rsi
cmove  %rax,%rsi
lea    0xdd5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x98,%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 = [5 x i8] c"q:iv\00"
@.str.1 = [6 x i8] c"query\00"
@required_argument = global i32 0
@.str.2 = [23 x i8] c"longinformationrequest\00"
@no_argument = global i32 0
@.str.3 = [8 x i8] c"version\00"
@optarg = global i32* null
@.str.4 = [4 x i8] c"%s\0A\00"
@.str.5 = [2 x i8] c"+\00"
@.str.6 = [2 x i8] c"-\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [4 x %struct.option]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* @opterr
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %6
%11 = getelementptr inbounds [4 x %struct.option], [4 x %struct.option]* %7, i64 0, i64 0
%12 = getelementptr inbounds %struct.option, %struct.option* %11, i32 0, i32 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds %struct.option, %struct.option* %11, i32 0, i32 1
%14 = load i32, i32* @required_argument
%15 = trunc i32 %14 to i8
store i8 %15, i8* %13
%16 = getelementptr inbounds %struct.option, %struct.option* %11, i32 0, i32 2
store i32* null, i32** %16
%17 = getelementptr inbounds %struct.option, %struct.option* %11, i32 0, i32 3
store i32 113, i32* %17
%18 = getelementptr inbounds %struct.option, %struct.option* %11, i64 1
%19 = getelementptr inbounds %struct.option, %struct.option* %18, i32 0, i32 0
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8** %19
%20 = getelementptr inbounds %struct.option, %struct.option* %18, i32 0, i32 1
%21 = load i32, i32* @no_argument
%22 = trunc i32 %21 to i8
store i8 %22, i8* %20
%23 = getelementptr inbounds %struct.option, %struct.option* %18, i32 0, i32 2
store i32* null, i32** %23
%24 = getelementptr inbounds %struct.option, %struct.option* %18, i32 0, i32 3
store i32 105, i32* %24
%25 = getelementptr inbounds %struct.option, %struct.option* %18, i64 1
%26 = getelementptr inbounds %struct.option, %struct.option* %25, i32 0, i32 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %26
%27 = getelementptr inbounds %struct.option, %struct.option* %25, i32 0, i32 1
%28 = load i32, i32* @no_argument
%29 = trunc i32 %28 to i8
store i8 %29, i8* %27
%30 = getelementptr inbounds %struct.option, %struct.option* %25, i32 0, i32 2
store i32* null, i32** %30
%31 = getelementptr inbounds %struct.option, %struct.option* %25, i32 0, i32 3
store i32 118, i32* %31
%32 = getelementptr inbounds %struct.option, %struct.option* %25, i64 1
%33 = bitcast %struct.option* %32 to i8*
store i32 1, i32* %8
br label %34
34: ; preds = %51, %2
%35 = load i32, i32* %4
%36 = load i8**, i8*** %5
%37 = load i8*, i8** %6
%38 = getelementptr inbounds [4 x %struct.option], [4 x %struct.option]* %7, i64 0, i64 0
%39 = call i32 @getopt_long(i32 %35, i8** %36, i8* %37, %struct.option* %38, i32* %10)
store i32 %39, i32* %9
%40 = icmp ne i32 %39, -1
br i1 %40, label %41, label %52
41: ; preds = %34
%42 = load i32, i32* %9
switch i32 %42, label %50 [
i32 113, label %43
i32 105, label %48
i32 118, label %48
i32 63, label %49
]
43: ; preds = %41
%44 = load i32*, i32** @optarg
%45 = icmp eq i32* null, %44
br i1 %45, label %46, label %47
46: ; preds = %43
store i32 0, i32* %8
br label %47
47: ; preds = %46, %43
br label %51
48: ; preds = %41, %41
br label %51
49: ; preds = %41
br label %50
50: ; preds = %41, %49
store i32 0, i32* %8
br label %51
51: ; preds = %50, %48, %47
br label %34
52: ; preds = %34
%53 = load i32, i32* %8
%54 = icmp ne i32 %53, 0
%55 = zext i1 %54 to i64
%56 = select i1 %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0)
%57 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %56)
ret i32 0
}

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