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

static const float Lut2[ 8 ][ 2 ] =
{
    { -1.0f, -1.0f }, { 1.0f, 0.0f }, { -1.0f, 0.0f }, { 1.0f, 1.0f },
    { -1.0f, 1.0f }, { 0.0f, -1.0f }, { 0.0f, 1.0f }, { 1.0f, -1.0f }
};

void findGradient( int hash, float* gx, float* gy )
{
    int h = hash & 7;
    *gx = Lut2[ h ][ 0 ];
    *gy = Lut2[ h ][ 1 ];
}

float computeSimplexContribution( float x, float y, int i, int j )
{
    float n = 0.0f;

    float t = 0.5f - x * x - y * y;
    if( t >= 0.0f )
    {
        float gx, gy;
        findGradient( Permutations[ i + Permutations[ j ] ], &gx, &gy );

        t = t * t * t * t;
        n = t * ( x * gx + y * gy );
    }

    return n;
}

//https://github.com/stegu/perlin-noise/blob/master/src/sdnoise1234.c
float simplex2D( float x, float y )
{
    const float F = 0.366025403f;
    const float G = 0.211324865f;

    float s = ( x + y ) * F;
    float xs = x + s;
    float ys = y + s;

    int i = floor( xs );
    int j = floor( ys );

    float t = ( i + j ) * G;

    float x0 = x - ( i - t );
    float y0 = y - ( j - t );

    int i1, j1;

    if( x0 > y0 )
    {
        i1 = 1;
        j1 = 0;
    }
    else
    {
        i1 = 0;
        j1 = 1;
    }

    float x1 = x0 - i1 + G;
    float y1 = y0 - j1 + G;
    float x2 = x0 - 1.0f + 2.0f * G;
    float y2 = y0 - 1.0f + 2.0f * G;

    int ii = i & 0xFF;
    int jj = j & 0xFF;

    float n0 = computeSimplexContribution( x0, y0, ii, jj );
    float n1 = computeSimplexContribution( x1, y1, ii + i1, jj + j1 );
    float n2 = computeSimplexContribution( x2, y2, ii + 1, jj + 1 );

    return 40.0f * ( n0 + n1 + n2 );
}

float fbm( float x, float y, int octaves, float lacunarity, float gain )
{
    float value = 0.0f;
    float frequency = 1.0f;
    float amplitude = 0.5f;

    for( int i = 0; i < octaves; i++ )
    {
        float noise = simplex2D( x * frequency, y * frequency );

        value += noise * amplitude;
        frequency *= lacunarity;
        amplitude *= gain;
    }

    return value;
}

float fbmRidged( float x, float y, int octaves, float lacunarity, float gain )
{
    float value = 0.0f;
    float amplitude = 0.5f;
    float frequency = 1.0f;

    for( int i = 0; i < octaves; i++ )
    {
        float noise = 1.0 - abs( simplex2D( x * frequency, y * frequency ) );

        value += noise * amplitude;
        frequency *= lacunarity;
        amplitude *= gain;
    }

    return value;
}

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

    __constant__
    static const float Lut2[ 8 ][ 2 ] =
    {
        { -1.0f, -1.0f }, { 1.0f, 0.0f }, { -1.0f, 0.0f }, { 1.0f, 1.0f },
        { -1.0f, 1.0f }, { 0.0f, -1.0f }, { 0.0f, 1.0f }, { 1.0f, -1.0f }
    };

    __device__
    void findGradient( int hash, float* gx, float* gy )
    {
        int h = hash & 7;
        *gx = Lut2[ h ][ 0 ];
        *gy = Lut2[ h ][ 1 ];
    }

    __device__
    float computeSimplexContribution( float x, float y, int hash )
    {
        float n = 0.0f;

        float t = 0.5f - x * x - y * y;
        if( t >= 0.0f )
        {
            float gx, gy;
            findGradient( hash, &gx, &gy );

            t = t * t * t * t;
            n = t * ( x * gx + y * gy );
        }

        return n;
    }

    __device__
    //https://github.com/stegu/perlin-noise/blob/master/src/sdnoise1234.c
    float simplex2D( float x, float y )
    {
        const float F = 0.366025403f;
        const float G = 0.211324865f;

        float s = ( x + y ) * F;
        float xs = x + s;
        float ys = y + s;

        int i = floor( xs );
        int j = floor( ys );

        float t = ( i + j ) * G;

        float x0 = x - ( i - t );
        float y0 = y - ( j - t );

        int i1, j1;

        if( x0 > y0 )
        {
            i1 = 1;
            j1 = 0;
        }
        else
        {
            i1 = 0;
            j1 = 1;
        }

        float x1 = x0 - i1 + G;
        float y1 = y0 - j1 + G;
        float x2 = x0 - 1.0f + 2.0f * G;
        float y2 = y0 - 1.0f + 2.0f * G;

        int ii = i & 0xFF;
        int jj = j & 0xFF;

        float n0 = computeSimplexContribution( x0, y0, Permutations[ ii + Permutations[ jj ] ] );
        float n1 = computeSimplexContribution( x1, y1, Permutations[ ii + i1 + Permutations[ jj + j1 ] ] );
        float n2 = computeSimplexContribution( x2, y2, Permutations[ ii + 1 + Permutations[ jj + 1 ] ] );

        return 40.0f * ( n0 + n1 + n2 );
    }

    __device__
    float fbm( float x, float y, int octaves, float lacunarity, float gain )
    {
        float value = 0.0f;
        float frequency = 1.0f;
        float amplitude = 0.5f;

        for( int i = 0; i < octaves; i++ )
        {
            float noise = simplex2D( x * frequency, y * frequency );

            value += noise * amplitude;
            frequency *= lacunarity;
            amplitude *= gain;
        }

        return value;
    }

    __device__
    float fbmRidged( float x, float y, int octaves, float lacunarity, float gain )
    {
        float value = 0.0f;
        float amplitude = 0.5f;
        float frequency = 1.0f;

        for( int i = 0; i < octaves; i++ )
        {
            float noise = 1.0 - abs( simplex2D( x * frequency, y * frequency ) );

            value += noise * amplitude;
            frequency *= lacunarity;
            amplitude *= gain;
        }

        return value;
    }
}
	.file	"tmpxft_003b0cdb_00000000-6_noise.inl.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2020:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2020:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z12findGradientiPfS_
	.type	_Z12findGradientiPfS_, @function
