#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 atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int result__(int);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int gcc_version = 9 * 1000 + 4 * 100 + 0;
  char *operator;
  char *cvs;
  int cv;
  if (argc == 1) {
    printf("%d\n", gcc_version);
    return 0;
  } else if (argc == 2) {
    operator= "gte";
    cvs = argv[1];
  } else if (argc == 3) {
    operator= argv[1];
    cvs = argv[2];
  } else {
    printf("invalid arguments.");
    return -1;
  }
  cv = atoi(cvs);
  if (!strcmp(operator, "gte")) {
    return result__(gcc_version >= cv);
  }
  if (!strcmp(operator, "gt")) {
    return result__(gcc_version > cv);
  }
  if (!strcmp(operator, "lte")) {
    return result__(gcc_version <= cv);
  }
  if (!strcmp(operator, "lt")) {
    return result__(gcc_version < cv);
  }
  if (!strcmp(operator, "eq") || !strcmp(operator, "==") ||
      !strcmp(operator, "-")) {
    return result__(gcc_version == cv);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x24b8,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1184 <main+0x44>
mov    -0x14(%rbp),%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1332 <main+0x1f2>
cmpl   $0x2,-0x8(%rbp)
jne    11aa <main+0x6a>
lea    0xe6f(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    11f0 <main+0xb0>
cmpl   $0x3,-0x8(%rbp)
jne    11d1 <main+0x91>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    11eb <main+0xab>
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1332 <main+0x1f2>
jmp    11f0 <main+0xb0>
jmp    11f5 <main+0xb5>
mov    -0x28(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xdf8(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1235 <main+0xf5>
mov    -0x14(%rbp),%eax
cmp    -0x2c(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <result__@plt>
mov    %eax,-0x4(%rbp)
jmp    1332 <main+0x1f2>
mov    -0x20(%rbp),%rdi
lea    0xddb(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1269 <main+0x129>
mov    -0x14(%rbp),%eax
cmp    -0x2c(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <result__@plt>
mov    %eax,-0x4(%rbp)
jmp    1332 <main+0x1f2>
mov    -0x20(%rbp),%rdi
lea    0xdaa(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    129d <main+0x15d>
mov    -0x14(%rbp),%eax
cmp    -0x2c(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <result__@plt>
mov    %eax,-0x4(%rbp)
jmp    1332 <main+0x1f2>
mov    -0x20(%rbp),%rdi
lea    0xd7a(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    12d1 <main+0x191>
mov    -0x14(%rbp),%eax
cmp    -0x2c(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <result__@plt>
mov    %eax,-0x4(%rbp)
jmp    1332 <main+0x1f2>
mov    -0x20(%rbp),%rdi
lea    0xd49(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     131c <main+0x1dc>
mov    -0x20(%rbp),%rdi
lea    0xd33(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     131c <main+0x1dc>
mov    -0x20(%rbp),%rdi
lea    0xd1d(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1332 <main+0x1f2>
mov    -0x14(%rbp),%eax
cmp    -0x2c(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <result__@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x3,%edi
je     1170 <main+0x30>
cmp    $0x2,%edi
je     117b <main+0x3b>
cmp    $0x1,%edi
jne    1237 <main+0xf7>
lea    0xea3(%rip),%rdi
xor    %ebx,%ebx
mov    $0x24b8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    124a <main+0x10a>
mov    0x8(%rsi),%rbx
mov    $0x2,%eax
jmp    1187 <main+0x47>
lea    0xe82(%rip),%rbx
mov    $0x1,%eax
mov    (%rsi,%rax,8),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
lea    0xe6b(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1253 <main+0x113>
lea    0xe6b(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     125d <main+0x11d>
lea    0xe57(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1274 <main+0x134>
lea    0xe44(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1282 <main+0x142>
lea    0xe30(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1229 <main+0xe9>
lea    0xe20(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1229 <main+0xe9>
lea    0xe10(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
xor    %ebx,%ebx
test   %eax,%eax
jne    124a <main+0x10a>
xor    %edi,%edi
cmp    $0x24b8,%ebp
sete   %dil
jmp    1269 <main+0x129>
lea    0xdca(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %edi,%edi
cmp    $0x24b9,%ebp
jmp    1265 <main+0x125>
xor    %edi,%edi
cmp    $0x24b8,%ebp
setl   %dil
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <result__@plt>
xor    %edi,%edi
cmp    $0x24b8,%ebp
setge  %dil
jmp    1269 <main+0x129>
xor    %edi,%edi
cmp    $0x24b9,%ebp
setge  %dil
jmp    1269 <main+0x129>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"gte\00"
@.str.2 = [19 x i8] c"invalid arguments.\00"
@.str.3 = [3 x i8] c"gt\00"
@.str.4 = [4 x i8] c"lte\00"
@.str.5 = [3 x i8] c"lt\00"
@.str.6 = [3 x i8] c"eq\00"
@.str.7 = [3 x i8] c"==\00"
@.str.8 = [2 x i8] c"-\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 9400, i32* %6
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %6
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
store i32 0, i32* %3
br label %96
15: ; preds = %2
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 2
br i1 %17, label %18, label %22
18: ; preds = %15
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %7
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
store i8* %21, i8** %8
br label %35
22: ; preds = %15
%23 = load i32, i32* %4
%24 = icmp eq i32 %23, 3
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
store i8* %28, i8** %7
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 2
%31 = load i8*, i8** %30
store i8* %31, i8** %8
br label %34
32: ; preds = %22
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %96
34: ; preds = %25
br label %35
35: ; preds = %34, %18
br label %36
36: ; preds = %35
%37 = load i8*, i8** %8
%38 = call i32 @atoi(i8* %37)
store i32 %38, i32* %9
%39 = load i8*, i8** %7
%40 = call i32 @strcmp(i8* %39, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%41 = icmp ne i32 %40, 0
br i1 %41, label %48, label %42
42: ; preds = %36
%43 = load i32, i32* %6
%44 = load i32, i32* %9
%45 = icmp sge i32 %43, %44
%46 = zext i1 %45 to i32
%47 = call i32 @result__(i32 %46)
store i32 %47, i32* %3
br label %96
48: ; preds = %36
%49 = load i8*, i8** %7
%50 = call i32 @strcmp(i8* %49, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%51 = icmp ne i32 %50, 0
br i1 %51, label %58, label %52
52: ; preds = %48
%53 = load i32, i32* %6
%54 = load i32, i32* %9
%55 = icmp sgt i32 %53, %54
%56 = zext i1 %55 to i32
%57 = call i32 @result__(i32 %56)
store i32 %57, i32* %3
br label %96
58: ; preds = %48
%59 = load i8*, i8** %7
%60 = call i32 @strcmp(i8* %59, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%61 = icmp ne i32 %60, 0
br i1 %61, label %68, label %62
62: ; preds = %58
%63 = load i32, i32* %6
%64 = load i32, i32* %9
%65 = icmp sle i32 %63, %64
%66 = zext i1 %65 to i32
%67 = call i32 @result__(i32 %66)
store i32 %67, i32* %3
br label %96
68: ; preds = %58
%69 = load i8*, i8** %7
%70 = call i32 @strcmp(i8* %69, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%71 = icmp ne i32 %70, 0
br i1 %71, label %78, label %72
72: ; preds = %68
%73 = load i32, i32* %6
%74 = load i32, i32* %9
%75 = icmp slt i32 %73, %74
%76 = zext i1 %75 to i32
%77 = call i32 @result__(i32 %76)
store i32 %77, i32* %3
br label %96
78: ; preds = %68
%79 = load i8*, i8** %7
%80 = call i32 @strcmp(i8* %79, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%81 = icmp ne i32 %80, 0
br i1 %81, label %82, label %90
82: ; preds = %78
%83 = load i8*, i8** %7
%84 = call i32 @strcmp(i8* %83, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%85 = icmp ne i32 %84, 0
br i1 %85, label %86, label %90
86: ; preds = %82
%87 = load i8*, i8** %7
%88 = call i32 @strcmp(i8* %87, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%89 = icmp ne i32 %88, 0
br i1 %89, label %96, label %90
90: ; preds = %86, %82, %78
%91 = load i32, i32* %6
%92 = load i32, i32* %9
%93 = icmp eq i32 %91, %92
%94 = zext i1 %93 to i32
%95 = call i32 @result__(i32 %94)
store i32 %95, i32* %3
br label %96
96: ; preds = %12, %32, %42, %52, %62, %72, %90, %86
%97 = load i32, i32* %3
ret i32 %97
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"gte\00"
@.str.2 = [19 x i8] c"invalid arguments.\00"
@.str.3 = [3 x i8] c"gt\00"
@.str.4 = [4 x i8] c"lte\00"
@.str.5 = [3 x i8] c"lt\00"
@.str.6 = [3 x i8] c"eq\00"
@.str.7 = [3 x i8] c"==\00"
@.str.8 = [2 x i8] c"-\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %8 [
i32 1, label %3
i32 2, label %10
i32 3, label %5
]
3: ; preds = %2
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9400)
br label %56
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
br label %10
8: ; preds = %2
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %56
10: ; preds = %2, %5
%11 = phi i64 [ 2, %5 ], [ 1, %2 ]
%12 = phi i8* [ %7, %5 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %2 ]
%13 = getelementptr inbounds i8*, i8** %1, i64 %11
%14 = load i8*, i8** %13
%15 = tail call i32 @atoi(i8* %14)
%16 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %10
%19 = icmp slt i32 %15, 9401
%20 = zext i1 %19 to i32
%21 = tail call i32 @result__(i32 %20)
br label %56
22: ; preds = %10
%23 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %29
25: ; preds = %22
%26 = icmp slt i32 %15, 9400
%27 = zext i1 %26 to i32
%28 = tail call i32 @result__(i32 %27)
br label %56
29: ; preds = %22
%30 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %36
32: ; preds = %29
%33 = icmp sgt i32 %15, 9399
%34 = zext i1 %33 to i32
%35 = tail call i32 @result__(i32 %34)
br label %56
36: ; preds = %29
%37 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %43
39: ; preds = %36
%40 = icmp sgt i32 %15, 9400
%41 = zext i1 %40 to i32
%42 = tail call i32 @result__(i32 %41)
br label %56
43: ; preds = %36
%44 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%45 = icmp eq i32 %44, 0
br i1 %45, label %52, label %46
46: ; preds = %43
%47 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%48 = icmp eq i32 %47, 0
br i1 %48, label %52, label %49
49: ; preds = %46
%50 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %56
52: ; preds = %49, %46, %43
%53 = icmp eq i32 %15, 9400
%54 = zext i1 %53 to i32
%55 = tail call i32 @result__(i32 %54)
br label %56
56: ; preds = %49, %52, %39, %32, %25, %18, %8, %3
%57 = phi i32 [ 0, %3 ], [ %55, %52 ], [ %42, %39 ], [ %35, %32 ], [ %28, %25 ], [ %21, %18 ], [ -1, %8 ], [ 0, %49 ]
ret i32 %57
}