#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int i, j, k;
  printf("Introdueix el contingut del cub: ");
  int cub[2][3][2];
  for (i = 0; i < 2; i++) {
    for (j = 0; j < 3; j++)
      for (k = 0; k < 2; k++)
        scanf("%d ", &cub[i][j][k]);
  }
  for (i = 0; i < 2; i++) {
    for (j = 0; j < 3; j++) {
      for (k = 0; k < 2; k++)
        printf("%3d ", cub[i][j][k]);
      printf("\n");
    }
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    11dc <main+0xbc>
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    11c9 <main+0xa9>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jge    11b6 <main+0x96>
movslq -0x14(%rbp),%rax
lea    -0x50(%rbp),%rsi
imul   $0x18,%rax,%rax
add    %rax,%rsi
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe7f(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    116d <main+0x4d>
jmp    11bb <main+0x9b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115c <main+0x3c>
jmp    11ce <main+0xae>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <main+0x2b>
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    127b <main+0x15b>
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    1268 <main+0x148>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jge    124c <main+0x12c>
movslq -0x14(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1205 <main+0xe5>
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11f4 <main+0xd4>
jmp    126d <main+0x14d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e3 <main+0xc3>
mov    0x2d5e(%rip),%rax
mov    (%rax),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed8(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x2c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    (%rsp),%esi
lea    0xe38(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x28(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2d0b(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [34 x i8] c"Introdueix el contingut del cub: \00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [5 x i8] c"%3d \00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x [3 x [2 x i32]]]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%5 = bitcast [2 x [3 x [2 x i32]]]* %3 to i8*
%6 = getelementptr inbounds [2 x [3 x [2 x i32]]], [2 x [3 x [2 x i32]]]* %3, i64 0, i64 0, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = getelementptr inbounds [2 x [3 x [2 x i32]]], [2 x [3 x [2 x i32]]]* %3, i64 0, i64 0, i64 0, i64 1
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%10 = getelementptr inbounds [2 x [3 x [2 x i32]]], [2 x [3 x [2 x i32]]]* %3, i64 0, i64 0, i64 1, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = getelementptr inbounds [2 x [3 x [2 x i32]]], [2 x [3 x [2 x i32]]]* %3, i64 0, i64 0, i64 1, i64 1
%13 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %12)
%14 = getelementptr inbounds [2 x [3 x [2 x i32]]], [2 x [3 x [2 x i32]]]* %3, i64 0, i64 0, i64 2, i64 0
%15 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = getelementptr inbounds [2 x [3 x [2 x i32]]], [2 x [3 x [2 x i32]]]* %3, i64 0, i64 0, i64 2, i64 1
%17 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%18 = getelementptr inbounds [2 x [3 x [2 x i32]]], [2 x [3 x [2 x i32]]]* %3, i64 0, i64 1, i64 0, i64 0
%19 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %18)
%20 = getelementptr inbounds [2 x [3 x [2 x i32]]], [2 x [3 x [2 x i32]]]* %3, i64 0, i64 1, i64 0, i64 1
%21 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %20)
%22 = getelementptr inbounds [2 x [3 x [2 x i32]]], [2 x [3 x [2 x i32]]]* %3, i64 0, i64 1, i64 1, i64 0
%23 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %22)
%24 = getelementptr inbounds [2 x [3 x [2 x i32]]], [2 x [3 x [2 x i32]]]* %3, i64 0, i64 1, i64 1, i64 1
%25 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %24)
%26 = getelementptr inbounds [2 x [3 x [2 x i32]]], [2 x [3 x [2 x i32]]]* %3, i64 0, i64 1, i64 2, i64 0
%27 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %26)
%28 = getelementptr inbounds [2 x [3 x [2 x i32]]], [2 x [3 x [2 x i32]]]* %3, i64 0, i64 1, i64 2, i64 1
%29 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %28)
%30 = load i32, i32* %6
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%32 = load i32, i32* %8
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%34 = call i32 @putchar(i32 10)
%35 = load i32, i32* %10
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %12
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %37)
%39 = call i32 @putchar(i32 10)
%40 = load i32, i32* %14
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %40)
%42 = load i32, i32* %16
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %42)
%44 = call i32 @putchar(i32 10)
%45 = load i32, i32* %18
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %20
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %47)
%49 = call i32 @putchar(i32 10)
%50 = load i32, i32* %22
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %50)
%52 = load i32, i32* %24
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %52)
%54 = call i32 @putchar(i32 10)
%55 = load i32, i32* %26
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %55)
%57 = load i32, i32* %28
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %57)
%59 = call i32 @putchar(i32 10)
%60 = load i32, i32* @EXIT_SUCCESS
ret i32 %60
}