#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 *, char *);
int /*<<< orphan*/ puts(char *);
int main(void) {
  int counter = 1;
  while (counter <= 100) {
    printf("%s", "*");
    if ((counter % 10) == 0) {
      puts("");
    }
    counter++;
  }
  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)
jg     1181 <main+0x61>
lea    0xeb9(%rip),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1173 <main+0x53>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %ebp,%ebp
mov    $0x1,%r12b
lea    0xecc(%rip),%r14
lea    0xec8(%rip),%r15
jmp    114c <main+0x2c>
nopl   (%rax)
add    $0xffffffff,%ebp
add    $0x1,%r12b
cmp    $0xffffff9c,%ebp
je     1180 <main+0x60>
movzbl %r12b,%eax
imul   $0xcd,%eax,%eax
shr    $0xa,%eax
and    $0xfffffffe,%eax
lea    (%rax,%rax,4),%ebx
neg    %ebx
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <printf@plt>
or     $0x1,%bl
cmp    %bpl,%bl
jne    1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"*\00"
@.str.2 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 100
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = srem i32 %8, 10
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %6
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %3
16: ; preds = %3
ret i32 0
}

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