_Z12findGradientiPfS_:
.LFB2008:
	.cfi_startproc
	endbr64
	leaq	_ZL4Lut2(%rip), %rax
	andl	$7, %edi
	movss	(%rax,%rdi,8), %xmm0
	movss	%xmm0, (%rsi)
	movss	4(%rax,%rdi,8), %xmm0
	movss	%xmm0, (%rdx)
	ret
	.cfi_endproc
.LFE2008:
	.size	_Z12findGradientiPfS_, .-_Z12findGradientiPfS_
	.globl	_Z26computeSimplexContributionffii
	.type	_Z26computeSimplexContributionffii, @function
_Z26computeSimplexContributionffii:
.LFB2009:
	.cfi_startproc
	endbr64
	movaps	%xmm0, %xmm2
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movss	.LC1(%rip), %xmm3
	movq	%fs:40, %rdx
	movq	%rdx, 8(%rsp)
	xorl	%edx, %edx
	mulss	%xmm0, %xmm0
	subss	%xmm0, %xmm3
	movaps	%xmm1, %xmm0
	mulss	%xmm1, %xmm0
	subss	%xmm0, %xmm3
	xorps	%xmm0, %xmm0
	comiss	%xmm0, %xmm3
	jb	.L9
	leaq	_ZL12Permutations(%rip), %rdx
	movslq	%esi, %rsi
	movl	%edi, %eax
	movq	%rsp, %rcx
	movzbl	(%rdx,%rsi), %edi
	leaq	4(%rsp), %r8
	movq	%rcx, %rsi
	movaps	%xmm3, %xmm4
	addl	%eax, %edi
	movslq	%edi, %rdi
	movzbl	(%rdx,%rdi), %edi
	movq	%r8, %rdx
	call	_Z12findGradientiPfS_
	mulss	%xmm3, %xmm4
	mulss	(%rsp), %xmm2
	mulss	4(%rsp), %xmm1
	mulss	%xmm3, %xmm4
	movaps	%xmm2, %xmm0
	addss	%xmm1, %xmm0
	mulss	%xmm3, %xmm4
	mulss	%xmm4, %xmm0
	jmp	.L3
.L9:
	xorps	%xmm0, %xmm0
.L3:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2009:
	.size	_Z26computeSimplexContributionffii, .-_Z26computeSimplexContributionffii
	.globl	_Z9simplex2Dff
	.type	_Z9simplex2Dff, @function
_Z9simplex2Dff:
.LFB2010:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movss	%xmm1, (%rsp)
	addss	%xmm0, %xmm1
	mulss	.LC2(%rip), %xmm1
	movss	%xmm0, 8(%rsp)
	addss	%xmm1, %xmm0
	movss	%xmm1, 4(%rsp)
	call	floorf@PLT
	movss	4(%rsp), %xmm1
	addss	(%rsp), %xmm1
	cvttss2sil	%xmm0, %ebx
	movaps	%xmm1, %xmm0
	call	floorf@PLT
	movss	.LC3(%rip), %xmm3
	movss	8(%rsp), %xmm2
	cvttss2sil	%xmm0, %ebp
	cvtsi2ssl	%ebx, %xmm4
	leal	(%rbx,%rbp), %eax
	movzbl	%bl, %ebx
	cvtsi2ssl	%eax, %xmm1
	movl	%ebx, %edi
	mulss	%xmm3, %xmm1
	subss	%xmm1, %xmm4
	subss	%xmm4, %xmm2
	movaps	%xmm2, %xmm0
	cvtsi2ssl	%ebp, %xmm2
	movzbl	%bpl, %ebp
	movl	%ebp, %esi
	subss	%xmm1, %xmm2
	movss	(%rsp), %xmm1
	subss	%xmm2, %xmm1
	movaps	%xmm0, %xmm2
	comiss	%xmm1, %xmm0
	seta	%r12b
	setbe	%r13b
	movzbl	%r12b, %r12d
	cvtsi2ssl	%r12d, %xmm4
	subss	%xmm4, %xmm2
	cvtsi2ssl	%r13d, %xmm4
	addss	%xmm3, %xmm2
	movd	%xmm2, %r14d
	movaps	%xmm1, %xmm2
	subss	%xmm4, %xmm2
	movaps	%xmm0, %xmm4
	addss	%xmm3, %xmm2
	movss	.LC4(%rip), %xmm3
	subss	%xmm3, %xmm4
	movd	%xmm2, %r15d
	movss	.LC5(%rip), %xmm2
	addss	%xmm2, %xmm4
	movss	%xmm4, (%rsp)
	movaps	%xmm1, %xmm4
	subss	%xmm3, %xmm4
	addss	%xmm2, %xmm4
	movss	%xmm4, 4(%rsp)
	call	_Z26computeSimplexContributionffii
	leal	0(%r13,%rbp), %esi
	leal	(%r12,%rbx), %edi
	movd	%r15d, %xmm1
	movss	%xmm0, 8(%rsp)
	movd	%r14d, %xmm0
	call	_Z26computeSimplexContributionffii
	movss	4(%rsp), %xmm1
	leal	1(%rbp), %esi
	leal	1(%rbx), %edi
	movss	%xmm0, 12(%rsp)
	movss	(%rsp), %xmm0
	call	_Z26computeSimplexContributionffii
	movaps	%xmm0, %xmm1
	movss	8(%rsp), %xmm0
	addss	12(%rsp), %xmm0
	addss	%xmm1, %xmm0
	mulss	.LC6(%rip), %xmm0
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2010:
	.size	_Z9simplex2Dff, .-_Z9simplex2Dff
	.globl	_Z3fbmffiff
	.type	_Z3fbmffiff, @function
