#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*/ assert_bool_eq(int, int, char *, int);
int /*<<< orphan*/ assert_bool_not_eq(int, int, char *, int);
int /*<<< orphan*/ test_case_end();
int /*<<< orphan*/ test_case_start(char *);
void test_boolean_asserts(void) {
  test_case_start("Test boolean asserts, these should pass");
  bool actual = true;
  bool expected = actual;
  (assert_bool_eq(expected, actual,
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/Rebelstack/simplyc/refs/"
                  "heads/master/simplyc_test.c",
                  133));
  expected = !actual;
  (assert_bool_not_eq(expected, actual,
                      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/Rebelstack/simplyc/"
                      "refs/heads/master/simplyc_test.c",
                      135));
  test_case_end();
  test_case_start("Test boolean asserts, these should fail");
  actual = false;
  expected = !actual;
  (assert_bool_eq(expected, actual,
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/Rebelstack/simplyc/refs/"
                  "heads/master/simplyc_test.c",
                  143));
  expected = actual;
  (assert_bool_not_eq(expected, actual,
                      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/Rebelstack/simplyc/"
                      "refs/heads/master/simplyc_test.c",
                      145));
  test_case_end();
}


x86 assembly (clang, -O0):
<test_boolean_asserts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <test_case_start@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
lea    0xeba(%rip),%rdx
mov    $0x85,%ecx
call   1030 <assert_bool_eq@plt>
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
lea    0xe92(%rip),%rdx
mov    $0x87,%ecx
call   1060 <assert_bool_not_eq@plt>
mov    $0x0,%al
call   1050 <test_case_end@plt>
lea    0xf08(%rip),%rdi
call   1040 <test_case_start@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
lea    0xe50(%rip),%rdx
mov    $0x8f,%ecx
call   1030 <assert_bool_eq@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
lea    0xe33(%rip),%rdx
mov    $0x91,%ecx
call   1060 <assert_bool_not_eq@plt>
mov    $0x0,%al
call   1050 <test_case_end@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_boolean_asserts>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1040 <test_case_start@plt>
lea    0xed4(%rip),%rbx
mov    $0x1,%edi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    $0x85,%ecx
call   1030 <assert_bool_eq@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    $0x87,%ecx
call   1060 <assert_bool_not_eq@plt>
xor    %eax,%eax
call   1050 <test_case_end@plt>
lea    0xf29(%rip),%rdi
call   1040 <test_case_start@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    %rbx,%rdx
mov    $0x8f,%ecx
call   1030 <assert_bool_eq@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rdx
mov    $0x91,%ecx
call   1060 <assert_bool_not_eq@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <test_case_end@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Test boolean asserts, these should pass\00"
@.str.1 = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Rebelstack/simplyc/refs/heads/master/simplyc_test.c\00"
@.str.2 = [40 x i8] c"Test boolean asserts, these should fail\00"
define void @test_boolean_asserts() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @test_case_start(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
%4 = load i32, i32* %1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = call i32 @assert_bool_eq(i32 %5, i32 %6, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.1, i64 0, i64 0), i32 133)
%8 = load i32, i32* %1
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = load i32, i32* %1
%14 = call i32 @assert_bool_not_eq(i32 %12, i32 %13, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.1, i64 0, i64 0), i32 135)
%15 = call i32 (...) @test_case_end()
%16 = call i32 @test_case_start(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
%17 = load i32, i32* %1
%18 = icmp ne i32 %17, 0
%19 = xor i1 %18, true
%20 = zext i1 %19 to i32
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = load i32, i32* %1
%23 = call i32 @assert_bool_eq(i32 %21, i32 %22, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.1, i64 0, i64 0), i32 143)
%24 = load i32, i32* %1
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = load i32, i32* %1
%27 = call i32 @assert_bool_not_eq(i32 %25, i32 %26, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.1, i64 0, i64 0), i32 145)
%28 = call i32 (...) @test_case_end()
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Test boolean asserts, these should pass\00"
@.str.1 = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Rebelstack/simplyc/refs/heads/master/simplyc_test.c\00"
@.str.2 = [40 x i8] c"Test boolean asserts, these should fail\00"
define void @test_boolean_asserts() {
%1 = tail call i32 @test_case_start(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @assert_bool_eq(i32 1, i32 1, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.1, i64 0, i64 0), i32 133)
%3 = tail call i32 @assert_bool_not_eq(i32 0, i32 1, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.1, i64 0, i64 0), i32 135)
%4 = tail call i32 (...) @test_case_end()
%5 = tail call i32 @test_case_start(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @assert_bool_eq(i32 1, i32 0, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.1, i64 0, i64 0), i32 143)
%7 = tail call i32 @assert_bool_not_eq(i32 0, i32 0, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.1, i64 0, i64 0), i32 145)
%8 = tail call i32 (...) @test_case_end()
ret void
}