#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 convert(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  for (int i = 0; i < 256; i++) {
    if (i % 16 == 15) {
      printf("%i,\n", convert(i));
    } else {
      printf("%i,\t", convert(i));
    }
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    119f <main+0x7f>
mov    -0x8(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0xf,%edx
jne    1174 <main+0x54>
mov    -0x8(%rbp),%edi
call   1030 <convert@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    118c <main+0x6c>
mov    -0x8(%rbp),%edi
call   1030 <convert@plt>
mov    %eax,%esi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1191 <main+0x71>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
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    0xec2(%rip),%r14
lea    0xec0(%rip),%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebx,%ebp
not    %ebp
mov    %ebx,%edi
call   1040 <convert@plt>
test   $0xf,%bpl
mov    %r15,%rdi
cmove  %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1150 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%i,\0A\00"
@.str.1 = [5 x i8] c"%i,\09\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %19, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %22
6: ; preds = %3
%7 = load i32, i32* %2
%8 = srem i32 %7, 16
%9 = icmp eq i32 %8, 15
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @convert(i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %18
14: ; preds = %6
%15 = load i32, i32* %2
%16 = call i32 @convert(i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %14, %10
br label %19
19: ; preds = %18
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %3
22: ; preds = %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%i,\0A\00"
@.str.1 = [5 x i8] c"%i,\09\00"
define i32 @main() {
br label %3
1: ; preds = %3
%2 = tail call i32 @putchar(i32 10)
ret i32 0
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %10, %3 ]
%5 = and i32 %4, 15
%6 = icmp eq i32 %5, 15
%7 = tail call i32 @convert(i32 %4)
%8 = select i1 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %8, i32 %7)
%10 = add nuw nsw i32 %4, 1
%11 = icmp eq i32 %10, 256
br i1 %11, label %1, label %3
}