#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 INT_MAX;
int INT_MIN;
int /*<<< orphan*/ itob(int, char *, int);
int /*<<< orphan*/ printf(char *, int, char *);
int main() {
  int tests[5] = {INT_MIN, INT_MAX, -300, 172, 38478235};
  char st[101] = "";
  int i;
  for (i = 0; i < 5; i++) {
    itob(tests[i], st, 16);
    printf("%12d in string form is %12s\n", tests[i], st);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e97(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
movl   $0xfffffed4,-0x18(%rbp)
movl   $0xac,-0x14(%rbp)
movl   $0x24b219b,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x65,%edx
call   1040 <memset@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0x5,-0x94(%rbp)
jge    11e7 <main+0xb7>
movslq -0x94(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edi
lea    -0x90(%rbp),%rsi
mov    $0x10,%edx
call   1050 <itob@plt>
movslq -0x94(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    -0x90(%rbp),%rdx
lea    0xe32(%rip),%rdi
call   1030 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    118c <main+0x5c>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    0x2eaf(%rip),%rax
mov    (%rax),%ebp
mov    0x2eae(%rip),%rax
mov    (%rax),%r15d
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x5d(%rsp)
mov    %rsp,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1040 <itob@plt>
lea    0xe81(%rip),%r14
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %r15d,%edi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1040 <itob@plt>
mov    %r14,%rdi
mov    %r15d,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    $0xfffffed4,%edi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1040 <itob@plt>
mov    %r14,%rdi
mov    $0xfffffed4,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    $0xac,%edi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1040 <itob@plt>
mov    %r14,%rdi
mov    $0xac,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    $0x24b219b,%edi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1040 <itob@plt>
mov    %r14,%rdi
mov    $0x24b219b,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
@INT_MAX = global i32 0
@.str = [29 x i8] c"%12d in string form is %12s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca [101 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* @INT_MIN
store i32 %6, i32* %5
%7 = getelementptr inbounds i32, i32* %5, i64 1
%8 = load i32, i32* @INT_MAX
store i32 %8, i32* %7
%9 = getelementptr inbounds i32, i32* %7, i64 1
store i32 -300, i32* %9
%10 = getelementptr inbounds i32, i32* %9, i64 1
store i32 172, i32* %10
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 38478235, i32* %11
%12 = bitcast [101 x i8]* %3 to i8*
store i32 0, i32* %4
br label %13
13: ; preds = %29, %0
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 5
br i1 %15, label %16, label %32
16: ; preds = %13
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%22 = call i32 @itob(i32 %20, i8* %21, i32 16)
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%28 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %26, i8* %27)
br label %29
29: ; preds = %16
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %13
32: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@INT_MIN = global i32 0
@INT_MAX = global i32 0
@.str = [29 x i8] c"%12d in string form is %12s\0A\00"
define i32 @main() {
%1 = alloca [101 x i8]
%2 = load i32, i32* @INT_MIN
%3 = load i32, i32* @INT_MAX
%4 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 0
%5 = call i32 @itob(i32 %2, i8* %4, i32 16)
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %4)
%7 = call i32 @itob(i32 %3, i8* %4, i32 16)
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %4)
%9 = call i32 @itob(i32 -300, i8* %4, i32 16)
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 -300, i8* %4)
%11 = call i32 @itob(i32 172, i8* %4, i32 16)
%12 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 172, i8* %4)
%13 = call i32 @itob(i32 38478235, i8* %4, i32 16)
%14 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 38478235, i8* %4)
ret i32 0
}