#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  int n1 = 0;
  char linea[180];
  printf("Intruduce un numero entero: ");
  fgets(linea, 180, stdin);
  sscanf(linea, "%d", &n1);
  int spacios = ((n1 * 2) - 2);
  int cuantos = spacios;
  for (int i = 0; i < n1; i++) {
    cuantos = cuantos / 2;
    for (int t = 0; t < cuantos; t++) {
      printf(" ");
    }
    for (int a = 0; a <= (i * 2); a++) {
      printf("*");
    }
    printf("\n");
  }
  printf("Pulsa Cuanquier tecla para terminar: ");
  fgets(linea, 180, stdin);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
lea    -0xd0(%rbp),%rdi
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
mov    $0xb4,%esi
call   1040 <fgets@plt>
lea    -0xd0(%rbp),%rdi
lea    0xe99(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
sub    $0x2,%eax
mov    %eax,-0xd4(%rbp)
mov    -0xd4(%rbp),%eax
mov    %eax,-0xd8(%rbp)
movl   $0x0,-0xdc(%rbp)
mov    -0xdc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1272 <main+0x142>
mov    -0xd8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xd8(%rbp)
movl   $0x0,-0xe0(%rbp)
mov    -0xe0(%rbp),%eax
cmp    -0xd8(%rbp),%eax
jge    1211 <main+0xe1>
lea    0xe23(%rip),%rdi
call   1030 <printf@plt>
mov    -0xe0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe0(%rbp)
jmp    11df <main+0xaf>
movl   $0x0,-0xe4(%rbp)
mov    -0xe4(%rbp),%eax
mov    -0xdc(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jg     1252 <main+0x122>
lea    0xde7(%rip),%rdi
call   1030 <printf@plt>
mov    -0xe4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe4(%rbp)
jmp    121b <main+0xeb>
lea    0xdc9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xdc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xdc(%rbp)
jmp    11b2 <main+0x82>
lea    0xdab(%rip),%rdi
call   1030 <printf@plt>
lea    -0xd0(%rbp),%rdi
mov    0x2d5c(%rip),%rax
mov    (%rax),%edx
mov    $0xb4,%esi
call   1040 <fgets@plt>
mov    -0x4(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
movl   $0x0,0xc(%rsp)
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e7c(%rip),%r14
mov    (%r14),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xb4,%esi
call   1050 <fgets@plt>
lea    0xe95(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
call   1060 <sscanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    1218 <main+0xd8>
lea    (%rax,%rax,1),%r13d
add    $0xfffffffe,%r13d
xor    %r15d,%r15d
mov    $0x1,%r12d
xchg   %ax,%ax
mov    %r13d,%eax
shr    $0x1f,%r13d
add    %eax,%r13d
sar    %r13d
mov    %r13d,%ebx
mov    %r12d,%ebp
cmp    $0x2,%eax
jl     11f0 <main+0xb0>
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11d0 <main+0x90>
mov    %r12d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11f0 <main+0xb0>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
add    $0x2,%r12d
cmp    0xc(%rsp),%r15d
jl     11b0 <main+0x70>
lea    0xe01(%rip),%rdi
call   1040 <printf@plt>
mov    (%r14),%edx
lea    0x10(%rsp),%rdi
mov    $0xb4,%esi
call   1050 <fgets@plt>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Intruduce un numero entero: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [2 x i8] c"*\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [38 x i8] c"Pulsa Cuanquier tecla para terminar: \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [180 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%14 = getelementptr inbounds [180 x i8], [180 x i8]* %7, i64 0, i64 0
%15 = load i32, i32* @stdin
%16 = call i32 @fgets(i8* %14, i32 180, i32 %15)
%17 = getelementptr inbounds [180 x i8], [180 x i8]* %7, i64 0, i64 0
%18 = call i32 @sscanf(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%19 = load i32, i32* %6
%20 = mul nsw i32 %19, 2
%21 = sub nsw i32 %20, 2
store i32 %21, i32* %8
%22 = load i32, i32* %8
store i32 %22, i32* %9
store i32 0, i32* %10
br label %23
23: ; preds = %52, %2
%24 = load i32, i32* %10
%25 = load i32, i32* %6
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %55
27: ; preds = %23
%28 = load i32, i32* %9
%29 = sdiv i32 %28, 2
store i32 %29, i32* %9
store i32 0, i32* %11
br label %30
30: ; preds = %36, %27
%31 = load i32, i32* %11
%32 = load i32, i32* %9
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %39
34: ; preds = %30
%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* %11
%38 = add nsw i32 %37, 1
store i32 %38, i32* %11
br label %30
39: ; preds = %30
store i32 0, i32* %12
br label %40
40: ; preds = %47, %39
%41 = load i32, i32* %12
%42 = load i32, i32* %10
%43 = mul nsw i32 %42, 2
%44 = icmp sle i32 %41, %43
br i1 %44, label %45, label %50
45: ; preds = %40
%46 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %47
47: ; preds = %45
%48 = load i32, i32* %12
%49 = add nsw i32 %48, 1
store i32 %49, i32* %12
br label %40
50: ; preds = %40
%51 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %52
52: ; preds = %50
%53 = load i32, i32* %10
%54 = add nsw i32 %53, 1
store i32 %54, i32* %10
br label %23
55: ; preds = %23
%56 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
%57 = getelementptr inbounds [180 x i8], [180 x i8]* %7, i64 0, i64 0
%58 = load i32, i32* @stdin
%59 = call i32 @fgets(i8* %57, i32 180, i32 %58)
%60 = load i32, i32* %3
ret i32 %60
}

LLVM IR (-O2):
@.str = [29 x i8] c"Intruduce un numero entero: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.5 = [38 x i8] c"Pulsa Cuanquier tecla para terminar: \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [180 x i8]
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = getelementptr inbounds [180 x i8], [180 x i8]* %4, i64 0, i64 0
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %6, i32 180, i32 %8)
%10 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %3
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = shl nuw nsw i32 %11, 1
%15 = add nsw i32 %14, -2
br label %20
16: ; preds = %32, %2
%17 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
%18 = load i32, i32* @stdin
%19 = call i32 @fgets(i8* %6, i32 180, i32 %18)
ret i32 0
20: ; preds = %13, %32
%21 = phi i32 [ 1, %13 ], [ %37, %32 ]
%22 = phi i32 [ 0, %13 ], [ %34, %32 ]
%23 = phi i32 [ %15, %13 ], [ %24, %32 ]
%24 = sdiv i32 %23, 2
%25 = icmp sgt i32 %23, 1
br i1 %25, label %27, label %26
26: ; preds = %27, %20
br label %38
27: ; preds = %20, %27
%28 = phi i32 [ %30, %27 ], [ 0, %20 ]
%29 = call i32 @putchar(i32 32)
%30 = add nuw nsw i32 %28, 1
%31 = icmp eq i32 %30, %24
br i1 %31, label %26, label %27
32: ; preds = %38
%33 = call i32 @putchar(i32 10)
%34 = add nuw nsw i32 %22, 1
%35 = load i32, i32* %3
%36 = icmp slt i32 %34, %35
%37 = add nuw i32 %21, 2
br i1 %36, label %20, label %16
38: ; preds = %26, %38
%39 = phi i32 [ %41, %38 ], [ 0, %26 ]
%40 = call i32 @putchar(i32 42)
%41 = add nuw i32 %39, 1
%42 = icmp eq i32 %41, %21
br i1 %42, label %32, label %38
}