#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 htoi(char *);
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
int main() {
  printf(" HEX | DECIMAL\n---------------\n   1 = %3d\n 0xf = %3d\n0X64 = "
         "%3d\n  fF = %3d\n 093 = %3d\n",
         htoi("1"), htoi("0xf"), htoi("0X64"), htoi("fF"), htoi("093"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf21(%rip),%rdi
call   1040 <htoi@plt>
mov    %eax,-0x14(%rbp)
lea    0xf14(%rip),%rdi
call   1040 <htoi@plt>
mov    %eax,-0x10(%rbp)
lea    0xf09(%rip),%rdi
call   1040 <htoi@plt>
mov    %eax,-0xc(%rbp)
lea    0xeff(%rip),%rdi
call   1040 <htoi@plt>
mov    %eax,-0x8(%rbp)
lea    0xef3(%rip),%rdi
call   1040 <htoi@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    %eax,%r9d
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xf29(%rip),%rdi
call   1040 <htoi@plt>
mov    %eax,%r14d
lea    0xf1c(%rip),%rdi
call   1040 <htoi@plt>
mov    %eax,%r15d
lea    0xf11(%rip),%rdi
call   1040 <htoi@plt>
mov    %eax,%ebx
lea    0xf08(%rip),%rdi
call   1040 <htoi@plt>
mov    %eax,%ebp
lea    0xefd(%rip),%rdi
call   1040 <htoi@plt>
lea    0xe8c(%rip),%rdi
mov    %r14d,%esi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    %ebp,%r8d
mov    %eax,%r9d
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [87 x i8] c" HEX | DECIMAL\0A---------------\0A 1 = %3d\0A 0xf = %3d\0A0X64 = %3d\0A fF = %3d\0A 093 = %3d\0A\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [4 x i8] c"0xf\00"
@.str.3 = [5 x i8] c"0X64\00"
@.str.4 = [3 x i8] c"fF\00"
@.str.5 = [4 x i8] c"093\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @htoi(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @htoi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @htoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @htoi(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @htoi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3, i32 %4, i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [87 x i8] c" HEX | DECIMAL\0A---------------\0A 1 = %3d\0A 0xf = %3d\0A0X64 = %3d\0A fF = %3d\0A 093 = %3d\0A\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [4 x i8] c"0xf\00"
@.str.3 = [5 x i8] c"0X64\00"
@.str.4 = [3 x i8] c"fF\00"
@.str.5 = [4 x i8] c"093\00"
define i32 @main() {
%1 = tail call i32 @htoi(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @htoi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @htoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @htoi(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%5 = tail call i32 @htoi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
ret i32 0
}