#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*/ emitbin(int, int);
int /*<<< orphan*/ puts(char *);
void emitrel(int expr1, char rel[], int expr2) {
  emitbin(expr1, expr2);
  puts("\tmov edx, eax\n");
  puts("\txor eax, eax\n");
  puts("\tcmp edx, ecx\n");
  puts("\tset");
  puts(rel);
  puts(" al\n");
}


x86 assembly (clang, -O0):
<emitrel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <emitbin@plt>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emitrel>:
push   %rbx
mov    %rsi,%rbx
mov    %edx,%esi
call   1040 <emitbin@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"\09mov edx, eax\0A\00"
@.str.1 = [15 x i8] c"\09xor eax, eax\0A\00"
@.str.2 = [15 x i8] c"\09cmp edx, ecx\0A\00"
@.str.3 = [5 x i8] c"\09set\00"
@.str.4 = [5 x i8] c" al\0A\00"
define void @emitrel(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = call i32 @emitbin(i32 %7, i32 %8)
%10 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%14 = load i8*, i8** %5
%15 = call i32 @puts(i8* %14)
%16 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"\09mov edx, eax\0A\00"
@.str.1 = [15 x i8] c"\09xor eax, eax\0A\00"
@.str.2 = [15 x i8] c"\09cmp edx, ecx\0A\00"
@.str.3 = [5 x i8] c"\09set\00"
@.str.4 = [5 x i8] c" al\0A\00"
define void @emitrel(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @emitbin(i32 %0, i32 %2)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) %1)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
ret void
}