#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 */
unsigned int bit_set(unsigned int, int);
int bit_test(unsigned int, int);
int /*<<< orphan*/ printf(char *, int, ...);
int main(void) {
  unsigned int a = 0xf3b5ca73;
  printf("bit 16 is %d, bit 24 is %d\n", bit_test(a, 16), bit_test(a, 24));
  a = bit_set(a, 24);
  printf("now bit 24 is %d\n", bit_test(a, 24));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf3b5ca73,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x10,%esi
call   1050 <bit_test@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x18,%esi
call   1050 <bit_test@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    $0x18,%esi
call   1040 <bit_set@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x18,%esi
call   1050 <bit_test@plt>
mov    %eax,%esi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xf3b5ca73,%edi
mov    $0x10,%esi
call   1050 <bit_test@plt>
mov    %eax,%ebx
mov    $0xf3b5ca73,%edi
mov    $0x18,%esi
call   1050 <bit_test@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xf3b5ca73,%edi
mov    $0x18,%esi
call   1040 <bit_set@plt>
mov    %eax,%edi
mov    $0x18,%esi
call   1050 <bit_test@plt>
lea    0xe97(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"bit 16 is %d, bit 24 is %d\0A\00"
@.str.1 = [18 x i8] c"now bit 24 is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -206189965, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @bit_test(i32 %3, i32 16)
%5 = load i32, i32* %2
%6 = call i32 @bit_test(i32 %5, i32 24)
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @bit_set(i32 %8, i32 24)
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = call i32 @bit_test(i32 %10, i32 24)
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"bit 16 is %d, bit 24 is %d\0A\00"
@.str.1 = [18 x i8] c"now bit 24 is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @bit_test(i32 -206189965, i32 16)
%2 = tail call i32 @bit_test(i32 -206189965, i32 24)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = tail call i32 @bit_set(i32 -206189965, i32 24)
%5 = tail call i32 @bit_test(i32 %4, i32 24)
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}