#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) - 1) - 1);
  int cuantos = spacios / 2;
  for (int i = 0; i < n1; i++) {
    for (int a = -1; a <= (2 * i - 1); a++) {
      if (a < (cuantos + 1)) {
        printf(" ");
      } else if (a == (cuantos + 1)) {
        printf("*");
      } else {
        printf(" ");
      }
    }
    printf("\n");
  }
  printf("Pulsa Cuanquier tecla para terminal: ");
  fgets(linea, 180, stdin);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%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    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0xd4(%rbp)
mov    -0xd4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xd8(%rbp)
movl   $0x0,-0xdc(%rbp)
mov    -0xdc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    128a <main+0x15a>
movl   $0xffffffff,-0xe0(%rbp)
ff ff ff
mov    -0xe0(%rbp),%eax
mov    -0xdc(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     126a <main+0x13a>
mov    -0xe0(%rbp),%eax
mov    -0xd8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1218 <main+0xe8>
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
jmp    1251 <main+0x121>
mov    -0xe0(%rbp),%eax
mov    -0xd8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jne    1240 <main+0x110>
lea    0xdea(%rip),%rdi
call   1030 <printf@plt>
jmp    124c <main+0x11c>
lea    0xe01(%rip),%rdi
call   1030 <printf@plt>
jmp    1251 <main+0x121>
jmp    1256 <main+0x126>
mov    -0xe0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe0(%rbp)
jmp    11d6 <main+0xa6>
lea    0xdb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0xdc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xdc(%rbp)
jmp    11bd <main+0x8d>
lea    0xd93(%rip),%rdi
call   1030 <printf@plt>
lea    -0xd0(%rbp),%rdi
mov    0x2d44(%rip),%rax
mov    (%rax),%edx
mov    $0xb4,%esi
call   1040 <fgets@plt>
mov    -0x4(%rbp),%eax
add    $0xe0,%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,0x4(%rsp)
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xb4,%esi
call   1050 <fgets@plt>
lea    0xe96(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
call   1060 <sscanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    1223 <main+0xe3>
lea    (%rax,%rax,1),%ebp
add    $0xfffffffe,%ebp
sar    %ebp
mov    %ebp,%ebx
neg    %ebx
xor    %eax,%eax
mov    $0x2a,%r12d
mov    $0x20,%r13d
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %ecx,0x8(%rsp)
test   %eax,%eax
mov    $0x0,%r14d
mov    %eax,0xc(%rsp)
cmovg  %eax,%r14d
mov    $0xffffffff,%r15d
nopw   0x0(%rax,%rax,1)
lea    (%rbx,%r15,1),%eax
cmp    $0x1,%eax
mov    $0x20,%edi
cmove  %r12d,%edi
cmp    %ebp,%r15d
cmovle %r13d,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
cmp    %r15d,%r14d
jne    11e0 <main+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%ecx
add    $0x1,%ecx
mov    0xc(%rsp),%eax
add    $0x2,%eax
cmp    0x4(%rsp),%ecx
jl     11c0 <main+0x80>
lea    0xdf6(%rip),%rdi
call   1040 <printf@plt>
mov    0x2db2(%rip),%rax
mov    (%rax),%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 terminal: \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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds [180 x i8], [180 x i8]* %7, i64 0, i64 0
%14 = load i32, i32* @stdin
%15 = call i32 @fgets(i8* %13, i32 180, i32 %14)
%16 = getelementptr inbounds [180 x i8], [180 x i8]* %7, i64 0, i64 0
%17 = call i32 @sscanf(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%18 = load i32, i32* %6
%19 = mul nsw i32 %18, 2
%20 = sub nsw i32 %19, 1
%21 = sub nsw i32 %20, 1
store i32 %21, i32* %8
%22 = load i32, i32* %8
%23 = sdiv i32 %22, 2
store i32 %23, i32* %9
store i32 0, i32* %10
br label %24
24: ; preds = %58, %2
%25 = load i32, i32* %10
%26 = load i32, i32* %6
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %61
28: ; preds = %24
store i32 -1, i32* %11
br label %29
29: ; preds = %53, %28
%30 = load i32, i32* %11
%31 = load i32, i32* %10
%32 = mul nsw i32 2, %31
%33 = sub nsw i32 %32, 1
%34 = icmp sle i32 %30, %33
br i1 %34, label %35, label %56
35: ; preds = %29
%36 = load i32, i32* %11
%37 = load i32, i32* %9
%38 = add nsw i32 %37, 1
%39 = icmp slt i32 %36, %38
br i1 %39, label %40, label %42
40: ; preds = %35
%41 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %52
42: ; preds = %35
%43 = load i32, i32* %11
%44 = load i32, i32* %9
%45 = add nsw i32 %44, 1
%46 = icmp eq i32 %43, %45
br i1 %46, label %47, label %49
47: ; preds = %42
%48 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %51
49: ; preds = %42
%50 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %51
51: ; preds = %49, %47
br label %52
52: ; preds = %51, %40
br label %53
53: ; preds = %52
%54 = load i32, i32* %11
%55 = add nsw i32 %54, 1
store i32 %55, i32* %11
br label %29
56: ; preds = %29
%57 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %58
58: ; preds = %56
%59 = load i32, i32* %10
%60 = add nsw i32 %59, 1
store i32 %60, i32* %10
br label %24
61: ; preds = %24
%62 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
%63 = getelementptr inbounds [180 x i8], [180 x i8]* %7, i64 0, i64 0
%64 = load i32, i32* @stdin
%65 = call i32 @fgets(i8* %63, i32 180, i32 %64)
%66 = load i32, i32* %3
ret i32 %66
}

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 terminal: \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 = shl nsw i32 %11, 1
%13 = add nsw i32 %12, -2
%14 = sdiv i32 %13, 2
%15 = icmp sgt i32 %11, 0
br i1 %15, label %16, label %22
16: ; preds = %2
%17 = add nsw i32 %14, 1
br label %18
18: ; preds = %26, %16
%19 = phi i32 [ 0, %16 ], [ %31, %26 ]
%20 = phi i32 [ 0, %16 ], [ %28, %26 ]
%21 = call i32 @llvm.smax.i32(i32 %19, i32 0)
br label %32
22: ; preds = %26, %2
%23 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
%24 = load i32, i32* @stdin
%25 = call i32 @fgets(i8* %6, i32 180, i32 %24)
ret i32 0
26: ; preds = %32
%27 = call i32 @putchar(i32 10)
%28 = add nuw nsw i32 %20, 1
%29 = load i32, i32* %3
%30 = icmp slt i32 %28, %29
%31 = add nuw i32 %19, 2
br i1 %30, label %18, label %22
32: ; preds = %18, %32
%33 = phi i32 [ %39, %32 ], [ -1, %18 ]
%34 = icmp sgt i32 %33, %14
%35 = icmp eq i32 %33, %17
%36 = select i1 %34, i1 %35, i1 false
%37 = select i1 %36, i32 42, i32 32
%38 = call i32 @putchar(i32 %37)
%39 = add nsw i32 %33, 1
%40 = icmp eq i32 %39, %21
br i1 %40, label %26, label %32
}