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


x86 assembly (clang, -O0):
<real_relation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115f <real_relation+0x4f>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    12ce <real_relation+0x1be>
mov    -0x8(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1198 <real_relation+0x88>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    12c9 <real_relation+0x1b9>
mov    -0x8(%rbp),%rdi
lea    0xe60(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11d1 <real_relation+0xc1>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    12c4 <real_relation+0x1b4>
mov    -0x8(%rbp),%rdi
lea    0xe2a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1209 <real_relation+0xf9>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    12bf <real_relation+0x1af>
mov    -0x8(%rbp),%rdi
lea    0xdf5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    123d <real_relation+0x12d>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    12ba <real_relation+0x1aa>
mov    -0x8(%rbp),%rdi
lea    0xdc4(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1275 <real_relation+0x165>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    12b5 <real_relation+0x1a5>
mov    -0x8(%rbp),%rdi
lea    0xd8e(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    12a9 <real_relation+0x199>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    12b0 <real_relation+0x1a0>
movl   $0x0,-0x1c(%rbp)
jmp    12b5 <real_relation+0x1a5>
jmp    12ba <real_relation+0x1aa>
jmp    12bf <real_relation+0x1af>
jmp    12c4 <real_relation+0x1b4>
jmp    12c9 <real_relation+0x1b9>
jmp    12ce <real_relation+0x1be>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<real_relation>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
lea    0xeda(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11c7 <real_relation+0xb7>
lea    0xec1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11c7 <real_relation+0xb7>
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11e4 <real_relation+0xd4>
lea    0xe9b(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11f2 <real_relation+0xe2>
lea    0xe8a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1202 <real_relation+0xf2>
lea    0xe79(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1212 <real_relation+0x102>
lea    0xe67(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
sete   %cl
movsd  0x8(%rsp),%xmm0
ucomisd (%rsp),%xmm0
seta   %al
and    %cl,%al
jmp    11db <real_relation+0xcb>
movsd  0x8(%rsp),%xmm0
cmpeqsd (%rsp),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbx
ret
movsd  0x8(%rsp),%xmm0
cmpneqsd (%rsp),%xmm0
jmp    11d3 <real_relation+0xc3>
movsd  (%rsp),%xmm0
ucomisd 0x8(%rsp),%xmm0
setae  %al
jmp    11db <real_relation+0xcb>
movsd  0x8(%rsp),%xmm0
ucomisd (%rsp),%xmm0
setae  %al
jmp    11db <real_relation+0xcb>
movsd  (%rsp),%xmm0
ucomisd 0x8(%rsp),%xmm0
seta   %al
jmp    11db <real_relation+0xcb>

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 @real_relation(i8* %0, double %1, double %2) {
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
%7 = alloca i32
store i8* %0, i8** %4
store double %1, double* %5
store double %2, double* %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 double, double* %5
%13 = load double, double* %6
%14 = fcmp oeq double %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 double, double* %5
%22 = load double, double* %6
%23 = fcmp oeq double %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 double, double* %5
%31 = load double, double* %6
%32 = fcmp une double %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 double, double* %5
%40 = load double, double* %6
%41 = fcmp ole double %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 double, double* %5
%49 = load double, double* %6
%50 = fcmp oge double %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 double, double* %5
%58 = load double, double* %6
%59 = fcmp olt double %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 double, double* %5
%67 = load double, double* %6
%68 = fcmp ogt double %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 @real_relation(i8* %0, double %1, double %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 = fcmp oeq double %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 = fcmp oeq double %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 = fcmp une double %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 = fcmp ole double %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 = fcmp oge double %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 = fcmp olt double %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 = fcmp ogt double %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
}