_Z3fbmffiff:
.LFB2011:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movss	.LC1(%rip), %xmm4
	movss	%xmm2, 12(%rsp)
	movss	.LC4(%rip), %xmm2
	movss	%xmm3, 16(%rsp)
	xorps	%xmm3, %xmm3
	movss	%xmm0, 4(%rsp)
	movss	%xmm1, 8(%rsp)
.L19:
	cmpl	%ebx, %ebp
	jge	.L22
	movss	4(%rsp), %xmm0
	movss	8(%rsp), %xmm1
	incl	%ebp
	movss	%xmm3, 28(%rsp)
	movss	%xmm4, 24(%rsp)
	mulss	%xmm2, %xmm0
	movss	%xmm2, 20(%rsp)
	mulss	%xmm2, %xmm1
	call	_Z9simplex2Dff
	movss	24(%rsp), %xmm4
	movss	28(%rsp), %xmm3
	movss	20(%rsp), %xmm2
	mulss	12(%rsp), %xmm2
	mulss	%xmm4, %xmm0
	mulss	16(%rsp), %xmm4
	addss	%xmm0, %xmm3
	jmp	.L19
.L22:
	addq	$40, %rsp
	.cfi_def_cfa_offset 24
	movaps	%xmm3, %xmm0
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2011:
	.size	_Z3fbmffiff, .-_Z3fbmffiff
	.globl	_Z9fbmRidgedffiff
	.type	_Z9fbmRidgedffiff, @function
_Z9fbmRidgedffiff:
.LFB2012:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movss	.LC1(%rip), %xmm4
	movss	%xmm2, 12(%rsp)
	movss	.LC4(%rip), %xmm2
	movss	%xmm3, 16(%rsp)
	xorps	%xmm3, %xmm3
	movss	%xmm0, 4(%rsp)
	movss	%xmm1, 8(%rsp)
.L24:
	cmpl	%ebx, %ebp
	jge	.L27
	movss	4(%rsp), %xmm0
	movss	8(%rsp), %xmm1
	incl	%ebp
	movss	%xmm3, 28(%rsp)
	movss	%xmm4, 24(%rsp)
	mulss	%xmm2, %xmm1
	movss	%xmm2, 20(%rsp)
	mulss	%xmm2, %xmm0
	call	_Z9simplex2Dff
	movss	.LC4(%rip), %xmm5
	movss	24(%rsp), %xmm4
	movaps	%xmm0, %xmm1
	andps	.LC7(%rip), %xmm1
	movss	28(%rsp), %xmm3
	movaps	%xmm5, %xmm0
	movss	20(%rsp), %xmm2
	subss	%xmm1, %xmm0
	mulss	12(%rsp), %xmm2
	mulss	%xmm4, %xmm0
	mulss	16(%rsp), %xmm4
	addss	%xmm0, %xmm3
	jmp	.L24
.L27:
	addq	$40, %rsp
	.cfi_def_cfa_offset 24
	movaps	%xmm3, %xmm0
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2012:
	.size	_Z9fbmRidgedffiff, .-_Z9fbmRidgedffiff
	.globl	_ZN4Cuda12findGradientEiPfS0_
	.type	_ZN4Cuda12findGradientEiPfS0_, @function
_ZN4Cuda12findGradientEiPfS0_:
.LFB2013:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2013:
	.size	_ZN4Cuda12findGradientEiPfS0_, .-_ZN4Cuda12findGradientEiPfS0_
	.globl	_ZN4Cuda26computeSimplexContributionEffi
	.type	_ZN4Cuda26computeSimplexContributionEffi, @function
_ZN4Cuda26computeSimplexContributionEffi:
.LFB2014:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2014:
	.size	_ZN4Cuda26computeSimplexContributionEffi, .-_ZN4Cuda26computeSimplexContributionEffi
	.globl	_ZN4Cuda9simplex2DEff
	.type	_ZN4Cuda9simplex2DEff, @function
_ZN4Cuda9simplex2DEff:
.LFB2015:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2015:
	.size	_ZN4Cuda9simplex2DEff, .-_ZN4Cuda9simplex2DEff
	.globl	_ZN4Cuda3fbmEffiff
	.type	_ZN4Cuda3fbmEffiff, @function
_ZN4Cuda3fbmEffiff:
.LFB2016:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2016:
	.size	_ZN4Cuda3fbmEffiff, .-_ZN4Cuda3fbmEffiff
	.globl	_ZN4Cuda9fbmRidgedEffiff
	.type	_ZN4Cuda9fbmRidgedEffiff, @function
_ZN4Cuda9fbmRidgedEffiff:
.LFB2159:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2159:
	.size	_ZN4Cuda9fbmRidgedEffiff, .-_ZN4Cuda9fbmRidgedEffiff
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC8:
	.string	"_ZN43_INTERNAL_e6926787_12_noise_inl_cu_b5e2a9784Cuda12PermutationsE"
