#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 bits(unsigned int);
size_t even(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int, int, char const *);
int /*<<< orphan*/ puts(char *);
int main() {
  const char *parity[] = {"ODD", "EVEN"};
  unsigned int i = 0;
  puts("Value Bits Parity");
  for (; i < 20; ++i)
    printf("%5u %4u %s\n", i, bits(i), parity[even(i)]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2cba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cb7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x14,-0x24(%rbp)
jae    11c0 <main+0x80>
mov    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%edi
call   1060 <bits@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
call   1050 <even@plt>
mov    -0x2c(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x20(%rbp,%rax,8),%rcx
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1178 <main+0x38>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
lea    0xecc(%rip),%r15
lea    0xeb8(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1060 <bits@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1050 <even@plt>
movslq (%r15,%rax,4),%rcx
add    %r15,%rcx
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x14,%ebx
jne    1170 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"ODD\00"
@.str.1 = [5 x i8] c"EVEN\00"
@__const.main.parity = [2 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [18 x i8] c"Value Bits Parity\00"
@.str.3 = [12 x i8] c"%5u %4u %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i8*]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [2 x i8*]* %2 to i8*
store i32 0, i32* %3
%5 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %6
6: ; preds = %18, %0
%7 = load i32, i32* %3
%8 = icmp ult i32 %7, 20
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = call i32 @bits(i32 %11)
%13 = load i32, i32* %3
%14 = call i64 @even(i32 %13)
%15 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %10, i32 %12, i8* %16)
br label %18
18: ; preds = %9
%19 = load i32, i32* %3
%20 = add i32 %19, 1
store i32 %20, i32* %3
br label %6
21: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"ODD\00"
@.str.1 = [5 x i8] c"EVEN\00"
@reltable.main = [2 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([2 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([2 x i32]* @reltable.main to i64)) to i32)]
@.str.2 = [18 x i8] c"Value Bits Parity\00"
@.str.3 = [12 x i8] c"%5u %4u %s\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %9, %2 ]
%4 = tail call i32 @bits(i32 %3)
%5 = tail call i64 @even(i32 %3)
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([2 x i32]* @reltable.main to i8*), i64 %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %3, i32 %4, i8* %7)
%9 = add nuw nsw i32 %3, 1
%10 = icmp eq i32 %9, 20
br i1 %10, label %11, label %2
11: ; preds = %2
ret i32 0
}