#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 input(int x[5][5], int m, int n) {
  int i, j;
  printf("Enter the values of matrix \n");
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      printf("Enter the values of matrix [%d][%d]:", i, j);
      scanf("%d", &x[i][j]);
    }
  }
}


x86 assembly (clang, -O0):
<input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c1 <input+0xa1>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11ae <input+0x8e>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rax
imul   $0x14,%rax,%rax
add    %rax,%rsi
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea7(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115a <input+0x3a>
jmp    11b3 <input+0x93>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <input+0x27>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,0x4(%rsp)
mov    %esi,%ebx
mov    %rdi,0x8(%rsp)
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
test   %ebx,%ebx
jle    11c9 <input+0x99>
mov    %ebx,%eax
mov    %rax,0x10(%rsp)
mov    0x4(%rsp),%r15d
lea    0xe94(%rip),%r12
lea    0xeb2(%rip),%r13
xor    %ebp,%ebp
jmp    1191 <input+0x61>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbp
addq   $0x14,0x8(%rsp)
cmp    0x10(%rsp),%rbp
je     11c9 <input+0x99>
cmpl   $0x0,0x4(%rsp)
jle    1180 <input+0x50>
mov    0x8(%rsp),%rbx
xor    %r14d,%r14d
mov    %r12,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
add    $0x1,%r14
add    $0x4,%rbx
cmp    %r14,%r15
jne    11a0 <input+0x70>
jmp    1180 <input+0x50>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [37 x i8] c"Enter the values of matrix [%d][%d]:\00"
@.str.2 = [3 x i8] c"%d\00"
@str = [28 x i8] c"Enter the values of matrix \00"
define void @input([5 x i32]* %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %25
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, %22
%11 = phi i64 [ 0, %6 ], [ %23, %22 ]
br i1 %7, label %12, label %22
12: ; preds = %10
%13 = trunc i64 %11 to i32
br label %14
14: ; preds = %12, %14
%15 = phi i64 [ 0, %12 ], [ %20, %14 ]
%16 = trunc i64 %15 to i32
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %16)
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 %11, i64 %15
%19 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %18)
%20 = add nuw nsw i64 %15, 1
%21 = icmp eq i64 %20, %9
br i1 %21, label %22, label %14
22: ; preds = %14, %10
%23 = add nuw nsw i64 %11, 1
%24 = icmp eq i64 %23, %8
br i1 %24, label %25, label %10
25: ; preds = %22, %3
ret void
}