#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*/ print_pattern(int, char *);
int main() {
  int n = 4;
  for (int i = 0; i < n; i++) {
    print_pattern(8, " *");
    print_pattern(8, "* ");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1169 <main+0x59>
mov    $0x8,%edi
lea    0xebb(%rip),%rsi
call   1030 <print_pattern@plt>
mov    $0x8,%edi
lea    0xead(%rip),%rsi
call   1030 <print_pattern@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%r14
mov    $0x8,%edi
mov    %r14,%rsi
call   1030 <print_pattern@plt>
lea    0xed4(%rip),%rbx
mov    $0x8,%edi
mov    %rbx,%rsi
call   1030 <print_pattern@plt>
mov    $0x8,%edi
mov    %r14,%rsi
call   1030 <print_pattern@plt>
mov    $0x8,%edi
mov    %rbx,%rsi
call   1030 <print_pattern@plt>
mov    $0x8,%edi
mov    %r14,%rsi
call   1030 <print_pattern@plt>
mov    $0x8,%edi
mov    %rbx,%rsi
call   1030 <print_pattern@plt>
mov    $0x8,%edi
mov    %r14,%rsi
call   1030 <print_pattern@plt>
mov    $0x8,%edi
mov    %rbx,%rsi
call   1030 <print_pattern@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" *\00"
@.str.1 = [3 x i8] c"* \00"
define i32 @main() {
%1 = tail call i32 @print_pattern(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_pattern(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @print_pattern(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @print_pattern(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @print_pattern(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @print_pattern(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @print_pattern(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @print_pattern(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}