#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);
int main() {
  int i;
  for (i = 1; i < 100; i++)
    if (i % 10 == 0 || i == 99)
      printf("%i\n", i);
    else
      printf("%d ", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1184 <main+0x74>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     114e <main+0x3e>
cmpl   $0x63,-0x8(%rbp)
jne    1162 <main+0x52>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    1171 <main+0x61>
mov    -0x8(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
jmp    1176 <main+0x66>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x1,%ebx
lea    0xedf(%rip),%r14
lea    0xedc(%rip),%r15
jmp    1146 <main+0x36>
nopw   0x0(%rax,%rax,1)
cmp    $0x63,%ebx
cmove  %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
je     1166 <main+0x56>
movzbl %bl,%eax
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
and    $0xfffffffe,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
mov    %r14,%rdi
add    %cl,%al
je     1130 <main+0x20>
mov    %r15,%rdi
jmp    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %10, %1 ]
%3 = trunc i32 %2 to i8
%4 = urem i8 %3, 10
%5 = icmp eq i8 %4, 0
%6 = icmp eq i32 %2, 99
%7 = or i1 %6, %5
%8 = select i1 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%9 = tail call i32 @printf(i8* %8, i32 %2)
%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
}