#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 */
double cos(double);
double noise1u(int);
double sin(double);
float sqrt(double);
float TorusNoise(double x, double y, double z, float thick, float radius) {
  int i = (((x) > 0) ? ((int)x) : (((int)x) - 1));
  int k = (((z) > 0) ? ((int)z) : (((int)z) - 1));
  double dy = y;
  float minval = 999;
  int ox, oz;
  for (ox = -1; ox <= 1; ox++) {
    for (oz = -1; oz <= 1; oz++) {
      double fx = x - i - ox;
      double fz = z - k - oz;
      double dx = fx - 0.5f;
      double dz = fz - 0.5f;
      int id = (i + ox) * 876543 + (k + oz);
      double ang = noise1u(id) * 2 * 3.14159265f;
      double tilt = noise1u(id + 98765) * 0.5 * 3.14159265f;
      double ti = cos(tilt);
      double rx = cos(ang) * ti;
      double ry = sin(ang) * ti;
      double rz = sin(tilt);
      double h = dx * rx + dy * ry + dz * rz;
      double l2 = dx * dx + dy * dy + dz * dz;
      double d = sqrt(l2 - h * h);
      double a = d - radius;
      float val = sqrt(a * a + h * h) - thick;
      if (val < minval)
        minval = val;
    }
  }
  return minval;
}


