#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 *);
void print_pattern(int ile_gwiazdek) {
  for (int i = 0; i < ile_gwiazdek - 1; i++) {
    printf("* ");
  }
  printf("*\n");
  for (int i = 0; i < ile_gwiazdek; i++) {
    printf(" *");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_pattern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    114d <print_pattern+0x3d>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_pattern+0x12>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1186 <print_pattern+0x76>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1160 <print_pattern+0x50>
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_pattern>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
cmp    $0x2,%edi
jl     115d <print_pattern+0x2d>
lea    -0x1(%rbx),%ebp
lea    0xebb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
call   1050 <printf@plt>
add    $0xffffffff,%ebp
jne    1150 <print_pattern+0x20>
lea    0xea0(%rip),%rdi
call   1040 <puts@plt>
test   %ebx,%ebx
jle    118d <print_pattern+0x5d>
lea    0xe8f(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1050 <printf@plt>
add    $0xffffffff,%ebx
jne    1180 <print_pattern+0x50>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

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

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