#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(int /*<<< orphan*/);
int test_icmp_(int, int, int, int);
int test_icmp(void) {
  if (test_icmp_(-1, 2, 0, 4) != 0x2a9)
    return fail(0);
  if (test_icmp_(-1, -1, 1, -1) != 0x322)
    return fail(0);
  if (test_icmp_(-1, 0, 3, -2) != 0x2a3)
    return fail(0);
  if (test_icmp_(-1, 0, 3, 0) != 0x2e3)
    return fail(0);
  if (test_icmp_(-1, 0, 0, -1) != 0x2b)
    return fail(0);
  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     1158 <test_icmp+0x38>
xor    %edi,%edi
call   1040 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    1211 <test_icmp+0xf1>
mov    $0xffffffff,%ecx
mov    $0x1,%edx
mov    %ecx,%edi
mov    %ecx,%esi
call   1030 <test_icmp_@plt>
cmp    $0x322,%eax
je     1185 <test_icmp+0x65>
xor    %edi,%edi
call   1040 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    1211 <test_icmp+0xf1>
mov    $0xffffffff,%edi
xor    %esi,%esi
mov    $0x3,%edx
mov    $0xfffffffe,%ecx
call   1030 <test_icmp_@plt>
cmp    $0x2a3,%eax
je     11b5 <test_icmp+0x95>
xor    %edi,%edi
call   1040 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    1211 <test_icmp+0xf1>
mov    $0xffffffff,%edi
xor    %ecx,%ecx
mov    $0x3,%edx
mov    %ecx,%esi
call   1030 <test_icmp_@plt>
cmp    $0x2e3,%eax
je     11e2 <test_icmp+0xc2>
xor    %edi,%edi
call   1040 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    1211 <test_icmp+0xf1>
mov    $0xffffffff,%ecx
xor    %edx,%edx
mov    %ecx,%edi
mov    %edx,%esi
call   1030 <test_icmp_@plt>
cmp    $0x2b,%eax
je     120a <test_icmp+0xea>
xor    %edi,%edi
call   1040 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    1211 <test_icmp+0xf1>
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>
cmp    $0x2a9,%eax
jne    11b4 <test_icmp+0x94>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
mov    $0x1,%edx
mov    $0xffffffff,%ecx
call   1030 <test_icmp_@plt>
cmp    $0x322,%eax
jne    11b4 <test_icmp+0x94>
mov    $0xffffffff,%edi
xor    %esi,%esi
mov    $0x3,%edx
mov    $0xfffffffe,%ecx
call   1030 <test_icmp_@plt>
cmp    $0x2a3,%eax
jne    11b4 <test_icmp+0x94>
mov    $0xffffffff,%edi
xor    %esi,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
call   1030 <test_icmp_@plt>
cmp    $0x2e3,%eax
jne    11b4 <test_icmp+0x94>
mov    $0xffffffff,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0xffffffff,%ecx
call   1030 <test_icmp_@plt>
cmp    $0x2b,%eax
jne    11b4 <test_icmp+0x94>
mov    $0x40000000,%eax
pop    %rcx
ret
xor    %edi,%edi
pop    %rax
jmp    1040 <fail@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(i32 0)
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(i32 0)
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(i32 0)
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(i32 0)
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(i32 0)
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 %17, label %15
15: ; preds = %12, %9, %6, %3, %0
%16 = tail call i32 @fail(i32 0)
br label %17
17: ; preds = %15, %12
%18 = phi i32 [ 1073741824, %12 ], [ %16, %15 ]
ret i32 %18
}