#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 /*<<< orphan*/ itoa(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ utoa(char *, unsigned int);
int main(int argc, char *argv[]) {
  int i;
  char str[128];
  i = 0;
  itoa(str, i);
  printf("%s\n", str);
  i = 0x7fffffff;
  itoa(str, i);
  printf("%s\n", str);
  i = 0x80000000;
  itoa(str, i);
  printf("%s\n", str);
  i = 32765;
  itoa(str, i);
  printf("%s\n", str);
  i = -32765;
  itoa(str, i);
  printf("%s\n", str);
  unsigned int u;
  u = 0;
  utoa(str, u);
  printf("%s\n", str);
  u = 0xffffffff;
  utoa(str, u);
  printf("%s\n", str);
  u = 0xffffffff >> 1;
  utoa(str, u);
  printf("%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <itoa@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
movl   $0x7fffffff,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <itoa@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
movl   $0x80000000,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <itoa@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
movl   $0x7ffd,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <itoa@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe18(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffff8003,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <itoa@plt>
lea    -0xa0(%rbp),%rsi
lea    0xdef(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xa4(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0xa4(%rbp),%esi
call   1040 <utoa@plt>
lea    -0xa0(%rbp),%rsi
lea    0xdc0(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0xa4(%rbp)
ff ff ff
lea    -0xa0(%rbp),%rdi
mov    -0xa4(%rbp),%esi
call   1040 <utoa@plt>
lea    -0xa0(%rbp),%rsi
lea    0xd91(%rip),%rdi
call   1030 <printf@plt>
movl   $0x7fffffff,-0xa4(%rbp)
ff ff 7f
lea    -0xa0(%rbp),%rdi
mov    -0xa4(%rbp),%esi
call   1040 <utoa@plt>
lea    -0xa0(%rbp),%rsi
lea    0xd62(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <itoa@plt>
lea    0xeb2(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7fffffff,%esi
call   1050 <itoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x80000000,%esi
call   1050 <itoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7ffd,%esi
call   1050 <itoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xffff8003,%esi
call   1050 <itoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <utoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
call   1040 <utoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7fffffff,%esi
call   1040 <utoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [128 x i8]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%10 = load i32, i32* %6
%11 = call i32 @itoa(i8* %9, i32 %10)
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 2147483647, i32* %6
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%15 = load i32, i32* %6
%16 = call i32 @itoa(i8* %14, i32 %15)
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %17)
store i32 -2147483648, i32* %6
%19 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%20 = load i32, i32* %6
%21 = call i32 @itoa(i8* %19, i32 %20)
%22 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %22)
store i32 32765, i32* %6
%24 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%25 = load i32, i32* %6
%26 = call i32 @itoa(i8* %24, i32 %25)
%27 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %27)
store i32 -32765, i32* %6
%29 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%30 = load i32, i32* %6
%31 = call i32 @itoa(i8* %29, i32 %30)
%32 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %32)
store i32 0, i32* %8
%34 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%35 = load i32, i32* %8
%36 = call i32 @utoa(i8* %34, i32 %35)
%37 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %37)
store i32 -1, i32* %8
%39 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%40 = load i32, i32* %8
%41 = call i32 @utoa(i8* %39, i32 %40)
%42 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %42)
store i32 2147483647, i32* %8
%44 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%45 = load i32, i32* %8
%46 = call i32 @utoa(i8* %44, i32 %45)
%47 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%48 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %47)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @itoa(i8* %4, i32 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = call i32 @itoa(i8* %4, i32 2147483647)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%9 = call i32 @itoa(i8* %4, i32 -2147483648)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%11 = call i32 @itoa(i8* %4, i32 32765)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%13 = call i32 @itoa(i8* %4, i32 -32765)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%15 = call i32 @utoa(i8* %4, i32 0)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%17 = call i32 @utoa(i8* %4, i32 -1)
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%19 = call i32 @utoa(i8* %4, i32 2147483647)
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}