#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*/ assertTrue(char *, int);
int clzi(int);
void test_ints() {
  assertTrue("clzi(8) == 28", clzi(8) == 28);
  assertTrue("clzi(1024) == 21", clzi(1024) == 21);
  assertTrue("clzi(16777215) == 8", clzi(16777215) == 8);
  assertTrue("clzi(-1) == 0", clzi(-1) == 0);
}


x86 assembly (clang, -O0):
<test_ints>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <clzi@plt>
cmp    $0x1c,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xec0(%rip),%rdi
call   1040 <assertTrue@plt>
mov    $0x400,%edi
call   1030 <clzi@plt>
cmp    $0x15,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xead(%rip),%rdi
call   1040 <assertTrue@plt>
mov    $0xffffff,%edi
call   1030 <clzi@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe9d(%rip),%rdi
call   1040 <assertTrue@plt>
mov    $0xffffffff,%edi
call   1030 <clzi@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe90(%rip),%rdi
call   1040 <assertTrue@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ints>:
push   %rax
mov    $0x8,%edi
call   1030 <clzi@plt>
xor    %esi,%esi
cmp    $0x1c,%eax
sete   %sil
lea    0xec5(%rip),%rdi
call   1040 <assertTrue@plt>
mov    $0x400,%edi
call   1030 <clzi@plt>
xor    %esi,%esi
cmp    $0x15,%eax
sete   %sil
lea    0xeb4(%rip),%rdi
call   1040 <assertTrue@plt>
mov    $0xffffff,%edi
call   1030 <clzi@plt>
xor    %esi,%esi
cmp    $0x8,%eax
sete   %sil
lea    0xea6(%rip),%rdi
call   1040 <assertTrue@plt>
mov    $0xffffffff,%edi
call   1030 <clzi@plt>
xor    %esi,%esi
test   %eax,%eax
sete   %sil
lea    0xe9c(%rip),%rdi
pop    %rax
jmp    1040 <assertTrue@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"clzi(8) == 28\00"
@.str.1 = [17 x i8] c"clzi(1024) == 21\00"
@.str.2 = [20 x i8] c"clzi(16777215) == 8\00"
@.str.3 = [14 x i8] c"clzi(-1) == 0\00"
define void @test_ints() {
%1 = call i32 @clzi(i32 8)
%2 = icmp eq i32 %1, 28
%3 = zext i1 %2 to i32
%4 = call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @clzi(i32 1024)
%6 = icmp eq i32 %5, 21
%7 = zext i1 %6 to i32
%8 = call i32 @assertTrue(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @clzi(i32 16777215)
%10 = icmp eq i32 %9, 8
%11 = zext i1 %10 to i32
%12 = call i32 @assertTrue(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = call i32 @clzi(i32 -1)
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"clzi(8) == 28\00"
@.str.1 = [17 x i8] c"clzi(1024) == 21\00"
@.str.2 = [20 x i8] c"clzi(16777215) == 8\00"
@.str.3 = [14 x i8] c"clzi(-1) == 0\00"
define void @test_ints() {
%1 = tail call i32 @clzi(i32 8)
%2 = icmp eq i32 %1, 28
%3 = zext i1 %2 to i32
%4 = tail call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @clzi(i32 1024)
%6 = icmp eq i32 %5, 21
%7 = zext i1 %6 to i32
%8 = tail call i32 @assertTrue(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = tail call i32 @clzi(i32 16777215)
%10 = icmp eq i32 %9, 8
%11 = zext i1 %10 to i32
%12 = tail call i32 @assertTrue(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = tail call i32 @clzi(i32 -1)
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %15)
ret void
}