#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 */
char *BOOL(int);
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int a, b;
  printf("%5s | %5s | %5s\n", "A", "B", "A|B");
  printf("------+-------+------\n");
  for (a = 0; a <= 1; ++a) {
    for (b = 0; b <= 1; ++b) {
      printf("%5s | %5s | %5s\n", BOOL(a), BOOL(b), BOOL(a | b));
    }
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xed4(%rip),%rsi
lea    0xed1(%rip),%rdx
lea    0xec8(%rip),%rcx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     11df <main+0xbf>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     11cc <main+0xac>
mov    -0x8(%rbp),%edi
call   1030 <BOOL@plt>
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <BOOL@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
or     -0xc(%rbp),%edi
call   1030 <BOOL@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1178 <main+0x58>
jmp    11d1 <main+0xb1>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1167 <main+0x47>
mov    0x2dfa(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xec4(%rip),%r14
lea    0xece(%rip),%rsi
lea    0xecb(%rip),%rdx
lea    0xec2(%rip),%rcx
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb5(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1030 <BOOL@plt>
mov    %rax,%r15
xor    %edi,%edi
call   1030 <BOOL@plt>
mov    %rax,%rbx
xor    %edi,%edi
call   1030 <BOOL@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1030 <BOOL@plt>
mov    %rax,%r15
mov    $0x1,%edi
call   1030 <BOOL@plt>
mov    %rax,%rbx
mov    $0x1,%edi
call   1030 <BOOL@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   1030 <BOOL@plt>
mov    %rax,%r15
xor    %edi,%edi
call   1030 <BOOL@plt>
mov    %rax,%rbx
mov    $0x1,%edi
call   1030 <BOOL@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   1030 <BOOL@plt>
mov    %rax,%r15
mov    $0x1,%edi
call   1030 <BOOL@plt>
mov    %rax,%rbx
mov    $0x1,%edi
call   1030 <BOOL@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2da5(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%5s | %5s | %5s\0A\00"
@.str.1 = [2 x i8] c"A\00"
@.str.2 = [2 x i8] c"B\00"
@.str.3 = [4 x i8] c"A|B\00"
@.str.4 = [23 x i8] c"------+-------+------\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %2
br label %6
6: ; preds = %27, %0
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 1
br i1 %8, label %9, label %30
9: ; preds = %6
store i32 0, i32* %3
br label %10
10: ; preds = %23, %9
%11 = load i32, i32* %3
%12 = icmp sle i32 %11, 1
br i1 %12, label %13, label %26
13: ; preds = %10
%14 = load i32, i32* %2
%15 = call i8* @BOOL(i32 %14)
%16 = load i32, i32* %3
%17 = call i8* @BOOL(i32 %16)
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = or i32 %18, %19
%21 = call i8* @BOOL(i32 %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %17, i8* %21)
br label %23
23: ; preds = %13
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %10
26: ; preds = %10
br label %27
27: ; preds = %26
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
br label %6
30: ; preds = %6
%31 = load i32, i32* @EXIT_SUCCESS
ret i32 %31
}

LLVM IR (-O2):
@.str = [17 x i8] c"%5s | %5s | %5s\0A\00"
@.str.1 = [2 x i8] c"A\00"
@.str.2 = [2 x i8] c"B\00"
@.str.3 = [4 x i8] c"A|B\00"
@EXIT_SUCCESS = global i32 0
@str = [22 x i8] c"------+-------+------\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%3 = tail call i8* @BOOL(i32 0)
%4 = tail call i8* @BOOL(i32 0)
%5 = tail call i8* @BOOL(i32 0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4, i8* %5)
%7 = tail call i8* @BOOL(i32 0)
%8 = tail call i8* @BOOL(i32 1)
%9 = tail call i8* @BOOL(i32 1)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* %9)
%11 = tail call i8* @BOOL(i32 1)
%12 = tail call i8* @BOOL(i32 0)
%13 = tail call i8* @BOOL(i32 1)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12, i8* %13)
%15 = tail call i8* @BOOL(i32 1)
%16 = tail call i8* @BOOL(i32 1)
%17 = tail call i8* @BOOL(i32 1)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16, i8* %17)
%19 = load i32, i32* @EXIT_SUCCESS
ret i32 %19
}