#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 */
scalar_t__ strcmp(char *, char *);
int integer_relation(char *operator, int avalue, int ivalue) {
  int t;
  if (strcmp(operator, "=") == 0)
    t = (avalue == ivalue);
  else if (strcmp(operator, "==") == 0)
    t = (avalue == ivalue);
  else if (strcmp(operator, "!=") == 0)
    t = (avalue != ivalue);
  else if (strcmp(operator, "<=") == 0)
    t = (avalue <= ivalue);
  else if (strcmp(operator, ">=") == 0)
    t = (avalue >= ivalue);
  else if (strcmp(operator, "<") == 0)
    t = (avalue < ivalue);
  else if (strcmp(operator, ">") == 0)
    t = (avalue > ivalue);
  else
    t = 0;
  return (t);
}


x86 assembly (clang, -O0):
<integer_relation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed7(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1152 <integer_relation+0x42>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
jmp    1297 <integer_relation+0x187>
mov    -0x8(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1182 <integer_relation+0x72>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
jmp    1292 <integer_relation+0x182>
mov    -0x8(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11b2 <integer_relation+0xa2>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
jmp    128d <integer_relation+0x17d>
mov    -0x8(%rbp),%rdi
lea    0xe49(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11e2 <integer_relation+0xd2>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
jmp    1288 <integer_relation+0x178>
mov    -0x8(%rbp),%rdi
lea    0xe1c(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1212 <integer_relation+0x102>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
jmp    1283 <integer_relation+0x173>
mov    -0x8(%rbp),%rdi
lea    0xdef(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1242 <integer_relation+0x132>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
jmp    127e <integer_relation+0x16e>
mov    -0x8(%rbp),%rdi
lea    0xdc1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1272 <integer_relation+0x162>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
jmp    1279 <integer_relation+0x169>
movl   $0x0,-0x14(%rbp)
jmp    127e <integer_relation+0x16e>
jmp    1283 <integer_relation+0x173>
jmp    1288 <integer_relation+0x178>
jmp    128d <integer_relation+0x17d>
jmp    1292 <integer_relation+0x182>
jmp    1297 <integer_relation+0x187>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integer_relation>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xee1(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11b4 <integer_relation+0xa4>
lea    0xec8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11b4 <integer_relation+0xa4>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11c2 <integer_relation+0xb2>
lea    0xea6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11ca <integer_relation+0xba>
lea    0xe95(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11d2 <integer_relation+0xc2>
lea    0xe84(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11da <integer_relation+0xca>
lea    0xe72(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
sete   %cl
cmp    %r14d,%ebp
setg   %al
and    %cl,%al
jmp    11ba <integer_relation+0xaa>
cmp    %r14d,%ebp
sete   %al
movzbl %al,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
cmp    %r14d,%ebp
setne  %al
jmp    11ba <integer_relation+0xaa>
cmp    %r14d,%ebp
setle  %al
jmp    11ba <integer_relation+0xaa>
cmp    %r14d,%ebp
setge  %al
jmp    11ba <integer_relation+0xaa>
cmp    %r14d,%ebp
setl   %al
jmp    11ba <integer_relation+0xaa>

LLVM IR (-O0):
@.str = [2 x i8] c"=\00"
@.str.1 = [3 x i8] c"==\00"
@.str.2 = [3 x i8] c"!=\00"
@.str.3 = [3 x i8] c"<=\00"
@.str.4 = [3 x i8] c">=\00"
@.str.5 = [2 x i8] c"<\00"
@.str.6 = [2 x i8] c">\00"
define i32 @integer_relation(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = icmp eq i32 %12, %13
%15 = zext i1 %14 to i32
store i32 %15, i32* %7
br label %77
16: ; preds = %3
%17 = load i8*, i8** %4
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %25
20: ; preds = %16
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = icmp eq i32 %21, %22
%24 = zext i1 %23 to i32
store i32 %24, i32* %7
br label %76
25: ; preds = %16
%26 = load i8*, i8** %4
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %34
29: ; preds = %25
%30 = load i32, i32* %5
%31 = load i32, i32* %6
%32 = icmp ne i32 %30, %31
%33 = zext i1 %32 to i32
store i32 %33, i32* %7
br label %75
34: ; preds = %25
%35 = load i8*, i8** %4
%36 = call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %43
38: ; preds = %34
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = icmp sle i32 %39, %40
%42 = zext i1 %41 to i32
store i32 %42, i32* %7
br label %74
43: ; preds = %34
%44 = load i8*, i8** %4
%45 = call i64 @strcmp(i8* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %52
47: ; preds = %43
%48 = load i32, i32* %5
%49 = load i32, i32* %6
%50 = icmp sge i32 %48, %49
%51 = zext i1 %50 to i32
store i32 %51, i32* %7
br label %73
52: ; preds = %43
%53 = load i8*, i8** %4
%54 = call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %61
56: ; preds = %52
%57 = load i32, i32* %5
%58 = load i32, i32* %6
%59 = icmp slt i32 %57, %58
%60 = zext i1 %59 to i32
store i32 %60, i32* %7
br label %72
61: ; preds = %52
%62 = load i8*, i8** %4
%63 = call i64 @strcmp(i8* %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %70
65: ; preds = %61
%66 = load i32, i32* %5
%67 = load i32, i32* %6
%68 = icmp sgt i32 %66, %67
%69 = zext i1 %68 to i32
store i32 %69, i32* %7
br label %71
70: ; preds = %61
store i32 0, i32* %7
br label %71
71: ; preds = %70, %65
br label %72
72: ; preds = %71, %56
br label %73
73: ; preds = %72, %47
br label %74
74: ; preds = %73, %38
br label %75
75: ; preds = %74, %29
br label %76
76: ; preds = %75, %20
br label %77
77: ; preds = %76, %11
%78 = load i32, i32* %7
ret i32 %78
}

LLVM IR (-O2):
@.str = [2 x i8] c"=\00"
@.str.1 = [3 x i8] c"==\00"
@.str.2 = [3 x i8] c"!=\00"
@.str.3 = [3 x i8] c"<=\00"
@.str.4 = [3 x i8] c">=\00"
@.str.5 = [2 x i8] c"<\00"
@.str.6 = [2 x i8] c">\00"
define i32 @integer_relation(i8* %0, i32 %1, i32 %2) {
%4 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = icmp eq i32 %1, %2
br label %38
8: ; preds = %3
%9 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = icmp eq i32 %1, %2
br label %38
13: ; preds = %8
%14 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = icmp ne i32 %1, %2
br label %38
18: ; preds = %13
%19 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = icmp sle i32 %1, %2
br label %38
23: ; preds = %18
%24 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = icmp sge i32 %1, %2
br label %38
28: ; preds = %23
%29 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = icmp slt i32 %1, %2
br label %38
33: ; preds = %28
%34 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
%36 = icmp sgt i32 %1, %2
%37 = and i1 %36, %35
br label %38
38: ; preds = %33, %11, %21, %31, %26, %16, %6
%39 = phi i1 [ %7, %6 ], [ %12, %11 ], [ %17, %16 ], [ %22, %21 ], [ %27, %26 ], [ %32, %31 ], [ %37, %33 ]
%40 = zext i1 %39 to i32
ret i32 %40
}