int main() {
  int x, y, z, a[2][2][4];
  for (z = 0; z < 2; z++)
    for (printf("%s 번째 배열\n", z ? "두" : "첫"), y = 0; y < 2; y++)
      for (x = 0; x < 4; x++)
        scanf("%d", &a[z][y][x]);
  for (y = 0; y < 2; y++, printf("\n"))
    for (x = 0; x < 4; x++)
      printf("%d ", a[0][y][x] * a[1][y][x]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    11ef <main+0xcf>
mov    -0x10(%rbp),%ecx
lea    0xecc(%rip),%rsi
lea    0xec1(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    11dc <main+0xbc>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    11c9 <main+0xa9>
movslq -0x10(%rbp),%rax
lea    -0x50(%rbp),%rsi
shl    $0x5,%rax
add    %rax,%rsi
movslq -0xc(%rbp),%rax
shl    $0x4,%rax
add    %rax,%rsi
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117e <main+0x5e>
jmp    11ce <main+0xae>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116d <main+0x4d>
jmp    11e1 <main+0xc1>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <main+0x16>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    127f <main+0x15f>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    125e <main+0x13e>
lea    -0x50(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    -0x50(%rbp),%rax
add    $0x20,%rax
movslq -0xc(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
imul   (%rax,%rcx,4),%esi
lea    0xdd4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1207 <main+0xe7>
jmp    1263 <main+0x143>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xd9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f6 <main+0xd6>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
lea    0xec2(%rip),%r14
lea    0xed1(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe3f(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x2c(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x34(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x38(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x3c(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x20(%rsp),%esi
imul   (%rsp),%esi
lea    0xdb9(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%esi
imul   0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x28(%rsp),%esi
imul   0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2c(%rsp),%esi
imul   0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x30(%rsp),%esi
imul   0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x34(%rsp),%esi
imul   0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x38(%rsp),%esi
imul   0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x3c(%rsp),%esi
imul   0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%s \EB\B2\88\EC\A7\B8 \EB\B0\B0\EC\97\B4\0A\00"
@.str.1 = [4 x i8] c"\EB\91\90\00"
@.str.2 = [4 x i8] c"\EC\B2\AB\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [4 x i8] c"%d \00"
@.str.5 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x [2 x [4 x i32]]]
store i32 0, i32* %1
store i32 0, i32* %4
br label %6
6: ; preds = %41, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %44
9: ; preds = %6
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %13)
store i32 0, i32* %3
br label %15
15: ; preds = %37, %9
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 2
br i1 %17, label %18, label %40
18: ; preds = %15
store i32 0, i32* %2
br label %19
19: ; preds = %33, %18
%20 = load i32, i32* %2
%21 = icmp slt i32 %20, 4
br i1 %21, label %22, label %36
22: ; preds = %19
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %5, i64 0, i64 %24
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [2 x [4 x i32]], [2 x [4 x i32]]* %25, i64 0, i64 %27
%29 = load i32, i32* %2
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [4 x i32], [4 x i32]* %28, i64 0, i64 %30
%32 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %31)
br label %33
33: ; preds = %22
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %2
br label %19
36: ; preds = %19
br label %37
37: ; preds = %36
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 1
store i32 %39, i32* %3
br label %15
40: ; preds = %15
br label %41
41: ; preds = %40
%42 = load i32, i32* %4
%43 = add nsw i32 %42, 1
store i32 %43, i32* %4
br label %6
44: ; preds = %6
store i32 0, i32* %3
br label %45
45: ; preds = %75, %44
%46 = load i32, i32* %3
%47 = icmp slt i32 %46, 2
br i1 %47, label %48, label %79
48: ; preds = %45
store i32 0, i32* %2
br label %49
49: ; preds = %71, %48
%50 = load i32, i32* %2
%51 = icmp slt i32 %50, 4
br i1 %51, label %52, label %74
52: ; preds = %49
%53 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %5, i64 0, i64 0
%54 = load i32, i32* %3
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [2 x [4 x i32]], [2 x [4 x i32]]* %53, i64 0, i64 %55
%57 = load i32, i32* %2
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [4 x i32], [4 x i32]* %56, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %5, i64 0, i64 1
%62 = load i32, i32* %3
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [2 x [4 x i32]], [2 x [4 x i32]]* %61, i64 0, i64 %63
%65 = load i32, i32* %2
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [4 x i32], [4 x i32]* %64, i64 0, i64 %66
%68 = load i32, i32* %67
%69 = mul nsw i32 %60, %68
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %69)
br label %71
71: ; preds = %52
%72 = load i32, i32* %2
%73 = add nsw i32 %72, 1
store i32 %73, i32* %2
br label %49
74: ; preds = %49
br label %75
75: ; preds = %74
%76 = load i32, i32* %3
%77 = add nsw i32 %76, 1
store i32 %77, i32* %3
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %45
79: ; preds = %45
%80 = load i32, i32* %1
ret i32 %80
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s \EB\B2\88\EC\A7\B8 \EB\B0\B0\EC\97\B4\0A\00"
@.str.1 = [4 x i8] c"\EB\91\90\00"
@.str.2 = [4 x i8] c"\EC\B2\AB\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca [2 x [2 x [4 x i32]]]
%2 = bitcast [2 x [2 x [4 x i32]]]* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %1, i64 0, i64 0, i64 0, i64 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%6 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %1, i64 0, i64 0, i64 0, i64 1
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%8 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %1, i64 0, i64 0, i64 0, i64 2
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %8)
%10 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %1, i64 0, i64 0, i64 0, i64 3
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %10)
%12 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %1, i64 0, i64 0, i64 1, i64 0
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %12)
%14 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %1, i64 0, i64 0, i64 1, i64 1
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %14)
%16 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %1, i64 0, i64 0, i64 1, i64 2
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %16)
%18 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %1, i64 0, i64 0, i64 1, i64 3
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %18)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%21 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %1, i64 0, i64 1, i64 0, i64 0
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %21)
%23 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %1, i64 0, i64 1, i64 0, i64 1
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %23)
%25 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %1, i64 0, i64 1, i64 0, i64 2
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %25)
%27 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %1, i64 0, i64 1, i64 0, i64 3
%28 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %27)
%29 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %1, i64 0, i64 1, i64 1, i64 0
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %29)
%31 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %1, i64 0, i64 1, i64 1, i64 1
%32 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %31)
%33 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %1, i64 0, i64 1, i64 1, i64 2
%34 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %33)
%35 = getelementptr inbounds [2 x [2 x [4 x i32]]], [2 x [2 x [4 x i32]]]* %1, i64 0, i64 1, i64 1, i64 3
%36 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %35)
%37 = load i32, i32* %4
%38 = load i32, i32* %21
%39 = mul nsw i32 %38, %37
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %39)
%41 = load i32, i32* %6
%42 = load i32, i32* %23
%43 = mul nsw i32 %42, %41
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %43)
%45 = load i32, i32* %8
%46 = load i32, i32* %25
%47 = mul nsw i32 %46, %45
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %47)
%49 = load i32, i32* %10
%50 = load i32, i32* %27
%51 = mul nsw i32 %50, %49
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %51)
%53 = call i32 @putchar(i32 10)
%54 = load i32, i32* %12
%55 = load i32, i32* %29
%56 = mul nsw i32 %55, %54
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %56)
%58 = load i32, i32* %14
%59 = load i32, i32* %31
%60 = mul nsw i32 %59, %58
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %60)
%62 = load i32, i32* %16
%63 = load i32, i32* %33
%64 = mul nsw i32 %63, %62
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %64)
%66 = load i32, i32* %18
%67 = load i32, i32* %35
%68 = mul nsw i32 %67, %66
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %68)
%70 = call i32 @putchar(i32 10)
ret i32 0
}