#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 imprimir(int n) {
  int i = 0, j = 0, count = 0;
  for (i = 1; i <= n; i++) {
    count = 0;
    for (j = 1; j <= n - i; j++) {
      printf(" ");
    }
    for (j = 0; j < i * 2 - 1; j++) {
      printf("*");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<imprimir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11cb <imprimir+0xbb>
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jg     117c <imprimir+0x6c>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1151 <imprimir+0x41>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11b1 <imprimir+0xa1>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1183 <imprimir+0x73>
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1137 <imprimir+0x27>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimir>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edi,%edi
jle    119a <imprimir+0x8a>
mov    %edi,%r14d
mov    $0x1,%r15d
mov    $0x1,%r12d
nopl   0x0(%rax,%rax,1)
cmp    $0x2,%r15d
mov    $0x1,%ebp
cmovge %r15d,%ebp
cmp    %r14d,%r12d
jge    1170 <imprimir+0x60>
mov    %r14d,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    %ebx,%r12d
jne    1150 <imprimir+0x40>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1170 <imprimir+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r12),%eax
add    $0x2,%r15d
cmp    %r14d,%r12d
mov    %eax,%r12d
jne    1130 <imprimir+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @imprimir(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %26, label %3
3: ; preds = %1, %20
%4 = phi i32 [ %24, %20 ], [ 1, %1 ]
%5 = phi i32 [ %23, %20 ], [ %0, %1 ]
%6 = phi i32 [ %22, %20 ], [ 1, %1 ]
%7 = call i32 @llvm.smax.i32(i32 %4, i32 1)
%8 = icmp slt i32 %6, %0
br i1 %8, label %9, label %14
9: ; preds = %3, %9
%10 = phi i32 [ %12, %9 ], [ 1, %3 ]
%11 = tail call i32 @putchar(i32 32)
%12 = add nuw i32 %10, 1
%13 = icmp eq i32 %12, %5
br i1 %13, label %14, label %9
14: ; preds = %9, %3
br label %15
15: ; preds = %14, %15
%16 = phi i32 [ %18, %15 ], [ 0, %14 ]
%17 = tail call i32 @putchar(i32 42)
%18 = add nuw nsw i32 %16, 1
%19 = icmp eq i32 %18, %7
br i1 %19, label %20, label %15
20: ; preds = %15
%21 = tail call i32 @putchar(i32 10)
%22 = add nuw i32 %6, 1
%23 = add i32 %5, -1
%24 = add nuw i32 %4, 2
%25 = icmp eq i32 %6, %0
br i1 %25, label %26, label %3
26: ; preds = %20, %1
ret i32 0
}