#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ printUsage(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  if (argc != 3) {
    fprintf(stderr, "***Unknown options\n");
    printUsage(stderr);
    return 1;
  } else if (strcmp(argv[1], "-query") != 0) {
    fprintf(stderr, "***Unknown option %s\n", argv[1]);
    printUsage(stderr);
    return 1;
  }
  if (strcmp(argv[2], "QT_VERSION") == 0) {
    puts("4.8.5");
    return 0;
  } else {
    puts("**Unknown**");
    return 101;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1191 <main+0x51>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1060 <printUsage@plt>
movl   $0x1,-0x4(%rbp)
jmp    1236 <main+0xf6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe74(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11e8 <main+0xa8>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe54(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e0b(%rip),%rax
mov    (%rax),%edi
call   1060 <printUsage@plt>
movl   $0x1,-0x4(%rbp)
jmp    1236 <main+0xf6>
jmp    11ed <main+0xad>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe35(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1223 <main+0xe3>
lea    0xe2a(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    1236 <main+0xf6>
lea    0xe18(%rip),%rdi
call   1030 <puts@plt>
movl   $0x65,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x3,%edi
jne    1182 <main+0x42>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xebd(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11ad <main+0x6d>
mov    0x2e78(%rip),%r14
mov    (%r14),%edi
mov    0x8(%rbx),%rdx
lea    0xea5(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r14),%edi
jmp    119b <main+0x5b>
mov    0x2e57(%rip),%rbx
mov    (%rbx),%edi
lea    0xe6e(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%rbx),%edi
call   1060 <printUsage@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x10(%rbx),%rdi
lea    0xe79(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11d5 <main+0x95>
lea    0xe79(%rip),%rdi
call   1030 <puts@plt>
mov    $0x65,%eax
jmp    11a5 <main+0x65>
lea    0xe60(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
jmp    11a5 <main+0x65>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"***Unknown options\0A\00"
@.str.1 = [7 x i8] c"-query\00"
@.str.2 = [22 x i8] c"***Unknown option %s\0A\00"
@.str.3 = [11 x i8] c"QT_VERSION\00"
@.str.4 = [6 x i8] c"4.8.5\00"
@.str.5 = [12 x i8] c"**Unknown**\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = call i32 @printUsage(i32 %11)
store i32 1, i32* %3
br label %38
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %27
19: ; preds = %13
%20 = load i32, i32* @stderr
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%25 = load i32, i32* @stderr
%26 = call i32 @printUsage(i32 %25)
store i32 1, i32* %3
br label %38
27: ; preds = %13
br label %28
28: ; preds = %27
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 2
%31 = load i8*, i8** %30
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %28
%35 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %3
br label %38
36: ; preds = %28
%37 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
store i32 101, i32* %3
br label %38
38: ; preds = %36, %34, %19, %8
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"***Unknown options\0A\00"
@.str.1 = [7 x i8] c"-query\00"
@.str.2 = [22 x i8] c"***Unknown option %s\0A\00"
@.str.3 = [11 x i8] c"QT_VERSION\00"
@.str.4 = [6 x i8] c"4.8.5\00"
@.str.5 = [12 x i8] c"**Unknown**\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 @printUsage(i32 %7)
br label %29
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %9
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %10
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %16)
%18 = load i32, i32* @stderr
%19 = tail call i32 @printUsage(i32 %18)
br label %29
20: ; preds = %9
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = tail call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %20
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %29
27: ; preds = %20
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %29
29: ; preds = %27, %25, %14, %4
%30 = phi i32 [ 1, %4 ], [ 1, %14 ], [ 0, %25 ], [ 101, %27 ]
ret i32 %30
}