#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 */
scalar_t__ foo();
int main(void) {
  int i;
  0 || foo();
  i = 0 || 99;
  if (i != 1)
    return 0;
  if (0 || 99)
    i = 2;
  if (i != 2)
    return 0;
  i = 0 || (2 < 3);
  if (i != 1)
    return 0;
  1 && foo();
  i = 1 && 99;
  if (i != 1)
    return 0;
  if (1 && 99)
    i = 2;
  if (i != 2)
    return 0;
  i = 1 && (2 < 3);
  if (i != 1)
    return 0;
  return 42;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1143 <main+0x33>
movl   $0x0,-0x4(%rbp)
jmp    11e2 <main+0xd2>
movl   $0x2,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1160 <main+0x50>
movl   $0x0,-0x4(%rbp)
jmp    11e2 <main+0xd2>
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     117d <main+0x6d>
movl   $0x0,-0x4(%rbp)
jmp    11e2 <main+0xd2>
mov    $0x0,%al
call   1030 <foo@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     11a1 <main+0x91>
movl   $0x0,-0x4(%rbp)
jmp    11e2 <main+0xd2>
movl   $0x2,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11be <main+0xae>
movl   $0x0,-0x4(%rbp)
jmp    11e2 <main+0xd2>
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     11db <main+0xcb>
movl   $0x0,-0x4(%rbp)
jmp    11e2 <main+0xd2>
movl   $0x2a,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i64 (...) @foo()
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
store i32 1, i32* %2
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 0, i32* %1
br label %33
9: ; preds = %0
store i32 2, i32* %2
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 2
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 0, i32* %1
br label %33
13: ; preds = %9
store i32 1, i32* %2
%14 = load i32, i32* %2
%15 = icmp ne i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 0, i32* %1
br label %33
17: ; preds = %13
%18 = call i64 (...) @foo()
%19 = icmp ne i64 %18, 0
%20 = zext i1 %19 to i32
store i32 1, i32* %2
%21 = load i32, i32* %2
%22 = icmp ne i32 %21, 1
br i1 %22, label %23, label %24
23: ; preds = %17
store i32 0, i32* %1
br label %33
24: ; preds = %17
store i32 2, i32* %2
%25 = load i32, i32* %2
%26 = icmp ne i32 %25, 2
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 0, i32* %1
br label %33
28: ; preds = %24
store i32 1, i32* %2
%29 = load i32, i32* %2
%30 = icmp ne i32 %29, 1
br i1 %30, label %31, label %32
31: ; preds = %28
store i32 0, i32* %1
br label %33
32: ; preds = %28
store i32 42, i32* %1
br label %33
33: ; preds = %32, %31, %27, %23, %16, %12, %8
%34 = load i32, i32* %1
ret i32 %34
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @foo()
%2 = tail call i64 (...) @foo()
ret i32 42
}