#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 long sort_even(unsigned long);
unsigned long sort_odd(unsigned long);
unsigned long nibble_sort_word(unsigned long x) {
  x = sort_even(x);
  x = sort_odd(x);
  x = sort_even(x);
  x = sort_odd(x);
  x = sort_even(x);
  x = sort_odd(x);
  x = sort_even(x);
  x = sort_odd(x);
  x = sort_even(x);
  x = sort_odd(x);
  x = sort_even(x);
  x = sort_odd(x);
  x = sort_even(x);
  x = sort_odd(x);
  x = sort_even(x);
  x = sort_odd(x);
  return x;
}


x86 assembly (clang, -O0):
<nibble_sort_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sort_even@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sort_odd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sort_even@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sort_odd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sort_even@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sort_odd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sort_even@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sort_odd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sort_even@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sort_odd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sort_even@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sort_odd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sort_even@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sort_odd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sort_even@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sort_odd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble_sort_word>:
push   %rax
call   1030 <sort_even@plt>
mov    %rax,%rdi
call   1040 <sort_odd@plt>
mov    %rax,%rdi
call   1030 <sort_even@plt>
mov    %rax,%rdi
call   1040 <sort_odd@plt>
mov    %rax,%rdi
call   1030 <sort_even@plt>
mov    %rax,%rdi
call   1040 <sort_odd@plt>
mov    %rax,%rdi
call   1030 <sort_even@plt>
mov    %rax,%rdi
call   1040 <sort_odd@plt>
mov    %rax,%rdi
call   1030 <sort_even@plt>
mov    %rax,%rdi
call   1040 <sort_odd@plt>
mov    %rax,%rdi
call   1030 <sort_even@plt>
mov    %rax,%rdi
call   1040 <sort_odd@plt>
mov    %rax,%rdi
call   1030 <sort_even@plt>
mov    %rax,%rdi
call   1040 <sort_odd@plt>
mov    %rax,%rdi
call   1030 <sort_even@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <sort_odd@plt>

LLVM IR (-O0):
define i64 @nibble_sort_word(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @sort_even(i64 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = call i64 @sort_odd(i64 %5)
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = call i64 @sort_even(i64 %7)
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = call i64 @sort_odd(i64 %9)
store i64 %10, i64* %2
%11 = load i64, i64* %2
%12 = call i64 @sort_even(i64 %11)
store i64 %12, i64* %2
%13 = load i64, i64* %2
%14 = call i64 @sort_odd(i64 %13)
store i64 %14, i64* %2
%15 = load i64, i64* %2
%16 = call i64 @sort_even(i64 %15)
store i64 %16, i64* %2
%17 = load i64, i64* %2
%18 = call i64 @sort_odd(i64 %17)
store i64 %18, i64* %2
%19 = load i64, i64* %2
%20 = call i64 @sort_even(i64 %19)
store i64 %20, i64* %2
%21 = load i64, i64* %2
%22 = call i64 @sort_odd(i64 %21)
store i64 %22, i64* %2
%23 = load i64, i64* %2
%24 = call i64 @sort_even(i64 %23)
store i64 %24, i64* %2
%25 = load i64, i64* %2
%26 = call i64 @sort_odd(i64 %25)
store i64 %26, i64* %2
%27 = load i64, i64* %2
%28 = call i64 @sort_even(i64 %27)
store i64 %28, i64* %2
%29 = load i64, i64* %2
%30 = call i64 @sort_odd(i64 %29)
store i64 %30, i64* %2
%31 = load i64, i64* %2
%32 = call i64 @sort_even(i64 %31)
store i64 %32, i64* %2
%33 = load i64, i64* %2
%34 = call i64 @sort_odd(i64 %33)
store i64 %34, i64* %2
%35 = load i64, i64* %2
ret i64 %35
}

LLVM IR (-O2):
define i64 @nibble_sort_word(i64 %0) {
%2 = tail call i64 @sort_even(i64 %0)
%3 = tail call i64 @sort_odd(i64 %2)
%4 = tail call i64 @sort_even(i64 %3)
%5 = tail call i64 @sort_odd(i64 %4)
%6 = tail call i64 @sort_even(i64 %5)
%7 = tail call i64 @sort_odd(i64 %6)
%8 = tail call i64 @sort_even(i64 %7)
%9 = tail call i64 @sort_odd(i64 %8)
%10 = tail call i64 @sort_even(i64 %9)
%11 = tail call i64 @sort_odd(i64 %10)
%12 = tail call i64 @sort_even(i64 %11)
%13 = tail call i64 @sort_odd(i64 %12)
%14 = tail call i64 @sort_even(i64 %13)
%15 = tail call i64 @sort_odd(i64 %14)
%16 = tail call i64 @sort_even(i64 %15)
%17 = tail call i64 @sort_odd(i64 %16)
ret i64 %17
}