#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 *, char *);
int main(void) {
  int min_int = INT_MIN;
  int width = 10;
  char s[200];
  itoa(min_int, s, width);
  printf("%s\n", s);
  width = 12;
  itoa(min_int, s, width);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xe0(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <itoa@plt>
lea    -0xe0(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
movl   $0xc,-0xc(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xe0(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <itoa@plt>
lea    -0xe0(%rbp),%rsi
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xd0,%rsp
mov    0x2eb5(%rip),%rax
mov    (%rax),%ebx
mov    %rsp,%r14
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0xa,%edx
call   1040 <itoa@plt>
lea    0xeb2(%rip),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0xc,%edx
call   1040 <itoa@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [200 x i8]
store i32 0, i32* %1
%5 = load i32, i32* @INT_MIN
store i32 %5, i32* %2
store i32 10, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @itoa(i32 %6, i8* %7, i32 %8)
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
store i32 12, i32* %3
%12 = load i32, i32* %2
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%14 = load i32, i32* %3
%15 = call i32 @itoa(i32 %12, i8* %13, i32 %14)
%16 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@INT_MIN = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = load i32, i32* @INT_MIN
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%4 = call i32 @itoa(i32 %2, i8* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @itoa(i32 %2, i8* %3, i32 12)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}