#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 */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ apply_G(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *, int /*<<< orphan*/ *);
scalar_t__ floor(int);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void P(uint8_t *S0, uint8_t *S1, uint8_t *S2, uint8_t *S3, uint8_t *S4,
       uint8_t *S5, uint8_t *S6, uint8_t *S7) {
  uint8_t *S[8] = {S0, S1, S2, S3, S4, S5, S6, S7};
  uint8_t V[4][4][8];
  int h;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      h = 4 * i + j;
      if (h % 2 == 0)
        memcpy(V[i][j], S[(int)floor(h / 2)] + 8, 8);
      else
        memcpy(V[i][j], S[(int)floor(h / 2)], 8);
    }
  }
  apply_G(V[0][0], V[1][0], V[2][0], V[3][0]);
  apply_G(V[0][1], V[1][1], V[2][1], V[3][1]);
  apply_G(V[0][2], V[1][2], V[2][2], V[3][2]);
  apply_G(V[0][3], V[1][3], V[2][3], V[3][3]);
  apply_G(V[0][0], V[1][1], V[2][2], V[3][3]);
  apply_G(V[0][1], V[1][2], V[2][3], V[0][3]);
  apply_G(V[0][2], V[1][3], V[2][0], V[3][1]);
  apply_G(V[0][3], V[1][0], V[2][1], V[3][2]);
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      h = 4 * i + j;
      if (h % 2 == 0)
        memcpy(S[(int)floor(h / 2)] + 8, V[i][j], 8);
      else
        memcpy(S[(int)floor(h / 2)], V[i][j], 8);
    }
  }
}


