#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 main() {
  int i = 1;
  int addSpace = 1;
  while (i <= 64) {
    printf("* ");
    if (i % 8 == 0) {
      printf("\n");
      addSpace++;
      if (addSpace % 2 == 0)
        printf(" ");
    }
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x40,-0x8(%rbp)
jg     119f <main+0x8f>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1191 <main+0x81>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    118c <main+0x7c>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
jmp    1191 <main+0x81>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebp
lea    0xed0(%rip),%r14
mov    $0x1,%ebx
jmp    1148 <main+0x28>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x41,%ebx
je     1174 <main+0x54>
mov    %r14,%rdi
call   1040 <printf@plt>
test   $0x7,%bl
jne    1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
test   $0x1,%bpl
jne    1140 <main+0x20>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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