#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*/ T_sparse(int, int **);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ transpose(int **, int **);
int main() {
  int i;
  int j;
  int k = 1;
  int sum = 0;
  int row_size;
  int column_size;
  int arr1[sum][3];
  printf("Enter the number of array's rows: ");
  scanf("%d", &row_size);
  printf("Enter the number of array's columns: ");
  scanf("%d", &column_size);
  int array1[row_size][column_size];
  printf("Enter the elements of the array: \n");
  for (i = 0; i < row_size; i++) {
    for (j = 0; j < column_size; j++) {
      printf("Enter element[%d][%d]: ", i, j);
      scanf("%d", &array1[i][j]);
      if (array1[i][j] != 0) {
        sum = sum + 1;
        arr1[k][0] = i;
        arr1[k][1] = j;
        arr1[k][2] = array1[i][j];
        k++;
      }
    }
  }
  arr1[0][0] = row_size;
  arr1[0][1] = column_size;
  arr1[0][2] = sum;
  printf("\n*The Sparse Matrix*\n");
  printf("\nRow\tColumn\tValue\n");
  for (i = 0; i <= sum; i++)
    printf("%d\t%d\t%d\n", arr1[i][0], arr1[i][1], arr1[i][2]);
  int arr2[sum][3];
  transpose(arr1, arr2);
  T_sparse(sum, arr2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    (%rax,%rax,2),%rcx
lea    0xf(,%rcx,4),%rdx
movabs $0x1ffffffff0,%rcx
and    %rcx,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
lea    0xe65(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x61(%rbp)
call   1030 <printf@plt>
lea    0xe77(%rip),%rdi
mov    %rdi,-0x60(%rbp)
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x61(%rbp),%al
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
mov    -0x60(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
mov    %rax,-0x58(%rbp)
mov    %rcx,%rdx
imul   %rax,%rdx
lea    0xf(,%rdx,4),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x50(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x38(%rbp)
mov    %rax,-0x40(%rbp)
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1333 <main+0x1f3>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1320 <main+0x1e0>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x58(%rbp),%rcx
mov    -0x50(%rbp),%rsi
movslq -0x8(%rbp),%rax
imul   %rcx,%rax
shl    $0x2,%rax
add    %rax,%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xda9(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x58(%rbp),%rdx
mov    -0x50(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     130d <main+0x1cd>
mov    -0x70(%rbp),%rax
mov    -0x50(%rbp),%rcx
mov    -0x58(%rbp),%rsi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
movslq -0x10(%rbp),%rdx
imul   $0xc,%rdx,%r8
mov    %rax,%rdx
add    %r8,%rdx
mov    %edi,(%rdx)
mov    -0xc(%rbp),%edi
movslq -0x10(%rbp),%rdx
imul   $0xc,%rdx,%r8
mov    %rax,%rdx
add    %r8,%rdx
mov    %edi,0x4(%rdx)
movslq -0x8(%rbp),%rdx
imul   %rsi,%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
movslq -0xc(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
movslq -0x10(%rbp),%rdx
imul   $0xc,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,0x8(%rax)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1312 <main+0x1d2>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1231 <main+0xf1>
jmp    1325 <main+0x1e5>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    121e <main+0xde>
mov    -0x70(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    %ecx,0x4(%rax)
mov    -0x14(%rbp),%ecx
mov    %ecx,0x8(%rax)
lea    0xd38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     13c6 <main+0x286>
mov    -0x70(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   $0xc,%rcx,%rdx
mov    %rax,%rcx
add    %rdx,%rcx
mov    (%rcx),%esi
movslq -0x8(%rbp),%rcx
imul   $0xc,%rcx,%rdx
mov    %rax,%rcx
add    %rdx,%rcx
mov    0x4(%rcx),%edx
movslq -0x8(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    0x8(%rax),%ecx
lea    0xcff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    136b <main+0x22b>
mov    -0x70(%rbp),%rdi
mov    -0x14(%rbp),%eax
lea    (%rax,%rax,2),%rcx
lea    0xf(,%rcx,4),%rcx
movabs $0x1ffffffff0,%rdx
and    %rdx,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,-0x78(%rbp)
mov    %rsi,%rsp
mov    %rax,-0x48(%rbp)
call   1040 <transpose@plt>
mov    -0x78(%rbp),%rsi
mov    -0x14(%rbp),%edi
call   1060 <T_sparse@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsp,-0x48(%rbp)
lea    0xe94(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea6(%rip),%rbx
lea    -0x38(%rbp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xe96(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    -0x34(%rbp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    -0x38(%rbp),%eax
mov    -0x34(%rbp),%r15d
imul   %r15,%rax
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r12
sub    %rax,%r12
mov    %r12,%rsp
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
mov    -0x38(%rbp),%r13d
mov    -0x34(%rbp),%ebx
test   %r13d,%r13d
jle    1287 <main+0x137>
shl    $0x2,%r15
lea    0xe62(%rip),%rdx
xor    %esi,%esi
xor    %r14d,%r14d
mov    %r15,-0x50(%rbp)
jmp    120f <main+0xbf>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rsi
movslq %r13d,%rax
add    %r15,%r12
cmp    %rax,%rsi
jge    1287 <main+0x137>
test   %ebx,%ebx
jle    1200 <main+0xb0>
xor    %r15d,%r15d
mov    %r12,-0x40(%rbp)
xor    %r12d,%r12d
mov    %rsi,-0x58(%rbp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rdx,%rbx
mov    %rdx,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x40(%rbp),%r13
lea    (%r15,%r13,1),%rsi
lea    0xdd4(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x58(%rbp),%rsi
mov    %rbx,%rdx
cmpl   $0x1,0x0(%r13,%r12,4)
sbb    $0xffffffff,%r14d
add    $0x1,%r12
movslq -0x34(%rbp),%rbx
add    $0x4,%r15
cmp    %rbx,%r12
jl     1230 <main+0xe0>
mov    -0x38(%rbp),%r13d
mov    -0x50(%rbp),%r15
mov    -0x40(%rbp),%r12
jmp    1200 <main+0xb0>
mov    %r13d,-0x30(%rbp)
mov    %ebx,-0x2c(%rbp)
mov    %r14d,-0x28(%rbp)
lea    0xdf7(%rip),%rdi
call   1030 <puts@plt>
lea    0xe00(%rip),%rdi
call   1030 <puts@plt>
test   %r14d,%r14d
js     12db <main+0x18b>
mov    $0xffffffff,%r12d
lea    0xda8(%rip),%r15
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %r13d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r12d
cmp    %r12d,%r14d
jne    12c0 <main+0x170>
mov    %r14d,%eax
lea    (%rax,%rax,2),%rax
lea    0xf(,%rax,4),%rax
movabs $0x1ffffffff0,%rcx
and    %rax,%rcx
mov    %rsp,%rbx
sub    %rcx,%rbx
mov    %rbx,%rsp
lea    -0x30(%rbp),%rdi
mov    %rbx,%rsi
call   1050 <transpose@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
call   1070 <T_sparse@plt>
mov    -0x48(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Enter the number of array's rows: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [38 x i8] c"Enter the number of array's columns: \00"
@.str.3 = [35 x i8] c"Enter the elements of the array: \0A\00"
@.str.4 = [24 x i8] c"Enter element[%d][%d]: \00"
@.str.5 = [22 x i8] c"\0A*The Sparse Matrix*\0A\00"
@.str.6 = [19 x i8] c"\0ARow\09Column\09Value\0A\00"
@.str.7 = [10 x i8] c"%d\09%d\09%d\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 i8*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
store i32 0, i32* %1
store i32 1, i32* %4
store i32 0, i32* %5
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = call i8* @llvm.stacksave()
store i8* %15, i8** %8
%16 = alloca [3 x i32], i64 %14
store i64 %14, i64* %9
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%21 = load i32, i32* %6
%22 = zext i32 %21 to i64
%23 = load i32, i32* %7
%24 = zext i32 %23 to i64
%25 = mul nuw i64 %22, %24
%26 = alloca i32, i64 %25
store i64 %22, i64* %10
store i64 %24, i64* %11
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %28
28: ; preds = %90, %0
%29 = load i32, i32* %2
%30 = load i32, i32* %6
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %93
32: ; preds = %28
store i32 0, i32* %3
br label %33
33: ; preds = %86, %32
%34 = load i32, i32* %3
%35 = load i32, i32* %7
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %89
37: ; preds = %33
%38 = load i32, i32* %2
%39 = load i32, i32* %3
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %38, i32 %39)
%41 = load i32, i32* %2
%42 = sext i32 %41 to i64
%43 = mul nsw i64 %42, %24
%44 = getelementptr inbounds i32, i32* %26, i64 %43
%45 = load i32, i32* %3
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i32, i32* %44, i64 %46
%48 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %47)
%49 = load i32, i32* %2
%50 = sext i32 %49 to i64
%51 = mul nsw i64 %50, %24
%52 = getelementptr inbounds i32, i32* %26, i64 %51
%53 = load i32, i32* %3
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i32, i32* %52, i64 %54
%56 = load i32, i32* %55
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %85
58: ; preds = %37
%59 = load i32, i32* %5
%60 = add nsw i32 %59, 1
store i32 %60, i32* %5
%61 = load i32, i32* %2
%62 = load i32, i32* %4
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 %63
%65 = getelementptr inbounds [3 x i32], [3 x i32]* %64, i64 0, i64 0
store i32 %61, i32* %65
%66 = load i32, i32* %3
%67 = load i32, i32* %4
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 %68
%70 = getelementptr inbounds [3 x i32], [3 x i32]* %69, i64 0, i64 1
store i32 %66, i32* %70
%71 = load i32, i32* %2
%72 = sext i32 %71 to i64
%73 = mul nsw i64 %72, %24
%74 = getelementptr inbounds i32, i32* %26, i64 %73
%75 = load i32, i32* %3
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i32, i32* %74, i64 %76
%78 = load i32, i32* %77
%79 = load i32, i32* %4
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 %80
%82 = getelementptr inbounds [3 x i32], [3 x i32]* %81, i64 0, i64 2
store i32 %78, i32* %82
%83 = load i32, i32* %4
%84 = add nsw i32 %83, 1
store i32 %84, i32* %4
br label %85
85: ; preds = %58, %37
br label %86
86: ; preds = %85
%87 = load i32, i32* %3
%88 = add nsw i32 %87, 1
store i32 %88, i32* %3
br label %33
89: ; preds = %33
br label %90
90: ; preds = %89
%91 = load i32, i32* %2
%92 = add nsw i32 %91, 1
store i32 %92, i32* %2
br label %28
93: ; preds = %28
%94 = load i32, i32* %6
%95 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 0
%96 = getelementptr inbounds [3 x i32], [3 x i32]* %95, i64 0, i64 0
store i32 %94, i32* %96
%97 = load i32, i32* %7
%98 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 0
%99 = getelementptr inbounds [3 x i32], [3 x i32]* %98, i64 0, i64 1
store i32 %97, i32* %99
%100 = load i32, i32* %5
%101 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 0
%102 = getelementptr inbounds [3 x i32], [3 x i32]* %101, i64 0, i64 2
store i32 %100, i32* %102
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %2
br label %105
105: ; preds = %126, %93
%106 = load i32, i32* %2
%107 = load i32, i32* %5
%108 = icmp sle i32 %106, %107
br i1 %108, label %109, label %129
109: ; preds = %105
%110 = load i32, i32* %2
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 %111
%113 = getelementptr inbounds [3 x i32], [3 x i32]* %112, i64 0, i64 0
%114 = load i32, i32* %113
%115 = load i32, i32* %2
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 %116
%118 = getelementptr inbounds [3 x i32], [3 x i32]* %117, i64 0, i64 1
%119 = load i32, i32* %118
%120 = load i32, i32* %2
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 %121
%123 = getelementptr inbounds [3 x i32], [3 x i32]* %122, i64 0, i64 2
%124 = load i32, i32* %123
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 %114, i32 %119, i32 %124)
br label %126
126: ; preds = %109
%127 = load i32, i32* %2
%128 = add nsw i32 %127, 1
store i32 %128, i32* %2
br label %105
129: ; preds = %105
%130 = load i32, i32* %5
%131 = zext i32 %130 to i64
%132 = alloca [3 x i32], i64 %131
store i64 %131, i64* %12
%133 = bitcast [3 x i32]* %16 to i32**
%134 = bitcast [3 x i32]* %132 to i32**
%135 = call i32 @transpose(i32** %133, i32** %134)
%136 = load i32, i32* %5
%137 = bitcast [3 x i32]* %132 to i32**
%138 = call i32 @T_sparse(i32 %136, i32** %137)
store i32 0, i32* %1
%139 = load i8*, i8** %8
%140 = load i32, i32* %1
ret i32 %140
}

LLVM IR (-O2):
@.str = [35 x i8] c"Enter the number of array's rows: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [38 x i8] c"Enter the number of array's columns: \00"
@.str.4 = [24 x i8] c"Enter element[%d][%d]: \00"
@.str.7 = [10 x i8] c"%d\09%d\09%d\0A\00"
@str = [34 x i8] c"Enter the elements of the array: \00"
@str.8 = [21 x i8] c"\0A*The Sparse Matrix*\00"
@str.9 = [18 x i8] c"\0ARow\09Column\09Value\00"
define i32 @main() {
%1 = alloca [0 x [3 x i32]]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = tail call i8* @llvm.stacksave()
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 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* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 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)
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %3
%14 = zext i32 %13 to i64
%15 = mul nuw i64 %14, %12
%16 = alloca i32, i64 %15
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%18 = load i32, i32* %2
%19 = icmp sgt i32 %18, 0
%20 = load i32, i32* %3
br i1 %19, label %21, label %55
21: ; preds = %0, %48
%22 = phi i32 [ %49, %48 ], [ %18, %0 ]
%23 = phi i32 [ %50, %48 ], [ %20, %0 ]
%24 = phi i64 [ %52, %48 ], [ 0, %0 ]
%25 = phi i32 [ %51, %48 ], [ 0, %0 ]
%26 = icmp sgt i32 %23, 0
br i1 %26, label %27, label %48
27: ; preds = %21
%28 = mul nuw nsw i64 %24, %14
%29 = getelementptr inbounds i32, i32* %16, i64 %28
%30 = trunc i64 %24 to i32
br label %31
31: ; preds = %27, %31
%32 = phi i64 [ 0, %27 ], [ %42, %31 ]
%33 = phi i32 [ %25, %27 ], [ %41, %31 ]
%34 = trunc i64 %32 to i32
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %30, i32 %34)
%36 = getelementptr inbounds i32, i32* %29, i64 %32
%37 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %36)
%38 = load i32, i32* %36
%39 = icmp ne i32 %38, 0
%40 = zext i1 %39 to i32
%41 = add nsw i32 %33, %40
%42 = add nuw nsw i64 %32, 1
%43 = load i32, i32* %3
%44 = sext i32 %43 to i64
%45 = icmp slt i64 %42, %44
br i1 %45, label %31, label %46
46: ; preds = %31
%47 = load i32, i32* %2
br label %48
48: ; preds = %46, %21
%49 = phi i32 [ %22, %21 ], [ %47, %46 ]
%50 = phi i32 [ %23, %21 ], [ %43, %46 ]
%51 = phi i32 [ %25, %21 ], [ %41, %46 ]
%52 = add nuw nsw i64 %24, 1
%53 = sext i32 %49 to i64
%54 = icmp slt i64 %52, %53
br i1 %54, label %21, label %55
55: ; preds = %48, %0
%56 = phi i32 [ %20, %0 ], [ %50, %48 ]
%57 = phi i32 [ 0, %0 ], [ %51, %48 ]
%58 = phi i32 [ %18, %0 ], [ %49, %48 ]
%59 = getelementptr inbounds [0 x [3 x i32]], [0 x [3 x i32]]* %1, i64 0, i64 0, i64 0
store i32 %58, i32* %59
%60 = getelementptr inbounds [0 x [3 x i32]], [0 x [3 x i32]]* %1, i64 0, i64 0, i64 1
store i32 %56, i32* %60
%61 = getelementptr inbounds [0 x [3 x i32]], [0 x [3 x i32]]* %1, i64 0, i64 0, i64 2
store i32 %57, i32* %61
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.8, i64 0, i64 0))
%63 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.9, i64 0, i64 0))
%64 = icmp slt i32 %57, 0
br i1 %64, label %70, label %65
65: ; preds = %55, %65
%66 = phi i32 [ %68, %65 ], [ 0, %55 ]
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 %58, i32 %56, i32 %57)
%68 = add nuw i32 %66, 1
%69 = icmp eq i32 %66, %57
br i1 %69, label %70, label %65
70: ; preds = %65, %55
%71 = zext i32 %57 to i64
%72 = alloca [3 x i32], i64 %71
%73 = bitcast [0 x [3 x i32]]* %1 to i32**
%74 = bitcast [3 x i32]* %72 to i32**
%75 = call i32 @transpose(i32** %73, i32** %74)
%76 = call i32 @T_sparse(i32 %57, i32** %74)
ret i32 0
}