#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 */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main() {
  int x = 0x66, y = 0x39;
  printf("x&y = 0x%.2x, x|y = 0x%.2x, ~x|~y = 0x%.2x, x&!y = 0x%.2x\n", x & y,
         x | y, ~x | ~y, x & !y);
  printf("x&&y = 0x%.2x, x||y = 0x%.2x, !x||!y = 0x%.2x, x&&~y = 0x%.2x\n",
         x && y, x || y, !x || !y, x && ~y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x66,-0x8(%rbp)
movl   $0x39,-0xc(%rbp)
mov    -0x8(%rbp),%esi
and    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
or     -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%r8d
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
and    %eax,%r8d
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1181 <main+0x71>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xe(%rbp)
jne    11a5 <main+0x95>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x15(%rbp)
je     11cb <main+0xbb>
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x1d(%rbp)
je     11f4 <main+0xe4>
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x1c(%rbp),%edx
mov    -0x14(%rbp),%esi
mov    -0x1d(%rbp),%al
and    $0x1,%al
movzbl %al,%r8d
lea    0xe2e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x20,%esi
mov    $0x7f,%edx
mov    $0xffffffdf,%ecx
xor    %r8d,%r8d
call   1030 <printf@plt>
lea    0xf05(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [59 x i8] c"x&y = 0x%.2x, x|y = 0x%.2x, ~x|~y = 0x%.2x, x&!y = 0x%.2x\0A\00"
@.str.1 = [63 x i8] c"x&&y = 0x%.2x, x||y = 0x%.2x, !x||!y = 0x%.2x, x&&~y = 0x%.2x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 102, i32* %2
store i32 57, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = and i32 %4, %5
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = or i32 %7, %8
%10 = load i32, i32* %2
%11 = xor i32 %10, -1
%12 = load i32, i32* %3
%13 = xor i32 %12, -1
%14 = or i32 %11, %13
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
%20 = and i32 %15, %19
%21 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %9, i32 %14, i32 %20)
%22 = load i32, i32* %2
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %0
%25 = load i32, i32* %3
%26 = icmp ne i32 %25, 0
br label %27
27: ; preds = %24, %0
%28 = phi i1 [ false, %0 ], [ %26, %24 ]
%29 = zext i1 %28 to i32
%30 = load i32, i32* %2
%31 = icmp ne i32 %30, 0
br i1 %31, label %35, label %32
32: ; preds = %27
%33 = load i32, i32* %3
%34 = icmp ne i32 %33, 0
br label %35
35: ; preds = %32, %27
%36 = phi i1 [ true, %27 ], [ %34, %32 ]
%37 = zext i1 %36 to i32
%38 = load i32, i32* %2
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %44
40: ; preds = %35
%41 = load i32, i32* %3
%42 = icmp ne i32 %41, 0
%43 = xor i1 %42, true
br label %44
44: ; preds = %40, %35
%45 = phi i1 [ true, %35 ], [ %43, %40 ]
%46 = zext i1 %45 to i32
%47 = load i32, i32* %2
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %53
49: ; preds = %44
%50 = load i32, i32* %3
%51 = xor i32 %50, -1
%52 = icmp ne i32 %51, 0
br label %53
53: ; preds = %49, %44
%54 = phi i1 [ false, %44 ], [ %52, %49 ]
%55 = zext i1 %54 to i32
%56 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i32 %29, i32 %37, i32 %46, i32 %55)
ret i32 0
}

LLVM IR (-O2):
@.str = [59 x i8] c"x&y = 0x%.2x, x|y = 0x%.2x, ~x|~y = 0x%.2x, x&!y = 0x%.2x\0A\00"
@.str.1 = [63 x i8] c"x&&y = 0x%.2x, x||y = 0x%.2x, !x||!y = 0x%.2x, x&&~y = 0x%.2x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 32, i32 127, i32 -33, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 1, i32 0, i32 1)
ret i32 0
}