#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 *);
void fnGetMatrix(int iaMat[][10], int iM, int iN) {
  int i, j;
  printf("\nEnter the elements\n");
  for (i = 0; i < iM; i++)
    for (j = 0; j < iN; j++)
      scanf("%d", &iaMat[i][j]);
}


x86 assembly (clang, -O0):
<fnGetMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ab <fnGetMatrix+0x8b>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1198 <fnGetMatrix+0x78>
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rax
imul   $0x28,%rax,%rax
add    %rax,%rsi
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe90(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1158 <fnGetMatrix+0x38>
jmp    119d <fnGetMatrix+0x7d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <fnGetMatrix+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnGetMatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,0xc(%rsp)
mov    %esi,%ebx
mov    %rdi,%r15
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
test   %ebx,%ebx
jle    1197 <fnGetMatrix+0x77>
mov    %ebx,%r12d
mov    0xc(%rsp),%eax
mov    %rax,0x10(%rsp)
xor    %r13d,%r13d
lea    0xea3(%rip),%rbp
jmp    116d <fnGetMatrix+0x4d>
nop
add    $0x1,%r13
add    $0x28,%r15
cmp    %r12,%r13
je     1197 <fnGetMatrix+0x77>
cmpl   $0x0,0xc(%rsp)
jle    1160 <fnGetMatrix+0x40>
mov    0x10(%rsp),%r14
mov    %r15,%rbx
nopl   0x0(%rax)
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r14
jne    1180 <fnGetMatrix+0x60>
jmp    1160 <fnGetMatrix+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [20 x i8] c"\0AEnter the elements\00"
define void @fnGetMatrix([10 x i32]* %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %21
6: ; preds = %3
%7 = icmp sgt i32 %2, 0
%8 = zext i32 %1 to i64
%9 = zext i32 %2 to i64
br label %10
10: ; preds = %6, %18
%11 = phi i64 [ 0, %6 ], [ %19, %18 ]
br i1 %7, label %12, label %18
12: ; preds = %10, %12
%13 = phi i64 [ %16, %12 ], [ 0, %10 ]
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 %11, i64 %13
%15 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = add nuw nsw i64 %13, 1
%17 = icmp eq i64 %16, %9
br i1 %17, label %18, label %12
18: ; preds = %12, %10
%19 = add nuw nsw i64 %11, 1
%20 = icmp eq i64 %19, %8
br i1 %20, label %21, label %10
21: ; preds = %18, %3
ret void
}