x86 assembly (clang, -O0):
<P>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2a0,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x278(%rbp)
cmpl   $0x4,-0x278(%rbp)
jge    12de <P+0x1ae>
movl   $0x0,-0x27c(%rbp)
cmpl   $0x4,-0x27c(%rbp)
jge    12c5 <P+0x195>
mov    -0x278(%rbp),%eax
shl    $0x2,%eax
add    -0x27c(%rbp),%eax
mov    %eax,-0x274(%rbp)
mov    -0x274(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1255 <P+0x125>
movslq -0x278(%rbp),%rcx
lea    -0x270(%rbp),%rax
shl    $0x7,%rcx
add    %rcx,%rax
movslq -0x27c(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
mov    %rax,-0x290(%rbp)
mov    -0x274(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1050 <floor@plt>
mov    -0x290(%rbp),%rdi
cltq
mov    -0x70(%rbp,%rax,8),%rsi
add    $0x20,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
jmp    12ac <P+0x17c>
movslq -0x278(%rbp),%rcx
lea    -0x270(%rbp),%rax
shl    $0x7,%rcx
add    %rcx,%rax
movslq -0x27c(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
mov    %rax,-0x298(%rbp)
mov    -0x274(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1050 <floor@plt>
mov    -0x298(%rbp),%rdi
cltq
mov    -0x70(%rbp,%rax,8),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
jmp    12b1 <P+0x181>
mov    -0x27c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x27c(%rbp)
jmp    11bc <P+0x8c>
jmp    12ca <P+0x19a>
mov    -0x278(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x278(%rbp)
jmp    11a5 <P+0x75>
lea    -0x270(%rbp),%rdi
lea    -0x270(%rbp),%rsi
add    $0x80,%rsi
lea    -0x270(%rbp),%rdx
add    $0x100,%rdx
lea    -0x270(%rbp),%rcx
add    $0x180,%rcx
call   1030 <apply_G@plt>
lea    -0x270(%rbp),%rdi
add    $0x20,%rdi
lea    -0x270(%rbp),%rsi
add    $0x80,%rsi
add    $0x20,%rsi
lea    -0x270(%rbp),%rdx
add    $0x100,%rdx
add    $0x20,%rdx
lea    -0x270(%rbp),%rcx
add    $0x180,%rcx
add    $0x20,%rcx
call   1030 <apply_G@plt>
lea    -0x270(%rbp),%rdi
add    $0x40,%rdi
lea    -0x270(%rbp),%rsi
add    $0x80,%rsi
add    $0x40,%rsi
lea    -0x270(%rbp),%rdx
add    $0x100,%rdx
add    $0x40,%rdx
lea    -0x270(%rbp),%rcx
add    $0x180,%rcx
add    $0x40,%rcx
call   1030 <apply_G@plt>
lea    -0x270(%rbp),%rdi
add    $0x60,%rdi
lea    -0x270(%rbp),%rsi
add    $0x80,%rsi
add    $0x60,%rsi
lea    -0x270(%rbp),%rdx
add    $0x100,%rdx
add    $0x60,%rdx
lea    -0x270(%rbp),%rcx
add    $0x180,%rcx
add    $0x60,%rcx
call   1030 <apply_G@plt>
lea    -0x270(%rbp),%rdi
lea    -0x270(%rbp),%rsi
add    $0x80,%rsi
add    $0x20,%rsi
lea    -0x270(%rbp),%rdx
add    $0x100,%rdx
add    $0x40,%rdx
lea    -0x270(%rbp),%rcx
add    $0x180,%rcx
add    $0x60,%rcx
call   1030 <apply_G@plt>
lea    -0x270(%rbp),%rdi
add    $0x20,%rdi
lea    -0x270(%rbp),%rsi
add    $0x80,%rsi
add    $0x40,%rsi
lea    -0x270(%rbp),%rdx
add    $0x100,%rdx
add    $0x60,%rdx
lea    -0x270(%rbp),%rcx
add    $0x60,%rcx
call   1030 <apply_G@plt>
lea    -0x270(%rbp),%rdi
add    $0x40,%rdi
lea    -0x270(%rbp),%rsi
add    $0x80,%rsi
add    $0x60,%rsi
lea    -0x270(%rbp),%rdx
add    $0x100,%rdx
lea    -0x270(%rbp),%rcx
add    $0x180,%rcx
add    $0x20,%rcx
call   1030 <apply_G@plt>
lea    -0x270(%rbp),%rdi
add    $0x60,%rdi
lea    -0x270(%rbp),%rsi
add    $0x80,%rsi
lea    -0x270(%rbp),%rdx
add    $0x100,%rdx
add    $0x20,%rdx
lea    -0x270(%rbp),%rcx
add    $0x180,%rcx
add    $0x40,%rcx
call   1030 <apply_G@plt>
movl   $0x0,-0x280(%rbp)
cmpl   $0x4,-0x280(%rbp)
jge    1612 <P+0x4e2>
movl   $0x0,-0x284(%rbp)
cmpl   $0x4,-0x284(%rbp)
jge    15f9 <P+0x4c9>
mov    -0x280(%rbp),%eax
shl    $0x2,%eax
add    -0x284(%rbp),%eax
mov    %eax,-0x274(%rbp)
mov    -0x274(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1597 <P+0x467>
mov    -0x274(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1050 <floor@plt>
cltq
mov    -0x70(%rbp,%rax,8),%rdi
add    $0x20,%rdi
movslq -0x280(%rbp),%rax
lea    -0x270(%rbp),%rsi
shl    $0x7,%rax
add    %rax,%rsi
movslq -0x284(%rbp),%rax
shl    $0x5,%rax
add    %rax,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
jmp    15e0 <P+0x4b0>
mov    -0x274(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1050 <floor@plt>
cltq
mov    -0x70(%rbp,%rax,8),%rdi
movslq -0x280(%rbp),%rax
lea    -0x270(%rbp),%rsi
shl    $0x7,%rax
add    %rax,%rsi
movslq -0x284(%rbp),%rax
shl    $0x5,%rax
add    %rax,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
jmp    15e5 <P+0x4b5>
mov    -0x284(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x284(%rbp)
jmp    150c <P+0x3dc>
jmp    15fe <P+0x4ce>
mov    -0x280(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x280(%rbp)
jmp    14f5 <P+0x3c5>
add    $0x2a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<P>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x248,%rsp
movaps 0x280(%rsp),%xmm0
mov    %rdi,(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rdx,0x10(%rsp)
mov    %rcx,0x18(%rsp)
mov    %r8,0x20(%rsp)
mov    %r9,0x28(%rsp)
movaps %xmm0,0x30(%rsp)
mov    $0x1,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rsp,%rbp,1),%r14
add    $0x40,%r14
lea    -0x1(%rbx),%r15d
mov    %r15d,%edi
call   1050 <floor@plt>
cltq
mov    (%rsp,%rax,8),%rsi
add    $0x20,%rsi
mov    %r14,%rdi
mov    $0x8,%edx
call   1040 <memcpy@plt>
lea    (%rsp,%rbp,1),%r14
add    $0x60,%r14
mov    %r15d,%edi
call   1050 <floor@plt>
cltq
mov    (%rsp,%rax,8),%rsi
mov    %r14,%rdi
mov    $0x8,%edx
call   1040 <memcpy@plt>
lea    (%rsp,%rbp,1),%r14
add    $0x80,%r14
mov    %ebx,%edi
call   1050 <floor@plt>
cltq
mov    (%rsp,%rax,8),%rsi
add    $0x20,%rsi
mov    %r14,%rdi
mov    $0x8,%edx
call   1040 <memcpy@plt>
lea    (%rsp,%rbp,1),%r14
add    $0xa0,%r14
mov    %ebx,%edi
call   1050 <floor@plt>
cltq
mov    (%rsp,%rax,8),%rsi
mov    %r14,%rdi
mov    $0x8,%edx
call   1040 <memcpy@plt>
add    $0x2,%ebx
sub    $0xffffffffffffff80,%rbp
cmp    $0x200,%rbp
jne    1180 <P+0x50>
lea    0xc0(%rsp),%rsi
lea    0x140(%rsp),%rdx
lea    0x1c0(%rsp),%rcx
lea    0x40(%rsp),%rdi
call   1030 <apply_G@plt>
lea    0x60(%rsp),%rdi
lea    0xe0(%rsp),%rsi
lea    0x160(%rsp),%rdx
lea    0x1e0(%rsp),%rcx
call   1030 <apply_G@plt>
lea    0x80(%rsp),%rdi
lea    0x100(%rsp),%rbx
lea    0x180(%rsp),%r14
lea    0x200(%rsp),%rcx
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <apply_G@plt>
lea    0xa0(%rsp),%r13
lea    0x120(%rsp),%rbp
lea    0x1a0(%rsp),%r15
lea    0x220(%rsp),%r12
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1030 <apply_G@plt>
lea    0x40(%rsp),%rdi
lea    0xe0(%rsp),%rsi
mov    %r14,%rdx
mov    %r12,%rcx
call   1030 <apply_G@plt>
lea    0x60(%rsp),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r13,%rcx
call   1030 <apply_G@plt>
lea    0x80(%rsp),%rdi
mov    %rbp,%rsi
lea    0x140(%rsp),%rdx
lea    0x1e0(%rsp),%rcx
call   1030 <apply_G@plt>
mov    %r13,%rdi
lea    0xc0(%rsp),%rsi
lea    0x160(%rsp),%rdx
lea    0x200(%rsp),%rcx
call   1030 <apply_G@plt>
mov    $0x1,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%r14d
mov    %r14d,%edi
call   1050 <floor@plt>
cltq
mov    (%rsp,%rax,8),%rdi
add    $0x20,%rdi
lea    (%rsp,%rbp,1),%rsi
add    $0x40,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    %r14d,%edi
call   1050 <floor@plt>
cltq
mov    (%rsp,%rax,8),%rdi
lea    (%rsp,%rbp,1),%rsi
add    $0x60,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    %ebx,%edi
call   1050 <floor@plt>
cltq
mov    (%rsp,%rax,8),%rdi
add    $0x20,%rdi
lea    (%rsp,%rbp,1),%rsi
add    $0x80,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    %ebx,%edi
call   1050 <floor@plt>
cltq
mov    (%rsp,%rax,8),%rdi
lea    (%rsp,%rbp,1),%rsi
add    $0xa0,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
add    $0x2,%ebx
sub    $0xffffffffffffff80,%rbp
cmp    $0x200,%rbp
jne    1350 <P+0x220>
add    $0x248,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @P(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7) {
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca [8 x i32*]
%18 = alloca [4 x [4 x [8 x i32]]]
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
store i32* %0, i32** %9
store i32* %1, i32** %10
store i32* %2, i32** %11
store i32* %3, i32** %12
store i32* %4, i32** %13
store i32* %5, i32** %14
store i32* %6, i32** %15
store i32* %7, i32** %16
%24 = getelementptr inbounds [8 x i32*], [8 x i32*]* %17, i64 0, i64 0
%25 = load i32*, i32** %9
store i32* %25, i32** %24
%26 = getelementptr inbounds i32*, i32** %24, i64 1
%27 = load i32*, i32** %10
store i32* %27, i32** %26
%28 = getelementptr inbounds i32*, i32** %26, i64 1
%29 = load i32*, i32** %11
store i32* %29, i32** %28
%30 = getelementptr inbounds i32*, i32** %28, i64 1
%31 = load i32*, i32** %12
store i32* %31, i32** %30
%32 = getelementptr inbounds i32*, i32** %30, i64 1
%33 = load i32*, i32** %13
store i32* %33, i32** %32
%34 = getelementptr inbounds i32*, i32** %32, i64 1
%35 = load i32*, i32** %14
store i32* %35, i32** %34
%36 = getelementptr inbounds i32*, i32** %34, i64 1
%37 = load i32*, i32** %15
store i32* %37, i32** %36
%38 = getelementptr inbounds i32*, i32** %36, i64 1
%39 = load i32*, i32** %16
store i32* %39, i32** %38
store i32 0, i32* %20
br label %40
40: ; preds = %93, %8
%41 = load i32, i32* %20
%42 = icmp slt i32 %41, 4
br i1 %42, label %43, label %96
43: ; preds = %40
store i32 0, i32* %21
br label %44
44: ; preds = %89, %43
%45 = load i32, i32* %21
%46 = icmp slt i32 %45, 4
br i1 %46, label %47, label %92
47: ; preds = %44
%48 = load i32, i32* %20
%49 = mul nsw i32 4, %48
%50 = load i32, i32* %21
%51 = add nsw i32 %49, %50
store i32 %51, i32* %19
%52 = load i32, i32* %19
%53 = srem i32 %52, 2
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %72
55: ; preds = %47
%56 = load i32, i32* %20
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 %57
%59 = load i32, i32* %21
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %58, i64 0, i64 %60
%62 = getelementptr inbounds [8 x i32], [8 x i32]* %61, i64 0, i64 0
%63 = load i32, i32* %19
%64 = sdiv i32 %63, 2
%65 = call i64 @floor(i32 %64)
%66 = trunc i64 %65 to i32
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [8 x i32*], [8 x i32*]* %17, i64 0, i64 %67
%69 = load i32*, i32** %68
%70 = getelementptr inbounds i32, i32* %69, i64 8
%71 = call i32 @memcpy(i32* %62, i32* %70, i32 8)
br label %88
72: ; preds = %47
%73 = load i32, i32* %20
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 %74
%76 = load i32, i32* %21
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %75, i64 0, i64 %77
%79 = getelementptr inbounds [8 x i32], [8 x i32]* %78, i64 0, i64 0
%80 = load i32, i32* %19
%81 = sdiv i32 %80, 2
%82 = call i64 @floor(i32 %81)
%83 = trunc i64 %82 to i32
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [8 x i32*], [8 x i32*]* %17, i64 0, i64 %84
%86 = load i32*, i32** %85
%87 = call i32 @memcpy(i32* %79, i32* %86, i32 8)
br label %88
88: ; preds = %72, %55
br label %89
89: ; preds = %88
%90 = load i32, i32* %21
%91 = add nsw i32 %90, 1
store i32 %91, i32* %21
br label %44
92: ; preds = %44
br label %93
93: ; preds = %92
%94 = load i32, i32* %20
%95 = add nsw i32 %94, 1
store i32 %95, i32* %20
br label %40
96: ; preds = %40
%97 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 0
%98 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %97, i64 0, i64 0
%99 = getelementptr inbounds [8 x i32], [8 x i32]* %98, i64 0, i64 0
%100 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 1
%101 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %100, i64 0, i64 0
%102 = getelementptr inbounds [8 x i32], [8 x i32]* %101, i64 0, i64 0
%103 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 2
%104 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %103, i64 0, i64 0
%105 = getelementptr inbounds [8 x i32], [8 x i32]* %104, i64 0, i64 0
%106 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 3
%107 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %106, i64 0, i64 0
%108 = getelementptr inbounds [8 x i32], [8 x i32]* %107, i64 0, i64 0
%109 = call i32 @apply_G(i32* %99, i32* %102, i32* %105, i32* %108)
%110 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 0
%111 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %110, i64 0, i64 1
%112 = getelementptr inbounds [8 x i32], [8 x i32]* %111, i64 0, i64 0
%113 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 1
%114 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %113, i64 0, i64 1
%115 = getelementptr inbounds [8 x i32], [8 x i32]* %114, i64 0, i64 0
%116 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 2
%117 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %116, i64 0, i64 1
%118 = getelementptr inbounds [8 x i32], [8 x i32]* %117, i64 0, i64 0
%119 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 3
%120 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %119, i64 0, i64 1
%121 = getelementptr inbounds [8 x i32], [8 x i32]* %120, i64 0, i64 0
%122 = call i32 @apply_G(i32* %112, i32* %115, i32* %118, i32* %121)
%123 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 0
%124 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %123, i64 0, i64 2
%125 = getelementptr inbounds [8 x i32], [8 x i32]* %124, i64 0, i64 0
%126 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 1
%127 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %126, i64 0, i64 2
%128 = getelementptr inbounds [8 x i32], [8 x i32]* %127, i64 0, i64 0
%129 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 2
%130 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %129, i64 0, i64 2
%131 = getelementptr inbounds [8 x i32], [8 x i32]* %130, i64 0, i64 0
%132 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 3
%133 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %132, i64 0, i64 2
%134 = getelementptr inbounds [8 x i32], [8 x i32]* %133, i64 0, i64 0
%135 = call i32 @apply_G(i32* %125, i32* %128, i32* %131, i32* %134)
%136 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 0
%137 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %136, i64 0, i64 3
%138 = getelementptr inbounds [8 x i32], [8 x i32]* %137, i64 0, i64 0
%139 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 1
%140 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %139, i64 0, i64 3
%141 = getelementptr inbounds [8 x i32], [8 x i32]* %140, i64 0, i64 0
%142 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 2
%143 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %142, i64 0, i64 3
%144 = getelementptr inbounds [8 x i32], [8 x i32]* %143, i64 0, i64 0
%145 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 3
%146 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %145, i64 0, i64 3
%147 = getelementptr inbounds [8 x i32], [8 x i32]* %146, i64 0, i64 0
%148 = call i32 @apply_G(i32* %138, i32* %141, i32* %144, i32* %147)
%149 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 0
%150 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %149, i64 0, i64 0
%151 = getelementptr inbounds [8 x i32], [8 x i32]* %150, i64 0, i64 0
%152 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 1
%153 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %152, i64 0, i64 1
%154 = getelementptr inbounds [8 x i32], [8 x i32]* %153, i64 0, i64 0
%155 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 2
%156 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %155, i64 0, i64 2
%157 = getelementptr inbounds [8 x i32], [8 x i32]* %156, i64 0, i64 0
%158 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 3
%159 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %158, i64 0, i64 3
%160 = getelementptr inbounds [8 x i32], [8 x i32]* %159, i64 0, i64 0
%161 = call i32 @apply_G(i32* %151, i32* %154, i32* %157, i32* %160)
%162 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 0
%163 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %162, i64 0, i64 1
%164 = getelementptr inbounds [8 x i32], [8 x i32]* %163, i64 0, i64 0
%165 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 1
%166 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %165, i64 0, i64 2
%167 = getelementptr inbounds [8 x i32], [8 x i32]* %166, i64 0, i64 0
%168 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 2
%169 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %168, i64 0, i64 3
%170 = getelementptr inbounds [8 x i32], [8 x i32]* %169, i64 0, i64 0
%171 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 0
%172 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %171, i64 0, i64 3
%173 = getelementptr inbounds [8 x i32], [8 x i32]* %172, i64 0, i64 0
%174 = call i32 @apply_G(i32* %164, i32* %167, i32* %170, i32* %173)
%175 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 0
%176 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %175, i64 0, i64 2
%177 = getelementptr inbounds [8 x i32], [8 x i32]* %176, i64 0, i64 0
%178 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 1
%179 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %178, i64 0, i64 3
%180 = getelementptr inbounds [8 x i32], [8 x i32]* %179, i64 0, i64 0
%181 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 2
%182 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %181, i64 0, i64 0
%183 = getelementptr inbounds [8 x i32], [8 x i32]* %182, i64 0, i64 0
%184 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 3
%185 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %184, i64 0, i64 1
%186 = getelementptr inbounds [8 x i32], [8 x i32]* %185, i64 0, i64 0
%187 = call i32 @apply_G(i32* %177, i32* %180, i32* %183, i32* %186)
%188 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 0
%189 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %188, i64 0, i64 3
%190 = getelementptr inbounds [8 x i32], [8 x i32]* %189, i64 0, i64 0
%191 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 1
%192 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %191, i64 0, i64 0
%193 = getelementptr inbounds [8 x i32], [8 x i32]* %192, i64 0, i64 0
%194 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 2
%195 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %194, i64 0, i64 1
%196 = getelementptr inbounds [8 x i32], [8 x i32]* %195, i64 0, i64 0
%197 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 3
%198 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %197, i64 0, i64 2
%199 = getelementptr inbounds [8 x i32], [8 x i32]* %198, i64 0, i64 0
%200 = call i32 @apply_G(i32* %190, i32* %193, i32* %196, i32* %199)
store i32 0, i32* %22
br label %201
201: ; preds = %254, %96
%202 = load i32, i32* %22
%203 = icmp slt i32 %202, 4
br i1 %203, label %204, label %257
204: ; preds = %201
store i32 0, i32* %23
br label %205
205: ; preds = %250, %204
%206 = load i32, i32* %23
%207 = icmp slt i32 %206, 4
br i1 %207, label %208, label %253
208: ; preds = %205
%209 = load i32, i32* %22
%210 = mul nsw i32 4, %209
%211 = load i32, i32* %23
%212 = add nsw i32 %210, %211
store i32 %212, i32* %19
%213 = load i32, i32* %19
%214 = srem i32 %213, 2
%215 = icmp eq i32 %214, 0
br i1 %215, label %216, label %233
216: ; preds = %208
%217 = load i32, i32* %19
%218 = sdiv i32 %217, 2
%219 = call i64 @floor(i32 %218)
%220 = trunc i64 %219 to i32
%221 = sext i32 %220 to i64
%222 = getelementptr inbounds [8 x i32*], [8 x i32*]* %17, i64 0, i64 %221
%223 = load i32*, i32** %222
%224 = getelementptr inbounds i32, i32* %223, i64 8
%225 = load i32, i32* %22
%226 = sext i32 %225 to i64
%227 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 %226
%228 = load i32, i32* %23
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %227, i64 0, i64 %229
%231 = getelementptr inbounds [8 x i32], [8 x i32]* %230, i64 0, i64 0
%232 = call i32 @memcpy(i32* %224, i32* %231, i32 8)
br label %249
233: ; preds = %208
%234 = load i32, i32* %19
%235 = sdiv i32 %234, 2
%236 = call i64 @floor(i32 %235)
%237 = trunc i64 %236 to i32
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds [8 x i32*], [8 x i32*]* %17, i64 0, i64 %238
%240 = load i32*, i32** %239
%241 = load i32, i32* %22
%242 = sext i32 %241 to i64
%243 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %18, i64 0, i64 %242
%244 = load i32, i32* %23
%245 = sext i32 %244 to i64
%246 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %243, i64 0, i64 %245
%247 = getelementptr inbounds [8 x i32], [8 x i32]* %246, i64 0, i64 0
%248 = call i32 @memcpy(i32* %240, i32* %247, i32 8)
br label %249
249: ; preds = %233, %216
br label %250
250: ; preds = %249
%251 = load i32, i32* %23
%252 = add nsw i32 %251, 1
store i32 %252, i32* %23
br label %205
253: ; preds = %205
br label %254
254: ; preds = %253
%255 = load i32, i32* %22
%256 = add nsw i32 %255, 1
store i32 %256, i32* %22
br label %201
257: ; preds = %201
ret void
}

LLVM IR (-O2):
define void @P(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7) {
%9 = alloca [8 x i32*]
%10 = alloca [4 x [4 x [8 x i32]]]
%11 = bitcast [8 x i32*]* %9 to i8*
%12 = getelementptr inbounds [8 x i32*], [8 x i32*]* %9, i64 0, i64 0
store i32* %0, i32** %12
%13 = getelementptr inbounds [8 x i32*], [8 x i32*]* %9, i64 0, i64 1
store i32* %1, i32** %13
%14 = getelementptr inbounds [8 x i32*], [8 x i32*]* %9, i64 0, i64 2
store i32* %2, i32** %14
%15 = getelementptr inbounds [8 x i32*], [8 x i32*]* %9, i64 0, i64 3
store i32* %3, i32** %15
%16 = getelementptr inbounds [8 x i32*], [8 x i32*]* %9, i64 0, i64 4
store i32* %4, i32** %16
%17 = getelementptr inbounds [8 x i32*], [8 x i32*]* %9, i64 0, i64 5
store i32* %5, i32** %17
%18 = getelementptr inbounds [8 x i32*], [8 x i32*]* %9, i64 0, i64 6
store i32* %6, i32** %18
%19 = getelementptr inbounds [8 x i32*], [8 x i32*]* %9, i64 0, i64 7
store i32* %7, i32** %19
%20 = bitcast [4 x [4 x [8 x i32]]]* %10 to i8*
br label %46
21: ; preds = %46
%22 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 0, i64 0, i64 0
%23 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 1, i64 0, i64 0
%24 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 2, i64 0, i64 0
%25 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 3, i64 0, i64 0
%26 = call i32 @apply_G(i32* %22, i32* %23, i32* %24, i32* %25)
%27 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 0, i64 1, i64 0
%28 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 1, i64 1, i64 0
%29 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 2, i64 1, i64 0
%30 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 3, i64 1, i64 0
%31 = call i32 @apply_G(i32* %27, i32* %28, i32* %29, i32* %30)
%32 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 0, i64 2, i64 0
%33 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 1, i64 2, i64 0
%34 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 2, i64 2, i64 0
%35 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 3, i64 2, i64 0
%36 = call i32 @apply_G(i32* %32, i32* %33, i32* %34, i32* %35)
%37 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 0, i64 3, i64 0
%38 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 1, i64 3, i64 0
%39 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 2, i64 3, i64 0
%40 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 3, i64 3, i64 0
%41 = call i32 @apply_G(i32* %37, i32* %38, i32* %39, i32* %40)
%42 = call i32 @apply_G(i32* %22, i32* %28, i32* %34, i32* %40)
%43 = call i32 @apply_G(i32* %27, i32* %33, i32* %39, i32* %37)
%44 = call i32 @apply_G(i32* %32, i32* %38, i32* %24, i32* %30)
%45 = call i32 @apply_G(i32* %37, i32* %23, i32* %29, i32* %35)
br label %92
46: ; preds = %8, %46
%47 = phi i64 [ 0, %8 ], [ %89, %46 ]
%48 = shl nsw i64 %47, 2
%49 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 %47, i64 0, i64 0
%50 = lshr exact i64 %48, 1
%51 = trunc i64 %50 to i32
%52 = call i64 @floor(i32 %51)
%53 = shl i64 %52, 32
%54 = ashr exact i64 %53, 32
%55 = getelementptr inbounds [8 x i32*], [8 x i32*]* %9, i64 0, i64 %54
%56 = load i32*, i32** %55
%57 = getelementptr inbounds i32, i32* %56, i64 8
%58 = call i32 @memcpy(i32* %49, i32* %57, i32 8)
%59 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 %47, i64 1, i64 0
%60 = trunc i64 %48 to i32
%61 = lshr exact i32 %60, 1
%62 = call i64 @floor(i32 %61)
%63 = shl i64 %62, 32
%64 = ashr exact i64 %63, 32
%65 = getelementptr inbounds [8 x i32*], [8 x i32*]* %9, i64 0, i64 %64
%66 = load i32*, i32** %65
%67 = call i32 @memcpy(i32* %59, i32* %66, i32 8)
%68 = trunc i64 %48 to i32
%69 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 %47, i64 2, i64 0
%70 = lshr exact i32 %68, 1
%71 = or i32 %70, 1
%72 = call i64 @floor(i32 %71)
%73 = shl i64 %72, 32
%74 = ashr exact i64 %73, 32
%75 = getelementptr inbounds [8 x i32*], [8 x i32*]* %9, i64 0, i64 %74
%76 = load i32*, i32** %75
%77 = getelementptr inbounds i32, i32* %76, i64 8
%78 = call i32 @memcpy(i32* %69, i32* %77, i32 8)
%79 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 %47, i64 3, i64 0
%80 = trunc i64 %48 to i32
%81 = lshr exact i32 %80, 1
%82 = or i32 %81, 1
%83 = call i64 @floor(i32 %82)
%84 = shl i64 %83, 32
%85 = ashr exact i64 %84, 32
%86 = getelementptr inbounds [8 x i32*], [8 x i32*]* %9, i64 0, i64 %85
%87 = load i32*, i32** %86
%88 = call i32 @memcpy(i32* %79, i32* %87, i32 8)
%89 = add nuw nsw i64 %47, 1
%90 = icmp eq i64 %89, 4
br i1 %90, label %21, label %46
91: ; preds = %92
ret void
92: ; preds = %21, %92
%93 = phi i64 [ 0, %21 ], [ %135, %92 ]
%94 = shl nsw i64 %93, 2
%95 = lshr exact i64 %94, 1
%96 = trunc i64 %95 to i32
%97 = call i64 @floor(i32 %96)
%98 = shl i64 %97, 32
%99 = ashr exact i64 %98, 32
%100 = getelementptr inbounds [8 x i32*], [8 x i32*]* %9, i64 0, i64 %99
%101 = load i32*, i32** %100
%102 = getelementptr inbounds i32, i32* %101, i64 8
%103 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 %93, i64 0, i64 0
%104 = call i32 @memcpy(i32* %102, i32* %103, i32 8)
%105 = trunc i64 %94 to i32
%106 = lshr exact i32 %105, 1
%107 = call i64 @floor(i32 %106)
%108 = shl i64 %107, 32
%109 = ashr exact i64 %108, 32
%110 = getelementptr inbounds [8 x i32*], [8 x i32*]* %9, i64 0, i64 %109
%111 = load i32*, i32** %110
%112 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 %93, i64 1, i64 0
%113 = call i32 @memcpy(i32* %111, i32* %112, i32 8)
%114 = trunc i64 %94 to i32
%115 = lshr exact i32 %114, 1
%116 = or i32 %115, 1
%117 = call i64 @floor(i32 %116)
%118 = shl i64 %117, 32
%119 = ashr exact i64 %118, 32
%120 = getelementptr inbounds [8 x i32*], [8 x i32*]* %9, i64 0, i64 %119
%121 = load i32*, i32** %120
%122 = getelementptr inbounds i32, i32* %121, i64 8
%123 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 %93, i64 2, i64 0
%124 = call i32 @memcpy(i32* %122, i32* %123, i32 8)
%125 = trunc i64 %94 to i32
%126 = lshr exact i32 %125, 1
%127 = or i32 %126, 1
%128 = call i64 @floor(i32 %127)
%129 = shl i64 %128, 32
%130 = ashr exact i64 %129, 32
%131 = getelementptr inbounds [8 x i32*], [8 x i32*]* %9, i64 0, i64 %130
%132 = load i32*, i32** %131
%133 = getelementptr inbounds [4 x [4 x [8 x i32]]], [4 x [4 x [8 x i32]]]* %10, i64 0, i64 %93, i64 3, i64 0
%134 = call i32 @memcpy(i32* %132, i32* %133, i32 8)
%135 = add nuw nsw i64 %93, 1
%136 = icmp eq i64 %135, 4
br i1 %136, label %91, label %92
}