#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 perlin_noise_2d(int const, int const);
int perlin_noise_3d(int const, int const, int const);
float perlin_smooth_noise_3d(const int x, const int y, const int z) {
  const float corners = (perlin_noise_3d(x - 1, y - 1, z + 1) +
                         perlin_noise_3d(x + 1, y - 1, z + 1) +
                         perlin_noise_3d(x - 1, y + 1, z + 1) +
                         perlin_noise_3d(x + 1, y + 1, z + 1) +
                         perlin_noise_3d(x - 1, y - 1, z - 1) +
                         perlin_noise_3d(x + 1, y - 1, z - 1) +
                         perlin_noise_3d(x - 1, y + 1, z - 1) +
                         perlin_noise_3d(x + 1, y + 1, z - 1)) /
                        16;
  const float sides =
      (perlin_noise_3d(x - 1, y, z + 1) + perlin_noise_3d(x + 1, y, z + 1) +
       perlin_noise_3d(x, y - 1, z + 1) + perlin_noise_3d(x, y + 1, z + 1) +
       perlin_noise_3d(x - 1, y, z - 1) + perlin_noise_3d(x + 1, y, z - 1) +
       perlin_noise_3d(x, y - 1, z - 1) + perlin_noise_3d(x, y + 1, z - 1) +
       perlin_noise_3d(x - 1, y - 1, z) + perlin_noise_3d(x + 1, y - 1, z) +
       perlin_noise_3d(x + 1, y + 1, z) + perlin_noise_3d(x - 1, y + 1, z)) /
      8;
  const float center = perlin_noise_2d(x, y) / 12;
  return corners + sides + center;
}


