#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*/ itoa(int, char *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char s[100];
  int space;
  space = 12;
  printf("%d\n", INT_MAX);
  itoa(INT_MAX, s, space);
  printf("%d\n", INT_MIN);
  itoa(INT_MIN, s, space);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x74(%rbp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    -0x70(%rbp),%rsi
mov    -0x74(%rbp),%edx
call   1040 <itoa@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
lea    -0x70(%rbp),%rsi
mov    -0x74(%rbp),%edx
call   1040 <itoa@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%esi
lea    0xec7(%rip),%r15
mov    %r15,%rdi
call   1030 <printf@plt>
mov    (%rbx),%edi
mov    %rsp,%r14
mov    %r14,%rsi
mov    $0xc,%edx
call   1040 <itoa@plt>
mov    0x2e86(%rip),%rbx
mov    (%rbx),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0xc,%edx
call   1040 <itoa@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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