#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 Isolate_rightmost0(int);
int Isolate_rightmost1(int);
int big2little(int);
int inverse_bit(int, int);
int leading_set_bit(int);
int odd_even(int);
int /*<<< orphan*/ printf(char *, int, ...);
int propagate_rightmost(int);
int set_on_off_bit(int, int, int);
int /*<<< orphan*/ swap_without_temp(int *, int *);
int switch_odd_even_bits(int);
int test_set(int, int);
int toggle_bit(int, int);
int turn_off_right_most(int);
int main(void) {
  int a = 3, b = 5;
  swap_without_temp(&a, &b);
  printf("%d,%d\r\n", a, b);
  printf("%d\r\n", set_on_off_bit(5, 1, 1));
  printf("%d\r\n", inverse_bit(5, 2));
  printf("%d\r\n", switch_odd_even_bits(55));
  printf("%x\r\n", big2little(0x12345678));
  printf("%d\r\n", leading_set_bit(0x02345678));
  printf("%d\r\n", odd_even(2));
  printf("%d\r\n", test_set(5, 2));
  printf("%d\r\n", toggle_bit(5, 1));
  printf("%d\r\n", turn_off_right_most(5));
  printf("%d\r\n", Isolate_rightmost1(12));
  printf("%d\r\n", propagate_rightmost(12));
  printf("%d\r\n", Isolate_rightmost0(5));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <swap_without_temp@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xdf0(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x5,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   10f0 <set_on_off_bit@plt>
mov    %eax,%esi
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x5,%edi
mov    $0x2,%esi
call   1040 <inverse_bit@plt>
mov    %eax,%esi
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x37,%edi
call   1060 <switch_odd_even_bits@plt>
mov    %eax,%esi
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x12345678,%edi
call   10a0 <big2little@plt>
mov    %eax,%esi
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x2345678,%edi
call   10e0 <leading_set_bit@plt>
mov    %eax,%esi
lea    0xd65(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x2,%edi
call   10d0 <odd_even@plt>
mov    %eax,%esi
lea    0xd4b(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x5,%edi
mov    $0x2,%esi
call   1070 <test_set@plt>
mov    %eax,%esi
lea    0xd2c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x5,%edi
mov    $0x1,%esi
call   10b0 <toggle_bit@plt>
mov    %eax,%esi
lea    0xd0d(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x5,%edi
call   1050 <turn_off_right_most@plt>
mov    %eax,%esi
lea    0xcf3(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0xc,%edi
call   1090 <Isolate_rightmost1@plt>
mov    %eax,%esi
lea    0xcd9(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0xc,%edi
call   10c0 <propagate_rightmost@plt>
mov    %eax,%esi
lea    0xcbf(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x5,%edi
call   1100 <Isolate_rightmost0@plt>
mov    %eax,%esi
lea    0xca5(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x3,0xc(%rsp)
movl   $0x5,0x8(%rsp)
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <swap_without_temp@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xded(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   10f0 <set_on_off_bit@plt>
lea    0xdce(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x5,%edi
mov    $0x2,%esi
call   1040 <inverse_bit@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x37,%edi
call   1060 <switch_odd_even_bits@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x12345678,%edi
call   10a0 <big2little@plt>
lea    0xd85(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x2345678,%edi
call   10e0 <leading_set_bit@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x2,%edi
call   10d0 <odd_even@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x5,%edi
mov    $0x2,%esi
call   1070 <test_set@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x5,%edi
mov    $0x1,%esi
call   10b0 <toggle_bit@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x5,%edi
call   1050 <turn_off_right_most@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xc,%edi
call   1090 <Isolate_rightmost1@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xc,%edi
call   10c0 <propagate_rightmost@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x5,%edi
call   1100 <Isolate_rightmost0@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%d,%d\0D\0A\00"
@.str.1 = [5 x i8] c"%d\0D\0A\00"
@.str.2 = [5 x i8] c"%x\0D\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 3, i32* %1
store i32 5, i32* %2
%3 = call i32 @swap_without_temp(i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = call i32 @set_on_off_bit(i32 5, i32 1, i32 1)
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @inverse_bit(i32 5, i32 2)
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 @switch_odd_even_bits(i32 55)
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @big2little(i32 305419896)
%14 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = call i32 @leading_set_bit(i32 36984440)
%16 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = call i32 @odd_even(i32 2)
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = call i32 @test_set(i32 5, i32 2)
%20 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = call i32 @toggle_bit(i32 5, i32 1)
%22 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = call i32 @turn_off_right_most(i32 5)
%24 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%25 = call i32 @Isolate_rightmost1(i32 12)
%26 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %25)
%27 = call i32 @propagate_rightmost(i32 12)
%28 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = call i32 @Isolate_rightmost0(i32 5)
%30 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d,%d\0D\0A\00"
@.str.1 = [5 x i8] c"%d\0D\0A\00"
@.str.2 = [5 x i8] c"%x\0D\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 3, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 5, i32* %2
%5 = call i32 @swap_without_temp(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = call i32 @set_on_off_bit(i32 5, i32 1, i32 1)
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 @inverse_bit(i32 5, i32 2)
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @switch_odd_even_bits(i32 55)
%14 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = call i32 @big2little(i32 305419896)
%16 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = call i32 @leading_set_bit(i32 36984440)
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = call i32 @odd_even(i32 2)
%20 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = call i32 @test_set(i32 5, i32 2)
%22 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = call i32 @toggle_bit(i32 5, i32 1)
%24 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%25 = call i32 @turn_off_right_most(i32 5)
%26 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %25)
%27 = call i32 @Isolate_rightmost1(i32 12)
%28 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = call i32 @propagate_rightmost(i32 12)
%30 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%31 = call i32 @Isolate_rightmost0(i32 5)
%32 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %31)
ret i32 0
}