x86 assembly (clang, -O0):
<perlin_smooth_noise_3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,-0x60(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x60(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x5c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x58(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x54(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x50(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x48(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
add    %ecx,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,-0x44(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x40(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    -0xc(%rbp),%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    -0xc(%rbp),%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <perlin_noise_2d@plt>
mov    $0xc,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perlin_smooth_noise_3d>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdx,0x30(%rsp)
lea    -0x1(%rdi),%r12d
mov    %rdi,%rbp
mov    %rdi,0x20(%rsp)
lea    -0x1(%rsi),%ebx
mov    %ebx,0x10(%rsp)
mov    %rsi,%r13
mov    %rsi,0x18(%rsp)
add    $0x1,%edx
mov    %r12d,%edi
mov    %ebx,%esi
mov    %edx,%r14d
call   1030 <perlin_noise_3d@plt>
mov    %eax,0xc(%rsp)
lea    0x1(%rbp),%edi
mov    %edi,0x8(%rsp)
mov    %ebx,%esi
mov    %r14d,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%r15d
add    0xc(%rsp),%r15d
lea    0x1(%r13),%ebp
mov    %ebp,0xc(%rsp)
mov    %r12d,%edi
mov    %r12d,%r13d
mov    %ebp,%esi
mov    %r14d,%edx
mov    %r14d,0x28(%rsp)
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ebx
add    %r15d,%ebx
mov    0x8(%rsp),%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%r15d
add    %ebx,%r15d
mov    0x30(%rsp),%rax
lea    -0x1(%rax),%r12d
mov    %r13d,%edi
mov    %r13d,%r14d
mov    0x10(%rsp),%ebp
mov    %ebp,%esi
mov    %r12d,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ebx
add    %r15d,%ebx
mov    0x8(%rsp),%r13d
mov    %r13d,%edi
mov    %ebp,%esi
mov    %r12d,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%r15d
add    %ebx,%r15d
mov    %r14d,%edi
mov    0xc(%rsp),%ebp
mov    %ebp,%esi
mov    %r12d,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ebx
add    %r15d,%ebx
mov    %r13d,%edi
mov    %ebp,%esi
mov    %r12d,%edx
call   1030 <perlin_noise_3d@plt>
mov    %ebx,%ecx
add    %eax,%ecx
lea    0xf(%rax,%rbx,1),%eax
cmovns %ecx,%eax
sar    $0x4,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x2c(%rsp)
mov    %r14d,%r15d
mov    %r14d,%edi
mov    0x18(%rsp),%rbp
mov    %ebp,%esi
mov    0x28(%rsp),%ebx
mov    %ebx,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%r14d
mov    %r13d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%r13d
add    %r14d,%r13d
mov    0x20(%rsp),%rbp
mov    %ebp,%edi
mov    0x10(%rsp),%esi
mov    %ebx,%edx
mov    %ebx,%r14d
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ebx
add    %r13d,%ebx
mov    %ebp,%edi
mov    0xc(%rsp),%r13d
mov    %r13d,%esi
mov    %r14d,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    %r15d,0x14(%rsp)
mov    %r15d,%edi
mov    0x18(%rsp),%rbx
mov    %ebx,%esi
mov    %r12d,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%r15d
add    %ebp,%r15d
mov    0x8(%rsp),%edi
mov    %ebx,%esi
mov    %r12d,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ebp
add    %r15d,%ebp
mov    0x20(%rsp),%rbx
mov    %ebx,%edi
mov    0x10(%rsp),%r15d
mov    %r15d,%esi
mov    %r12d,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%r14d
add    %ebp,%r14d
mov    %ebx,%edi
mov    %r13d,%esi
mov    %r12d,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ebp
add    %r14d,%ebp
mov    0x14(%rsp),%edi
mov    %r15d,%esi
mov    0x30(%rsp),%rbx
mov    %ebx,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%r14d
add    %ebp,%r14d
mov    0x8(%rsp),%r12d
mov    %r12d,%edi
mov    %r15d,%esi
mov    %ebx,%edx
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ebp
add    %r14d,%ebp
mov    %r12d,%edi
mov    %r13d,%esi
mov    %ebx,%edx
mov    %rbx,%r14
call   1030 <perlin_noise_3d@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    0x14(%rsp),%edi
mov    %r13d,%esi
mov    %r14d,%edx
call   1030 <perlin_noise_3d@plt>
mov    %ebx,%ecx
add    %eax,%ecx
lea    0x7(%rax,%rbx,1),%eax
cmovns %ecx,%eax
sar    $0x3,%eax
cvtsi2ss %eax,%xmm0
addss  0x2c(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
mov    0x20(%rsp),%rdi
mov    0x18(%rsp),%rsi
call   1040 <perlin_noise_2d@plt>
cltq
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
addss  0x8(%rsp),%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define float @perlin_smooth_noise_3d(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 1
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
%16 = call i32 @perlin_noise_3d(i32 %11, i32 %13, i32 %15)
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
%19 = load i32, i32* %5
%20 = sub nsw i32 %19, 1
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
%23 = call i32 @perlin_noise_3d(i32 %18, i32 %20, i32 %22)
%24 = add nsw i32 %16, %23
%25 = load i32, i32* %4
%26 = sub nsw i32 %25, 1
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
%31 = call i32 @perlin_noise_3d(i32 %26, i32 %28, i32 %30)
%32 = add nsw i32 %24, %31
%33 = load i32, i32* %4
%34 = add nsw i32 %33, 1
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
%39 = call i32 @perlin_noise_3d(i32 %34, i32 %36, i32 %38)
%40 = add nsw i32 %32, %39
%41 = load i32, i32* %4
%42 = sub nsw i32 %41, 1
%43 = load i32, i32* %5
%44 = sub nsw i32 %43, 1
%45 = load i32, i32* %6
%46 = sub nsw i32 %45, 1
%47 = call i32 @perlin_noise_3d(i32 %42, i32 %44, i32 %46)
%48 = add nsw i32 %40, %47
%49 = load i32, i32* %4
%50 = add nsw i32 %49, 1
%51 = load i32, i32* %5
%52 = sub nsw i32 %51, 1
%53 = load i32, i32* %6
%54 = sub nsw i32 %53, 1
%55 = call i32 @perlin_noise_3d(i32 %50, i32 %52, i32 %54)
%56 = add nsw i32 %48, %55
%57 = load i32, i32* %4
%58 = sub nsw i32 %57, 1
%59 = load i32, i32* %5
%60 = add nsw i32 %59, 1
%61 = load i32, i32* %6
%62 = sub nsw i32 %61, 1
%63 = call i32 @perlin_noise_3d(i32 %58, i32 %60, i32 %62)
%64 = add nsw i32 %56, %63
%65 = load i32, i32* %4
%66 = add nsw i32 %65, 1
%67 = load i32, i32* %5
%68 = add nsw i32 %67, 1
%69 = load i32, i32* %6
%70 = sub nsw i32 %69, 1
%71 = call i32 @perlin_noise_3d(i32 %66, i32 %68, i32 %70)
%72 = add nsw i32 %64, %71
%73 = sdiv i32 %72, 16
%74 = sitofp i32 %73 to float
store float %74, float* %7
%75 = load i32, i32* %4
%76 = sub nsw i32 %75, 1
%77 = load i32, i32* %5
%78 = load i32, i32* %6
%79 = add nsw i32 %78, 1
%80 = call i32 @perlin_noise_3d(i32 %76, i32 %77, i32 %79)
%81 = load i32, i32* %4
%82 = add nsw i32 %81, 1
%83 = load i32, i32* %5
%84 = load i32, i32* %6
%85 = add nsw i32 %84, 1
%86 = call i32 @perlin_noise_3d(i32 %82, i32 %83, i32 %85)
%87 = add nsw i32 %80, %86
%88 = load i32, i32* %4
%89 = load i32, i32* %5
%90 = sub nsw i32 %89, 1
%91 = load i32, i32* %6
%92 = add nsw i32 %91, 1
%93 = call i32 @perlin_noise_3d(i32 %88, i32 %90, i32 %92)
%94 = add nsw i32 %87, %93
%95 = load i32, i32* %4
%96 = load i32, i32* %5
%97 = add nsw i32 %96, 1
%98 = load i32, i32* %6
%99 = add nsw i32 %98, 1
%100 = call i32 @perlin_noise_3d(i32 %95, i32 %97, i32 %99)
%101 = add nsw i32 %94, %100
%102 = load i32, i32* %4
%103 = sub nsw i32 %102, 1
%104 = load i32, i32* %5
%105 = load i32, i32* %6
%106 = sub nsw i32 %105, 1
%107 = call i32 @perlin_noise_3d(i32 %103, i32 %104, i32 %106)
%108 = add nsw i32 %101, %107
%109 = load i32, i32* %4
%110 = add nsw i32 %109, 1
%111 = load i32, i32* %5
%112 = load i32, i32* %6
%113 = sub nsw i32 %112, 1
%114 = call i32 @perlin_noise_3d(i32 %110, i32 %111, i32 %113)
%115 = add nsw i32 %108, %114
%116 = load i32, i32* %4
%117 = load i32, i32* %5
%118 = sub nsw i32 %117, 1
%119 = load i32, i32* %6
%120 = sub nsw i32 %119, 1
%121 = call i32 @perlin_noise_3d(i32 %116, i32 %118, i32 %120)
%122 = add nsw i32 %115, %121
%123 = load i32, i32* %4
%124 = load i32, i32* %5
%125 = add nsw i32 %124, 1
%126 = load i32, i32* %6
%127 = sub nsw i32 %126, 1
%128 = call i32 @perlin_noise_3d(i32 %123, i32 %125, i32 %127)
%129 = add nsw i32 %122, %128
%130 = load i32, i32* %4
%131 = sub nsw i32 %130, 1
%132 = load i32, i32* %5
%133 = sub nsw i32 %132, 1
%134 = load i32, i32* %6
%135 = call i32 @perlin_noise_3d(i32 %131, i32 %133, i32 %134)
%136 = add nsw i32 %129, %135
%137 = load i32, i32* %4
%138 = add nsw i32 %137, 1
%139 = load i32, i32* %5
%140 = sub nsw i32 %139, 1
%141 = load i32, i32* %6
%142 = call i32 @perlin_noise_3d(i32 %138, i32 %140, i32 %141)
%143 = add nsw i32 %136, %142
%144 = load i32, i32* %4
%145 = add nsw i32 %144, 1
%146 = load i32, i32* %5
%147 = add nsw i32 %146, 1
%148 = load i32, i32* %6
%149 = call i32 @perlin_noise_3d(i32 %145, i32 %147, i32 %148)
%150 = add nsw i32 %143, %149
%151 = load i32, i32* %4
%152 = sub nsw i32 %151, 1
%153 = load i32, i32* %5
%154 = add nsw i32 %153, 1
%155 = load i32, i32* %6
%156 = call i32 @perlin_noise_3d(i32 %152, i32 %154, i32 %155)
%157 = add nsw i32 %150, %156
%158 = sdiv i32 %157, 8
%159 = sitofp i32 %158 to float
store float %159, float* %8
%160 = load i32, i32* %4
%161 = load i32, i32* %5
%162 = call i32 @perlin_noise_2d(i32 %160, i32 %161)
%163 = sdiv i32 %162, 12
%164 = sitofp i32 %163 to float
store float %164, float* %9
%165 = load float, float* %7
%166 = load float, float* %8
%167 = fadd float %165, %166
%168 = load float, float* %9
%169 = fadd float %167, %168
ret float %169
}

LLVM IR (-O2):
define float @perlin_smooth_noise_3d(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, -1
%5 = add nsw i32 %1, -1
%6 = add nsw i32 %2, 1
%7 = tail call i32 @perlin_noise_3d(i32 %4, i32 %5, i32 %6)
%8 = add nsw i32 %0, 1
%9 = tail call i32 @perlin_noise_3d(i32 %8, i32 %5, i32 %6)
%10 = add nsw i32 %9, %7
%11 = add nsw i32 %1, 1
%12 = tail call i32 @perlin_noise_3d(i32 %4, i32 %11, i32 %6)
%13 = add nsw i32 %10, %12
%14 = tail call i32 @perlin_noise_3d(i32 %8, i32 %11, i32 %6)
%15 = add nsw i32 %13, %14
%16 = add nsw i32 %2, -1
%17 = tail call i32 @perlin_noise_3d(i32 %4, i32 %5, i32 %16)
%18 = add nsw i32 %15, %17
%19 = tail call i32 @perlin_noise_3d(i32 %8, i32 %5, i32 %16)
%20 = add nsw i32 %18, %19
%21 = tail call i32 @perlin_noise_3d(i32 %4, i32 %11, i32 %16)
%22 = add nsw i32 %20, %21
%23 = tail call i32 @perlin_noise_3d(i32 %8, i32 %11, i32 %16)
%24 = add nsw i32 %22, %23
%25 = sdiv i32 %24, 16
%26 = sitofp i32 %25 to float
%27 = tail call i32 @perlin_noise_3d(i32 %4, i32 %1, i32 %6)
%28 = tail call i32 @perlin_noise_3d(i32 %8, i32 %1, i32 %6)
%29 = add nsw i32 %28, %27
%30 = tail call i32 @perlin_noise_3d(i32 %0, i32 %5, i32 %6)
%31 = add nsw i32 %29, %30
%32 = tail call i32 @perlin_noise_3d(i32 %0, i32 %11, i32 %6)
%33 = add nsw i32 %31, %32
%34 = tail call i32 @perlin_noise_3d(i32 %4, i32 %1, i32 %16)
%35 = add nsw i32 %33, %34
%36 = tail call i32 @perlin_noise_3d(i32 %8, i32 %1, i32 %16)
%37 = add nsw i32 %35, %36
%38 = tail call i32 @perlin_noise_3d(i32 %0, i32 %5, i32 %16)
%39 = add nsw i32 %37, %38
%40 = tail call i32 @perlin_noise_3d(i32 %0, i32 %11, i32 %16)
%41 = add nsw i32 %39, %40
%42 = tail call i32 @perlin_noise_3d(i32 %4, i32 %5, i32 %2)
%43 = add nsw i32 %41, %42
%44 = tail call i32 @perlin_noise_3d(i32 %8, i32 %5, i32 %2)
%45 = add nsw i32 %43, %44
%46 = tail call i32 @perlin_noise_3d(i32 %8, i32 %11, i32 %2)
%47 = add nsw i32 %45, %46
%48 = tail call i32 @perlin_noise_3d(i32 %4, i32 %11, i32 %2)
%49 = add nsw i32 %47, %48
%50 = sdiv i32 %49, 8
%51 = sitofp i32 %50 to float
%52 = tail call i32 @perlin_noise_2d(i32 %0, i32 %1)
%53 = sdiv i32 %52, 12
%54 = sitofp i32 %53 to float
%55 = fadd float %26, %51
%56 = fadd float %55, %54
ret float %56
}