#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*/ assert(int);
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  char s[100];
  itoa(0, s);
  assert(!strcmp("0", s));
  itoa(-0, s);
  assert(!strcmp("0", s));
  itoa(1234, s);
  assert(!strcmp("1234", s));
  itoa(-1234, s);
  assert(!strcmp("-1234", s));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rsi
xor    %edi,%edi
call   1050 <itoa@plt>
lea    -0x80(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x80(%rbp),%rsi
xor    %edi,%edi
call   1050 <itoa@plt>
lea    -0x80(%rbp),%rsi
lea    0xe74(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x80(%rbp),%rsi
mov    $0x4d2,%edi
call   1050 <itoa@plt>
lea    -0x80(%rbp),%rsi
lea    0xe47(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x80(%rbp),%rsi
mov    $0xfffffb2e,%edi
call   1050 <itoa@plt>
lea    -0x80(%rbp),%rsi
lea    0xe16(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
xor    %edi,%edi
cmpw   $0x30,(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
xor    %edi,%edi
cmpw   $0x30,(%rsp)
sete   %dil
call   1030 <assert@plt>
mov    $0x4d2,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
mov    $0x34333231,%eax
xor    (%rsp),%eax
movzbl 0x4(%rsp),%ecx
xor    %edi,%edi
or     %eax,%ecx
sete   %dil
call   1030 <assert@plt>
mov    $0xfffffb2e,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
mov    $0x3332312d,%eax
xor    (%rsp),%eax
movzwl 0x4(%rsp),%ecx
xor    $0x34,%ecx
xor    %edi,%edi
or     %eax,%ecx
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
@.str.1 = [5 x i8] c"1234\00"
@.str.2 = [6 x i8] c"-1234\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%8 = call i32 @itoa(i32 0, i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%10 = call i32 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%16 = call i32 @itoa(i32 0, i8* %15)
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%18 = call i32 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = icmp ne i32 %18, 0
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%24 = call i32 @itoa(i32 1234, i8* %23)
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%26 = call i32 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %25)
%27 = icmp ne i32 %26, 0
%28 = xor i1 %27, true
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%32 = call i32 @itoa(i32 -1234, i8* %31)
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%34 = call i32 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %33)
%35 = icmp ne i32 %34, 0
%36 = xor i1 %35, true
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"1234\00"
@.str.2 = [6 x i8] c"-1234\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @itoa(i32 0, i8* %4)
%6 = bitcast [100 x i8]* %3 to i16*
%7 = load i16, i16* %6
%8 = icmp eq i16 %7, 48
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 @itoa(i32 0, i8* %4)
%12 = load i16, i16* %6
%13 = icmp eq i16 %12, 48
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = call i32 @itoa(i32 1234, i8* %4)
%17 = call i32 @bcmp(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* dereferenceable(5) %4, i64 5)
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = call i32 @itoa(i32 -1234, i8* %4)
%22 = call i32 @bcmp(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* dereferenceable(6) %4, i64 6)
%23 = icmp eq i32 %22, 0
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
ret i32 0
}