int main() {
  _Bool b1, b2, b3;
  b1 = 0;
  b1++;
  assert(b1);
  b2 = 1;
  b2 += 10;
  assert(b2);
  b3 = b1 + b2;
  assert(b3 == 1);
  struct {
    _Bool f1, f2, f3;
    _Bool f4 : 1, f5 : 1;
  } s;
  assert(sizeof(s) == 4);
  s.f1 = 2;
  assert(s.f1 == 1);
  s.f4 = 1;
  assert(s.f4);
  *((unsigned char *)(&s.f2)) = 1;
  assert(s.f2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movb   $0x1,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movb   $0x1,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0xa,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    -0x2(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movb   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x5(%rbp),%al
and    $0xfe,%al
or     $0x1,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movb   $0x1,-0x7(%rbp)
mov    -0x7(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.anon = type { i8, i8, i8, i8 }
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = alloca %struct.anon
store i8 0, i8* %1
%5 = load i8, i8* %1
%6 = trunc i8 %5 to i1
store i8 1, i8* %1
%7 = load i8, i8* %1
%8 = trunc i8 %7 to i1
%9 = zext i1 %8 to i32
%10 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %9)
store i8 1, i8* %2
%11 = load i8, i8* %2
%12 = trunc i8 %11 to i1
%13 = zext i1 %12 to i32
%14 = add nsw i32 %13, 10
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i8
store i8 %16, i8* %2
%17 = load i8, i8* %2
%18 = trunc i8 %17 to i1
%19 = zext i1 %18 to i32
%20 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %19)
%21 = load i8, i8* %1
%22 = trunc i8 %21 to i1
%23 = zext i1 %22 to i32
%24 = load i8, i8* %2
%25 = trunc i8 %24 to i1
%26 = zext i1 %25 to i32
%27 = add nsw i32 %23, %26
%28 = icmp ne i32 %27, 0
%29 = zext i1 %28 to i8
store i8 %29, i8* %3
%30 = load i8, i8* %3
%31 = trunc i8 %30 to i1
%32 = zext i1 %31 to i32
%33 = icmp eq i32 %32, 1
%34 = zext i1 %33 to i32
%35 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %34)
%36 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%37 = getelementptr inbounds %struct.anon, %struct.anon* %4, i32 0, i32 0
store i8 1, i8* %37
%38 = getelementptr inbounds %struct.anon, %struct.anon* %4, i32 0, i32 0
%39 = load i8, i8* %38
%40 = trunc i8 %39 to i1
%41 = zext i1 %40 to i32
%42 = icmp eq i32 %41, 1
%43 = zext i1 %42 to i32
%44 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %43)
%45 = getelementptr inbounds %struct.anon, %struct.anon* %4, i32 0, i32 3
%46 = load i8, i8* %45
%47 = and i8 %46, -2
%48 = or i8 %47, 1
store i8 %48, i8* %45
%49 = getelementptr inbounds %struct.anon, %struct.anon* %4, i32 0, i32 3
%50 = load i8, i8* %49
%51 = and i8 %50, 1
%52 = trunc i8 %51 to i1
%53 = zext i1 %52 to i32
%54 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %53)
%55 = getelementptr inbounds %struct.anon, %struct.anon* %4, i32 0, i32 1
store i8 1, i8* %55
%56 = getelementptr inbounds %struct.anon, %struct.anon* %4, i32 0, i32 1
%57 = load i8, i8* %56
%58 = trunc i8 %57 to i1
%59 = zext i1 %58 to i32
%60 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %59)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
ret i32 0
}