#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*/ printBin(int);
int /*<<< orphan*/ printHex(int);
int /*<<< orphan*/ printOct(int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf("Dec\tOct\tHex\tBin\n");
  int i;
  for (i = 0; i <= 32; i++) {
    printf("%i\t", i);
    if (1)
      printf("0");
    printOct(i);
    printf("\t");
    if (1)
      printf("0x");
    printHex(i);
    printf("\t");
    if (1)
      printf("0b");
    printBin(i);
    printf("\t");
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jg     1207 <main+0xc7>
mov    -0x8(%rbp),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
call   1030 <printOct@plt>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
call   1060 <printHex@plt>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <printBin@plt>
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1164 <main+0x24>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xe9c(%rip),%rdi
call   1050 <puts@plt>
lea    0xe86(%rip),%r14
lea    0xe83(%rip),%r15
lea    0xe7f(%rip),%rbx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    %ebp,%edi
call   1040 <printOct@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebp,%edi
call   1080 <printHex@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebp,%edi
call   1060 <printBin@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    $0x21,%ebp
jne    1190 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Dec\09Oct\09Hex\09Bin\0A\00"
@.str.1 = [4 x i8] c"%i\09\00"
@.str.2 = [2 x i8] c"0\00"
@.str.3 = [2 x i8] c"\09\00"
@.str.4 = [3 x i8] c"0x\00"
@.str.5 = [3 x i8] c"0b\00"
@.str.6 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %4
4: ; preds = %23, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 32
br i1 %6, label %7, label %26
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32, i32* %2
%12 = call i32 @printOct(i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%15 = load i32, i32* %2
%16 = call i32 @printHex(i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%19 = load i32, i32* %2
%20 = call i32 @printBin(i32 %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %23
23: ; preds = %7
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %4
26: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%i\09\00"
@.str.4 = [3 x i8] c"0x\00"
@.str.5 = [3 x i8] c"0b\00"
@str = [16 x i8] c"Dec\09Oct\09Hex\09Bin\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %15, %2 ]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @putchar(i32 48)
%6 = tail call i32 @printOct(i32 %3)
%7 = tail call i32 @putchar(i32 9)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i32 @printHex(i32 %3)
%10 = tail call i32 @putchar(i32 9)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%12 = tail call i32 @printBin(i32 %3)
%13 = tail call i32 @putchar(i32 9)
%14 = tail call i32 @putchar(i32 10)
%15 = add nuw nsw i32 %3, 1
%16 = icmp eq i32 %15, 33
br i1 %16, label %17, label %2
17: ; preds = %2
ret i32 0
}