#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ itoa(int, char *, int);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
scalar_t__ strcmp(char *, char *);
int main() {
  char a[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  char *correct = "11111111";
  itoa(255, a, 2);
  puts(a);
  putchar('\n');
  if (strcmp(a, correct))
    return EXIT_SUCCESS;
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <memset@plt>
lea    0xe8a(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0xe(%rbp),%rsi
mov    $0xff,%edi
mov    $0x2,%edx
call   1070 <itoa@plt>
lea    -0xe(%rbp),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0xe(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     11c8 <main+0x78>
mov    0x2e1a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11d4 <main+0x84>
mov    0x2e11(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
mov    %rsp,%rbx
mov    $0xff,%edi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1060 <itoa@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe7e(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1198 <main+0x58>
mov    0x2e4a(%rip),%rax
jmp    119f <main+0x5f>
mov    0x2e39(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"11111111\00"
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [10 x i8]* %2 to i8*
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = call i32 @itoa(i32 255, i8* %5, i32 2)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%8 = call i32 @puts(i8* %7)
%9 = call i32 @putchar(i8 signext 10)
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%11 = load i8*, i8** %3
%12 = call i64 @strcmp(i8* %10, i8* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = load i32, i32* @EXIT_SUCCESS
store i32 %15, i32* %1
br label %18
16: ; preds = %0
%17 = load i32, i32* @EXIT_FAILURE
store i32 %17, i32* %1
br label %18
18: ; preds = %16, %14
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [9 x i8] c"11111111\00"
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 255, i8* %2, i32 2)
%4 = call i32 @puts(i8* %2)
%5 = call i32 @putchar(i8 signext 10)
%6 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = load i32, i32* @EXIT_FAILURE
%9 = load i32, i32* @EXIT_SUCCESS
%10 = select i1 %7, i32 %8, i32 %9
ret i32 %10
}