#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 cmp_object(char *op, char *l, char *r) {
  if (strcmp(op, "==") == 0)
    return strcmp(l, r) == 0;
  if (strcmp(op, "!=") == 0)
    return strcmp(l, r) != 0;
  if (strcmp(op, ">=") == 0)
    return strcmp(l, r) >= 0;
  if (strcmp(op, "<=") == 0)
    return strcmp(l, r) <= 0;
  if (strcmp(op, ">") == 0)
    return strcmp(l, r) > 0;
  if (strcmp(op, "<") == 0)
    return strcmp(l, r) < 0;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_object>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115f <cmp_object+0x4f>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    128d <cmp_object+0x17d>
mov    -0x10(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    119a <cmp_object+0x8a>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    128d <cmp_object+0x17d>
mov    -0x10(%rbp),%rdi
lea    0xe61(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11d5 <cmp_object+0xc5>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    128d <cmp_object+0x17d>
mov    -0x10(%rbp),%rdi
lea    0xe29(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1210 <cmp_object+0x100>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    128d <cmp_object+0x17d>
mov    -0x10(%rbp),%rdi
lea    0xdf1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    124b <cmp_object+0x13b>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    128d <cmp_object+0x17d>
mov    -0x10(%rbp),%rdi
lea    0xdb8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1286 <cmp_object+0x176>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    128d <cmp_object+0x17d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_object>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xedb(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1197 <cmp_object+0x87>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11aa <cmp_object+0x9a>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11bd <cmp_object+0xad>
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11d0 <cmp_object+0xc0>
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11e3 <cmp_object+0xd3>
lea    0xe88(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11f6 <cmp_object+0xe6>
xor    %eax,%eax
jmp    1205 <cmp_object+0xf5>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
sete   %al
jmp    1205 <cmp_object+0xf5>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
setne  %al
jmp    1205 <cmp_object+0xf5>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
setns  %al
jmp    1205 <cmp_object+0xf5>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
setle  %al
jmp    1205 <cmp_object+0xf5>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
setg   %al
jmp    1205 <cmp_object+0xf5>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
shr    $0x3f,%rax
movzbl %al,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

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