#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*/ printf(char *, int, int);
int swap_odd_even_bits(int);
int main() {
  int numbers[5] = {14, 31, 0, 27, 5};
  int i;
  for (i = 0; i < 5; i++)
    printf("%d -> %d\n", numbers[i], swap_odd_even_bits(numbers[i]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    1196 <main+0x76>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    %eax,-0x28(%rbp)
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edi
call   1040 <swap_odd_even_bits@plt>
mov    -0x28(%rbp),%esi
mov    %eax,%edx
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1155 <main+0x35>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xe,%edi
call   1040 <swap_odd_even_bits@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    $0xe,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x1f,%edi
call   1040 <swap_odd_even_bits@plt>
mov    %rbx,%rdi
mov    $0x1f,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <swap_odd_even_bits@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x1b,%edi
call   1040 <swap_odd_even_bits@plt>
mov    %rbx,%rdi
mov    $0x1b,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <swap_odd_even_bits@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.numbers = [5 x i32] [i32 14, i32 31, i32 0, i32 27, i32 5]
@.str = [10 x i8] c"%d -> %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %19, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 5
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %10
%12 = load i32, i32* %11
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @swap_odd_even_bits(i32 %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %17)
br label %19
19: ; preds = %8
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %5
22: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d -> %d\0A\00"
define i32 @main() {
%1 = tail call i32 @swap_odd_even_bits(i32 14)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 14, i32 %1)
%3 = tail call i32 @swap_odd_even_bits(i32 31)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 31, i32 %3)
%5 = tail call i32 @swap_odd_even_bits(i32 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 %5)
%7 = tail call i32 @swap_odd_even_bits(i32 27)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 27, i32 %7)
%9 = tail call i32 @swap_odd_even_bits(i32 5)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 5, i32 %9)
ret i32 0
}