#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*/ __emit_expression_range(int /*<<< orphan*/, int);
void test_relational_operators(int lhs, int rhs) {
  __emit_expression_range(0, lhs < rhs);
  __emit_expression_range(0, lhs > rhs);
  __emit_expression_range(0, lhs <= rhs);
  __emit_expression_range(0, lhs >= rhs);
}


x86 assembly (clang, -O0):
<test_relational_operators>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_relational_operators>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
xor    %ebx,%ebx
xor    %ebp,%ebp
xor    %r14d,%r14d
cmp    %esi,%edi
setl   %al
setg   %bl
setle  %bpl
setge  %r14b
xor    %edi,%edi
mov    %eax,%esi
call   1030 <__emit_expression_range@plt>
xor    %edi,%edi
mov    %ebx,%esi
call   1030 <__emit_expression_range@plt>
xor    %edi,%edi
mov    %ebp,%esi
call   1030 <__emit_expression_range@plt>
xor    %edi,%edi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <__emit_expression_range@plt>

LLVM IR (-O0):
define void @test_relational_operators(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @__emit_expression_range(i32 0, i32 %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = icmp sgt i32 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @__emit_expression_range(i32 0, i32 %13)
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = icmp sle i32 %15, %16
%18 = zext i1 %17 to i32
%19 = call i32 @__emit_expression_range(i32 0, i32 %18)
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = icmp sge i32 %20, %21
%23 = zext i1 %22 to i32
%24 = call i32 @__emit_expression_range(i32 0, i32 %23)
ret void
}

LLVM IR (-O2):
define void @test_relational_operators(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @__emit_expression_range(i32 0, i32 %4)
%6 = icmp sgt i32 %0, %1
%7 = zext i1 %6 to i32
%8 = tail call i32 @__emit_expression_range(i32 0, i32 %7)
%9 = icmp sle i32 %0, %1
%10 = zext i1 %9 to i32
%11 = tail call i32 @__emit_expression_range(i32 0, i32 %10)
%12 = icmp sge i32 %0, %1
%13 = zext i1 %12 to i32
%14 = tail call i32 @__emit_expression_range(i32 0, i32 %13)
ret void
}