#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*/ printf(char *, int, char);
main() {
  int i;
  for (i = 0; i < 100; i++) {
    printf("%6d%c", i, (i % 10 == 9 || i == 100 - 1) ? '\n' : ' ');
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    118c <main+0x7c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x9,%edx
mov    %al,-0x9(%rbp)
je     1159 <main+0x49>
cmpl   $0x63,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x9(%rbp),%dl
mov    $0x20,%eax
mov    $0xa,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
lea    0xe8a(%rip),%rdi
movsbl %al,%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
jmp    1138 <main+0x28>
nop
cmp    $0x63,%ebx
cmove  %eax,%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
je     1164 <main+0x54>
movzbl %bl,%ecx
imul   $0xcd,%ecx,%eax
shr    $0xa,%eax
and    $0xfffffffe,%eax
lea    (%rax,%rax,4),%esi
add    $0x9,%sil
mov    $0xa,%eax
mov    $0xa,%edx
cmp    %cl,%sil
je     1120 <main+0x10>
mov    $0x20,%edx
jmp    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%6d%c\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 = %20, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %23
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = srem i32 %8, 10
%10 = icmp eq i32 %9, 9
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 99
br label %14
14: ; preds = %11, %6
%15 = phi i1 [ true, %6 ], [ %13, %11 ]
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 10, i32 32
%18 = trunc i32 %17 to i8
%19 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7, i8 signext %18)
br label %20
20: ; preds = %14
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %3
23: ; preds = %3
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
@.str = [6 x i8] c"%6d%c\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %10, %1 ]
%3 = trunc i32 %2 to i8
%4 = urem i8 %3, 10
%5 = icmp eq i8 %4, 9
%6 = icmp eq i32 %2, 99
%7 = or i1 %6, %5
%8 = select i1 %7, i8 10, i8 32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2, i8 signext %8)
%10 = add nuw nsw i32 %2, 1
%11 = icmp eq i32 %10, 100
br i1 %11, label %12, label %1
12: ; preds = %1
ret i32 0
}