#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 FixedDecimalStringToInteger(char *);
int FixedHexStringToInteger(char *);
int /*<<< orphan*/ Int2DecimalString(int, char *);
int /*<<< orphan*/ Int2HexString(int, char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char HexString[10];
  char DecimalString[12];
  int Value;
  Int2HexString(0x1234abcd, HexString);
  printf("Testing Int2HexString(0x1234abcd): Result %s\n", HexString);
  Int2DecimalString(1234567890, DecimalString);
  printf("Testing Int2DecString(1234567890): Result %s\n", DecimalString);
  Value = FixedHexStringToInteger("1234ABCD");
  printf("Testing FixedHexStringToInteger(\"1234ABCD\"): Result %d\n", Value);
  Value = FixedDecimalStringToInteger("1234567890");
  printf("Testing FixedDecimalStringToInteger(\"1234567890\"): Result %d\n",
         Value);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0xa(%rbp),%rsi
mov    $0x1234abcd,%edi
call   1050 <Int2HexString@plt>
lea    -0xa(%rbp),%rsi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x16(%rbp),%rsi
mov    $0x499602d2,%edi
call   1070 <Int2DecimalString@plt>
lea    -0x16(%rbp),%rsi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
call   1040 <FixedHexStringToInteger@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
call   1060 <FixedDecimalStringToInteger@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xa(%rsp),%rbx
mov    $0x1234abcd,%edi
mov    %rbx,%rsi
call   1050 <Int2HexString@plt>
lea    0xe92(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x14(%rsp),%rbx
mov    $0x499602d2,%edi
mov    %rbx,%rsi
call   1070 <Int2DecimalString@plt>
lea    0xe9d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
call   1040 <FixedHexStringToInteger@plt>
lea    0xeb7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
call   1060 <FixedDecimalStringToInteger@plt>
lea    0xede(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Testing Int2HexString(0x1234abcd): Result %s\0A\00"
@.str.1 = [46 x i8] c"Testing Int2DecString(1234567890): Result %s\0A\00"
@.str.2 = [9 x i8] c"1234ABCD\00"
@.str.3 = [56 x i8] c"Testing FixedHexStringToInteger(\221234ABCD\22): Result %d\0A\00"
@.str.4 = [11 x i8] c"1234567890\00"
@.str.5 = [62 x i8] c"Testing FixedDecimalStringToInteger(\221234567890\22): Result %d\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [12 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%5 = call i32 @Int2HexString(i32 305441741, i8* %4)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%9 = call i32 @Int2DecimalString(i32 1234567890, i8* %8)
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = call i32 @FixedHexStringToInteger(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0), i32 %13)
%15 = call i32 @FixedDecimalStringToInteger(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"Testing Int2HexString(0x1234abcd): Result %s\0A\00"
@.str.1 = [46 x i8] c"Testing Int2DecString(1234567890): Result %s\0A\00"
@.str.2 = [9 x i8] c"1234ABCD\00"
@.str.3 = [56 x i8] c"Testing FixedHexStringToInteger(\221234ABCD\22): Result %d\0A\00"
@.str.4 = [11 x i8] c"1234567890\00"
@.str.5 = [62 x i8] c"Testing FixedDecimalStringToInteger(\221234567890\22): Result %d\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [12 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = call i32 @Int2HexString(i32 305441741, i8* %3)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = call i32 @Int2DecimalString(i32 1234567890, i8* %4)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%9 = call i32 @FixedHexStringToInteger(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%11 = call i32 @FixedDecimalStringToInteger(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i64 0, i64 0), i32 %11)
ret i32 0
}