#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 */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int main() {
  int *M;
  int m = 0, n = 0;
  int i, j;
  int total = 0;
  int columnas = 0;
  system("cls");
  printf("%c==========================================%c\n", 201, 187);
  printf("%c===========     BIENVENIDO     ===========%c\n", 204, 185);
  printf("%c==========================================%c\n\n", 200, 188);
  system("pause");
  do {
    printf("\nCuantos renglones tiene su matriz?\n");
    scanf("%d", &m);
    if (m <= 0)
      printf("Inserte un valor entero positivo...\n");
  } while (m <= 0);
  do {
    printf("\nCuantas columnas tiene su matriz?\n");
    scanf("%d", &n);
    if (n <= 0)
      printf("Inserte un valor entero positivo...\n");
  } while (n <= 0);
  M = (int *)malloc((m * n) * sizeof(int));
  printf("\n");
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      printf("Ingrese el valor de M[%d][%d]:  ", i + 1, j + 1);
      scanf("%d", M + i + j + columnas);
      printf("%d-----%p\n", i + j + columnas, M);
    }
    columnas = columnas + (n - 1);
  }
  columnas = 0;
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      if (*M == 0)
        total = total + 1;
      printf(" %d ", *M);
      M++;
    }
    printf("\n");
  }
  printf("\n\n\tSe ingresaron %d ceros\n\n", total);
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
lea    0xe8e(%rip),%rdi
call   1030 <system@plt>
lea    0xe86(%rip),%rdi
mov    $0xc9,%esi
mov    $0xbb,%edx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9e(%rip),%rdi
mov    $0xcc,%esi
mov    $0xb9,%edx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
mov    $0xc8,%esi
mov    $0xbc,%edx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
call   1030 <system@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,-0x14(%rbp)
jg     1201 <main+0xc1>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1206 <main+0xc6>
cmpl   $0x0,-0x14(%rbp)
jle    11cb <main+0x8b>
jmp    1215 <main+0xd5>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,-0x18(%rbp)
jg     124b <main+0x10b>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1250 <main+0x110>
cmpl   $0x0,-0x18(%rbp)
jle    1215 <main+0xd5>
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1336 <main+0x1f6>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    131a <main+0x1da>
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
mov    -0x20(%rbp),%edx
add    $0x1,%edx
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
movslq -0x28(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xdd4(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x1c(%rbp),%esi
add    -0x20(%rbp),%esi
add    -0x28(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    129a <main+0x15a>
mov    -0x28(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1287 <main+0x147>
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    13c3 <main+0x283>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    13a7 <main+0x267>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1379 <main+0x239>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xdb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1357 <main+0x217>
lea    0xce5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1344 <main+0x204>
mov    -0x24(%rbp),%esi
lea    0xd70(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xcba(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xe7b(%rip),%rdi
call   1050 <system@plt>
lea    0xe73(%rip),%rdi
mov    $0xc9,%esi
mov    $0xbb,%edx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe8b(%rip),%rdi
mov    $0xcc,%esi
mov    $0xb9,%edx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xea3(%rip),%rdi
mov    $0xc8,%esi
mov    $0xbc,%edx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xebc(%rip),%rdi
call   1050 <system@plt>
lea    0xf06(%rip),%r14
lea    0xeaf(%rip),%r15
lea    0xc(%rsp),%rbx
lea    0xf3a(%rip),%rbp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jg     1229 <main+0xc9>
mov    %rbp,%rdi
call   1040 <puts@plt>
cmpl   $0x0,0xc(%rsp)
jle    1200 <main+0xa0>
lea    0xedf(%rip),%r14
lea    0xe64(%rip),%r15
lea    0x8(%rsp),%rbx
lea    0xeef(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <scanf@plt>
mov    0x8(%rsp),%edi
test   %edi,%edi
jg     127b <main+0x11b>
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    0x8(%rsp),%edi
test   %edi,%edi
jle    1250 <main+0xf0>
imul   0xc(%rsp),%edi
shl    $0x2,%edi
call   1070 <malloc@plt>
mov    %rax,%r12
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%r9d
test   %r9d,%r9d
jle    13d3 <main+0x273>
mov    0x8(%rsp),%eax
lea    0xdf0(%rip),%rbx
mov    %r12,%rdi
xor    %ecx,%ecx
mov    %rcx,0x10(%rsp)
xor    %ecx,%ecx
jmp    12dd <main+0x17d>
nopl   0x0(%rax)
add    %eax,%ecx
add    $0xffffffff,%ecx
movslq %r9d,%rdx
add    $0x4,%rdi
mov    %r13,%rbp
mov    %r13,0x10(%rsp)
cmp    %rdx,%r13
jge    1371 <main+0x211>
mov    0x10(%rsp),%rdx
lea    0x1(%rdx),%r13
test   %eax,%eax
jle    12c0 <main+0x160>
movslq %ecx,%rax
mov    %rdi,0x20(%rsp)
lea    (%rdi,%rax,4),%rbp
mov    %rcx,0x18(%rsp)
mov    0x10(%rsp),%rax
add    %ecx,%eax
mov    %rax,0x10(%rsp)
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
lea    0x1(%r14),%r15
mov    %rbx,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd70(%rip),%rdi
mov    %rbp,%rsi
call   1080 <scanf@plt>
add    0x10(%rsp),%r14d
lea    0xd80(%rip),%rdi
mov    %r14d,%esi
mov    %r12,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
movslq 0x8(%rsp),%rax
add    $0x4,%rbp
mov    %r15,%r14
cmp    %rax,%r15
jl     1310 <main+0x1b0>
mov    0xc(%rsp),%r9d
mov    0x20(%rsp),%rdi
mov    0x18(%rsp),%rcx
jmp    12c0 <main+0x160>
test   %r9d,%r9d
jle    13d3 <main+0x273>
lea    0xd4d(%rip),%r14
xor    %ebp,%ebp
xor    %r15d,%r15d
jmp    13a5 <main+0x245>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
cmp    0xc(%rsp),%r15d
jge    13d5 <main+0x275>
cmpl   $0x0,0x8(%rsp)
jle    1390 <main+0x230>
xor    %ebx,%ebx
xchg   %ax,%ax
mov    (%r12),%esi
cmp    $0x1,%esi
adc    $0x0,%ebp
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x4,%r12
add    $0x1,%ebx
cmp    0x8(%rsp),%ebx
jl     13b0 <main+0x250>
jmp    1390 <main+0x230>
xor    %ebp,%ebp
lea    0xcf3(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xca9(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [48 x i8] c"%c==========================================%c\0A\00"
@.str.2 = [48 x i8] c"%c=========== BIENVENIDO ===========%c\0A\00"
@.str.3 = [49 x i8] c"%c==========================================%c\0A\0A\00"
@.str.4 = [6 x i8] c"pause\00"
@.str.5 = [37 x i8] c"\0ACuantos renglones tiene su matriz?\0A\00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [37 x i8] c"Inserte un valor entero positivo...\0A\00"
@.str.8 = [36 x i8] c"\0ACuantas columnas tiene su matriz?\0A\00"
@.str.9 = [2 x i8] c"\0A\00"
@.str.10 = [33 x i8] c"Ingrese el valor de M[%d][%d]: \00"
@.str.11 = [11 x i8] c"%d-----%p\0A\00"
@.str.12 = [5 x i8] c" %d \00"
@.str.13 = [28 x i8] c"\0A\0A\09Se ingresaron %d ceros\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %7
store i32 0, i32* %8
%9 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i32 201, i32 187)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i32 204, i32 185)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i32 200, i32 188)
%13 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %14
14: ; preds = %22, %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %3)
%17 = load i32, i32* %3
%18 = icmp sle i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0))
br label %21
21: ; preds = %19, %14
br label %22
22: ; preds = %21
%23 = load i32, i32* %3
%24 = icmp sle i32 %23, 0
br i1 %24, label %14, label %25
25: ; preds = %22
br label %26
26: ; preds = %34, %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0))
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %4)
%29 = load i32, i32* %4
%30 = icmp sle i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %26
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0))
br label %33
33: ; preds = %31, %26
br label %34
34: ; preds = %33
%35 = load i32, i32* %4
%36 = icmp sle i32 %35, 0
br i1 %36, label %26, label %37
37: ; preds = %34
%38 = load i32, i32* %3
%39 = load i32, i32* %4
%40 = mul nsw i32 %38, %39
%41 = sext i32 %40 to i64
%42 = mul i64 %41, 4
%43 = trunc i64 %42 to i32
%44 = call i64 @malloc(i32 %43)
%45 = inttoptr i64 %44 to i32*
store i32* %45, i32** %2
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %5
br label %47
47: ; preds = %88, %37
%48 = load i32, i32* %5
%49 = load i32, i32* %3
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %91
51: ; preds = %47
store i32 0, i32* %6
br label %52
52: ; preds = %80, %51
%53 = load i32, i32* %6
%54 = load i32, i32* %4
%55 = icmp slt i32 %53, %54
br i1 %55, label %56, label %83
56: ; preds = %52
%57 = load i32, i32* %5
%58 = add nsw i32 %57, 1
%59 = load i32, i32* %6
%60 = add nsw i32 %59, 1
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i32 %58, i32 %60)
%62 = load i32*, i32** %2
%63 = load i32, i32* %5
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i32, i32* %62, i64 %64
%66 = load i32, i32* %6
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i32, i32* %65, i64 %67
%69 = load i32, i32* %8
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i32, i32* %68, i64 %70
%72 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %71)
%73 = load i32, i32* %5
%74 = load i32, i32* %6
%75 = add nsw i32 %73, %74
%76 = load i32, i32* %8
%77 = add nsw i32 %75, %76
%78 = load i32*, i32** %2
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i32 %77, i32* %78)
br label %80
80: ; preds = %56
%81 = load i32, i32* %6
%82 = add nsw i32 %81, 1
store i32 %82, i32* %6
br label %52
83: ; preds = %52
%84 = load i32, i32* %8
%85 = load i32, i32* %4
%86 = sub nsw i32 %85, 1
%87 = add nsw i32 %84, %86
store i32 %87, i32* %8
br label %88
88: ; preds = %83
%89 = load i32, i32* %5
%90 = add nsw i32 %89, 1
store i32 %90, i32* %5
br label %47
91: ; preds = %47
store i32 0, i32* %8
store i32 0, i32* %5
br label %92
92: ; preds = %119, %91
%93 = load i32, i32* %5
%94 = load i32, i32* %3
%95 = icmp slt i32 %93, %94
br i1 %95, label %96, label %122
96: ; preds = %92
store i32 0, i32* %6
br label %97
97: ; preds = %114, %96
%98 = load i32, i32* %6
%99 = load i32, i32* %4
%100 = icmp slt i32 %98, %99
br i1 %100, label %101, label %117
101: ; preds = %97
%102 = load i32*, i32** %2
%103 = load i32, i32* %102
%104 = icmp eq i32 %103, 0
br i1 %104, label %105, label %108
105: ; preds = %101
%106 = load i32, i32* %7
%107 = add nsw i32 %106, 1
store i32 %107, i32* %7
br label %108
108: ; preds = %105, %101
%109 = load i32*, i32** %2
%110 = load i32, i32* %109
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32 %110)
%112 = load i32*, i32** %2
%113 = getelementptr inbounds i32, i32* %112, i32 1
store i32* %113, i32** %2
br label %114
114: ; preds = %108
%115 = load i32, i32* %6
%116 = add nsw i32 %115, 1
store i32 %116, i32* %6
br label %97
117: ; preds = %97
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %119
119: ; preds = %117
%120 = load i32, i32* %5
%121 = add nsw i32 %120, 1
store i32 %121, i32* %5
br label %92
122: ; preds = %92
%123 = load i32, i32* %7
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0), i32 %123)
%125 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.1 = [48 x i8] c"%c==========================================%c\0A\00"
@.str.2 = [48 x i8] c"%c=========== BIENVENIDO ===========%c\0A\00"
@.str.3 = [49 x i8] c"%c==========================================%c\0A\0A\00"
@.str.4 = [6 x i8] c"pause\00"
@.str.6 = [3 x i8] c"%d\00"
@.str.10 = [33 x i8] c"Ingrese el valor de M[%d][%d]: \00"
@.str.11 = [11 x i8] c"%d-----%p\0A\00"
@.str.12 = [5 x i8] c" %d \00"
@.str.13 = [28 x i8] c"\0A\0A\09Se ingresaron %d ceros\0A\0A\00"
@str = [36 x i8] c"\0ACuantos renglones tiene su matriz?\00"
@str.14 = [35 x i8] c"\0ACuantas columnas tiene su matriz?\00"
@str.16 = [36 x i8] c"Inserte un valor entero positivo...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i32 201, i32 187)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i32 204, i32 185)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i32 200, i32 188)
%9 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %10
10: ; preds = %15, %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %1)
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 1
br i1 %14, label %15, label %19
15: ; preds = %10
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.16, i64 0, i64 0))
%17 = load i32, i32* %1
%18 = icmp slt i32 %17, 1
br i1 %18, label %10, label %19
19: ; preds = %10, %15
br label %20
20: ; preds = %19, %25
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.14, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%23 = load i32, i32* %2
%24 = icmp slt i32 %23, 1
br i1 %24, label %25, label %29
25: ; preds = %20
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.16, i64 0, i64 0))
%27 = load i32, i32* %2
%28 = icmp slt i32 %27, 1
br i1 %28, label %20, label %29
29: ; preds = %20, %25
%30 = phi i32 [ %27, %25 ], [ %23, %20 ]
%31 = load i32, i32* %1
%32 = shl i32 %30, 2
%33 = mul i32 %32, %31
%34 = call i64 @malloc(i32 %33)
%35 = inttoptr i64 %34 to i32*
%36 = call i32 @putchar(i32 10)
%37 = load i32, i32* %1
%38 = icmp sgt i32 %37, 0
br i1 %38, label %39, label %105
39: ; preds = %29
%40 = load i32, i32* %2
br label %41
41: ; preds = %39, %72
%42 = phi i32 [ %37, %39 ], [ %73, %72 ]
%43 = phi i32 [ %40, %39 ], [ %74, %72 ]
%44 = phi i64 [ 0, %39 ], [ %47, %72 ]
%45 = phi i32 [ 0, %39 ], [ %76, %72 ]
%46 = icmp sgt i32 %43, 0
%47 = add nuw nsw i64 %44, 1
br i1 %46, label %48, label %72
48: ; preds = %41
%49 = getelementptr inbounds i32, i32* %35, i64 %44
%50 = sext i32 %45 to i64
%51 = trunc i64 %44 to i32
%52 = add i32 %45, %51
%53 = trunc i64 %47 to i32
%54 = getelementptr inbounds i32, i32* %49, i64 %50
br label %57
55: ; preds = %72
%56 = icmp sgt i32 %73, 0
br i1 %56, label %79, label %105
57: ; preds = %48, %57
%58 = phi i64 [ 0, %48 ], [ %59, %57 ]
%59 = add nuw nsw i64 %58, 1
%60 = trunc i64 %59 to i32
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i32 %53, i32 %60)
%62 = getelementptr inbounds i32, i32* %54, i64 %58
%63 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %62)
%64 = trunc i64 %58 to i32
%65 = add i32 %52, %64
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i32 %65, i32* %35)
%67 = load i32, i32* %2
%68 = sext i32 %67 to i64
%69 = icmp slt i64 %59, %68
br i1 %69, label %57, label %70
70: ; preds = %57
%71 = load i32, i32* %1
br label %72
72: ; preds = %41, %70
%73 = phi i32 [ %71, %70 ], [ %42, %41 ]
%74 = phi i32 [ %67, %70 ], [ %43, %41 ]
%75 = add i32 %45, -1
%76 = add i32 %75, %74
%77 = sext i32 %73 to i64
%78 = icmp slt i64 %47, %77
br i1 %78, label %41, label %55
79: ; preds = %55, %98
%80 = phi i32 [ %100, %98 ], [ 0, %55 ]
%81 = phi i32 [ %102, %98 ], [ 0, %55 ]
%82 = phi i32* [ %99, %98 ], [ %35, %55 ]
%83 = load i32, i32* %2
%84 = icmp sgt i32 %83, 0
br i1 %84, label %85, label %98
85: ; preds = %79, %85
%86 = phi i32 [ %92, %85 ], [ %80, %79 ]
%87 = phi i32 [ %95, %85 ], [ 0, %79 ]
%88 = phi i32* [ %94, %85 ], [ %82, %79 ]
%89 = load i32, i32* %88
%90 = icmp eq i32 %89, 0
%91 = zext i1 %90 to i32
%92 = add nsw i32 %86, %91
%93 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32 %89)
%94 = getelementptr inbounds i32, i32* %88, i64 1
%95 = add nuw nsw i32 %87, 1
%96 = load i32, i32* %2
%97 = icmp slt i32 %95, %96
br i1 %97, label %85, label %98
98: ; preds = %85, %79
%99 = phi i32* [ %82, %79 ], [ %94, %85 ]
%100 = phi i32 [ %80, %79 ], [ %92, %85 ]
%101 = call i32 @putchar(i32 10)
%102 = add nuw nsw i32 %81, 1
%103 = load i32, i32* %1
%104 = icmp slt i32 %102, %103
br i1 %104, label %79, label %105
105: ; preds = %98, %29, %55
%106 = phi i32 [ 0, %55 ], [ 0, %29 ], [ %100, %98 ]
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0), i32 %106)
%108 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}