#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int nfil, ncol;
  int matriz[50][50];
  int i, j;
  printf("Introduce el nº de filas: ");
  scanf("%d", &nfil);
  printf("Introduce el nº de columnas: ");
  scanf("%d", &ncol);
  for (i = 0; i < nfil; i++) {
    for (j = 0; j < ncol; j++) {
      printf("m[%d][%d]= ", i, j);
      scanf("%d", &matriz[i][j]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2730,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x2724(%rbp)
mov    -0x2724(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1219 <main+0xf9>
movl   $0x0,-0x2728(%rbp)
mov    -0x2728(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1200 <main+0xe0>
mov    -0x2724(%rbp),%esi
mov    -0x2728(%rbp),%edx
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x2724(%rbp),%rax
lea    -0x2720(%rbp),%rsi
imul   $0xc8,%rax,%rax
add    %rax,%rsi
movslq -0x2728(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe35(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x2728(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2728(%rbp)
jmp    1191 <main+0x71>
jmp    1205 <main+0xe5>
mov    -0x2724(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2724(%rbp)
jmp    1178 <main+0x58>
xor    %eax,%eax
add    $0x2730,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2728,%rsp
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
jle    11f2 <main+0xd2>
lea    0x10(%rsp),%rbp
mov    0x8(%rsp),%eax
lea    0xeb8(%rip),%r14
lea    0xe8f(%rip),%r15
xor    %r12d,%r12d
jmp    11b3 <main+0x93>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%r12
movslq %ecx,%rdx
add    $0xc8,%rbp
cmp    %rdx,%r12
jge    11f2 <main+0xd2>
test   %eax,%eax
jle    11a0 <main+0x80>
mov    %rbp,%r13
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
add    $0x4,%r13
cmp    %rax,%rbx
jl     11c0 <main+0xa0>
mov    0xc(%rsp),%ecx
jmp    11a0 <main+0x80>
xor    %eax,%eax
add    $0x2728,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Introduce el n\C2\BA de filas: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"Introduce el n\C2\BA de columnas: \00"
@.str.3 = [12 x i8] c"m[%d][%d]= \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [50 x [50 x i32]]
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
store i32 0, i32* %5
br label %11
11: ; preds = %35, %0
%12 = load i32, i32* %5
%13 = load i32, i32* %2
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %38
15: ; preds = %11
store i32 0, i32* %6
br label %16
16: ; preds = %31, %15
%17 = load i32, i32* %6
%18 = load i32, i32* %3
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %34
20: ; preds = %16
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %21, i32 %22)
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [50 x [50 x i32]], [50 x [50 x i32]]* %4, i64 0, i64 %25
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [50 x i32], [50 x i32]* %26, i64 0, i64 %28
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %29)
br label %31
31: ; preds = %20
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %16
34: ; preds = %16
br label %35
35: ; preds = %34
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 1
store i32 %37, i32* %5
br label %11
38: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Introduce el n\C2\BA de filas: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"Introduce el n\C2\BA de columnas: \00"
@.str.3 = [12 x i8] c"m[%d][%d]= \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [50 x [50 x i32]]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast [50 x [50 x i32]]* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %1
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %40
13: ; preds = %0
%14 = load i32, i32* %2
br label %15
15: ; preds = %13, %34
%16 = phi i32 [ %11, %13 ], [ %35, %34 ]
%17 = phi i32 [ %14, %13 ], [ %36, %34 ]
%18 = phi i64 [ 0, %13 ], [ %37, %34 ]
%19 = icmp sgt i32 %17, 0
br i1 %19, label %20, label %34
20: ; preds = %15
%21 = trunc i64 %18 to i32
br label %22
22: ; preds = %20, %22
%23 = phi i64 [ 0, %20 ], [ %28, %22 ]
%24 = trunc i64 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %21, i32 %24)
%26 = getelementptr inbounds [50 x [50 x i32]], [50 x [50 x i32]]* %3, i64 0, i64 %18, i64 %23
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %26)
%28 = add nuw nsw i64 %23, 1
%29 = load i32, i32* %2
%30 = sext i32 %29 to i64
%31 = icmp slt i64 %28, %30
br i1 %31, label %22, label %32
32: ; preds = %22
%33 = load i32, i32* %1
br label %34
34: ; preds = %32, %15
%35 = phi i32 [ %33, %32 ], [ %16, %15 ]
%36 = phi i32 [ %29, %32 ], [ %17, %15 ]
%37 = add nuw nsw i64 %18, 1
%38 = sext i32 %35 to i64
%39 = icmp slt i64 %37, %38
br i1 %39, label %15, label %40
40: ; preds = %34, %0
ret i32 0
}