#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 */
float big_sxnoise_2d(float, float, int);
float dendroid_noise(float, float);
float dendroid_and_simplex(float x, float y) {
  float sx = big_sxnoise_2d(x * 1.5, y * 1.5, 1737);
  float dn = dendroid_noise(x, y);
  return ((0.3 + 0.7 * (1 - 0.5 * (1 + sx))) * dn + sx) / 2.0;
}


x86 assembly (clang, -O0):
<dendroid_and_simplex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xecc(%rip),%xmm2
mulsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
mov    $0x6c9,%edi
call   1030 <big_sxnoise_2d@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <dendroid_noise@plt>
movss  %xmm0,-0x10(%rbp)
movss  0xea1(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe78(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe74(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe50(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe4c(%rip),%xmm1
addsd  %xmm1,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe16(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dendroid_and_simplex>:
sub    $0x18,%rsp
movaps %xmm1,%xmm2
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0x14(%rsp)
movss  0xec5(%rip),%xmm1
mulss  %xmm1,%xmm0
mulss  %xmm2,%xmm1
mov    $0x6c9,%edi
call   1030 <big_sxnoise_2d@plt>
movss  %xmm0,0xc(%rsp)
movss  0x14(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
call   1040 <dendroid_noise@plt>
movss  0xc(%rsp),%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
addss  0xe8b(%rip),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  0xe83(%rip),%xmm2
addsd  0xe83(%rip),%xmm2
mulsd  0xe83(%rip),%xmm2
addsd  0xe83(%rip),%xmm2
cvtss2sd %xmm0,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xe77(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @dendroid_and_simplex(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fmul double %8, 1.500000e+00
%10 = fptrunc double %9 to float
%11 = load float, float* %4
%12 = fpext float %11 to double
%13 = fmul double %12, 1.500000e+00
%14 = fptrunc double %13 to float
%15 = call float @big_sxnoise_2d(float %10, float %14, i32 1737)
store float %15, float* %5
%16 = load float, float* %3
%17 = load float, float* %4
%18 = call float @dendroid_noise(float %16, float %17)
store float %18, float* %6
%19 = load float, float* %5
%20 = fadd float 1.000000e+00, %19
%21 = fpext float %20 to double
%22 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %21, double 1.000000e+00)
%23 = call double @llvm.fmuladd.f64(double 0x3FE6666666666666, double %22, double 3.000000e-01)
%24 = load float, float* %6
%25 = fpext float %24 to double
%26 = load float, float* %5
%27 = fpext float %26 to double
%28 = call double @llvm.fmuladd.f64(double %23, double %25, double %27)
%29 = fdiv double %28, 2.000000e+00
%30 = fptrunc double %29 to float
ret float %30
}

LLVM IR (-O2):
define float @dendroid_and_simplex(float %0, float %1) {
%3 = fmul float %0, 1.500000e+00
%4 = fmul float %1, 1.500000e+00
%5 = tail call float @big_sxnoise_2d(float %3, float %4, i32 1737)
%6 = tail call float @dendroid_noise(float %0, float %1)
%7 = fadd float %5, 1.000000e+00
%8 = fpext float %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %8, double -5.000000e-01, double 1.000000e+00)
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0x3FE6666666666666, double 3.000000e-01)
%11 = fpext float %6 to double
%12 = fpext float %5 to double
%13 = tail call double @llvm.fmuladd.f64(double %10, double %11, double %12)
%14 = fmul double %13, 5.000000e-01
%15 = fptrunc double %14 to float
ret float %15
}