#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 bit_count(int);
int test_count() {
  return 0 == bit_count(0) && 1 == bit_count(1) && 2 == bit_count(2) &&
         4 == bit_count(3) && 5 == bit_count(4) && 7 == bit_count(5) &&
         9 == bit_count(6) && 12 == bit_count(7) && 13 == bit_count(8) &&
         15 == bit_count(9) && 17 == bit_count(10) && 20 == bit_count(11) &&
         22 == bit_count(12) && 25 == bit_count(13) && 28 == bit_count(14) &&
         32 == bit_count(15);
}


x86 assembly (clang, -O0):
<test_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <bit_count@plt>
mov    %eax,%edx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    12ed <test_count+0x1dd>
mov    $0x1,%edi
call   1030 <bit_count@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    12ed <test_count+0x1dd>
mov    $0x2,%edi
call   1030 <bit_count@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x2,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    12ed <test_count+0x1dd>
mov    $0x3,%edi
call   1030 <bit_count@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x4,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    12ed <test_count+0x1dd>
mov    $0x4,%edi
call   1030 <bit_count@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x5,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    12ed <test_count+0x1dd>
mov    $0x5,%edi
call   1030 <bit_count@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x7,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    12ed <test_count+0x1dd>
mov    $0x6,%edi
call   1030 <bit_count@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x9,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    12ed <test_count+0x1dd>
mov    $0x7,%edi
call   1030 <bit_count@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xc,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    12ed <test_count+0x1dd>
mov    $0x8,%edi
call   1030 <bit_count@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xd,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    12ed <test_count+0x1dd>
mov    $0x9,%edi
call   1030 <bit_count@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xf,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    12ed <test_count+0x1dd>
mov    $0xa,%edi
call   1030 <bit_count@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x11,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    12ed <test_count+0x1dd>
mov    $0xb,%edi
call   1030 <bit_count@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x14,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    12ed <test_count+0x1dd>
mov    $0xc,%edi
call   1030 <bit_count@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x16,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    12ed <test_count+0x1dd>
mov    $0xd,%edi
call   1030 <bit_count@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x19,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    12ed <test_count+0x1dd>
mov    $0xe,%edi
call   1030 <bit_count@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1c,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    12ed <test_count+0x1dd>
mov    $0xf,%edi
call   1030 <bit_count@plt>
mov    %eax,%ecx
mov    $0x20,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_count>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
call   1030 <bit_count@plt>
test   %eax,%eax
jne    121e <test_count+0x10e>
mov    $0x1,%edi
call   1030 <bit_count@plt>
cmp    $0x1,%eax
jne    121e <test_count+0x10e>
mov    $0x2,%edi
call   1030 <bit_count@plt>
cmp    $0x2,%eax
jne    121e <test_count+0x10e>
mov    $0x3,%edi
call   1030 <bit_count@plt>
cmp    $0x4,%eax
jne    121e <test_count+0x10e>
mov    $0x4,%edi
call   1030 <bit_count@plt>
cmp    $0x5,%eax
jne    121e <test_count+0x10e>
mov    $0x5,%edi
call   1030 <bit_count@plt>
cmp    $0x7,%eax
jne    121e <test_count+0x10e>
mov    $0x6,%edi
call   1030 <bit_count@plt>
cmp    $0x9,%eax
jne    121e <test_count+0x10e>
mov    $0x7,%edi
call   1030 <bit_count@plt>
cmp    $0xc,%eax
jne    121e <test_count+0x10e>
mov    $0x8,%edi
call   1030 <bit_count@plt>
cmp    $0xd,%eax
jne    121e <test_count+0x10e>
mov    $0x9,%edi
call   1030 <bit_count@plt>
cmp    $0xf,%eax
jne    121e <test_count+0x10e>
mov    $0xa,%edi
call   1030 <bit_count@plt>
cmp    $0x11,%eax
jne    121e <test_count+0x10e>
mov    $0xb,%edi
call   1030 <bit_count@plt>
cmp    $0x14,%eax
jne    121e <test_count+0x10e>
mov    $0xc,%edi
call   1030 <bit_count@plt>
cmp    $0x16,%eax
jne    121e <test_count+0x10e>
mov    $0xd,%edi
call   1030 <bit_count@plt>
cmp    $0x19,%eax
jne    121e <test_count+0x10e>
mov    $0xe,%edi
call   1030 <bit_count@plt>
cmp    $0x1c,%eax
jne    121e <test_count+0x10e>
mov    $0xf,%edi
call   1030 <bit_count@plt>
xor    %ebx,%ebx
cmp    $0x20,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_count() {
%1 = call i32 @bit_count(i32 0)
%2 = icmp eq i32 0, %1
br i1 %2, label %3, label %48
3: ; preds = %0
%4 = call i32 @bit_count(i32 1)
%5 = icmp eq i32 1, %4
br i1 %5, label %6, label %48
6: ; preds = %3
%7 = call i32 @bit_count(i32 2)
%8 = icmp eq i32 2, %7
br i1 %8, label %9, label %48
9: ; preds = %6
%10 = call i32 @bit_count(i32 3)
%11 = icmp eq i32 4, %10
br i1 %11, label %12, label %48
12: ; preds = %9
%13 = call i32 @bit_count(i32 4)
%14 = icmp eq i32 5, %13
br i1 %14, label %15, label %48
15: ; preds = %12
%16 = call i32 @bit_count(i32 5)
%17 = icmp eq i32 7, %16
br i1 %17, label %18, label %48
18: ; preds = %15
%19 = call i32 @bit_count(i32 6)
%20 = icmp eq i32 9, %19
br i1 %20, label %21, label %48
21: ; preds = %18
%22 = call i32 @bit_count(i32 7)
%23 = icmp eq i32 12, %22
br i1 %23, label %24, label %48
24: ; preds = %21
%25 = call i32 @bit_count(i32 8)
%26 = icmp eq i32 13, %25
br i1 %26, label %27, label %48
27: ; preds = %24
%28 = call i32 @bit_count(i32 9)
%29 = icmp eq i32 15, %28
br i1 %29, label %30, label %48
30: ; preds = %27
%31 = call i32 @bit_count(i32 10)
%32 = icmp eq i32 17, %31
br i1 %32, label %33, label %48
33: ; preds = %30
%34 = call i32 @bit_count(i32 11)
%35 = icmp eq i32 20, %34
br i1 %35, label %36, label %48
36: ; preds = %33
%37 = call i32 @bit_count(i32 12)
%38 = icmp eq i32 22, %37
br i1 %38, label %39, label %48
39: ; preds = %36
%40 = call i32 @bit_count(i32 13)
%41 = icmp eq i32 25, %40
br i1 %41, label %42, label %48
42: ; preds = %39
%43 = call i32 @bit_count(i32 14)
%44 = icmp eq i32 28, %43
br i1 %44, label %45, label %48
45: ; preds = %42
%46 = call i32 @bit_count(i32 15)
%47 = icmp eq i32 32, %46
br label %48
48: ; preds = %45, %42, %39, %36, %33, %30, %27, %24, %21, %18, %15, %12, %9, %6, %3, %0
%49 = phi i1 [ false, %42 ], [ false, %39 ], [ false, %36 ], [ false, %33 ], [ false, %30 ], [ false, %27 ], [ false, %24 ], [ false, %21 ], [ false, %18 ], [ false, %15 ], [ false, %12 ], [ false, %9 ], [ false, %6 ], [ false, %3 ], [ false, %0 ], [ %47, %45 ]
%50 = zext i1 %49 to i32
ret i32 %50
}

