#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(int, char *);
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char **argv) {
  char str[16];
  signed i = ((unsigned)(~0) ^ ((unsigned)(~0) >> 1));
  itoa(i, str);
  printf("%d\n%s\n", i, str);
  i++;
  itoa(i, str);
  printf("%d\n%s\n", i, str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x80000000,-0x24(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1040 <itoa@plt>
mov    -0x24(%rbp),%esi
lea    -0x20(%rbp),%rdx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1040 <itoa@plt>
mov    -0x24(%rbp),%esi
lea    -0x20(%rbp),%rdx
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsp,%rbx
mov    $0x80000000,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
lea    0xec2(%rip),%r14
mov    %r14,%rdi
mov    $0x80000000,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    $0x80000001,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
mov    %r14,%rdi
mov    $0x80000001,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d\0A%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @itoa(i32 -2147483648, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 -2147483648, i8* %4)
%7 = call i32 @itoa(i32 -2147483647, i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 -2147483647, i8* %4)
ret i32 0
}