#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *);
void fill_D_array(int ROW, int COL, int strTwoD[][COL]) {
  int row, col;
  for (row = 0; row < ROW; row++) {
    for (col = 0; col < COL; col++) {
      if ((scanf("%d", &strTwoD[row][col])) != 1) {
        printf("Not digit!");
        exit(EXIT_FAILURE);
      }
    }
  }
}


x86 assembly (clang, -O0):
<fill_D_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11e6 <fill_D_array+0xb6>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d3 <fill_D_array+0xa3>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
imul   %rcx,%rax
shl    $0x2,%rax
add    %rax,%rsi
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe68(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     11c0 <fill_D_array+0x90>
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
jmp    11c5 <fill_D_array+0x95>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1163 <fill_D_array+0x33>
jmp    11d8 <fill_D_array+0xa8>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1150 <fill_D_array+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_D_array>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %esi,0x4(%rsp)
test   %edi,%edi
jle    11ac <fill_D_array+0x7c>
mov    %rdx,%r15
mov    0x4(%rsp),%eax
mov    %edi,%ecx
mov    %rcx,0x8(%rsp)
mov    %rax,0x10(%rsp)
lea    0x0(,%rax,4),%r14
xor    %r13d,%r13d
lea    0xe95(%rip),%rbp
jmp    117e <fill_D_array+0x4e>
nopl   (%rax)
add    $0x1,%r13
add    %r14,%r15
cmp    0x8(%rsp),%r13
je     11ac <fill_D_array+0x7c>
mov    0x10(%rsp),%r12
mov    %r15,%rbx
cmpl   $0x0,0x4(%rsp)
jle    1170 <fill_D_array+0x40>
nopl   (%rax)
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11bb <fill_D_array+0x8b>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r12
jne    1190 <fill_D_array+0x60>
jmp    1170 <fill_D_array+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e12(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
define void @fill_D_array(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%9 = load i32, i32* %5
%10 = zext i32 %9 to i64
store i32 0, i32* %7
br label %11
11: ; preds = %40, %3
%12 = load i32, i32* %7
%13 = load i32, i32* %4
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %43
15: ; preds = %11
store i32 0, i32* %8
br label %16
16: ; preds = %36, %15
%17 = load i32, i32* %8
%18 = load i32, i32* %5
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %39
20: ; preds = %16
%21 = load i32*, i32** %6
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = mul nsw i64 %23, %10
%25 = getelementptr inbounds i32, i32* %21, i64 %24
%26 = load i32, i32* %8
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %28)
%30 = icmp ne i32 %29, 1
br i1 %30, label %31, label %35
31: ; preds = %20
%32 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%33 = load i32, i32* @EXIT_FAILURE
%34 = call i32 @exit(i32 %33)
unreachable
35: ; preds = %20
br label %36
36: ; preds = %35
%37 = load i32, i32* %8
%38 = add nsw i32 %37, 1
store i32 %38, i32* %8
br label %16
39: ; preds = %16
br label %40
40: ; preds = %39
%41 = load i32, i32* %7
%42 = add nsw i32 %41, 1
store i32 %42, i32* %7
br label %11
43: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
define void @fill_D_array(i32 %0, i32 %1, i32* %2) {
%4 = zext i32 %1 to i64
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %29
6: ; preds = %3
%7 = icmp sgt i32 %1, 0
%8 = zext i32 %0 to i64
br label %9
9: ; preds = %6, %26
%10 = phi i64 [ 0, %6 ], [ %27, %26 ]
br i1 %7, label %11, label %26
11: ; preds = %9
%12 = mul nuw nsw i64 %10, %4
%13 = getelementptr inbounds i32, i32* %2, i64 %12
br label %16
14: ; preds = %16
%15 = icmp eq i64 %21, %4
br i1 %15, label %26, label %16
16: ; preds = %11, %14
%17 = phi i64 [ 0, %11 ], [ %21, %14 ]
%18 = getelementptr inbounds i32, i32* %13, i64 %17
%19 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %18)
%20 = icmp eq i32 %19, 1
%21 = add nuw nsw i64 %17, 1
br i1 %20, label %14, label %22
22: ; preds = %16
%23 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%24 = load i32, i32* @EXIT_FAILURE
%25 = tail call i32 @exit(i32 %24)
unreachable
26: ; preds = %14, %9
%27 = add nuw nsw i64 %10, 1
%28 = icmp eq i64 %27, %8
br i1 %28, label %29, label %9
29: ; preds = %26, %3
ret void
}