#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*/ printBits(unsigned int);
int /*<<< orphan*/ printf(char *);
void test1() {
  unsigned int a = 9;
  unsigned int b = 3;
  printf("a:\n");
  printBits(a);
  printf("b:\n");
  printBits(b);
  printf("a&b:\n");
  printBits(a & b);
  printf("a|b:\n");
  printBits(a | b);
  printf("a^b:\n");
  printBits(a ^ b);
  printf("~a:\n");
  printBits(~a);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x9,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <printBits@plt>
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
call   1030 <printBits@plt>
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
and    -0x8(%rbp),%edi
call   1030 <printBits@plt>
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
or     -0x8(%rbp),%edi
call   1030 <printBits@plt>
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
xor    -0x8(%rbp),%edi
call   1030 <printBits@plt>
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
xor    $0xffffffff,%edi
call   1030 <printBits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x9,%edi
call   1040 <printBits@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
call   1040 <printBits@plt>
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <printBits@plt>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
mov    $0xb,%edi
call   1040 <printBits@plt>
lea    0xe8a(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1040 <printBits@plt>
lea    0xe79(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffff6,%edi
pop    %rax
jmp    1040 <printBits@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"a:\0A\00"
@.str.1 = [4 x i8] c"b:\0A\00"
@.str.2 = [6 x i8] c"a&b:\0A\00"
@.str.3 = [6 x i8] c"a|b:\0A\00"
@.str.4 = [6 x i8] c"a^b:\0A\00"
@.str.5 = [5 x i8] c"~a:\0A\00"
define void @test1() {
%1 = alloca i32
%2 = alloca i32
store i32 9, i32* %1
store i32 3, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
%5 = call i32 @printBits(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = call i32 @printBits(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = and i32 %10, %11
%13 = call i32 @printBits(i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = or i32 %15, %16
%18 = call i32 @printBits(i32 %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%20 = load i32, i32* %1
%21 = load i32, i32* %2
%22 = xor i32 %20, %21
%23 = call i32 @printBits(i32 %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%25 = load i32, i32* %1
%26 = xor i32 %25, -1
%27 = call i32 @printBits(i32 %26)
ret void
}

LLVM IR (-O2):
@str = [3 x i8] c"a:\00"
@str.6 = [3 x i8] c"b:\00"
@str.7 = [5 x i8] c"a&b:\00"
@str.8 = [5 x i8] c"a|b:\00"
@str.9 = [5 x i8] c"a^b:\00"
@str.10 = [4 x i8] c"~a:\00"
define void @test1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printBits(i32 9)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @printBits(i32 3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.7, i64 0, i64 0))
%6 = tail call i32 @printBits(i32 1)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.8, i64 0, i64 0))
%8 = tail call i32 @printBits(i32 11)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.9, i64 0, i64 0))
%10 = tail call i32 @printBits(i32 10)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.10, i64 0, i64 0))
%12 = tail call i32 @printBits(i32 -10)
ret void
}