#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 const *);
int int_compare(const char *s1, const char *s2, char o, void *object) {
  int l1 = atoi(s1);
  int l2 = atoi(s2);
  if (o == '=')
    return (l1 == l2);
  if (o == '<')
    return (l1 < l2);
  if (o == '>')
    return (l1 > l2);
  return 0;
}


x86 assembly (clang, -O0):
<int_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x30(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x3d,%eax
jne    1164 <int_compare+0x54>
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    11b1 <int_compare+0xa1>
movsbl -0x19(%rbp),%eax
cmp    $0x3c,%eax
jne    1187 <int_compare+0x77>
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    11b1 <int_compare+0xa1>
movsbl -0x19(%rbp),%eax
cmp    $0x3e,%eax
jne    11aa <int_compare+0x9a>
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    11b1 <int_compare+0xa1>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_compare>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%rbp
call   1030 <atoi@plt>
mov    %eax,%r14d
mov    %rbp,%rdi
call   1030 <atoi@plt>
cmp    $0x3c,%bl
je     1140 <int_compare+0x30>
cmp    $0x3e,%bl
je     1148 <int_compare+0x38>
cmp    $0x3d,%bl
jne    1150 <int_compare+0x40>
cmp    %eax,%r14d
sete   %al
jmp    1152 <int_compare+0x42>
cmp    %eax,%r14d
setl   %al
jmp    1152 <int_compare+0x42>
cmp    %eax,%r14d
setg   %al
jmp    1152 <int_compare+0x42>
xor    %eax,%eax
movzbl %al,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @int_compare(i8* %0, i8* %1, i8 signext %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8 %2, i8* %8
store i8* %3, i8** %9
%12 = load i8*, i8** %6
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %10
%14 = load i8*, i8** %7
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %11
%16 = load i8, i8* %8
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 61
br i1 %18, label %19, label %24
19: ; preds = %4
%20 = load i32, i32* %10
%21 = load i32, i32* %11
%22 = icmp eq i32 %20, %21
%23 = zext i1 %22 to i32
store i32 %23, i32* %5
br label %43
24: ; preds = %4
%25 = load i8, i8* %8
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 60
br i1 %27, label %28, label %33
28: ; preds = %24
%29 = load i32, i32* %10
%30 = load i32, i32* %11
%31 = icmp slt i32 %29, %30
%32 = zext i1 %31 to i32
store i32 %32, i32* %5
br label %43
33: ; preds = %24
%34 = load i8, i8* %8
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 62
br i1 %36, label %37, label %42
37: ; preds = %33
%38 = load i32, i32* %10
%39 = load i32, i32* %11
%40 = icmp sgt i32 %38, %39
%41 = zext i1 %40 to i32
store i32 %41, i32* %5
br label %43
42: ; preds = %33
store i32 0, i32* %5
br label %43
43: ; preds = %42, %37, %28, %19
%44 = load i32, i32* %5
ret i32 %44
}

LLVM IR (-O2):
define i32 @int_compare(i8* nocapture %0, i8* nocapture %1, i8 signext %2, i8* nocapture readnone %3) {
%5 = tail call i32 @atoi(i8* %0)
%6 = tail call i32 @atoi(i8* %1)
switch i8 %2, label %13 [
i8 61, label %7
i8 60, label %9
i8 62, label %11
]
7: ; preds = %4
%8 = icmp eq i32 %5, %6
br label %13
9: ; preds = %4
%10 = icmp slt i32 %5, %6
br label %13
11: ; preds = %4
%12 = icmp sgt i32 %5, %6
br label %13
13: ; preds = %4, %11, %9, %7
%14 = phi i1 [ %8, %7 ], [ %10, %9 ], [ %12, %11 ], [ false, %4 ]
%15 = zext i1 %14 to i32
ret i32 %15
}