#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*/ decimal_to_binary(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Binary\t\tDecimal\t\tOctal\t\tHexadecimal");
  int number = 1;
  while (number <= 256) {
    decimal_to_binary(number);
    printf("\t%d\t\t%o\t\t%x", number, number, number);
    number++;
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jg     119a <main+0x6a>
mov    -0x8(%rbp),%edi
call   1050 <decimal_to_binary@plt>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1152 <main+0x22>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebx
lea    0xec8(%rip),%r14
nopl   0x0(%rax)
mov    %ebx,%edi
call   1060 <decimal_to_binary@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x101,%ebx
jne    1160 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Binary\09\09Decimal\09\09Octal\09\09Hexadecimal\00"
@.str.1 = [12 x i8] c"\09%d\09\09%o\09\09%x\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 256
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @decimal_to_binary(i32 %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = load i32, i32* %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %4
17: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"Binary\09\09Decimal\09\09Octal\09\09Hexadecimal\00"
@.str.1 = [12 x i8] c"\09%d\09\09%o\09\09%x\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %6, %2 ]
%4 = tail call i32 @decimal_to_binary(i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %3, i32 %3)
%6 = add nuw nsw i32 %3, 1
%7 = tail call i32 @putchar(i32 10)
%8 = icmp eq i32 %6, 257
br i1 %8, label %9, label %2
9: ; preds = %2
ret i32 0
}