#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 /*<<< orphan*/ putchar(char);
void print_pattern3(int ile_gwiazdek) {
  for (int i = 1; i <= ile_gwiazdek; i++) {
    if (ile_gwiazdek == 4) {
      putchar('****');
    } else if (ile_gwiazdek == 3) {
      putchar('***');
    } else if (ile_gwiazdek == 2) {
      putchar('**');
    } else if (ile_gwiazdek == 1) {
      putchar('*');
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_pattern3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11bf <print_pattern3+0x9f>
cmpl   $0x4,-0x4(%rbp)
jne    1157 <print_pattern3+0x37>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    11ac <print_pattern3+0x8c>
cmpl   $0x3,-0x4(%rbp)
jne    1170 <print_pattern3+0x50>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    11a7 <print_pattern3+0x87>
cmpl   $0x2,-0x4(%rbp)
jne    1189 <print_pattern3+0x69>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    11a2 <print_pattern3+0x82>
cmpl   $0x1,-0x4(%rbp)
jne    119d <print_pattern3+0x7d>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    11a2 <print_pattern3+0x82>
jmp    11a7 <print_pattern3+0x87>
jmp    11ac <print_pattern3+0x8c>
jmp    11b1 <print_pattern3+0x91>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <print_pattern3+0x12>
lea    0xe3a(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_pattern3>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1136 <print_pattern3+0x26>
mov    %edi,%ebx
lea    -0x1(%rbx),%ebp
jmp    1125 <print_pattern3+0x15>
xchg   %ax,%ax
add    $0xffffffff,%ebx
je     1136 <print_pattern3+0x26>
cmp    $0x3,%ebp
ja     1120 <print_pattern3+0x10>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    1120 <print_pattern3+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @print_pattern3(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = icmp ult i32 %4, 4
br label %8
6: ; preds = %12, %1
%7 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
ret void
8: ; preds = %3, %12
%9 = phi i32 [ %13, %12 ], [ 1, %3 ]
br i1 %5, label %10, label %12
10: ; preds = %8
%11 = tail call i32 @putchar(i8 signext 42)
br label %12
12: ; preds = %8, %10
%13 = add nuw i32 %9, 1
%14 = icmp eq i32 %9, %0
br i1 %14, label %6, label %8
}