#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 = 0; i < n1; i++) {
    for (int a = 0; a < n1; a++) {
      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>
movl   $0x0,-0xd4(%rbp)
mov    -0xd4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11ff <main+0xcf>
movl   $0x0,-0xd8(%rbp)
mov    -0xd8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11df <main+0xaf>
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    11b0 <main+0x80>
lea    0xe3c(%rip),%rdi
call   1030 <printf@plt>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    1197 <main+0x67>
lea    0xe1e(%rip),%rdi
call   1030 <printf@plt>
lea    -0xd0(%rbp),%rdi
mov    0x2dcf(%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   %r14
push   %rbx
sub    $0xd0,%rsp
movl   $0x0,0xc(%rsp)
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e82(%rip),%r14
mov    (%r14),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xb4,%esi
call   1050 <fgets@plt>
lea    0xe9b(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
call   1060 <sscanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11d5 <main+0x95>
xor    %ebx,%ebx
jmp    11b5 <main+0x75>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%eax
cmp    %eax,%ebx
jge    11d5 <main+0x95>
test   %eax,%eax
jle    11a0 <main+0x60>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     11c0 <main+0x80>
jmp    11a0 <main+0x60>
lea    0xe44(%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    %r14
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"\0A\00"
@.str.4 = [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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [180 x i8], [180 x i8]* %7, i64 0, i64 0
%12 = load i32, i32* @stdin
%13 = call i32 @fgets(i8* %11, i32 180, i32 %12)
%14 = getelementptr inbounds [180 x i8], [180 x i8]* %7, i64 0, i64 0
%15 = call i32 @sscanf(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
store i32 0, i32* %8
br label %16
16: ; preds = %32, %2
%17 = load i32, i32* %8
%18 = load i32, i32* %6
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %35
20: ; preds = %16
store i32 0, i32* %9
br label %21
21: ; preds = %27, %20
%22 = load i32, i32* %9
%23 = load i32, i32* %6
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %27
27: ; preds = %25
%28 = load i32, i32* %9
%29 = add nsw i32 %28, 1
store i32 %29, i32* %9
br label %21
30: ; preds = %21
%31 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %32
32: ; preds = %30
%33 = load i32, i32* %8
%34 = add nsw i32 %33, 1
store i32 %34, i32* %8
br label %16
35: ; preds = %16
%36 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%37 = getelementptr inbounds [180 x i8], [180 x i8]* %7, i64 0, i64 0
%38 = load i32, i32* @stdin
%39 = call i32 @fgets(i8* %37, i32 180, i32 %38)
%40 = load i32, i32* %3
ret i32 %40
}

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