int main() {
  int a = 1;
  int b = 0;
  int c = a || b;
  int d = a && b;
  int e = true() || false();
  printf("c --> %d\n", c);
  printf("d --> %d\n", d);
  printf("e --> %d\n", e);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x19(%rbp)
jne    1166 <main+0x36>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x1a(%rbp)
je     118a <main+0x5a>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <true@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x1b(%rbp)
jne    11bc <main+0x8c>
mov    $0x0,%al
call   1040 <false@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x1b(%rbp)
mov    -0x1b(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <true@plt>
mov    $0x1,%ebx
test   %eax,%eax
jne    114f <main+0x1f>
xor    %eax,%eax
call   1040 <false@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
lea    0xeaa(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe9b(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"c --> %d\0A\00"
@.str.1 = [10 x i8] c"d --> %d\0A\00"
@.str.2 = [10 x i8] c"e --> %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %0
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %9, %0
%13 = phi i1 [ true, %0 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
store i32 %14, i32* %4
%15 = load i32, i32* %2
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load i32, i32* %3
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %17, %12
%21 = phi i1 [ false, %12 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
store i32 %22, i32* %5
%23 = call i32 (...) @true()
%24 = icmp ne i32 %23, 0
br i1 %24, label %28, label %25
25: ; preds = %20
%26 = call i32 (...) @false()
%27 = icmp ne i32 %26, 0
br label %28
28: ; preds = %25, %20
%29 = phi i1 [ true, %20 ], [ %27, %25 ]
%30 = zext i1 %29 to i32
store i32 %30, i32* %6
%31 = load i32, i32* %4
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %5
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%35 = load i32, i32* %6
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %1
ret i32 %37
}

LLVM IR (-O2):
@.str = [10 x i8] c"c --> %d\0A\00"
@.str.1 = [10 x i8] c"d --> %d\0A\00"
@.str.2 = [10 x i8] c"e --> %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @true()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 (...) @false()
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 0)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}