.LC9:
	.string	"_ZN43_INTERNAL_e6926787_12_noise_inl_cu_b5e2a9784Cuda4Lut2E"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2043:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	movl	$512, %r9d
	xorl	%r8d, %r8d
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC8(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	movq	%rdx, %rcx
	leaq	_ZN4CudaL12PermutationsE(%rip), %rsi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC9(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$64, %r9d
	leaq	_ZN4CudaL4Lut2E(%rip), %rsi
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2043:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata
	.align 32
	.type	_ZN4CudaL4Lut2E, @object
	.size	_ZN4CudaL4Lut2E, 64
_ZN4CudaL4Lut2E:
	.long	-1082130432
	.long	-1082130432
	.long	1065353216
	.long	0
	.long	-1082130432
	.long	0
	.long	1065353216
	.long	1065353216
	.long	-1082130432
	.long	1065353216
	.long	0
	.long	-1082130432
	.long	0
	.long	1065353216
	.long	1065353216
	.long	-1082130432
	.align 32
	.type	_ZN4CudaL12PermutationsE, @object
	.size	_ZN4CudaL12PermutationsE, 512
_ZN4CudaL12PermutationsE:
	.string	"\227\240\211[Z\017\203\r\311_`5\302\351\007\341\214$g\036E\216\bc%\360\025\n\027\276\006\224\367x\352K"
	.string	"\032\305>^\374\333\313u#\013 9\261!X\355\2258W\256\024}\210\253\250D\257J\245G\206\2130\033\246M\222\236\347So\345z<\323\205\346\334i\\)7.\365(\364f\2176A\031?\241\001\330PI\321L\204\273\320Y\022\251\310\304\207\202t\274\237V\244dm\306\255\272\003@4\331\342\372|{\005\312&\223v~\377RU\324\317\316;\343/\020:\021\266\275\034*\337\267\252\325w\370\230\002,\232\243F\335\231e\233\247+\254\t\201\026'\375\023blnOq\340\350\262\271ph\332\366a\344\373\"\362\301\356\322\220\f\277\263\242\361Q3\221\353\371\016\357k1\300\326\037\265\307j\235\270T\314\260sy2-\177\004\226\376\212\354\315]\336rC\035\030H\363\215\200\303NB\327=\234\264\227\240\211[Z\017\203\r\311_`5\302\351\007\341\214$g\036E\216\bc%\360\025\n\027\276\006\224\367x\352K"
	.ascii	"\032\305>^\374\333\313u#\013 9\261!X\355\2258W\256\024}\210\253"
	.ascii	"\250D\257J\245G\206\2130\033\246M\222\236\347So\345z<\323\205"
	.ascii	"\346\334i\\)7.\365(\364f\2176A\031?\241\001\330PI\321L\204\273"
	.ascii	"\320Y\022\251\310\304\207\202t\274\237V\244dm\306\255\272\003"
	.ascii	"@4\331\342\372|{\005\312&\223v~\377RU\324\317\316;\343/\020:"
	.ascii	"\021\266\275\034*\337\267\252\325w\370\230\002,\232\243F\335"
	.ascii	"\231e\233\247+\254\t\201\026'\375\023blnOq\340\350\262\271ph"
	.ascii	"\332\366a\344\373\"\362\301\356\322\220\f\277\263\242\361Q3\221"
	.ascii	"\353\371\016\357k1\300\326\037\265\307j\235\270T\314\260sy2-"
	.ascii	"\177\004\226\376\212\354\315]\336rC\035\030H\363\215\200\303"
	.ascii	"NB\327=\234\264"
	.align 32
	.type	_ZL4Lut2, @object
	.size	_ZL4Lut2, 64
_ZL4Lut2:
	.long	-1082130432
	.long	-1082130432
	.long	1065353216
	.long	0
	.long	-1082130432
	.long	0
	.long	1065353216
	.long	1065353216
	.long	-1082130432
	.long	1065353216
	.long	0
	.long	-1082130432
	.long	0
	.long	1065353216
	.long	1065353216
	.long	-1082130432
	.align 32
	.type	_ZL12Permutations, @object
	.size	_ZL12Permutations, 512
_ZL12Permutations:
	.string	"\227\240\211[Z\017\203\r\311_`5\302\351\007\341\214$g\036E\216\bc%\360\025\n\027\276\006\224\367x\352K"
	.string	"\032\305>^\374\333\313u#\013 9\261!X\355\2258W\256\024}\210\253\250D\257J\245G\206\2130\033\246M\222\236\347So\345z<\323\205\346\334i\\)7.\365(\364f\2176A\031?\241\001\330PI\321L\204\273\320Y\022\251\310\304\207\202t\274\237V\244dm\306\255\272\003@4\331\342\372|{\005\312&\223v~\377RU\324\317\316;\343/\020:\021\266\275\034*\337\267\252\325w\370\230\002,\232\243F\335\231e\233\247+\254\t\201\026'\375\023blnOq\340\350\262\271ph\332\366a\344\373\"\362\301\356\322\220\f\277\263\242\361Q3\221\353\371\016\357k1\300\326\037\265\307j\235\270T\314\260sy2-\177\004\226\376\212\354\315]\336rC\035\030H\363\215\200\303NB\327=\234\264\227\240\211[Z\017\203\r\311_`5\302\351\007\341\214$g\036E\216\bc%\360\025\n\027\276\006\224\367x\352K"
	.ascii	"\032\305>^\374\333\313u#\013 9\261!X\355\2258W\256\024}\210\253"
	.ascii	"\250D\257J\245G\206\2130\033\246M\222\236\347So\345z<\323\205"
	.ascii	"\346\334i\\)7.\365(\364f\2176A\031?\241\001\330PI\321L\204\273"
	.ascii	"\320Y\022\251\310\304\207\202t\274\237V\244dm\306\255\272\003"
	.ascii	"@4\331\342\372|{\005\312&\223v~\377RU\324\317\316;\343/\020:"
	.ascii	"\021\266\275\034*\337\267\252\325w\370\230\002,\232\243F\335"
	.ascii	"\231e\233\247+\254\t\201\026'\375\023blnOq\340\350\262\271ph"
	.ascii	"\332\366a\344\373\"\362\301\356\322\220\f\277\263\242\361Q3\221"
	.ascii	"\353\371\016\357k1\300\326\037\265\307j\235\270T\314\260sy2-"
	.ascii	"\177\004\226\376\212\354\315]\336rC\035\030H\363\215\200\303"
	.ascii	"NB\327=\234\264"
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC1:
	.long	1056964608
	.align 4
.LC2:
	.long	1052469166
	.align 4
.LC3:
	.long	1045980556
	.align 4
.LC4:
	.long	1065353216
	.align 4
.LC5:
	.long	1054369164
	.align 4
.LC6:
	.long	1109393408
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC7:
	.long	2147483647
	.long	0
	.long	0
	.long	0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


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

static const float Lut2[ 8 ][ 2 ] =
{
    { -1.0f, -1.0f }, { 1.0f, 0.0f }, { -1.0f, 0.0f }, { 1.0f, 1.0f },
    { -1.0f, 1.0f }, { 0.0f, -1.0f }, { 0.0f, 1.0f }, { 1.0f, -1.0f }
};

void findGradient( int hash, float* gx, float* gy )
{
    int h = hash & 7;
    *gx = Lut2[ h ][ 0 ];
    *gy = Lut2[ h ][ 1 ];
}

float computeSimplexContribution( float x, float y, int i, int j )
{
    float n = 0.0f;

    float t = 0.5f - x * x - y * y;
    if( t >= 0.0f )
    {
        float gx, gy;
        findGradient( Permutations[ i + Permutations[ j ] ], &gx, &gy );

        t = t * t * t * t;
        n = t * ( x * gx + y * gy );
    }

    return n;
}

//https://github.com/stegu/perlin-noise/blob/master/src/sdnoise1234.c
float simplex2D( float x, float y )
{
    const float F = 0.366025403f;
    const float G = 0.211324865f;

    float s = ( x + y ) * F;
    float xs = x + s;
    float ys = y + s;

    int i = floor( xs );
    int j = floor( ys );

    float t = ( i + j ) * G;

    float x0 = x - ( i - t );
    float y0 = y - ( j - t );

    int i1, j1;

    if( x0 > y0 )
    {
        i1 = 1;
        j1 = 0;
    }
    else
    {
        i1 = 0;
        j1 = 1;
    }

    float x1 = x0 - i1 + G;
    float y1 = y0 - j1 + G;
    float x2 = x0 - 1.0f + 2.0f * G;
    float y2 = y0 - 1.0f + 2.0f * G;

    int ii = i & 0xFF;
    int jj = j & 0xFF;

    float n0 = computeSimplexContribution( x0, y0, ii, jj );
    float n1 = computeSimplexContribution( x1, y1, ii + i1, jj + j1 );
    float n2 = computeSimplexContribution( x2, y2, ii + 1, jj + 1 );

    return 40.0f * ( n0 + n1 + n2 );
}

float fbm( float x, float y, int octaves, float lacunarity, float gain )
{
    float value = 0.0f;
    float frequency = 1.0f;
    float amplitude = 0.5f;

    for( int i = 0; i < octaves; i++ )
    {
        float noise = simplex2D( x * frequency, y * frequency );

        value += noise * amplitude;
        frequency *= lacunarity;
        amplitude *= gain;
    }

    return value;
}

float fbmRidged( float x, float y, int octaves, float lacunarity, float gain )
{
    float value = 0.0f;
    float amplitude = 0.5f;
    float frequency = 1.0f;

    for( int i = 0; i < octaves; i++ )
    {
        float noise = 1.0 - abs( simplex2D( x * frequency, y * frequency ) );

        value += noise * amplitude;
        frequency *= lacunarity;
        amplitude *= gain;
    }

    return value;
}

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

    __constant__
    static const float Lut2[ 8 ][ 2 ] =
    {
        { -1.0f, -1.0f }, { 1.0f, 0.0f }, { -1.0f, 0.0f }, { 1.0f, 1.0f },
        { -1.0f, 1.0f }, { 0.0f, -1.0f }, { 0.0f, 1.0f }, { 1.0f, -1.0f }
    };

    __device__
    void findGradient( int hash, float* gx, float* gy )
    {
        int h = hash & 7;
        *gx = Lut2[ h ][ 0 ];
        *gy = Lut2[ h ][ 1 ];
    }

    __device__
    float computeSimplexContribution( float x, float y, int hash )
    {
        float n = 0.0f;

        float t = 0.5f - x * x - y * y;
        if( t >= 0.0f )
        {
            float gx, gy;
            findGradient( hash, &gx, &gy );

            t = t * t * t * t;
            n = t * ( x * gx + y * gy );
        }

        return n;
    }

    __device__
    //https://github.com/stegu/perlin-noise/blob/master/src/sdnoise1234.c
    float simplex2D( float x, float y )
    {
        const float F = 0.366025403f;
        const float G = 0.211324865f;

        float s = ( x + y ) * F;
        float xs = x + s;
        float ys = y + s;

        int i = floor( xs );
        int j = floor( ys );

        float t = ( i + j ) * G;

        float x0 = x - ( i - t );
        float y0 = y - ( j - t );

        int i1, j1;

        if( x0 > y0 )
        {
            i1 = 1;
            j1 = 0;
        }
        else
        {
            i1 = 0;
            j1 = 1;
        }

        float x1 = x0 - i1 + G;
        float y1 = y0 - j1 + G;
        float x2 = x0 - 1.0f + 2.0f * G;
        float y2 = y0 - 1.0f + 2.0f * G;

        int ii = i & 0xFF;
        int jj = j & 0xFF;

        float n0 = computeSimplexContribution( x0, y0, Permutations[ ii + Permutations[ jj ] ] );
        float n1 = computeSimplexContribution( x1, y1, Permutations[ ii + i1 + Permutations[ jj + j1 ] ] );
        float n2 = computeSimplexContribution( x2, y2, Permutations[ ii + 1 + Permutations[ jj + 1 ] ] );

        return 40.0f * ( n0 + n1 + n2 );
    }

    __device__
    float fbm( float x, float y, int octaves, float lacunarity, float gain )
    {
        float value = 0.0f;
        float frequency = 1.0f;
        float amplitude = 0.5f;

        for( int i = 0; i < octaves; i++ )
        {
            float noise = simplex2D( x * frequency, y * frequency );

            value += noise * amplitude;
            frequency *= lacunarity;
            amplitude *= gain;
        }

        return value;
    }

    __device__
    float fbmRidged( float x, float y, int octaves, float lacunarity, float gain )
    {
        float value = 0.0f;
        float amplitude = 0.5f;
        float frequency = 1.0f;

        for( int i = 0; i < octaves; i++ )
        {
            float noise = 1.0 - abs( simplex2D( x * frequency, y * frequency ) );

            value += noise * amplitude;
            frequency *= lacunarity;
            amplitude *= gain;
        }

        return value;
    }
}
	.text
	.file	"noise.inl.hip"
	.globl	_Z12findGradientiPfS_           # -- Begin function _Z12findGradientiPfS_
	.type	_Z12findGradientiPfS_,@function
_Z12findGradientiPfS_:                  # @_Z12findGradientiPfS_
	.cfi_startproc
# %bb.0:
                                        # kill: def $edi killed $edi def $rdi
	andl	$7, %edi
	movss	_ZL4Lut2(,%rdi,8), %xmm0        # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rsi)
	movss	_ZL4Lut2+4(,%rdi,8), %xmm0      # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rdx)
	retq
.Lfunc_end0:
	.size	_Z12findGradientiPfS_, .Lfunc_end0-_Z12findGradientiPfS_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z26computeSimplexContributionffii
.LCPI1_0:
	.long	0x3f000000                      # float 0.5
	.text
	.globl	_Z26computeSimplexContributionffii
	.type	_Z26computeSimplexContributionffii,@function
_Z26computeSimplexContributionffii:     # @_Z26computeSimplexContributionffii
	.cfi_startproc
# %bb.0:
	movaps	%xmm0, %xmm2
	mulss	%xmm0, %xmm2
	movss	.LCPI1_0(%rip), %xmm3           # xmm3 = mem[0],zero,zero,zero
	subss	%xmm2, %xmm3
	movaps	%xmm1, %xmm2
	mulss	%xmm1, %xmm2
	subss	%xmm2, %xmm3
	xorps	%xmm2, %xmm2
	ucomiss	%xmm2, %xmm3
	jb	.LBB1_2
# %bb.1:
	movslq	%esi, %rax
	movzbl	_ZL12Permutations(%rax), %eax
	movslq	%edi, %rcx
	movzbl	_ZL12Permutations(%rax,%rcx), %eax
	andl	$7, %eax
	movaps	%xmm3, %xmm2
	mulss	%xmm3, %xmm2
	mulss	%xmm3, %xmm2
	mulss	_ZL4Lut2(,%rax,8), %xmm0
	mulss	_ZL4Lut2+4(,%rax,8), %xmm1
	mulss	%xmm3, %xmm2
	addss	%xmm0, %xmm1
	mulss	%xmm2, %xmm1
	movaps	%xmm1, %xmm2
.LBB1_2:
	movaps	%xmm2, %xmm0
	retq
.Lfunc_end1:
	.size	_Z26computeSimplexContributionffii, .Lfunc_end1-_Z26computeSimplexContributionffii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z9simplex2Dff
.LCPI2_0:
	.long	0x3ebb67ae                      # float 0.366025388
.LCPI2_1:
	.long	0x3e58658c                      # float 0.211324871
.LCPI2_2:
	.long	0x3f800000                      # float 1
.LCPI2_3:
	.long	0xbf800000                      # float -1
.LCPI2_4:
	.long	0x3ed8658c                      # float 0.422649741
.LCPI2_5:
	.long	0x42200000                      # float 40
	.text
	.globl	_Z9simplex2Dff
	.type	_Z9simplex2Dff,@function
_Z9simplex2Dff:                         # @_Z9simplex2Dff
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movss	%xmm1, 8(%rsp)                  # 4-byte Spill
	movaps	%xmm0, %xmm2
	movss	%xmm0, (%rsp)                   # 4-byte Spill
	movaps	%xmm0, %xmm3
	addss	%xmm1, %xmm3
	mulss	.LCPI2_0(%rip), %xmm3
	movaps	%xmm3, %xmm0
	addss	%xmm2, %xmm0
	addss	%xmm1, %xmm3
	movss	%xmm3, 4(%rsp)                  # 4-byte Spill
	callq	floorf@PLT
	movaps	%xmm0, 16(%rsp)                 # 16-byte Spill
	cvttss2si	%xmm0, %ebx
	movss	4(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	callq	floorf@PLT
	cvttss2si	%xmm0, %r14d
	leal	(%rbx,%r14), %eax
	xorps	%xmm2, %xmm2
	cvtsi2ss	%eax, %xmm2
	movss	.LCPI2_1(%rip), %xmm4           # xmm4 = mem[0],zero,zero,zero
	mulss	%xmm4, %xmm2
	cvttps2dq	16(%rsp), %xmm3         # 16-byte Folded Reload
	cvtdq2ps	%xmm3, %xmm3
	subss	%xmm2, %xmm3
	movss	(%rsp), %xmm1                   # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	subss	%xmm3, %xmm1
	movaps	%xmm1, %xmm3
	movss	8(%rsp), %xmm1                  # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	cvttps2dq	%xmm0, %xmm0
	cvtdq2ps	%xmm0, %xmm0
	subss	%xmm2, %xmm0
	subss	%xmm0, %xmm1
	xorl	%ebp, %ebp
	xorl	%r15d, %r15d
	ucomiss	%xmm1, %xmm3
	seta	%al
	setbe	%cl
	movss	.LCPI2_2(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movaps	%xmm0, %xmm2
	ja	.LBB2_2
# %bb.1:
	xorps	%xmm2, %xmm2
.LBB2_2:
	movb	%cl, %r15b
	movb	%al, %bpl
	movaps	%xmm3, %xmm5
	subss	%xmm2, %xmm5
	addss	%xmm4, %xmm5
	movss	%xmm5, (%rsp)                   # 4-byte Spill
	jbe	.LBB2_4
# %bb.3:
	xorps	%xmm0, %xmm0
.LBB2_4:
	movaps	%xmm1, %xmm2
	subss	%xmm0, %xmm2
	addss	%xmm4, %xmm2
	movss	%xmm2, 4(%rsp)                  # 4-byte Spill
	movss	.LCPI2_3(%rip), %xmm2           # xmm2 = mem[0],zero,zero,zero
	movaps	%xmm3, %xmm4
	addss	%xmm2, %xmm4
	movss	.LCPI2_4(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	addss	%xmm0, %xmm4
	movss	%xmm4, 8(%rsp)                  # 4-byte Spill
	addss	%xmm1, %xmm2
	addss	%xmm0, %xmm2
	movss	%xmm2, 16(%rsp)                 # 4-byte Spill
	movl	$255, %eax
	andl	%eax, %ebx
	andl	%eax, %r14d
	movaps	%xmm3, %xmm0
	movl	%ebx, %edi
	movl	%r14d, %esi
	callq	_Z26computeSimplexContributionffii
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	addl	%ebx, %ebp
	addl	%r14d, %r15d
	movss	(%rsp), %xmm0                   # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	movss	4(%rsp), %xmm1                  # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	movl	%ebp, %edi
	movl	%r15d, %esi
	callq	_Z26computeSimplexContributionffii
	movss	%xmm0, (%rsp)                   # 4-byte Spill
	incl	%ebx
	incl	%r14d
	movss	8(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	movss	16(%rsp), %xmm1                 # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	movl	%ebx, %edi
	movl	%r14d, %esi
	callq	_Z26computeSimplexContributionffii
	movss	(%rsp), %xmm1                   # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	addss	12(%rsp), %xmm1                 # 4-byte Folded Reload
	addss	%xmm1, %xmm0
	mulss	.LCPI2_5(%rip), %xmm0
	addq	$40, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z9simplex2Dff, .Lfunc_end2-_Z9simplex2Dff
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z3fbmffiff
.LCPI3_0:
	.long	0x3f800000                      # float 1
.LCPI3_1:
	.long	0x3f000000                      # float 0.5
	.text
	.globl	_Z3fbmffiff
	.type	_Z3fbmffiff,@function
_Z3fbmffiff:                            # @_Z3fbmffiff
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	jle	.LBB3_1
# %bb.3:                                # %.lr.ph.preheader
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movl	%edi, %ebx
	movaps	%xmm1, %xmm4
	movaps	%xmm0, %xmm1
	movss	.LCPI3_0(%rip), %xmm5           # xmm5 = mem[0],zero,zero,zero
	movss	.LCPI3_1(%rip), %xmm6           # xmm6 = mem[0],zero,zero,zero
	xorps	%xmm0, %xmm0
	movss	%xmm3, 20(%rsp)                 # 4-byte Spill
	movss	%xmm2, 16(%rsp)                 # 4-byte Spill
	movss	%xmm4, 12(%rsp)                 # 4-byte Spill
	movss	%xmm1, 8(%rsp)                  # 4-byte Spill
.LBB3_4:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movss	%xmm6, 24(%rsp)                 # 4-byte Spill
	movss	%xmm5, 28(%rsp)                 # 4-byte Spill
	movss	%xmm0, 4(%rsp)                  # 4-byte Spill
	movaps	%xmm5, %xmm0
	mulss	%xmm1, %xmm0
	movaps	%xmm5, %xmm1
	mulss	%xmm4, %xmm1
	callq	_Z9simplex2Dff
	movss	24(%rsp), %xmm6                 # 4-byte Reload
                                        # xmm6 = mem[0],zero,zero,zero
	movss	8(%rsp), %xmm1                  # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	movss	12(%rsp), %xmm4                 # 4-byte Reload
                                        # xmm4 = mem[0],zero,zero,zero
	movss	16(%rsp), %xmm2                 # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	movss	20(%rsp), %xmm3                 # 4-byte Reload
                                        # xmm3 = mem[0],zero,zero,zero
	mulss	%xmm6, %xmm0
	movss	4(%rsp), %xmm5                  # 4-byte Reload
                                        # xmm5 = mem[0],zero,zero,zero
	addss	%xmm0, %xmm5
	movss	%xmm5, 4(%rsp)                  # 4-byte Spill
	movss	28(%rsp), %xmm5                 # 4-byte Reload
                                        # xmm5 = mem[0],zero,zero,zero
	movss	4(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	mulss	%xmm2, %xmm5
	mulss	%xmm3, %xmm6
	decl	%ebx
	jne	.LBB3_4
# %bb.5:
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	retq
.LBB3_1:
	xorps	%xmm0, %xmm0
	retq
.Lfunc_end3:
	.size	_Z3fbmffiff, .Lfunc_end3-_Z3fbmffiff
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z9fbmRidgedffiff
.LCPI4_0:
	.long	0x3f000000                      # float 0.5
.LCPI4_1:
	.long	0x3f800000                      # float 1
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0
.LCPI4_2:
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.text
	.globl	_Z9fbmRidgedffiff
	.type	_Z9fbmRidgedffiff,@function
_Z9fbmRidgedffiff:                      # @_Z9fbmRidgedffiff
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	jle	.LBB4_1
# %bb.3:                                # %.lr.ph.preheader
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movl	%edi, %ebx
	movaps	%xmm1, %xmm4
	movaps	%xmm0, %xmm1
	movss	.LCPI4_0(%rip), %xmm5           # xmm5 = mem[0],zero,zero,zero
	movss	.LCPI4_1(%rip), %xmm6           # xmm6 = mem[0],zero,zero,zero
	xorps	%xmm0, %xmm0
	movss	%xmm3, 16(%rsp)                 # 4-byte Spill
	movss	%xmm2, 12(%rsp)                 # 4-byte Spill
	movss	%xmm4, 8(%rsp)                  # 4-byte Spill
	movss	%xmm1, 4(%rsp)                  # 4-byte Spill
.LBB4_4:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movss	%xmm6, 20(%rsp)                 # 4-byte Spill
	movss	%xmm5, 24(%rsp)                 # 4-byte Spill
	movss	%xmm0, 28(%rsp)                 # 4-byte Spill
	movaps	%xmm6, %xmm0
	mulss	%xmm1, %xmm0
	movaps	%xmm6, %xmm1
	mulss	%xmm4, %xmm1
	callq	_Z9simplex2Dff
	movss	20(%rsp), %xmm6                 # 4-byte Reload
                                        # xmm6 = mem[0],zero,zero,zero
	movss	24(%rsp), %xmm5                 # 4-byte Reload
                                        # xmm5 = mem[0],zero,zero,zero
	movss	8(%rsp), %xmm4                  # 4-byte Reload
                                        # xmm4 = mem[0],zero,zero,zero
	movss	12(%rsp), %xmm2                 # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	movss	16(%rsp), %xmm3                 # 4-byte Reload
                                        # xmm3 = mem[0],zero,zero,zero
	andps	.LCPI4_2(%rip), %xmm0
	movss	.LCPI4_1(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	subss	%xmm0, %xmm1
	movss	28(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	mulss	%xmm5, %xmm1
	addss	%xmm1, %xmm0
	movss	4(%rsp), %xmm1                  # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	mulss	%xmm2, %xmm6
	mulss	%xmm3, %xmm5
	decl	%ebx
	jne	.LBB4_4
# %bb.5:
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	retq
.LBB4_1:
	xorps	%xmm0, %xmm0
	retq
.Lfunc_end4:
	.size	_Z9fbmRidgedffiff, .Lfunc_end4-_Z9fbmRidgedffiff
	.cfi_endproc
                                        # -- End function
	.type	_ZL4Lut2,@object                # @_ZL4Lut2
	.section	.rodata,"a",@progbits
	.p2align	4, 0x0
_ZL4Lut2:
	.long	0xbf800000                      # float -1
	.long	0xbf800000                      # float -1
	.long	0x3f800000                      # float 1
	.long	0x00000000                      # float 0
	.long	0xbf800000                      # float -1
	.long	0x00000000                      # float 0
	.long	0x3f800000                      # float 1
	.long	0x3f800000                      # float 1
	.long	0xbf800000                      # float -1
	.long	0x3f800000                      # float 1
	.long	0x00000000                      # float 0
	.long	0xbf800000                      # float -1
	.long	0x00000000                      # float 0
	.long	0x3f800000                      # float 1
	.long	0x3f800000                      # float 1
	.long	0xbf800000                      # float -1
	.size	_ZL4Lut2, 64

	.type	_ZL12Permutations,@object       # @_ZL12Permutations
	.p2align	4, 0x0
_ZL12Permutations:
	.ascii	"\227\240\211[Z\017\203\r\311_`5\302\351\007\341\214$g\036E\216\bc%\360\025\n\027\276\006\224\367x\352K\000\032\305>^\374\333\313u#\013 9\261!X\355\2258W\256\024}\210\253\250D\257J\245G\206\2130\033\246M\222\236\347So\345z<\323\205\346\334i\\)7.\365(\364f\2176A\031?\241\001\330PI\321L\204\273\320Y\022\251\310\304\207\202t\274\237V\244dm\306\255\272\003@4\331\342\372|{\005\312&\223v~\377RU\324\317\316;\343/\020:\021\266\275\034*\337\267\252\325w\370\230\002,\232\243F\335\231e\233\247+\254\t\201\026'\375\023blnOq\340\350\262\271ph\332\366a\344\373\"\362\301\356\322\220\f\277\263\242\361Q3\221\353\371\016\357k1\300\326\037\265\307j\235\270T\314\260sy2-\177\004\226\376\212\354\315]\336rC\035\030H\363\215\200\303NB\327=\234\264\227\240\211[Z\017\203\r\311_`5\302\351\007\341\214$g\036E\216\bc%\360\025\n\027\276\006\224\367x\352K\000\032\305>^\374\333\313u#\013 9\261!X\355\2258W\256\024}\210\253\250D\257J\245G\206\2130\033\246M\222\236\347So\345z<\323\205\346\334i\\)7.\365(\364f\2176A\031?\241\001\330PI\321L\204\273\320Y\022\251\310\304\207\202t\274\237V\244dm\306\255\272\003@4\331\342\372|{\005\312&\223v~\377RU\324\317\316;\343/\020:\021\266\275\034*\337\267\252\325w\370\230\002,\232\243F\335\231e\233\247+\254\t\201\026'\375\023blnOq\340\350\262\271ph\332\366a\344\373\"\362\301\356\322\220\f\277\263\242\361Q3\221\353\371\016\357k1\300\326\037\265\307j\235\270T\314\260sy2-\177\004\226\376\212\354\315]\336rC\035\030H\363\215\200\303NB\327=\234\264"
	.size	_ZL12Permutations, 512

	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_

	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