LLVM IR (-O2):
define i32 @test_count() {
%1 = tail call i32 @bit_count(i32 0)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %49
3: ; preds = %0
%4 = tail call i32 @bit_count(i32 1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %49
6: ; preds = %3
%7 = tail call i32 @bit_count(i32 2)
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %49
9: ; preds = %6
%10 = tail call i32 @bit_count(i32 3)
%11 = icmp eq i32 %10, 4
br i1 %11, label %12, label %49
12: ; preds = %9
%13 = tail call i32 @bit_count(i32 4)
%14 = icmp eq i32 %13, 5
br i1 %14, label %15, label %49
15: ; preds = %12
%16 = tail call i32 @bit_count(i32 5)
%17 = icmp eq i32 %16, 7
br i1 %17, label %18, label %49
18: ; preds = %15
%19 = tail call i32 @bit_count(i32 6)
%20 = icmp eq i32 %19, 9
br i1 %20, label %21, label %49
21: ; preds = %18
%22 = tail call i32 @bit_count(i32 7)
%23 = icmp eq i32 %22, 12
br i1 %23, label %24, label %49
24: ; preds = %21
%25 = tail call i32 @bit_count(i32 8)
%26 = icmp eq i32 %25, 13
br i1 %26, label %27, label %49
27: ; preds = %24
%28 = tail call i32 @bit_count(i32 9)
%29 = icmp eq i32 %28, 15
br i1 %29, label %30, label %49
30: ; preds = %27
%31 = tail call i32 @bit_count(i32 10)
%32 = icmp eq i32 %31, 17
br i1 %32, label %33, label %49
33: ; preds = %30
%34 = tail call i32 @bit_count(i32 11)
%35 = icmp eq i32 %34, 20
br i1 %35, label %36, label %49
36: ; preds = %33
%37 = tail call i32 @bit_count(i32 12)
%38 = icmp eq i32 %37, 22
br i1 %38, label %39, label %49
39: ; preds = %36
%40 = tail call i32 @bit_count(i32 13)
%41 = icmp eq i32 %40, 25
br i1 %41, label %42, label %49
42: ; preds = %39
%43 = tail call i32 @bit_count(i32 14)
%44 = icmp eq i32 %43, 28
br i1 %44, label %45, label %49
45: ; preds = %42
%46 = tail call i32 @bit_count(i32 15)
%47 = icmp eq i32 %46, 32
%48 = zext i1 %47 to i32
br label %49
49: ; preds = %45, %42, %39, %36, %33, %30, %27, %24, %21, %18, %15, %12, %9, %6, %3, %0
%50 = phi i32 [ 0, %42 ], [ 0, %39 ], [ 0, %36 ], [ 0, %33 ], [ 0, %30 ], [ 0, %27 ], [ 0, %24 ], [ 0, %21 ], [ 0, %18 ], [ 0, %15 ], [ 0, %12 ], [ 0, %9 ], [ 0, %6 ], [ 0, %3 ], [ 0, %0 ], [ %48, %45 ]
ret i32 %50
}