#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 EXIT_SUCCESS;
int /*<<< orphan*/ assert(int);
int number_of_bits_in_int(int);
int number_of_bits_in_uint(int);
int /*<<< orphan*/ printf(char *, unsigned int);
int main(int argc, char **argv, char **envp) {
  assert(4 == number_of_bits_in_uint(23));
  assert(1 == number_of_bits_in_uint(64));
  assert(2 == number_of_bits_in_uint(40));
  assert(2 == number_of_bits_in_int(20));
  assert(3 == number_of_bits_in_int(-20));
  printf("-1>>1 is %d\n", -1 >> 1);
  printf("-10 casted to unsigned int is %u\n", (unsigned int)-10);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x17,%edi
call   1050 <number_of_bits_in_uint@plt>
mov    %eax,%ecx
mov    $0x4,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x40,%edi
call   1050 <number_of_bits_in_uint@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x28,%edi
call   1050 <number_of_bits_in_uint@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x14,%edi
call   1060 <number_of_bits_in_int@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0xffffffec,%edi
call   1060 <number_of_bits_in_int@plt>
mov    %eax,%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xdff(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
lea    0xdfb(%rip),%rdi
mov    $0xfffffff6,%esi
call   1030 <printf@plt>
mov    0x2dbd(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x17,%edi
call   1050 <number_of_bits_in_uint@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x40,%edi
call   1050 <number_of_bits_in_uint@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x28,%edi
call   1050 <number_of_bits_in_uint@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x14,%edi
call   1060 <number_of_bits_in_int@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0xffffffec,%edi
call   1060 <number_of_bits_in_int@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe40(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
lea    0xe3c(%rip),%rdi
mov    $0xfffffff6,%esi
call   1030 <printf@plt>
mov    0x2dfe(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"-1>>1 is %d\0A\00"
@.str.1 = [34 x i8] c"-10 casted to unsigned int is %u\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 @number_of_bits_in_uint(i32 23)
%9 = icmp eq i32 4, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i32 @number_of_bits_in_uint(i32 64)
%13 = icmp eq i32 1, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = call i32 @number_of_bits_in_uint(i32 40)
%17 = icmp eq i32 2, %16
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = call i32 @number_of_bits_in_int(i32 20)
%21 = icmp eq i32 2, %20
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = call i32 @number_of_bits_in_int(i32 -20)
%25 = icmp eq i32 3, %24
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 -1)
%29 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 -10)
%30 = load i32, i32* @EXIT_SUCCESS
ret i32 %30
}

LLVM IR (-O2):
@.str = [13 x i8] c"-1>>1 is %d\0A\00"
@.str.1 = [34 x i8] c"-10 casted to unsigned int is %u\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @number_of_bits_in_uint(i32 23)
%5 = icmp eq i32 %4, 4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @number_of_bits_in_uint(i32 64)
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = tail call i32 @number_of_bits_in_uint(i32 40)
%13 = icmp eq i32 %12, 2
%14 = zext i1 %13 to i32
%15 = tail call i32 @assert(i32 %14)
%16 = tail call i32 @number_of_bits_in_int(i32 20)
%17 = icmp eq i32 %16, 2
%18 = zext i1 %17 to i32
%19 = tail call i32 @assert(i32 %18)
%20 = tail call i32 @number_of_bits_in_int(i32 -20)
%21 = icmp eq i32 %20, 3
%22 = zext i1 %21 to i32
%23 = tail call i32 @assert(i32 %22)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 -1)
%25 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 -10)
%26 = load i32, i32* @EXIT_SUCCESS
ret i32 %26
}