#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);
  for (int i = 1; i <= n1; i++) {
    for (int t = 0; t < (n1 - i); t++) {
      printf(" ");
    }
    for (int a = 0; a < (2 * i - 1); 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    $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>
movl   $0x1,-0xd4(%rbp)
mov    -0xd4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     124b <main+0x11b>
movl   $0x0,-0xd8(%rbp)
mov    -0xd8(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    -0xd4(%rbp),%ecx
cmp    %ecx,%eax
jge    11e7 <main+0xb7>
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    11b0 <main+0x80>
movl   $0x0,-0xdc(%rbp)
mov    -0xdc(%rbp),%eax
mov    -0xd4(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    122b <main+0xfb>
lea    0xe0e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xdc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xdc(%rbp)
jmp    11f1 <main+0xc1>
lea    0xdf0(%rip),%rdi
call   1030 <printf@plt>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    1197 <main+0x67>
lea    0xdd2(%rip),%rdi
call   1030 <printf@plt>
lea    -0xd0(%rbp),%rdi
mov    0x2d83(%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   %r12
push   %rbx
sub    $0xd0,%rsp
movl   $0x0,0xc(%rsp)
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e7e(%rip),%r14
mov    (%r14),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xb4,%esi
call   1050 <fgets@plt>
lea    0xe97(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
call   1060 <sscanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    121e <main+0xde>
mov    $0x1,%r15d
mov    $0x1,%r12d
nopl   0x0(%rax,%rax,1)
cmp    $0x2,%r15d
mov    $0x1,%ebp
cmovge %r15d,%ebp
cmp    %r12d,%eax
jle    11f0 <main+0xb0>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%eax
sub    %r12d,%eax
cmp    %eax,%ebx
jl     11d0 <main+0x90>
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11f0 <main+0xb0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r12),%ecx
mov    0xc(%rsp),%eax
add    $0x2,%r15d
cmp    %eax,%r12d
mov    %ecx,%r12d
jl     11b0 <main+0x70>
lea    0xdfb(%rip),%rdi
call   1040 <printf@plt>
mov    (%r14),%edx
lea    0x10(%rsp),%rdi
mov    $0xb4,%esi
call   1050 <fgets@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
pop    %r12
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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%11 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [180 x i8], [180 x i8]* %7, i64 0, i64 0
%13 = load i32, i32* @stdin
%14 = call i32 @fgets(i8* %12, i32 180, i32 %13)
%15 = getelementptr inbounds [180 x i8], [180 x i8]* %7, i64 0, i64 0
%16 = call i32 @sscanf(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
store i32 1, i32* %8
br label %17
17: ; preds = %47, %2
%18 = load i32, i32* %8
%19 = load i32, i32* %6
%20 = icmp sle i32 %18, %19
br i1 %20, label %21, label %50
21: ; preds = %17
store i32 0, i32* %9
br label %22
22: ; preds = %30, %21
%23 = load i32, i32* %9
%24 = load i32, i32* %6
%25 = load i32, i32* %8
%26 = sub nsw i32 %24, %25
%27 = icmp slt i32 %23, %26
br i1 %27, label %28, label %33
28: ; preds = %22
%29 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %30
30: ; preds = %28
%31 = load i32, i32* %9
%32 = add nsw i32 %31, 1
store i32 %32, i32* %9
br label %22
33: ; preds = %22
store i32 0, i32* %10
br label %34
34: ; preds = %42, %33
%35 = load i32, i32* %10
%36 = load i32, i32* %8
%37 = mul nsw i32 2, %36
%38 = sub nsw i32 %37, 1
%39 = icmp slt i32 %35, %38
br i1 %39, label %40, label %45
40: ; preds = %34
%41 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %42
42: ; preds = %40
%43 = load i32, i32* %10
%44 = add nsw i32 %43, 1
store i32 %44, i32* %10
br label %34
45: ; preds = %34
%46 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %47
47: ; preds = %45
%48 = load i32, i32* %8
%49 = add nsw i32 %48, 1
store i32 %49, i32* %8
br label %17
50: ; preds = %17
%51 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
%52 = getelementptr inbounds [180 x i8], [180 x i8]* %7, i64 0, i64 0
%53 = load i32, i32* @stdin
%54 = call i32 @fgets(i8* %52, i32 180, i32 %53)
%55 = load i32, i32* %3
ret i32 %55
}

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