#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*/ assertTrue(char *, int);
int is_negative(int);
void test_expect() {
  assertTrue("is_negative(1) == 42", is_negative(1) == 42);
  assertTrue("is_negative(0) == 42", is_negative(0) == 42);
  assertTrue("is_negative(-5) == -42", is_negative(-5) == -42);
}


x86 assembly (clang, -O0):
<test_expect>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <is_negative@plt>
cmp    $0x2a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xec0(%rip),%rdi
call   1030 <assertTrue@plt>
xor    %edi,%edi
call   1040 <is_negative@plt>
cmp    $0x2a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeb7(%rip),%rdi
call   1030 <assertTrue@plt>
mov    $0xfffffffb,%edi
call   1040 <is_negative@plt>
cmp    $0xffffffd6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeab(%rip),%rdi
call   1030 <assertTrue@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_expect>:
push   %rax
mov    $0x1,%edi
call   1040 <is_negative@plt>
xor    %esi,%esi
cmp    $0x2a,%eax
sete   %sil
lea    0xec5(%rip),%rdi
call   1030 <assertTrue@plt>
xor    %edi,%edi
call   1040 <is_negative@plt>
xor    %esi,%esi
cmp    $0x2a,%eax
sete   %sil
lea    0xebe(%rip),%rdi
call   1030 <assertTrue@plt>
mov    $0xfffffffb,%edi
call   1040 <is_negative@plt>
xor    %esi,%esi
cmp    $0xffffffd6,%eax
sete   %sil
lea    0xeb4(%rip),%rdi
pop    %rax
jmp    1030 <assertTrue@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"is_negative(1) == 42\00"
@.str.1 = [21 x i8] c"is_negative(0) == 42\00"
@.str.2 = [23 x i8] c"is_negative(-5) == -42\00"
define void @test_expect() {
%1 = call i32 @is_negative(i32 1)
%2 = icmp eq i32 %1, 42
%3 = zext i1 %2 to i32
%4 = call i32 @assertTrue(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @is_negative(i32 0)
%6 = icmp eq i32 %5, 42
%7 = zext i1 %6 to i32
%8 = call i32 @assertTrue(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @is_negative(i32 -5)
%10 = icmp eq i32 %9, -42
%11 = zext i1 %10 to i32
%12 = call i32 @assertTrue(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"is_negative(1) == 42\00"
@.str.1 = [21 x i8] c"is_negative(0) == 42\00"
@.str.2 = [23 x i8] c"is_negative(-5) == -42\00"
define void @test_expect() {
%1 = tail call i32 @is_negative(i32 1)
%2 = icmp eq i32 %1, 42
%3 = zext i1 %2 to i32
%4 = tail call i32 @assertTrue(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @is_negative(i32 0)
%6 = icmp eq i32 %5, 42
%7 = zext i1 %6 to i32
%8 = tail call i32 @assertTrue(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = tail call i32 @is_negative(i32 -5)
%10 = icmp eq i32 %9, -42
%11 = zext i1 %10 to i32
%12 = tail call i32 @assertTrue(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret void
}