#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*/ ft_putchar(char);
int stars_cntr(int size) {
  int lvl;
  int i;
  int size_cnt;
  int base;
  int star_ctr;
  int ie;
  int remp;
  int i2;
  lvl = 0;
  i = 1;
  size_cnt = -1;
  star_ctr = 1;
  ie = 0;
  remp = 0;
  i2 = -1;
  while (++size_cnt != size) {
    base = i;
    while (lvl != base + 2) {
      i2 = -1;
      ie = 0;
      remp = 0;
      while (++i2 != star_ctr)
        ie += 1;
      ft_putchar('\n');
      lvl++;
      if (lvl != base + 2) {
        star_ctr += 2;
      }
    }
    i++;
    base = 0;
    lvl = 0;
    star_ctr += 6;
    remp = ie;
  }
  ft_putchar('\n');
  return (remp);
}


x86 assembly (clang, -O0):
<stars_cntr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0xffffffff,-0x24(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmp    -0x4(%rbp),%eax
je     1207 <stars_cntr+0xf7>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
je     11dc <stars_cntr+0xcc>
movl   $0xffffffff,-0x24(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmp    -0x18(%rbp),%eax
je     11aa <stars_cntr+0x9a>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    118a <stars_cntr+0x7a>
mov    $0xa,%edi
call   1030 <ft_putchar@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     11d7 <stars_cntr+0xc7>
mov    -0x18(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
jmp    1164 <stars_cntr+0x54>
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)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    114c <stars_cntr+0x3c>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    -0x20(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stars_cntr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
je     117d <stars_cntr+0x6d>
mov    %edi,%r14d
mov    $0x1,%r12d
xor    %r15d,%r15d
mov    $0x3,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r13d,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0xfffffffe,%ebp
add    $0xffffffff,%ebx
jne    1150 <stars_cntr+0x40>
mov    %r12d,%ebx
sub    %ebp,%ebx
lea    0x4(%rbx),%r12d
add    $0x1,%r15d
add    $0x1,%r13d
cmp    %r14d,%r15d
jne    1140 <stars_cntr+0x30>
add    $0xfffffffe,%ebx
jmp    117f <stars_cntr+0x6f>
xor    %ebx,%ebx
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @stars_cntr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = 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
store i32 0, i32* %8
store i32 0, i32* %9
store i32 -1, i32* %10
br label %11
11: ; preds = %44, %1
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
%14 = load i32, i32* %2
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %50
16: ; preds = %11
%17 = load i32, i32* %4
store i32 %17, i32* %6
br label %18
18: ; preds = %43, %16
%19 = load i32, i32* %3
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 2
%22 = icmp ne i32 %19, %21
br i1 %22, label %23, label %44
23: ; preds = %18
store i32 -1, i32* %10
store i32 0, i32* %8
store i32 0, i32* %9
br label %24
24: ; preds = %29, %23
%25 = load i32, i32* %10
%26 = add nsw i32 %25, 1
store i32 %26, i32* %10
%27 = load i32, i32* %7
%28 = icmp ne i32 %26, %27
br i1 %28, label %29, label %32
29: ; preds = %24
%30 = load i32, i32* %8
%31 = add nsw i32 %30, 1
store i32 %31, i32* %8
br label %24
32: ; preds = %24
%33 = call i32 @ft_putchar(i8 signext 10)
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
%36 = load i32, i32* %3
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 2
%39 = icmp ne i32 %36, %38
br i1 %39, label %40, label %43
40: ; preds = %32
%41 = load i32, i32* %7
%42 = add nsw i32 %41, 2
store i32 %42, i32* %7
br label %43
43: ; preds = %40, %32
br label %18
44: ; preds = %18
%45 = load i32, i32* %4
%46 = add nsw i32 %45, 1
store i32 %46, i32* %4
store i32 0, i32* %6
store i32 0, i32* %3
%47 = load i32, i32* %7
%48 = add nsw i32 %47, 6
store i32 %48, i32* %7
%49 = load i32, i32* %8
store i32 %49, i32* %9
br label %11
50: ; preds = %11
%51 = call i32 @ft_putchar(i8 signext 10)
%52 = load i32, i32* %9
ret i32 %52
}

LLVM IR (-O2):
define i32 @stars_cntr(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 @ft_putchar(i8 signext 10)
%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
%21 = phi i32 [ 0, %1 ], [ %9, %15 ]
%22 = tail call i32 @ft_putchar(i8 signext 10)
ret i32 %21
}