#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 /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printd(char);
int /*<<< orphan*/ putchar(char);
void cmp(char a, char b) {
  printd(a);
  putchar(' ');
  printd(b);
  if (a == b)
    print(" ==");
  if (a != b)
    print(" !=");
  if (a < b)
    print(" < ");
  if (a > b)
    print(" > ");
  if (a <= b)
    print(" <=");
  if (a >= b)
    print(" >=");
  print("\r\n");
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <printd@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl -0x2(%rbp),%edi
call   1040 <printd@plt>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jne    117c <cmp+0x4c>
lea    0xe89(%rip),%rdi
call   1050 <print@plt>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
je     1198 <cmp+0x68>
lea    0xe71(%rip),%rdi
call   1050 <print@plt>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jge    11b4 <cmp+0x84>
lea    0xe59(%rip),%rdi
call   1050 <print@plt>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jle    11d0 <cmp+0xa0>
lea    0xe41(%rip),%rdi
call   1050 <print@plt>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jg     11ec <cmp+0xbc>
lea    0xe29(%rip),%rdi
call   1050 <print@plt>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jl     1208 <cmp+0xd8>
lea    0xe11(%rip),%rdi
call   1050 <print@plt>
lea    0xe09(%rip),%rdi
call   1050 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <printd@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1040 <printd@plt>
lea    0xeac(%rip),%rax
lea    0xea9(%rip),%rdi
cmp    %bl,%bpl
cmove  %rax,%rdi
lea    0xea3(%rip),%rax
lea    0xea0(%rip),%rcx
cmovle %rcx,%rax
lea    0xe8d(%rip),%rbx
cmovge %rax,%rbx
lea    0xe8e(%rip),%rbp
cmovl  %rcx,%rbp
call   1050 <print@plt>
mov    %rbx,%rdi
call   1050 <print@plt>
mov    %rbp,%rdi
call   1050 <print@plt>
lea    0xe72(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <print@plt>

LLVM IR (-O0):
@.str = [4 x i8] c" ==\00"
@.str.1 = [4 x i8] c" !=\00"
@.str.2 = [4 x i8] c" < \00"
@.str.3 = [4 x i8] c" > \00"
@.str.4 = [4 x i8] c" <=\00"
@.str.5 = [4 x i8] c" >=\00"
@.str.6 = [3 x i8] c"\0D\0A\00"
define void @cmp(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @printd(i8 signext %5)
%7 = call i32 @putchar(i8 signext 32)
%8 = load i8, i8* %4
%9 = call i32 @printd(i8 signext %8)
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %11, %13
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %2
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = load i8, i8* %4
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %19, %21
br i1 %22, label %23, label %25
23: ; preds = %17
%24 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %25
25: ; preds = %23, %17
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = load i8, i8* %4
%29 = sext i8 %28 to i32
%30 = icmp slt i32 %27, %29
br i1 %30, label %31, label %33
31: ; preds = %25
%32 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %33
33: ; preds = %31, %25
%34 = load i8, i8* %3
%35 = sext i8 %34 to i32
%36 = load i8, i8* %4
%37 = sext i8 %36 to i32
%38 = icmp sgt i32 %35, %37
br i1 %38, label %39, label %41
39: ; preds = %33
%40 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %41
41: ; preds = %39, %33
%42 = load i8, i8* %3
%43 = sext i8 %42 to i32
%44 = load i8, i8* %4
%45 = sext i8 %44 to i32
%46 = icmp sle i32 %43, %45
br i1 %46, label %47, label %49
47: ; preds = %41
%48 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %49
49: ; preds = %47, %41
%50 = load i8, i8* %3
%51 = sext i8 %50 to i32
%52 = load i8, i8* %4
%53 = sext i8 %52 to i32
%54 = icmp sge i32 %51, %53
br i1 %54, label %55, label %57
55: ; preds = %49
%56 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %57
57: ; preds = %55, %49
%58 = call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" ==\00"
@.str.1 = [4 x i8] c" !=\00"
@.str.2 = [4 x i8] c" < \00"
@.str.3 = [4 x i8] c" > \00"
@.str.4 = [4 x i8] c" <=\00"
@.str.5 = [4 x i8] c" >=\00"
@.str.6 = [3 x i8] c"\0D\0A\00"
define void @cmp(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @printd(i8 signext %0)
%4 = tail call i32 @putchar(i8 signext 32)
%5 = tail call i32 @printd(i8 signext %1)
%6 = icmp eq i8 %0, %1
%7 = select i1 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%8 = tail call i32 @print(i8* %7)
%9 = icmp slt i8 %0, %1
%10 = icmp sgt i8 %0, %1
%11 = select i1 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0)
%12 = select i1 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %11
%13 = select i1 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0)
%14 = tail call i32 @print(i8* %12)
%15 = tail call i32 @print(i8* %13)
%16 = tail call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
ret void
}