#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*/ wr_stars(int);
void sastantua(int size) {
  int lvl;
  int i;
  int size_cnt;
  int base;
  int star_countr;
  lvl = 0;
  i = 1;
  size_cnt = -1;
  star_countr = 1;
  while (++size_cnt != size) {
    base = i;
    while (lvl != base + 2) {
      wr_stars(star_countr);
      lvl++;
      if (lvl != base + 2)
        star_countr += 2;
    }
    i++;
    base = 0;
    lvl = 0;
    star_countr += 6;
  }
}


x86 assembly (clang, -O0):
<sastantua>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmp    -0x4(%rbp),%eax
je     11b5 <sastantua+0xa5>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
je     1190 <sastantua+0x80>
mov    -0x18(%rbp),%edi
call   1030 <wr_stars@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
je     118b <sastantua+0x7b>
mov    -0x18(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
jmp    114f <sastantua+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x18(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x18(%rbp)
jmp    1137 <sastantua+0x27>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sastantua>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edi,%edi
je     115f <sastantua+0x4f>
mov    %edi,%r14d
mov    $0x1,%ebp
xor    %r15d,%r15d
mov    $0x3,%r12d
nopl   (%rax)
mov    %r12d,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%edi
call   1030 <wr_stars@plt>
add    $0x2,%ebp
add    $0xffffffff,%ebx
jne    1140 <sastantua+0x30>
add    $0x4,%ebp
add    $0x1,%r15d
add    $0x1,%r12d
cmp    %r14d,%r15d
jne    1130 <sastantua+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @sastantua(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
store i32 -1, i32* %5
store i32 1, i32* %7
br label %8
8: ; preds = %33, %1
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
store i32 %10, i32* %5
%11 = load i32, i32* %2
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %38
13: ; preds = %8
%14 = load i32, i32* %4
store i32 %14, i32* %6
br label %15
15: ; preds = %32, %13
%16 = load i32, i32* %3
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 2
%19 = icmp ne i32 %16, %18
br i1 %19, label %20, label %33
20: ; preds = %15
%21 = load i32, i32* %7
%22 = call i32 @wr_stars(i32 %21)
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
%25 = load i32, i32* %3
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 2
%28 = icmp ne i32 %25, %27
br i1 %28, label %29, label %32
29: ; preds = %20
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 2
store i32 %31, i32* %7
br label %32
32: ; preds = %29, %20
br label %15
33: ; preds = %15
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
store i32 0, i32* %6
store i32 0, i32* %3
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 6
store i32 %37, i32* %7
br label %8
38: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @sastantua(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %20, label %3
3: ; preds = %1, %15
%4 = phi i32 [ %18, %15 ], [ 0, %1 ]
%5 = phi i32 [ %17, %15 ], [ 1, %1 ]
%6 = phi i32 [ %16, %15 ], [ 1, %1 ]
%7 = add nuw nsw i32 %6, 1
br label %8
8: ; preds = %3, %8
%9 = phi i32 [ %5, %3 ], [ %14, %8 ]
%10 = phi i32 [ 0, %3 ], [ %12, %8 ]
%11 = tail call i32 @wr_stars(i32 %9)
%12 = add nuw nsw i32 %10, 1
%13 = icmp eq i32 %10, %7
%14 = add nsw i32 %9, 2
br i1 %13, label %15, label %8
15: ; preds = %8
%16 = add nuw nsw i32 %6, 1
%17 = add nsw i32 %9, 6
%18 = add nuw nsw i32 %4, 1
%19 = icmp eq i32 %18, %0
br i1 %19, label %20, label %3
20: ; preds = %15, %1
ret void
}