x86 assembly (clang, -O0):
<TorusNoise>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movss  %xmm3,-0x1c(%rbp)
movss  %xmm4,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1186 <TorusNoise+0x46>
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc0(%rbp)
jmp    1194 <TorusNoise+0x54>
cvttsd2si -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc0(%rbp)
mov    -0xc0(%rbp),%eax
mov    %eax,-0x24(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11bf <TorusNoise+0x7f>
cvttsd2si -0x18(%rbp),%eax
mov    %eax,-0xc4(%rbp)
jmp    11cd <TorusNoise+0x8d>
cvttsd2si -0x18(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc4(%rbp)
mov    -0xc4(%rbp),%eax
mov    %eax,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movss  0xe18(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
movl   $0xffffffff,-0x38(%rbp)
cmpl   $0x1,-0x38(%rbp)
jg     1486 <TorusNoise+0x346>
movl   $0xffffffff,-0x3c(%rbp)
cmpl   $0x1,-0x3c(%rbp)
jg     1473 <TorusNoise+0x333>
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
subsd  %xmm1,%xmm0
cvtsi2sdl -0x38(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
subsd  %xmm1,%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xdbc(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  0xda6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x24(%rbp),%eax
add    -0x38(%rbp),%eax
imul   $0xd5fff,%eax,%eax
mov    -0x28(%rbp),%ecx
add    -0x3c(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%edi
call   1040 <noise1u@plt>
movsd  0xd7e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd62(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x64(%rbp),%edi
add    $0x181cd,%edi
call   1040 <noise1u@plt>
movsd  0xd4b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd37(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
call   1050 <cos@plt>
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
call   1030 <sin@plt>
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x58(%rbp),%xmm1
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x30(%rbp),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x58(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm2
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movss  -0x20(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  -0xb8(%rbp),%xmm2
ff
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
subss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0xbc(%rbp)
ff
movss  -0xbc(%rbp),%xmm1
ff
movss  -0x34(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1460 <TorusNoise+0x320>
movss  -0xbc(%rbp),%xmm0
ff
movss  %xmm0,-0x34(%rbp)
jmp    1465 <TorusNoise+0x325>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1205 <TorusNoise+0xc5>
jmp    1478 <TorusNoise+0x338>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11f4 <TorusNoise+0xb4>
movss  -0x34(%rbp),%xmm0
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TorusNoise>:
push   %rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
movss  %xmm3,0x1c(%rsp)
xorpd  %xmm3,%xmm3
xor    %eax,%eax
ucomisd %xmm3,%xmm0
setbe  %al
cvttsd2si %xmm0,%ecx
sub    %eax,%ecx
xor    %eax,%eax
ucomisd %xmm3,%xmm2
setbe  %al
cvttsd2si %xmm2,%edx
imul   $0xd5fff,%ecx,%ebx
add    %edx,%ebx
sub    %eax,%edx
xorps  %xmm3,%xmm3
cvtsi2sd %ecx,%xmm3
subsd  %xmm3,%xmm0
movsd  %xmm0,0x68(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
subsd  %xmm0,%xmm2
movsd  %xmm1,0x40(%rsp)
mulsd  %xmm1,%xmm1
movsd  %xmm1,0x60(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm4,%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0xe44(%rip),%xmm0
addsd  %xmm2,%xmm0
movsd  0xe40(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x58(%rsp)
movapd %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x50(%rsp)
movsd  0xe28(%rip),%xmm3
addsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x70(%rsp)
sub    %eax,%ebx
add    $0xfff421cf,%ebx
movss  0xe22(%rip),%xmm0
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movss  %xmm0,0xc(%rsp)
movsd  %xmm3,0x78(%rsp)
movsd  0x68(%rsp),%xmm1
subsd  %xmm3,%xmm1
addsd  0xdda(%rip),%xmm1
movsd  %xmm1,0x48(%rsp)
lea    -0x181ce(%rbx,%rbp,1),%r14d
ff
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  0x60(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
lea    (%rbx,%rbp,1),%edi
add    $0xfffe7e31,%edi
call   1040 <noise1u@plt>
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movsd  0xdaa(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
lea    (%rbx,%rbp,1),%edi
add    $0xfffffffe,%edi
call   1040 <noise1u@plt>
movapd %xmm0,%xmm1
movsd  0xd92(%rip),%xmm0
mulsd  %xmm0,%xmm1
mulsd  0xd7e(%rip),%xmm1
movsd  %xmm1,0x28(%rsp)
movapd %xmm1,%xmm0
call   1050 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1050 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x28(%rsp),%xmm0
call   1030 <sin@plt>
movapd %xmm0,%xmm1
movsd  (%rsp),%xmm2
mulsd  0x40(%rsp),%xmm2
movsd  0x20(%rsp),%xmm0
mulsd  0x48(%rsp),%xmm0
addsd  %xmm2,%xmm0
movapd %xmm0,%xmm2
movsd  0x58(%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm0
addsd  0x30(%rsp),%xmm0
mulsd  %xmm1,%xmm1
movsd  %xmm1,(%rsp)
subsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
cvtss2sd %xmm0,%xmm0
subsd  0x38(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  (%rsp),%xmm0
call   1060 <sqrt@plt>
subss  0x1c(%rsp),%xmm0
minss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r14d,%edi
call   1040 <noise1u@plt>
addsd  %xmm0,%xmm0
mulsd  0xca8(%rip),%xmm0
movsd  %xmm0,(%rsp)
lea    (%rbx,%rbp,1),%edi
add    $0xffffffff,%edi
call   1040 <noise1u@plt>
mulsd  0xc98(%rip),%xmm0
mulsd  0xc88(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
call   1050 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1050 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x28(%rsp),%xmm0
call   1030 <sin@plt>
movapd %xmm0,%xmm1
movsd  (%rsp),%xmm2
mulsd  0x40(%rsp),%xmm2
movsd  0x20(%rsp),%xmm0
mulsd  0x48(%rsp),%xmm0
addsd  %xmm2,%xmm0
movapd %xmm0,%xmm2
movsd  0x50(%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm0
addsd  0x30(%rsp),%xmm0
mulsd  %xmm1,%xmm1
movsd  %xmm1,(%rsp)
subsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
cvtss2sd %xmm0,%xmm0
subsd  0x38(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  (%rsp),%xmm0
call   1060 <sqrt@plt>
subss  0x1c(%rsp),%xmm0
minss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
lea    (%rbx,%rbp,1),%edi
add    $0xfffe7e33,%edi
call   1040 <noise1u@plt>
addsd  %xmm0,%xmm0
mulsd  0xbb0(%rip),%xmm0
movsd  %xmm0,(%rsp)
lea    (%rbx,%rbp,1),%edi
call   1040 <noise1u@plt>
mulsd  0xba3(%rip),%xmm0
mulsd  0xb93(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
call   1050 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1050 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x28(%rsp),%xmm0
call   1030 <sin@plt>
movapd %xmm0,%xmm1
movsd  (%rsp),%xmm2
mulsd  0x40(%rsp),%xmm2
movsd  0x20(%rsp),%xmm0
mulsd  0x48(%rsp),%xmm0
addsd  %xmm2,%xmm0
movapd %xmm0,%xmm2
movsd  0x70(%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm0
addsd  0x30(%rsp),%xmm0
mulsd  %xmm1,%xmm1
movsd  %xmm1,0x30(%rsp)
subsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
cvtss2sd %xmm0,%xmm0
subsd  0x38(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  0x30(%rsp),%xmm0
call   1060 <sqrt@plt>
movsd  0x78(%rsp),%xmm3
subss  0x1c(%rsp),%xmm0
minss  0xc(%rsp),%xmm0
addsd  0xab3(%rip),%xmm3
add    $0xd5fff,%ebp
cmp    $0x281ffd,%ebp
jne    1210 <TorusNoise+0xd0>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define float @TorusNoise(double %0, double %1, double %2, float %3, float %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca float
%10 = alloca float
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca float
%15 = alloca i32
%16 = alloca i32
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca i32
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca float
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store float %3, float* %9
store float %4, float* %10
%33 = load double, double* %6
%34 = fcmp ogt double %33, 0.000000e+00
br i1 %34, label %35, label %38
35: ; preds = %5
%36 = load double, double* %6
%37 = fptosi double %36 to i32
br label %42
38: ; preds = %5
%39 = load double, double* %6
%40 = fptosi double %39 to i32
%41 = sub nsw i32 %40, 1
br label %42
42: ; preds = %38, %35
%43 = phi i32 [ %37, %35 ], [ %41, %38 ]
store i32 %43, i32* %11
%44 = load double, double* %8
%45 = fcmp ogt double %44, 0.000000e+00
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = load double, double* %8
%48 = fptosi double %47 to i32
br label %53
49: ; preds = %42
%50 = load double, double* %8
%51 = fptosi double %50 to i32
%52 = sub nsw i32 %51, 1
br label %53
53: ; preds = %49, %46
%54 = phi i32 [ %48, %46 ], [ %52, %49 ]
store i32 %54, i32* %12
%55 = load double, double* %7
store double %55, double* %13
store float 9.990000e+02, float* %14
store i32 -1, i32* %15
br label %56
56: ; preds = %159, %53
%57 = load i32, i32* %15
%58 = icmp sle i32 %57, 1
br i1 %58, label %59, label %162
59: ; preds = %56
store i32 -1, i32* %16
br label %60
60: ; preds = %155, %59
%61 = load i32, i32* %16
%62 = icmp sle i32 %61, 1
br i1 %62, label %63, label %158
63: ; preds = %60
%64 = load double, double* %6
%65 = load i32, i32* %11
%66 = sitofp i32 %65 to double
%67 = fsub double %64, %66
%68 = load i32, i32* %15
%69 = sitofp i32 %68 to double
%70 = fsub double %67, %69
store double %70, double* %17
%71 = load double, double* %8
%72 = load i32, i32* %12
%73 = sitofp i32 %72 to double
%74 = fsub double %71, %73
%75 = load i32, i32* %16
%76 = sitofp i32 %75 to double
%77 = fsub double %74, %76
store double %77, double* %18
%78 = load double, double* %17
%79 = fsub double %78, 5.000000e-01
store double %79, double* %19
%80 = load double, double* %18
%81 = fsub double %80, 5.000000e-01
store double %81, double* %20
%82 = load i32, i32* %11
%83 = load i32, i32* %15
%84 = add nsw i32 %82, %83
%85 = mul nsw i32 %84, 876543
%86 = load i32, i32* %12
%87 = load i32, i32* %16
%88 = add nsw i32 %86, %87
%89 = add nsw i32 %85, %88
store i32 %89, i32* %21
%90 = load i32, i32* %21
%91 = call double @noise1u(i32 %90)
%92 = fmul double %91, 2.000000e+00
%93 = fmul double %92, 0x400921FB60000000
store double %93, double* %22
%94 = load i32, i32* %21
%95 = add nsw i32 %94, 98765
%96 = call double @noise1u(i32 %95)
%97 = fmul double %96, 5.000000e-01
%98 = fmul double %97, 0x400921FB60000000
store double %98, double* %23
%99 = load double, double* %23
%100 = call double @cos(double %99)
store double %100, double* %24
%101 = load double, double* %22
%102 = call double @cos(double %101)
%103 = load double, double* %24
%104 = fmul double %102, %103
store double %104, double* %25
%105 = load double, double* %22
%106 = call double @sin(double %105)
%107 = load double, double* %24
%108 = fmul double %106, %107
store double %108, double* %26
%109 = load double, double* %23
%110 = call double @sin(double %109)
store double %110, double* %27
%111 = load double, double* %19
%112 = load double, double* %25
%113 = load double, double* %13
%114 = load double, double* %26
%115 = fmul double %113, %114
%116 = call double @llvm.fmuladd.f64(double %111, double %112, double %115)
%117 = load double, double* %20
%118 = load double, double* %27
%119 = call double @llvm.fmuladd.f64(double %117, double %118, double %116)
store double %119, double* %28
%120 = load double, double* %19
%121 = load double, double* %19
%122 = load double, double* %13
%123 = load double, double* %13
%124 = fmul double %122, %123
%125 = call double @llvm.fmuladd.f64(double %120, double %121, double %124)
%126 = load double, double* %20
%127 = load double, double* %20
%128 = call double @llvm.fmuladd.f64(double %126, double %127, double %125)
store double %128, double* %29
%129 = load double, double* %29
%130 = load double, double* %28
%131 = load double, double* %28
%132 = fneg double %130
%133 = call double @llvm.fmuladd.f64(double %132, double %131, double %129)
%134 = call float @sqrt(double %133)
%135 = fpext float %134 to double
store double %135, double* %30
%136 = load double, double* %30
%137 = load float, float* %10
%138 = fpext float %137 to double
%139 = fsub double %136, %138
store double %139, double* %31
%140 = load double, double* %31
%141 = load double, double* %31
%142 = load double, double* %28
%143 = load double, double* %28
%144 = fmul double %142, %143
%145 = call double @llvm.fmuladd.f64(double %140, double %141, double %144)
%146 = call float @sqrt(double %145)
%147 = load float, float* %9
%148 = fsub float %146, %147
store float %148, float* %32
%149 = load float, float* %32
%150 = load float, float* %14
%151 = fcmp olt float %149, %150
br i1 %151, label %152, label %154
152: ; preds = %63
%153 = load float, float* %32
store float %153, float* %14
br label %154
154: ; preds = %152, %63
br label %155
155: ; preds = %154
%156 = load i32, i32* %16
%157 = add nsw i32 %156, 1
store i32 %157, i32* %16
br label %60
158: ; preds = %60
br label %159
159: ; preds = %158
%160 = load i32, i32* %15
%161 = add nsw i32 %160, 1
store i32 %161, i32* %15
br label %56
162: ; preds = %56
%163 = load float, float* %14
ret float %163
}

LLVM IR (-O2):
define float @TorusNoise(double %0, double %1, double %2, float %3, float %4) {
%6 = fcmp ule double %0, 0.000000e+00
%7 = fptosi double %0 to i32
%8 = sext i1 %6 to i32
%9 = add nsw i32 %8, %7
%10 = fcmp ule double %2, 0.000000e+00
%11 = fptosi double %2 to i32
%12 = sext i1 %10 to i32
%13 = add nsw i32 %12, %11
%14 = sitofp i32 %9 to double
%15 = fsub double %0, %14
%16 = sitofp i32 %13 to double
%17 = fsub double %2, %16
%18 = fmul double %1, %1
%19 = fpext float %4 to double
%20 = fadd double %17, 1.000000e+00
%21 = fadd double %20, -5.000000e-01
%22 = fadd double %17, -5.000000e-01
%23 = fadd double %17, -1.000000e+00
%24 = fadd double %23, -5.000000e-01
br label %25
25: ; preds = %5, %25
%26 = phi float [ 9.990000e+02, %5 ], [ %120, %25 ]
%27 = phi i32 [ -1, %5 ], [ %121, %25 ]
%28 = sitofp i32 %27 to double
%29 = fsub double %15, %28
%30 = fadd double %29, -5.000000e-01
%31 = add nsw i32 %27, %9
%32 = mul nsw i32 %31, 876543
%33 = add i32 %32, %13
%34 = tail call double @llvm.fmuladd.f64(double %30, double %30, double %18)
%35 = add i32 %33, -1
%36 = tail call double @noise1u(i32 %35)
%37 = fmul double %36, 2.000000e+00
%38 = fmul double %37, 0x400921FB60000000
%39 = add i32 %33, 98764
%40 = tail call double @noise1u(i32 %39)
%41 = fmul double %40, 5.000000e-01
%42 = fmul double %41, 0x400921FB60000000
%43 = tail call double @cos(double %42)
%44 = tail call double @cos(double %38)
%45 = fmul double %43, %44
%46 = tail call double @sin(double %38)
%47 = fmul double %43, %46
%48 = tail call double @sin(double %42)
%49 = fmul double %47, %1
%50 = tail call double @llvm.fmuladd.f64(double %30, double %45, double %49)
%51 = tail call double @llvm.fmuladd.f64(double %21, double %48, double %50)
%52 = tail call double @llvm.fmuladd.f64(double %21, double %21, double %34)
%53 = fneg double %51
%54 = tail call double @llvm.fmuladd.f64(double %53, double %51, double %52)
%55 = tail call float @sqrt(double %54)
%56 = fpext float %55 to double
%57 = fsub double %56, %19
%58 = fmul double %51, %51
%59 = tail call double @llvm.fmuladd.f64(double %57, double %57, double %58)
%60 = tail call float @sqrt(double %59)
%61 = fsub float %60, %3
%62 = fcmp olt float %61, %26
%63 = select i1 %62, float %61, float %26
%64 = tail call double @noise1u(i32 %33)
%65 = fmul double %64, 2.000000e+00
%66 = fmul double %65, 0x400921FB60000000
%67 = add nsw i32 %33, 98765
%68 = tail call double @noise1u(i32 %67)
%69 = fmul double %68, 5.000000e-01
%70 = fmul double %69, 0x400921FB60000000
%71 = tail call double @cos(double %70)
%72 = tail call double @cos(double %66)
%73 = fmul double %71, %72
%74 = tail call double @sin(double %66)
%75 = fmul double %71, %74
%76 = tail call double @sin(double %70)
%77 = fmul double %75, %1
%78 = tail call double @llvm.fmuladd.f64(double %30, double %73, double %77)
%79 = tail call double @llvm.fmuladd.f64(double %22, double %76, double %78)
%80 = tail call double @llvm.fmuladd.f64(double %22, double %22, double %34)
%81 = fneg double %79
%82 = tail call double @llvm.fmuladd.f64(double %81, double %79, double %80)
%83 = tail call float @sqrt(double %82)
%84 = fpext float %83 to double
%85 = fsub double %84, %19
%86 = fmul double %79, %79
%87 = tail call double @llvm.fmuladd.f64(double %85, double %85, double %86)
%88 = tail call float @sqrt(double %87)
%89 = fsub float %88, %3
%90 = fcmp olt float %89, %63
%91 = select i1 %90, float %89, float %63
%92 = add i32 %33, 1
%93 = tail call double @noise1u(i32 %92)
%94 = fmul double %93, 2.000000e+00
%95 = fmul double %94, 0x400921FB60000000
%96 = add i32 %33, 98766
%97 = tail call double @noise1u(i32 %96)
%98 = fmul double %97, 5.000000e-01
%99 = fmul double %98, 0x400921FB60000000
%100 = tail call double @cos(double %99)
%101 = tail call double @cos(double %95)
%102 = fmul double %100, %101
%103 = tail call double @sin(double %95)
%104 = fmul double %100, %103
%105 = tail call double @sin(double %99)
%106 = fmul double %104, %1
%107 = tail call double @llvm.fmuladd.f64(double %30, double %102, double %106)
%108 = tail call double @llvm.fmuladd.f64(double %24, double %105, double %107)
%109 = tail call double @llvm.fmuladd.f64(double %24, double %24, double %34)
%110 = fneg double %108
%111 = tail call double @llvm.fmuladd.f64(double %110, double %108, double %109)
%112 = tail call float @sqrt(double %111)
%113 = fpext float %112 to double
%114 = fsub double %113, %19
%115 = fmul double %108, %108
%116 = tail call double @llvm.fmuladd.f64(double %114, double %114, double %115)
%117 = tail call float @sqrt(double %116)
%118 = fsub float %117, %3
%119 = fcmp olt float %118, %91
%120 = select i1 %119, float %118, float %91
%121 = add nsw i32 %27, 1
%122 = icmp eq i32 %121, 2
br i1 %122, label %123, label %25
123: ; preds = %25
ret float %120
}