void test_bool() {
  _Bool v = 3;
  fexpect(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/conversion.c",
      7, 1, v);
  ;
  v = 5;
  fexpect(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/conversion.c",
      9, 1, v);
  ;
  v = 0.5;
  fexpect(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/conversion.c",
      11, 1, v);
  ;
  v = 0.0;
  fexpect(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/conversion.c",
      13, 0, v);
  ;
}


x86 assembly (clang, -O0):
<test_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x1,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%ecx
lea    0xed5(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <fexpect@plt>
movb   $0x1,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%ecx
lea    0xeb1(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <fexpect@plt>
movb   $0x1,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%ecx
lea    0xe8d(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <fexpect@plt>
movb   $0x0,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%ecx
lea    0xe69(%rip),%rdi
mov    $0xd,%esi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bool>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@.str = [133 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/conversion.c\00"
define void @test_bool() {
%1 = alloca i8
store i8 1, i8* %1
%2 = load i8, i8* %1
%3 = trunc i8 %2 to i1
%4 = zext i1 %3 to i32
%5 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 7, i32 1, i32 %4)
store i8 1, i8* %1
%6 = load i8, i8* %1
%7 = trunc i8 %6 to i1
%8 = zext i1 %7 to i32
%9 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 9, i32 1, i32 %8)
store i8 1, i8* %1
%10 = load i8, i8* %1
%11 = trunc i8 %10 to i1
%12 = zext i1 %11 to i32
%13 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 11, i32 1, i32 %12)
store i8 0, i8* %1
%14 = load i8, i8* %1
%15 = trunc i8 %14 to i1
%16 = zext i1 %15 to i32
%17 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 13, i32 0, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [133 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/conversion.c\00"
define void @test_bool() {
%1 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 7, i32 1, i32 1)
%2 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 9, i32 1, i32 1)
%3 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 11, i32 1, i32 1)
%4 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 13, i32 0, i32 0)
ret void
}