#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);
  printf("%d\n", spacios);
  int cuantos = spacios / 2;
  printf("%d", cuantos);
  for (int i = 0; i < n1; i++) {
    for (int a = 0; a < n1; a++) {
      if (a < cuantos) {
        printf(" ");
      } else if (a == cuantos) {
        printf("*");
      } else {
        printf(" ");
      }
    }
    printf("\n");
  }
  printf("Pulsa Cuanquier tecla para terminar: ");
  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
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xd0(%rbp),%rdi
mov    0x2e7c(%rip),%rax
mov    (%rax),%edx
mov    $0xb4,%esi
call   1040 <fgets@plt>
lea    -0xd0(%rbp),%rdi
lea    0xe97(%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),%esi
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xd4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xd8(%rbp)
mov    -0xd8(%rbp),%esi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xdc(%rbp)
mov    -0xdc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12a7 <main+0x177>
movl   $0x0,-0xe0(%rbp)
mov    -0xe0(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1285 <main+0x155>
mov    -0xe0(%rbp),%eax
cmp    -0xd8(%rbp),%eax
jge    1234 <main+0x104>
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    126c <main+0x13c>
mov    -0xe0(%rbp),%eax
cmp    -0xd8(%rbp),%eax
jne    1259 <main+0x129>
lea    0xdd7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1267 <main+0x137>
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    126c <main+0x13c>
jmp    1271 <main+0x141>
mov    -0xe0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe0(%rbp)
jmp    1200 <main+0xd0>
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xdc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xdc(%rbp)
jmp    11e7 <main+0xb7>
lea    0xd78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xd0(%rbp),%rdi
mov    0x2d25(%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,0xc(%rsp)
lea    0xea0(%rip),%rdi
xor    %r12d,%r12d
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e77(%rip),%r15
mov    (%r15),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xb4,%esi
call   1050 <fgets@plt>
lea    0xe90(%rip),%r14
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <sscanf@plt>
mov    0xc(%rsp),%eax
lea    (%rax,%rax,1),%ebx
add    $0xfffffffe,%ebx
lea    0xe72(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
sar    %ebx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    121f <main+0xdf>
mov    $0x2a,%r14d
mov    $0x20,%r13d
jmp    11f7 <main+0xb7>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
mov    0xc(%rsp),%eax
cmp    %eax,%r12d
jge    121f <main+0xdf>
test   %eax,%eax
jle    11e0 <main+0xa0>
xor    %ebp,%ebp
nopl   (%rax)
cmp    %ebp,%ebx
mov    $0x20,%edi
cmove  %r14d,%edi
cmovg  %r13d,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     1200 <main+0xc0>
jmp    11e0 <main+0xa0>
lea    0xdfe(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15),%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 = [4 x i8] c"%d\0A\00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [2 x i8] c"*\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%12 = call i32 (i8*, ...) @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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %8
%25 = sdiv i32 %24, 2
store i32 %25, i32* %9
%26 = load i32, i32* %9
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %26)
store i32 0, i32* %10
br label %28
28: ; preds = %58, %2
%29 = load i32, i32* %10
%30 = load i32, i32* %6
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %61
32: ; preds = %28
store i32 0, i32* %11
br label %33
33: ; preds = %53, %32
%34 = load i32, i32* %11
%35 = load i32, i32* %6
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %56
37: ; preds = %33
%38 = load i32, i32* %11
%39 = load i32, i32* %9
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %43
41: ; preds = %37
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %52
43: ; preds = %37
%44 = load i32, i32* %11
%45 = load i32, i32* %9
%46 = icmp eq i32 %44, %45
br i1 %46, label %47, label %49
47: ; preds = %43
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %51
49: ; preds = %43
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %51
51: ; preds = %49, %47
br label %52
52: ; preds = %51, %41
br label %53
53: ; preds = %52
%54 = load i32, i32* %11
%55 = add nsw i32 %54, 1
store i32 %55, i32* %11
br label %33
56: ; preds = %33
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, 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 %28
61: ; preds = %28
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, 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.2 = [4 x i8] c"%d\0A\00"
@.str.6 = [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 (i8*, ...) @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 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = sdiv i32 %13, 2
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %3
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %2, %27
%20 = phi i32 [ %30, %27 ], [ %17, %2 ]
%21 = phi i32 [ %29, %27 ], [ 0, %2 ]
%22 = icmp sgt i32 %20, 0
br i1 %22, label %32, label %27
23: ; preds = %27, %2
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0))
%25 = load i32, i32* @stdin
%26 = call i32 @fgets(i8* %6, i32 180, i32 %25)
ret i32 0
27: ; preds = %32, %19
%28 = call i32 @putchar(i32 10)
%29 = add nuw nsw i32 %21, 1
%30 = load i32, i32* %3
%31 = icmp slt i32 %29, %30
br i1 %31, label %19, label %23
32: ; preds = %19, %32
%33 = phi i32 [ %39, %32 ], [ 0, %19 ]
%34 = icmp slt i32 %33, %15
%35 = icmp eq i32 %33, %15
%36 = select i1 %35, i32 42, i32 32
%37 = select i1 %34, i32 32, i32 %36
%38 = call i32 @putchar(i32 %37)
%39 = add nuw nsw i32 %33, 1
%40 = load i32, i32* %3
%41 = icmp slt i32 %39, %40
br i1 %41, label %32, label %27
}