#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 fail_real(int /*<<< orphan*/, int);
int test_icmp_(int, int, int, int);
int test_icmp(void) {
  if (test_icmp_(-1, 2, 0, 4) != 0x2a9)
    return fail_real(0, 656);
  if (test_icmp_(-1, -1, 1, -1) != 0x322)
    return fail_real(0, 658);
  if (test_icmp_(-1, 0, 3, -2) != 0x2a3)
    return fail_real(0, 660);
  if (test_icmp_(-1, 0, 3, 0) != 0x2e3)
    return fail_real(0, 662);
  if (test_icmp_(-1, 0, 0, -1) != 0x2b)
    return fail_real(0, 664);
  return 0x40000000;
}


x86 assembly (clang, -O0):
<test_icmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xffffffff,%edi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <test_icmp_@plt>
cmp    $0x2a9,%eax
je     115d <test_icmp+0x3d>
xor    %edi,%edi
mov    $0x290,%esi
call   1040 <fail_real@plt>
mov    %eax,-0x4(%rbp)
jmp    122a <test_icmp+0x10a>
mov    $0xffffffff,%ecx
mov    $0x1,%edx
mov    %ecx,%edi
mov    %ecx,%esi
call   1030 <test_icmp_@plt>
cmp    $0x322,%eax
je     118f <test_icmp+0x6f>
xor    %edi,%edi
mov    $0x292,%esi
call   1040 <fail_real@plt>
mov    %eax,-0x4(%rbp)
jmp    122a <test_icmp+0x10a>
mov    $0xffffffff,%edi
xor    %esi,%esi
mov    $0x3,%edx
mov    $0xfffffffe,%ecx
call   1030 <test_icmp_@plt>
cmp    $0x2a3,%eax
je     11c4 <test_icmp+0xa4>
xor    %edi,%edi
mov    $0x294,%esi
call   1040 <fail_real@plt>
mov    %eax,-0x4(%rbp)
jmp    122a <test_icmp+0x10a>
mov    $0xffffffff,%edi
xor    %ecx,%ecx
mov    $0x3,%edx
mov    %ecx,%esi
call   1030 <test_icmp_@plt>
cmp    $0x2e3,%eax
je     11f6 <test_icmp+0xd6>
xor    %edi,%edi
mov    $0x296,%esi
call   1040 <fail_real@plt>
mov    %eax,-0x4(%rbp)
jmp    122a <test_icmp+0x10a>
mov    $0xffffffff,%ecx
xor    %edx,%edx
mov    %ecx,%edi
mov    %edx,%esi
call   1030 <test_icmp_@plt>
cmp    $0x2b,%eax
je     1223 <test_icmp+0x103>
xor    %edi,%edi
mov    $0x298,%esi
call   1040 <fail_real@plt>
mov    %eax,-0x4(%rbp)
jmp    122a <test_icmp+0x10a>
movl   $0x40000000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_icmp>:
push   %rax
mov    $0xffffffff,%edi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <test_icmp_@plt>
mov    $0x290,%esi
cmp    $0x2a9,%eax
jne    11d1 <test_icmp+0xb1>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
mov    $0x1,%edx
mov    $0xffffffff,%ecx
call   1030 <test_icmp_@plt>
mov    $0x292,%esi
cmp    $0x322,%eax
jne    11d1 <test_icmp+0xb1>
mov    $0xffffffff,%edi
xor    %esi,%esi
mov    $0x3,%edx
mov    $0xfffffffe,%ecx
call   1030 <test_icmp_@plt>
mov    $0x294,%esi
cmp    $0x2a3,%eax
jne    11d1 <test_icmp+0xb1>
mov    $0xffffffff,%edi
xor    %esi,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
call   1030 <test_icmp_@plt>
mov    $0x296,%esi
cmp    $0x2e3,%eax
jne    11d1 <test_icmp+0xb1>
mov    $0xffffffff,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0xffffffff,%ecx
call   1030 <test_icmp_@plt>
mov    $0x298,%esi
cmp    $0x2b,%eax
jne    11d1 <test_icmp+0xb1>
mov    $0x40000000,%eax
pop    %rcx
ret
xor    %edi,%edi
pop    %rax
jmp    1040 <fail_real@plt>

LLVM IR (-O0):
define i32 @test_icmp() {
%1 = alloca i32
%2 = call i32 @test_icmp_(i32 -1, i32 2, i32 0, i32 4)
%3 = icmp ne i32 %2, 681
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @fail_real(i32 0, i32 656)
store i32 %5, i32* %1
br label %27
6: ; preds = %0
%7 = call i32 @test_icmp_(i32 -1, i32 -1, i32 1, i32 -1)
%8 = icmp ne i32 %7, 802
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @fail_real(i32 0, i32 658)
store i32 %10, i32* %1
br label %27
11: ; preds = %6
%12 = call i32 @test_icmp_(i32 -1, i32 0, i32 3, i32 -2)
%13 = icmp ne i32 %12, 675
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @fail_real(i32 0, i32 660)
store i32 %15, i32* %1
br label %27
16: ; preds = %11
%17 = call i32 @test_icmp_(i32 -1, i32 0, i32 3, i32 0)
%18 = icmp ne i32 %17, 739
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @fail_real(i32 0, i32 662)
store i32 %20, i32* %1
br label %27
21: ; preds = %16
%22 = call i32 @test_icmp_(i32 -1, i32 0, i32 0, i32 -1)
%23 = icmp ne i32 %22, 43
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 @fail_real(i32 0, i32 664)
store i32 %25, i32* %1
br label %27
26: ; preds = %21
store i32 1073741824, i32* %1
br label %27
27: ; preds = %26, %24, %19, %14, %9, %4
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
define i32 @test_icmp() {
%1 = tail call i32 @test_icmp_(i32 -1, i32 2, i32 0, i32 4)
%2 = icmp eq i32 %1, 681
br i1 %2, label %3, label %15
3: ; preds = %0
%4 = tail call i32 @test_icmp_(i32 -1, i32 -1, i32 1, i32 -1)
%5 = icmp eq i32 %4, 802
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = tail call i32 @test_icmp_(i32 -1, i32 0, i32 3, i32 -2)
%8 = icmp eq i32 %7, 675
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = tail call i32 @test_icmp_(i32 -1, i32 0, i32 3, i32 0)
%11 = icmp eq i32 %10, 739
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = tail call i32 @test_icmp_(i32 -1, i32 0, i32 0, i32 -1)
%14 = icmp eq i32 %13, 43
br i1 %14, label %18, label %15
15: ; preds = %12, %9, %6, %3, %0
%16 = phi i32 [ 656, %0 ], [ 658, %3 ], [ 660, %6 ], [ 662, %9 ], [ 664, %12 ]
%17 = tail call i32 @fail_real(i32 0, i32 %16)
br label %18
18: ; preds = %15, %12
%19 = phi i32 [ 1073741824, %12 ], [ %17, %15 ]
ret i32 %19
}