#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*/ scanf(char *, int *, ...);
int main() {
  int n, m, i, j, k;
  scanf("%d %d", &n, &m);
  int table[n][m];
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++)
      scanf("%d", &table[i][j]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
xor    %eax,%eax
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
mov    %rax,-0x40(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,%rdx
imul   %rax,%rdx
lea    0xf(,%rdx,4),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x38(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11e7 <main+0xd7>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11d4 <main+0xc4>
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rcx
movslq -0x10(%rbp),%rax
imul   %rcx,%rax
shl    $0x2,%rax
add    %rax,%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118a <main+0x7a>
jmp    11d9 <main+0xc9>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1177 <main+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%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    $0x18,%rsp
lea    0xed8(%rip),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
xor    %eax,%eax
call   1030 <scanf@plt>
mov    %rsp,-0x40(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x2c(%rbp),%ecx
mov    %rcx,-0x38(%rbp)
imul   %rcx,%rax
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r13
sub    %rax,%r13
mov    %r13,%rsp
mov    -0x30(%rbp),%ecx
test   %ecx,%ecx
jle    11c3 <main+0xb3>
mov    -0x2c(%rbp),%eax
shlq   $0x2,-0x38(%rbp)
lea    0xe8f(%rip),%r14
xor    %r15d,%r15d
jmp    1190 <main+0x80>
nopl   0x0(%rax)
add    $0x1,%r15
movslq %ecx,%rdx
add    -0x38(%rbp),%r13
cmp    %rdx,%r15
jge    11c3 <main+0xb3>
test   %eax,%eax
jle    1180 <main+0x70>
mov    %r13,%rbx
xor    %r12d,%r12d
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <scanf@plt>
add    $0x1,%r12
movslq -0x2c(%rbp),%rax
add    $0x4,%rbx
cmp    %rax,%r12
jl     11a0 <main+0x90>
mov    -0x30(%rbp),%ecx
jmp    1180 <main+0x70>
mov    -0x40(%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 = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
store i32 0, i32* %1
%10 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, 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 = call i8* @llvm.stacksave()
store i8* %15, i8** %7
%16 = mul nuw i64 %12, %14
%17 = alloca i32, i64 %16
store i64 %12, i64* %8
store i64 %14, i64* %9
store i32 0, i32* %4
br label %18
18: ; preds = %40, %0
%19 = load i32, i32* %4
%20 = load i32, i32* %2
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %43
22: ; preds = %18
store i32 0, i32* %5
br label %23
23: ; preds = %36, %22
%24 = load i32, i32* %5
%25 = load i32, i32* %3
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %39
27: ; preds = %23
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = mul nsw i64 %29, %14
%31 = getelementptr inbounds i32, i32* %17, i64 %30
%32 = load i32, i32* %5
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %31, i64 %33
%35 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %34)
br label %36
36: ; preds = %27
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %23
39: ; preds = %23
br label %40
40: ; preds = %39
%41 = load i32, i32* %4
%42 = add nsw i32 %41, 1
store i32 %42, i32* %4
br label %18
43: ; preds = %18
store i32 0, i32* %1
%44 = load i8*, i8** %7
%45 = load i32, i32* %1
ret i32 %45
}

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