#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 bitParity(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = 129;
  int b = 128;
  int c = bitParity(a);
  int d = bitParity(b);
  printf("%d has bitParity of %d\n", a, 0);
  printf("bitParity(%d) -> %d\n", a, c);
  printf("%d has bitParity of %d\n", b, 1);
  printf("bitParity(%d) -> %d\n", b, d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x81,-0x4(%rbp)
movl   $0x80,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <bitParity@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <bitParity@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeaa(%rip),%rdi
xor    %edx,%edx
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe87(%rip),%rdi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x81,%edi
call   1040 <bitParity@plt>
mov    %eax,%ebx
mov    $0x80,%edi
call   1040 <bitParity@plt>
mov    %eax,%ebp
lea    0xeba(%rip),%r14
mov    %r14,%rdi
mov    $0x81,%esi
xor    %edx,%edx
call   1030 <printf@plt>
lea    0xebc(%rip),%r15
mov    %r15,%rdi
mov    $0x81,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x80,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    %r15,%rdi
mov    $0x80,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"%d has bitParity of %d\0A\00"
@.str.1 = [21 x i8] c"bitParity(%d) -> %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 129, i32* %1
store i32 128, i32* %2
%5 = load i32, i32* %1
%6 = call i32 @bitParity(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = call i32 @bitParity(i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %1
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %9, i32 0)
%11 = load i32, i32* %1
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12)
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %14, i32 1)
%16 = load i32, i32* %2
%17 = load i32, i32* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %16, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"%d has bitParity of %d\0A\00"
@.str.1 = [21 x i8] c"bitParity(%d) -> %d\0A\00"
define i32 @main() {
%1 = tail call i32 @bitParity(i32 129)
%2 = tail call i32 @bitParity(i32 128)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 129, i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 129, i32 %1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 128, i32 1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 128, i32 %2)
ret i32 0
}