#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*/ copy_int_1D(int, int *, int *);
void copy_int_RT_3D(int N_X, int K, int ncode, int ***from, int ***to) {
  int n_X, k;
  for (n_X = 0; n_X < N_X; n_X++) {
    for (k = 0; k < K; k++) {
      copy_int_1D(ncode, from[n_X][k], to[n_X][k]);
    }
  }
}


x86 assembly (clang, -O0):
<copy_int_RT_3D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11a0 <copy_int_RT_3D+0x90>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    118d <copy_int_RT_3D+0x7d>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
call   1030 <copy_int_1D@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1143 <copy_int_RT_3D+0x33>
jmp    1192 <copy_int_RT_3D+0x82>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1130 <copy_int_RT_3D+0x20>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_int_RT_3D>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %esi,0xc(%rsp)
test   %edi,%edi
jle    1183 <copy_int_RT_3D+0x73>
mov    %r8,%r14
mov    %rcx,%r13
mov    %edx,%ebp
mov    %edi,%eax
mov    %rax,0x10(%rsp)
mov    0xc(%rsp),%ebx
xor    %r15d,%r15d
jmp    114b <copy_int_RT_3D+0x3b>
xchg   %ax,%ax
add    $0x1,%r15
cmp    0x10(%rsp),%r15
je     1183 <copy_int_RT_3D+0x73>
cmpl   $0x0,0xc(%rsp)
jle    1140 <copy_int_RT_3D+0x30>
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x0(%r13,%r15,8),%rax
mov    (%rax,%r12,8),%rsi
mov    (%r14,%r15,8),%rax
mov    (%rax,%r12,8),%rdx
mov    %ebp,%edi
call   1030 <copy_int_1D@plt>
add    $0x1,%r12
cmp    %r12,%rbx
jne    1160 <copy_int_RT_3D+0x50>
jmp    1140 <copy_int_RT_3D+0x30>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @copy_int_RT_3D(i32 %0, i32 %1, i32 %2, i32*** %3, i32*** %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32***
%10 = alloca i32***
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32*** %3, i32**** %9
store i32*** %4, i32**** %10
store i32 0, i32* %11
br label %13
13: ; preds = %47, %5
%14 = load i32, i32* %11
%15 = load i32, i32* %6
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %50
17: ; preds = %13
store i32 0, i32* %12
br label %18
18: ; preds = %43, %17
%19 = load i32, i32* %12
%20 = load i32, i32* %7
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %46
22: ; preds = %18
%23 = load i32, i32* %8
%24 = load i32***, i32**** %9
%25 = load i32, i32* %11
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32**, i32*** %24, i64 %26
%28 = load i32**, i32*** %27
%29 = load i32, i32* %12
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32*, i32** %28, i64 %30
%32 = load i32*, i32** %31
%33 = load i32***, i32**** %10
%34 = load i32, i32* %11
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i32**, i32*** %33, i64 %35
%37 = load i32**, i32*** %36
%38 = load i32, i32* %12
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32*, i32** %37, i64 %39
%41 = load i32*, i32** %40
%42 = call i32 @copy_int_1D(i32 %23, i32* %32, i32* %41)
br label %43
43: ; preds = %22
%44 = load i32, i32* %12
%45 = add nsw i32 %44, 1
store i32 %45, i32* %12
br label %18
46: ; preds = %18
br label %47
47: ; preds = %46
%48 = load i32, i32* %11
%49 = add nsw i32 %48, 1
store i32 %49, i32* %11
br label %13
50: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @copy_int_RT_3D(i32 %0, i32 %1, i32 %2, i32*** nocapture %3, i32*** nocapture %4) {
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %30
7: ; preds = %5
%8 = icmp sgt i32 %1, 0
%9 = zext i32 %0 to i64
%10 = zext i32 %1 to i64
br label %11
11: ; preds = %7, %27
%12 = phi i64 [ 0, %7 ], [ %28, %27 ]
br i1 %8, label %13, label %27
13: ; preds = %11
%14 = getelementptr inbounds i32**, i32*** %3, i64 %12
%15 = getelementptr inbounds i32**, i32*** %4, i64 %12
br label %16
16: ; preds = %13, %16
%17 = phi i64 [ 0, %13 ], [ %25, %16 ]
%18 = load i32**, i32*** %14
%19 = getelementptr inbounds i32*, i32** %18, i64 %17
%20 = load i32*, i32** %19
%21 = load i32**, i32*** %15
%22 = getelementptr inbounds i32*, i32** %21, i64 %17
%23 = load i32*, i32** %22
%24 = tail call i32 @copy_int_1D(i32 %2, i32* %20, i32* %23)
%25 = add nuw nsw i64 %17, 1
%26 = icmp eq i64 %25, %10
br i1 %26, label %27, label %16
27: ; preds = %16, %11
%28 = add nuw nsw i64 %12, 1
%29 = icmp eq i64 %28, %9
br i1 %29, label %30, label %11
30: ; preds = %27, %5
ret void
}