#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_MIN;
int /*<<< orphan*/ itoa(int, char *, int);
int /*<<< orphan*/ printf(char *, int, int, char *);
int main(void) {
  int n;
  int w = 12;
  char s[256] = "";
  n = -234;
  itoa(n, s, w);
  printf("Number %d converted to a string of width %d is: \"%s\"\n", n, w, s);
  n = 1043;
  itoa(n, s, w);
  printf("Number %d converted to a string of width %d is: \"%s\"\n", n, w, s);
  n = INT_MIN;
  itoa(n, s, w);
  printf("Number %d converted to a string of width %d is: \"%s\"\n", n, w, s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
movl   $0xffffff16,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <itoa@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    -0x110(%rbp),%rcx
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
movl   $0x413,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <itoa@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    -0x110(%rbp),%rcx
lea    0xe45(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <itoa@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    -0x110(%rbp),%rcx
lea    0xe0e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x100,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    $0xffffff16,%edi
mov    %rbx,%rsi
mov    $0xc,%edx
call   1040 <itoa@plt>
lea    0xe4f(%rip),%r14
mov    %r14,%rdi
mov    $0xffffff16,%esi
mov    $0xc,%edx
mov    %rbx,%rcx
call   1030 <printf@plt>
mov    $0x413,%edi
mov    %rbx,%rsi
mov    $0xc,%edx
call   1040 <itoa@plt>
mov    %r14,%rdi
mov    $0x413,%esi
mov    $0xc,%edx
mov    %rbx,%rcx
call   1030 <printf@plt>
mov    0x2df4(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0xc,%edx
call   1040 <itoa@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    $0xc,%edx
mov    %rbx,%rcx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [54 x i8] c"Number %d converted to a string of width %d is: \22%s\22\0A\00"
@INT_MIN = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [256 x i8]
store i32 0, i32* %1
store i32 12, i32* %3
%5 = bitcast [256 x i8]* %4 to i8*
store i32 -234, i32* %2
%6 = load i32, i32* %2
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @itoa(i32 %6, i8* %7, i32 %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i8* %12)
store i32 1043, i32* %2
%14 = load i32, i32* %2
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%16 = load i32, i32* %3
%17 = call i32 @itoa(i32 %14, i8* %15, i32 %16)
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %19, i8* %20)
%22 = load i32, i32* @INT_MIN
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%25 = load i32, i32* %3
%26 = call i32 @itoa(i32 %23, i8* %24, i32 %25)
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%30 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %27, i32 %28, i8* %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [54 x i8] c"Number %d converted to a string of width %d is: \22%s\22\0A\00"
@INT_MIN = global i32 0
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 -234, i8* %2, i32 12)
%4 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 -234, i32 12, i8* %2)
%5 = call i32 @itoa(i32 1043, i8* %2, i32 12)
%6 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 1043, i32 12, i8* %2)
%7 = load i32, i32* @INT_MIN
%8 = call i32 @itoa(i32 %7, i8* %2, i32 12)
%9 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %7, i32 12, i8* %2)
ret i32 0
}