#include "softmax.hh"
#include "../runtime/node.hh"
#include "../memory/alloc.hh"



namespace gpu
{

    namespace
    {
        constexpr std::size_t BLOCK_SIZE = 512;

        __global__
        void softmax1(const dbl_t* x, dbl_t* y,
                      std::size_t rows, std::size_t cols) //8ms
        {
            __shared__ dbl_t partial[2 * BLOCK_SIZE];

            //load all elements of the array in shared memory
            auto row = blockIdx.x;
            auto col = threadIdx.x;
            std::size_t step = BLOCK_SIZE;

            dbl_t init = 1e-30;
            for (std::size_t i = col; i < cols; i += step)
                init = max(x[row * cols + i], init);
        
            partial[col] = init;
            __syncthreads();

            for (std::size_t s = BLOCK_SIZE / 2; s > 32; s >>= 1)
            {
                if (col < s)
                    partial[col] = max(partial[col], partial[col + s]);

                __syncthreads();
            }

            //if not volatile, must use __synctthreads again, why ?
            volatile dbl_t* vpartial = partial;
            if (col < 32)
            {
                vpartial[col] = max(vpartial[col], vpartial[col + 32]);
                vpartial[col] = max(vpartial[col], vpartial[col + 16]);
                vpartial[col] = max(vpartial[col], vpartial[col + 8]);
                vpartial[col] = max(vpartial[col], vpartial[col + 4]);
                vpartial[col] = max(vpartial[col],vpartial[col + 2]);
                vpartial[col] = max(vpartial[col], vpartial[col + 1]);
            }
            
            __syncthreads();
            
            for (std::size_t i = col; i < cols; i += step)
                y[row * cols + i] = exp(x[row * cols + i] - partial[0]);

            __syncthreads();

            init = 0;
            for (std::size_t i = col; i < cols; i += step)
                init += y[row * cols + i];
        
            partial[col] = init;
            __syncthreads();

            for (std::size_t s = BLOCK_SIZE / 2; s > 32; s >>= 1)
            {
                if (col < s)
                    partial[col] += partial[col + s];

                __syncthreads();
            }

            if (col < 32)
            {
                vpartial[col] += vpartial[col + 32];
                vpartial[col] += vpartial[col + 16];
                vpartial[col] += vpartial[col + 8];
                vpartial[col] += vpartial[col + 4];
                vpartial[col] += vpartial[col + 2];
                vpartial[col] += vpartial[col + 1];
            }


            __syncthreads();
            
            for (std::size_t i = col; i < cols; i += step)
                y[row * cols + i] /= partial[0];
        }

        __global__
        void log_softmax1(const dbl_t* x, dbl_t* y,
                      std::size_t rows, std::size_t cols) //8ms
        {
            __shared__ dbl_t partial[2 * BLOCK_SIZE];

            //load all elements of the array in shared memory
            auto row = blockIdx.x;
            auto col = threadIdx.x;
            std::size_t step = BLOCK_SIZE;

            dbl_t init = 1e-30;
            for (std::size_t i = col; i < cols; i += step)
                init = max(x[row * cols + i], init);
        
            partial[col] = init;
            __syncthreads();

            for (std::size_t s = BLOCK_SIZE / 2; s > 32; s >>= 1)
            {
                if (col < s)
                    partial[col] = max(partial[col], partial[col + s]);

                __syncthreads();
            }

            //if not volatile, must use __synctthreads again, why ?
            volatile dbl_t* vpartial = partial;
            if (col < 32)
            {
                vpartial[col] = max(vpartial[col], vpartial[col + 32]);
                vpartial[col] = max(vpartial[col], vpartial[col + 16]);
                vpartial[col] = max(vpartial[col], vpartial[col + 8]);
                vpartial[col] = max(vpartial[col], vpartial[col + 4]);
                vpartial[col] = max(vpartial[col],vpartial[col + 2]);
                vpartial[col] = max(vpartial[col], vpartial[col + 1]);
            }
            
            __syncthreads();

            dbl_t max_x = partial[0];

            init = 0;
            for (std::size_t i = col; i < cols; i += step)
                init += exp(x[row * cols + i] - max_x);
        
            partial[col] = init;
            __syncthreads();

            for (std::size_t s = BLOCK_SIZE / 2; s > 32; s >>= 1)
            {
                if (col < s)
                    partial[col] += partial[col + s];

                __syncthreads();
            }

            if (col < 32)
            {
                vpartial[col] += vpartial[col + 32];
                vpartial[col] += vpartial[col + 16];
                vpartial[col] += vpartial[col + 8];
                vpartial[col] += vpartial[col + 4];
                vpartial[col] += vpartial[col + 2];
                vpartial[col] += vpartial[col + 1];
            }


            __syncthreads();

            dbl_t logsum = max_x + std::log(partial[0]);
            
            for (std::size_t i = col; i < cols; i += step)
                y[row * cols + i] = x[row * cols + i] - logsum;
        }

        __global__
        void softmax_lcost1(const dbl_t* y, const dbl_t* x, dbl_t* out,
                            std::size_t rows, std::size_t cols)
        {
            __shared__ dbl_t partial[2 * BLOCK_SIZE];

            //load all elements of the array in shared memory
            auto row = blockIdx.x;
            auto col = threadIdx.x;
            std::size_t step = BLOCK_SIZE;

            dbl_t init = 1e-30;
            for (std::size_t i = col; i < cols; i += step)
                init = max(x[row * cols + i], init);
        
            partial[col] = init;
            __syncthreads();

            for (std::size_t s = BLOCK_SIZE / 2; s > 32; s >>= 1)
            {
                if (col < s)
                    partial[col] = max(partial[col], partial[col + s]);

                __syncthreads();
            }

            //if not volatile, must use __synctthreads again, why ?
            volatile dbl_t* vpartial = partial;
            if (col < 32)
            {
                vpartial[col] = max(vpartial[col], vpartial[col + 32]);
                vpartial[col] = max(vpartial[col], vpartial[col + 16]);
                vpartial[col] = max(vpartial[col], vpartial[col + 8]);
                vpartial[col] = max(vpartial[col], vpartial[col + 4]);
                vpartial[col] = max(vpartial[col],vpartial[col + 2]);
                vpartial[col] = max(vpartial[col], vpartial[col + 1]);
            }
            
            __syncthreads();

            dbl_t max_x = partial[0];

            init = 0;
            for (std::size_t i = col; i < cols; i += step)
                init += exp(x[row * cols + i] - max_x);
        
            partial[col] = init;
            __syncthreads();

            for (std::size_t s = BLOCK_SIZE / 2; s > 32; s >>= 1)
            {
                if (col < s)
                    partial[col] += partial[col + s];

                __syncthreads();
            }

            if (col < 32)
            {
                vpartial[col] += vpartial[col + 32];
                vpartial[col] += vpartial[col + 16];
                vpartial[col] += vpartial[col + 8];
                vpartial[col] += vpartial[col + 4];
                vpartial[col] += vpartial[col + 2];
                vpartial[col] += vpartial[col + 1];
            }


            __syncthreads();

            dbl_t logsum = max_x + std::log(partial[0]);

            init = 0;
            for (std::size_t i = col; i < cols; i += step)
                init += y[row * cols + i] * (x[row * cols + i] - logsum);
        
            partial[col] = init;
            __syncthreads();

            for (std::size_t s = BLOCK_SIZE / 2; s > 32; s >>= 1)
            {
                if (col < s)
                    partial[col] += partial[col + s];

                __syncthreads();
            }

            if (col < 32)
            {
                vpartial[col] += vpartial[col + 32];
                vpartial[col] += vpartial[col + 16];
                vpartial[col] += vpartial[col + 8];
                vpartial[col] += vpartial[col + 4];
                vpartial[col] += vpartial[col + 2];
                vpartial[col] += vpartial[col + 1];
            }
            
            if (col == 0)
                out[row] = partial[0];
        }

        __global__
        void softmax_reduce(const dbl_t* x, dbl_t* y, std::size_t len) //8ms
        {
            __shared__ dbl_t partial[2 * BLOCK_SIZE];

            //load all elements of the array in shared memory
            auto i = threadIdx.x;
            std::size_t step = BLOCK_SIZE;

            dbl_t init = 0;
            for (std::size_t j = i; j < len; j += step)
                init += x[j];
        
            partial[i] = init;
            __syncthreads();

            for (std::size_t s = BLOCK_SIZE / 2; s > 32; s >>= 1)
            {
                if (i < s)
                    partial[i] += partial[i + s];

                __syncthreads();
            }

            //if not volatile, must use __synctthreads again, why ?
            volatile dbl_t* vpartial = partial;
            if (i < 32)
            {
                vpartial[i] += vpartial[i + 32];
                vpartial[i] += vpartial[i + 16];
                vpartial[i] += vpartial[i + 8];
                vpartial[i] += vpartial[i + 4];
                vpartial[i] += vpartial[i + 2];
                vpartial[i] += vpartial[i + 1];
            }


            if (i == 0)
                y[0] = - partial[0] / len;
        }

        __global__
        void softmax_cross_entropy_grad(const dbl_t* y, dbl_t* out,
                                        std::size_t rows, std::size_t cols)
        {
            std::size_t len = rows * cols;
            std::size_t index = blockIdx.x * blockDim.x + threadIdx.x;
            std::size_t stride = blockDim.x * gridDim.x;

            for (std::size_t i = index; i < len; i += stride)
                out[i] = (out[i] - y[i]) / rows;
        }
    }

    void kernel_softmax(rt::Node* node)
    {
        std::size_t rows = node->len1;
        std::size_t cols = node->len2;
        softmax1<<<rows, BLOCK_SIZE>>>(node->in1, node->out1, rows, cols);
    }

    void kernel_log_softmax(rt::Node* node)
    {
        std::size_t rows = node->len1;
        std::size_t cols = node->len2;
        log_softmax1<<<rows, BLOCK_SIZE>>>(node->in1, node->out1, rows, cols);
    }

    void kernel_softmax_cross_entropy(rt::Node* node)
    {
        std::size_t rows = node->len1;
        std::size_t cols = node->len2;
        const dbl_t* y = node->in1;
        const dbl_t* x = node->in2;
        dbl_t* out = node->out1;

        dbl_t* tmp = tensor_alloc(rows);
        softmax_lcost1<<<rows, BLOCK_SIZE>>>(y, x, tmp, rows, cols);
        cudaDeviceSynchronize();
        softmax_reduce<<<1, BLOCK_SIZE>>>(tmp, out, rows);
        cudaDeviceSynchronize();
        tensor_free(tmp);
    }

    void kernel_softmax_cross_entropy_grad(rt::Node* node)
    {
        const dbl_t* y = node->in1;
        const dbl_t* logits = node->in2;
        dbl_t* out = node->out1;
        std::size_t rows = node->len1;
        std::size_t cols = node->len2;
        
        softmax1<<<rows, BLOCK_SIZE>>>(logits, out, rows, cols);
        cudaDeviceSynchronize();

        std::size_t len = rows * cols;
        std::size_t nb_blocks = (len + BLOCK_SIZE - 1) / BLOCK_SIZE;
        softmax_cross_entropy_grad<<<nb_blocks, BLOCK_SIZE>>>(y, out, rows, cols);
    }

}

	.file	"tmpxft_003b9fca_00000000-6_softmax.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2883:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2883:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z83__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmmPKfPfmm
	.hidden	_Z83__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmmPKfPfmm
	.type	_Z83__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmmPKfPfmm, @function
_Z83__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmmPKfPfmm:
.LFB2905:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L2
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmm(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L2:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2905:
	.size	_Z83__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmmPKfPfmm, .-_Z83__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmmPKfPfmm
	.globl	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmm
	.hidden	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmm
	.type	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmm, @function
_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmm:
.LFB2906:
	.cfi_startproc
	endbr64
	jmp	_Z83__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmmPKfPfmm
	.cfi_endproc
.LFE2906:
	.size	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmm, .-_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmm
	.globl	_ZN3gpu14kernel_softmaxEPN2rt4NodeE
	.type	_ZN3gpu14kernel_softmaxEPN2rt4NodeE, @function
_ZN3gpu14kernel_softmaxEPN2rt4NodeE:
.LFB2877:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	$8388609, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	salq	$9, %rdx
	movl	$1, %ecx
	movabsq	$4294967297, %rax
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	120(%rdi), %rbp
	movq	128(%rdi), %r12
	movq	%rax, 12(%rsp)
	movl	16(%rsp), %esi
	movl	%ebp, 8(%rsp)
	movq	8(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L8
	movq	88(%rbx), %rsi
	movq	64(%rbx), %rdi
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	movq	%r12, %rcx
	popq	%rbx
	.cfi_def_cfa_offset 24
	movq	%rbp, %rdx
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	_Z83__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmmPKfPfmm
.L8:
	.cfi_restore_state
	addq	$32, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2877:
	.size	_ZN3gpu14kernel_softmaxEPN2rt4NodeE, .-_ZN3gpu14kernel_softmaxEPN2rt4NodeE
	.globl	_Z88__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a12log_softmax1EPKfPfmmPKfPfmm
	.hidden	_Z88__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a12log_softmax1EPKfPfmmPKfPfmm
	.type	_Z88__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a12log_softmax1EPKfPfmmPKfPfmm, @function
_Z88__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a12log_softmax1EPKfPfmmPKfPfmm:
.LFB2907:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L11
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a12log_softmax1EPKfPfmm(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L11:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2907:
	.size	_Z88__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a12log_softmax1EPKfPfmmPKfPfmm, .-_Z88__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a12log_softmax1EPKfPfmmPKfPfmm
	.globl	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a12log_softmax1EPKfPfmm
	.hidden	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a12log_softmax1EPKfPfmm
	.type	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a12log_softmax1EPKfPfmm, @function
_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a12log_softmax1EPKfPfmm:
.LFB2908:
	.cfi_startproc
	endbr64
	jmp	_Z88__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a12log_softmax1EPKfPfmmPKfPfmm
	.cfi_endproc
.LFE2908:
	.size	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a12log_softmax1EPKfPfmm, .-_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a12log_softmax1EPKfPfmm
	.globl	_ZN3gpu18kernel_log_softmaxEPN2rt4NodeE
	.type	_ZN3gpu18kernel_log_softmaxEPN2rt4NodeE, @function
_ZN3gpu18kernel_log_softmaxEPN2rt4NodeE:
.LFB2878:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	$8388609, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	salq	$9, %rdx
	movl	$1, %ecx
	movabsq	$4294967297, %rax
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	120(%rdi), %rbp
	movq	128(%rdi), %r12
	movq	%rax, 12(%rsp)
	movl	16(%rsp), %esi
	movl	%ebp, 8(%rsp)
	movq	8(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L16
	movq	88(%rbx), %rsi
	movq	64(%rbx), %rdi
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	movq	%r12, %rcx
	popq	%rbx
	.cfi_def_cfa_offset 24
	movq	%rbp, %rdx
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	_Z88__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a12log_softmax1EPKfPfmmPKfPfmm
.L16:
	.cfi_restore_state
	addq	$32, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2878:
	.size	_ZN3gpu18kernel_log_softmaxEPN2rt4NodeE, .-_ZN3gpu18kernel_log_softmaxEPN2rt4NodeE
	.globl	_Z93__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_lcost1EPKfS2_PfmmPKfS0_Pfmm
	.hidden	_Z93__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_lcost1EPKfS2_PfmmPKfS0_Pfmm
	.type	_Z93__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_lcost1EPKfS2_PfmmPKfS0_Pfmm, @function
_Z93__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_lcost1EPKfS2_PfmmPKfS0_Pfmm:
.LFB2909:
	.cfi_startproc
	endbr64
	subq	$168, %rsp
	.cfi_def_cfa_offset 176
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	56(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 144(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L19
	pushq	56(%rsp)
	.cfi_def_cfa_offset 184
	leaq	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_lcost1EPKfS2_Pfmm(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 192
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 184
	popq	%rdx
	.cfi_def_cfa_offset 176
.L19:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	addq	$168, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2909:
	.size	_Z93__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_lcost1EPKfS2_PfmmPKfS0_Pfmm, .-_Z93__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_lcost1EPKfS2_PfmmPKfS0_Pfmm
	.globl	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_lcost1EPKfS2_Pfmm
	.hidden	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_lcost1EPKfS2_Pfmm
	.type	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_lcost1EPKfS2_Pfmm, @function
_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_lcost1EPKfS2_Pfmm:
.LFB2910:
	.cfi_startproc
	endbr64
	jmp	_Z93__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_lcost1EPKfS2_PfmmPKfS0_Pfmm
	.cfi_endproc
.LFE2910:
	.size	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_lcost1EPKfS2_Pfmm, .-_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_lcost1EPKfS2_Pfmm
	.globl	_Z89__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_reduceEPKfPfmPKfPfm
	.hidden	_Z89__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_reduceEPKfPfmPKfPfm
	.type	_Z89__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_reduceEPKfPfmPKfPfm, @function
_Z89__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_reduceEPKfPfmPKfPfm:
.LFB2911:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L24
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_reduceEPKfPfm(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L24:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2911:
	.size	_Z89__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_reduceEPKfPfmPKfPfm, .-_Z89__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_reduceEPKfPfmPKfPfm
	.globl	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_reduceEPKfPfm
	.hidden	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_reduceEPKfPfm
	.type	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_reduceEPKfPfm, @function
_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_reduceEPKfPfm:
.LFB2912:
	.cfi_startproc
	endbr64
	jmp	_Z89__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_reduceEPKfPfmPKfPfm
	.cfi_endproc
.LFE2912:
	.size	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_reduceEPKfPfm, .-_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_reduceEPKfPfm
	.globl	_ZN3gpu28kernel_softmax_cross_entropyEPN2rt4NodeE
	.type	_ZN3gpu28kernel_softmax_cross_entropyEPN2rt4NodeE, @function
_ZN3gpu28kernel_softmax_cross_entropyEPN2rt4NodeE:
.LFB2879:
	.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
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	120(%rdi), %rbp
	movq	128(%rdi), %r14
	movq	64(%rdi), %r12
	movq	72(%rdi), %r13
	movq	88(%rdi), %r15
	movq	%rbp, %rdi
	call	_Z12tensor_allocm@PLT
	movl	%ebp, 8(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rax, %rbx
	movl	$8388609, %edx
	movabsq	$4294967297, %rax
	movl	$1, %ecx
	movq	%rax, 12(%rsp)
	movl	16(%rsp), %esi
	salq	$9, %rdx
	movq	8(%rsp), %rdi
	movq	%rdx, 20(%rsp)
	movl	$1, 28(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L30
	movq	%r14, %r8
	movq	%rbp, %rcx
	movq	%rbx, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	_Z93__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_lcost1EPKfS2_PfmmPKfS0_Pfmm
.L30:
	call	cudaDeviceSynchronize@PLT
	movl	$8388609, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$9, %rdx
	movl	$1, %ecx
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movq	%rdx, 20(%rsp)
	movl	$1, 28(%rsp)
	movq	%rdi, 8(%rsp)
	movl	$1, 16(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L31
	movq	%rbp, %rdx
	movq	%r15, %rsi
	movq	%rbx, %rdi
	call	_Z89__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_reduceEPKfPfmPKfPfm
.L31:
	call	cudaDeviceSynchronize@PLT
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	movq	%rbx, %rdi
	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
	jmp	_Z11tensor_freePf@PLT
	.cfi_endproc
.LFE2879:
	.size	_ZN3gpu28kernel_softmax_cross_entropyEPN2rt4NodeE, .-_ZN3gpu28kernel_softmax_cross_entropyEPN2rt4NodeE
	.globl	_Z102__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a26softmax_cross_entropy_gradEPKfPfmmPKfPfmm
	.hidden	_Z102__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a26softmax_cross_entropy_gradEPKfPfmmPKfPfmm
	.type	_Z102__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a26softmax_cross_entropy_gradEPKfPfmmPKfPfmm, @function
_Z102__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a26softmax_cross_entropy_gradEPKfPfmmPKfPfmm:
.LFB2913:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L33
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a26softmax_cross_entropy_gradEPKfPfmm(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L33:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2913:
	.size	_Z102__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a26softmax_cross_entropy_gradEPKfPfmmPKfPfmm, .-_Z102__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a26softmax_cross_entropy_gradEPKfPfmmPKfPfmm
	.globl	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a26softmax_cross_entropy_gradEPKfPfmm
	.hidden	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a26softmax_cross_entropy_gradEPKfPfmm
	.type	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a26softmax_cross_entropy_gradEPKfPfmm, @function
_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a26softmax_cross_entropy_gradEPKfPfmm:
.LFB2914:
	.cfi_startproc
	endbr64
	jmp	_Z102__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a26softmax_cross_entropy_gradEPKfPfmmPKfPfmm
	.cfi_endproc
.LFE2914:
	.size	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a26softmax_cross_entropy_gradEPKfPfmm, .-_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a26softmax_cross_entropy_gradEPKfPfmm
	.globl	_ZN3gpu33kernel_softmax_cross_entropy_gradEPN2rt4NodeE
	.type	_ZN3gpu33kernel_softmax_cross_entropy_gradEPN2rt4NodeE, @function
_ZN3gpu33kernel_softmax_cross_entropy_gradEPN2rt4NodeE:
.LFB2880:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$8388609, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	salq	$9, %rdx
	movl	$1, %ecx
	movabsq	$4294967297, %rax
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	120(%rdi), %rbx
	movq	64(%rdi), %r12
	movq	72(%rdi), %r14
	movq	88(%rdi), %rbp
	movq	%rax, 12(%rsp)
	movq	128(%rdi), %r13
	movl	16(%rsp), %esi
	movl	%ebx, 8(%rsp)
	movq	8(%rsp), %rdi
	movq	%rdx, 20(%rsp)
	movl	$1, 28(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L39
	movq	%r13, %rcx
	movq	%rbx, %rdx
	movq	%rbp, %rsi
	movq	%r14, %rdi
	call	_Z83__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmmPKfPfmm
.L39:
	call	cudaDeviceSynchronize@PLT
	movq	%rbx, %rax
	movl	$8388609, %edx
	xorl	%r9d, %r9d
	imulq	%r13, %rax
	salq	$9, %rdx
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movq	%rdx, 20(%rsp)
	movl	$1, 28(%rsp)
	addq	$511, %rax
	shrq	$9, %rax
	movl	%eax, 8(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 12(%rsp)
	movq	8(%rsp), %rdi
	movl	16(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L38
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	movq	%r13, %rcx
	movq	%rbx, %rdx
	movq	%rbp, %rsi
	popq	%rbx
	.cfi_def_cfa_offset 40
	movq	%r12, %rdi
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	_Z102__device_stub__ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a26softmax_cross_entropy_gradEPKfPfmmPKfPfmm
.L38:
	.cfi_restore_state
	addq	$32, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2880:
	.size	_ZN3gpu33kernel_softmax_cross_entropy_gradEPN2rt4NodeE, .-_ZN3gpu33kernel_softmax_cross_entropy_gradEPN2rt4NodeE
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a26softmax_cross_entropy_gradEPKfPfmm"
.LC1:
	.string	"_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_reduceEPKfPfm"
.LC2:
	.string	"_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_lcost1EPKfS2_Pfmm"
.LC3:
	.string	"_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a12log_softmax1EPKfPfmm"
.LC4:
	.string	"_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmm"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2916:
	.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
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a26softmax_cross_entropy_gradEPKfPfmm(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC1(%rip), %rdx
	orl	$-1, %r8d
	leaq	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_reduceEPKfPfm(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC2(%rip), %rdx
	orl	$-1, %r8d
	leaq	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a14softmax_lcost1EPKfS2_Pfmm(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC3(%rip), %rdx
	orl	$-1, %r8d
	leaq	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a12log_softmax1EPKfPfmm(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC4(%rip), %rdx
	orl	$-1, %r8d
	leaq	_ZN3gpu43_GLOBAL__N__40ce78b3_10_softmax_cu_f0f11d8a8softmax1EPKfPfmm(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.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
.LFE2916:
	.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
	.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>
#include "softmax.hh"
#include "../runtime/node.hh"
#include "../memory/alloc.hh"



namespace gpu
{

    namespace
    {
        constexpr std::size_t BLOCK_SIZE = 512;

        __global__
        void softmax1(const dbl_t* x, dbl_t* y,
                      std::size_t rows, std::size_t cols) //8ms
        {
            __shared__ dbl_t partial[2 * BLOCK_SIZE];

            //load all elements of the array in shared memory
            auto row = blockIdx.x;
            auto col = threadIdx.x;
            std::size_t step = BLOCK_SIZE;

            dbl_t init = 1e-30;
            for (std::size_t i = col; i < cols; i += step)
                init = max(x[row * cols + i], init);
        
            partial[col] = init;
            __syncthreads();

            for (std::size_t s = BLOCK_SIZE / 2; s > 32; s >>= 1)
            {
                if (col < s)
                    partial[col] = max(partial[col], partial[col + s]);

                __syncthreads();
            }

            //if not volatile, must use __synctthreads again, why ?
            volatile dbl_t* vpartial = partial;
            if (col < 32)
            {
                vpartial[col] = max(vpartial[col], vpartial[col + 32]);
                vpartial[col] = max(vpartial[col], vpartial[col + 16]);
                vpartial[col] = max(vpartial[col], vpartial[col + 8]);
                vpartial[col] = max(vpartial[col], vpartial[col + 4]);
                vpartial[col] = max(vpartial[col],vpartial[col + 2]);
                vpartial[col] = max(vpartial[col], vpartial[col + 1]);
            }
            
            __syncthreads();
            
            for (std::size_t i = col; i < cols; i += step)
                y[row * cols + i] = exp(x[row * cols + i] - partial[0]);

            __syncthreads();

            init = 0;
            for (std::size_t i = col; i < cols; i += step)
                init += y[row * cols + i];
        
            partial[col] = init;
            __syncthreads();

            for (std::size_t s = BLOCK_SIZE / 2; s > 32; s >>= 1)
            {
                if (col < s)
                    partial[col] += partial[col + s];

                __syncthreads();
            }

            if (col < 32)
            {
                vpartial[col] += vpartial[col + 32];
                vpartial[col] += vpartial[col + 16];
                vpartial[col] += vpartial[col + 8];
                vpartial[col] += vpartial[col + 4];
                vpartial[col] += vpartial[col + 2];
                vpartial[col] += vpartial[col + 1];
            }


            __syncthreads();
            
            for (std::size_t i = col; i < cols; i += step)
                y[row * cols + i] /= partial[0];
        }

        __global__
        void log_softmax1(const dbl_t* x, dbl_t* y,
                      std::size_t rows, std::size_t cols) //8ms
        {
            __shared__ dbl_t partial[2 * BLOCK_SIZE];

            //load all elements of the array in shared memory
            auto row = blockIdx.x;
            auto col = threadIdx.x;
            std::size_t step = BLOCK_SIZE;

            dbl_t init = 1e-30;
            for (std::size_t i = col; i < cols; i += step)
                init = max(x[row * cols + i], init);
        
            partial[col] = init;
            __syncthreads();

            for (std::size_t s = BLOCK_SIZE / 2; s > 32; s >>= 1)
            {
                if (col < s)
                    partial[col] = max(partial[col], partial[col + s]);

                __syncthreads();
            }

            //if not volatile, must use __synctthreads again, why ?
            volatile dbl_t* vpartial = partial;
            if (col < 32)
            {
                vpartial[col] = max(vpartial[col], vpartial[col + 32]);
                vpartial[col] = max(vpartial[col], vpartial[col + 16]);
                vpartial[col] = max(vpartial[col], vpartial[col + 8]);
                vpartial[col] = max(vpartial[col], vpartial[col + 4]);
                vpartial[col] = max(vpartial[col],vpartial[col + 2]);
                vpartial[col] = max(vpartial[col], vpartial[col + 1]);
            }
            
            __syncthreads();

            dbl_t max_x = partial[0];

            init = 0;
            for (std::size_t i = col; i < cols; i += step)
                init += exp(x[row * cols + i] - max_x);
        
            partial[col] = init;
            __syncthreads();

            for (std::size_t s = BLOCK_SIZE / 2; s > 32; s >>= 1)
            {
                if (col < s)
                    partial[col] += partial[col + s];

                __syncthreads();
            }

            if (col < 32)
            {
                vpartial[col] += vpartial[col + 32];
                vpartial[col] += vpartial[col + 16];
                vpartial[col] += vpartial[col + 8];
                vpartial[col] += vpartial[col + 4];
                vpartial[col] += vpartial[col + 2];
                vpartial[col] += vpartial[col + 1];
            }


            __syncthreads();

            dbl_t logsum = max_x + std::log(partial[0]);
            
            for (std::size_t i = col; i < cols; i += step)
                y[row * cols + i] = x[row * cols + i] - logsum;
        }

        __global__
        void softmax_lcost1(const dbl_t* y, const dbl_t* x, dbl_t* out,
                            std::size_t rows, std::size_t cols)
        {
            __shared__ dbl_t partial[2 * BLOCK_SIZE];

            //load all elements of the array in shared memory
            auto row = blockIdx.x;
            auto col = threadIdx.x;
            std::size_t step = BLOCK_SIZE;

            dbl_t init = 1e-30;
            for (std::size_t i = col; i < cols; i += step)
                init = max(x[row * cols + i], init);
        
            partial[col] = init;
            __syncthreads();

            for (std::size_t s = BLOCK_SIZE / 2; s > 32; s >>= 1)
            {
                if (col < s)
                    partial[col] = max(partial[col], partial[col + s]);

                __syncthreads();
            }

            //if not volatile, must use __synctthreads again, why ?
            volatile dbl_t* vpartial = partial;
            if (col < 32)
            {
                vpartial[col] = max(vpartial[col], vpartial[col + 32]);
                vpartial[col] = max(vpartial[col], vpartial[col + 16]);
                vpartial[col] = max(vpartial[col], vpartial[col + 8]);
                vpartial[col] = max(vpartial[col], vpartial[col + 4]);
                vpartial[col] = max(vpartial[col],vpartial[col + 2]);
                vpartial[col] = max(vpartial[col], vpartial[col + 1]);
            }
            
            __syncthreads();

            dbl_t max_x = partial[0];

            init = 0;
            for (std::size_t i = col; i < cols; i += step)
                init += exp(x[row * cols + i] - max_x);
        
            partial[col] = init;
            __syncthreads();

            for (std::size_t s = BLOCK_SIZE / 2; s > 32; s >>= 1)
            {
                if (col < s)
                    partial[col] += partial[col + s];

                __syncthreads();
            }

            if (col < 32)
            {
                vpartial[col] += vpartial[col + 32];
                vpartial[col] += vpartial[col + 16];
                vpartial[col] += vpartial[col + 8];
                vpartial[col] += vpartial[col + 4];
                vpartial[col] += vpartial[col + 2];
                vpartial[col] += vpartial[col + 1];
            }


            __syncthreads();

            dbl_t logsum = max_x + std::log(partial[0]);

            init = 0;
            for (std::size_t i = col; i < cols; i += step)
                init += y[row * cols + i] * (x[row * cols + i] - logsum);
        
            partial[col] = init;
            __syncthreads();

            for (std::size_t s = BLOCK_SIZE / 2; s > 32; s >>= 1)
            {
                if (col < s)
                    partial[col] += partial[col + s];

                __syncthreads();
            }

            if (col < 32)
            {
                vpartial[col] += vpartial[col + 32];
                vpartial[col] += vpartial[col + 16];
                vpartial[col] += vpartial[col + 8];
                vpartial[col] += vpartial[col + 4];
                vpartial[col] += vpartial[col + 2];
                vpartial[col] += vpartial[col + 1];
            }
            
            if (col == 0)
                out[row] = partial[0];
        }

        __global__
        void softmax_reduce(const dbl_t* x, dbl_t* y, std::size_t len) //8ms
        {
            __shared__ dbl_t partial[2 * BLOCK_SIZE];

            //load all elements of the array in shared memory
            auto i = threadIdx.x;
            std::size_t step = BLOCK_SIZE;

            dbl_t init = 0;
            for (std::size_t j = i; j < len; j += step)
                init += x[j];
        
            partial[i] = init;
            __syncthreads();

            for (std::size_t s = BLOCK_SIZE / 2; s > 32; s >>= 1)
            {
                if (i < s)
                    partial[i] += partial[i + s];

                __syncthreads();
            }

            //if not volatile, must use __synctthreads again, why ?
            volatile dbl_t* vpartial = partial;
            if (i < 32)
            {
                vpartial[i] += vpartial[i + 32];
                vpartial[i] += vpartial[i + 16];
                vpartial[i] += vpartial[i + 8];
                vpartial[i] += vpartial[i + 4];
                vpartial[i] += vpartial[i + 2];
                vpartial[i] += vpartial[i + 1];
            }


            if (i == 0)
                y[0] = - partial[0] / len;
        }

        __global__
        void softmax_cross_entropy_grad(const dbl_t* y, dbl_t* out,
                                        std::size_t rows, std::size_t cols)
        {
            std::size_t len = rows * cols;
            std::size_t index = blockIdx.x * blockDim.x + threadIdx.x;
            std::size_t stride = blockDim.x * gridDim.x;

            for (std::size_t i = index; i < len; i += stride)
                out[i] = (out[i] - y[i]) / rows;
        }
    }

    void kernel_softmax(rt::Node* node)
    {
        std::size_t rows = node->len1;
        std::size_t cols = node->len2;
        softmax1<<<rows, BLOCK_SIZE>>>(node->in1, node->out1, rows, cols);
    }

    void kernel_log_softmax(rt::Node* node)
    {
        std::size_t rows = node->len1;
        std::size_t cols = node->len2;
        log_softmax1<<<rows, BLOCK_SIZE>>>(node->in1, node->out1, rows, cols);
    }

    void kernel_softmax_cross_entropy(rt::Node* node)
    {
        std::size_t rows = node->len1;
        std::size_t cols = node->len2;
        const dbl_t* y = node->in1;
        const dbl_t* x = node->in2;
        dbl_t* out = node->out1;

        dbl_t* tmp = tensor_alloc(rows);
        softmax_lcost1<<<rows, BLOCK_SIZE>>>(y, x, tmp, rows, cols);
        hipDeviceSynchronize();
        softmax_reduce<<<1, BLOCK_SIZE>>>(tmp, out, rows);
        hipDeviceSynchronize();
        tensor_free(tmp);
    }

    void kernel_softmax_cross_entropy_grad(rt::Node* node)
    {
        const dbl_t* y = node->in1;
        const dbl_t* logits = node->in2;
        dbl_t* out = node->out1;
        std::size_t rows = node->len1;
        std::size_t cols = node->len2;
        
        softmax1<<<rows, BLOCK_SIZE>>>(logits, out, rows, cols);
        hipDeviceSynchronize();

        std::size_t len = rows * cols;
        std::size_t nb_blocks = (len + BLOCK_SIZE - 1) / BLOCK_SIZE;
        softmax_cross_entropy_grad<<<nb_blocks, BLOCK_SIZE>>>(y, out, rows, cols);
    }

}

	.text
	.file	"softmax.hip"
	.globl	_ZN3gpu14kernel_softmaxEPN2rt4NodeE # -- Begin function _ZN3gpu14kernel_softmaxEPN2rt4NodeE
	.type	_ZN3gpu14kernel_softmaxEPN2rt4NodeE,@function
_ZN3gpu14kernel_softmaxEPN2rt4NodeE:    # @_ZN3gpu14kernel_softmaxEPN2rt4NodeE
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %r15
	movq	120(%rdi), %rbx
	movq	128(%rdi), %r14
	movl	%ebx, %edi
	btsq	$32, %rdi
	movabsq	$4294967296, %rdx               # imm = 0x100000000
	orq	$512, %rdx                      # imm = 0x200
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	je	.LBB0_2
# %bb.1:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB0_2:
	.cfi_def_cfa_offset 32
	movq	64(%r15), %rdi
	movq	88(%r15), %rsi
	movq	%rbx, %rdx
	movq	%r14, %rcx
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	_ZN3gpu12_GLOBAL__N_123__device_stub__softmax1EPKfPfmm # TAILCALL
.Lfunc_end0:
	.size	_ZN3gpu14kernel_softmaxEPN2rt4NodeE, .Lfunc_end0-_ZN3gpu14kernel_softmaxEPN2rt4NodeE
	.cfi_endproc
                                        # -- End function
	.type	_ZN3gpu12_GLOBAL__N_123__device_stub__softmax1EPKfPfmm,@function # -- Begin function _ZN3gpu12_GLOBAL__N_123__device_stub__softmax1EPKfPfmm
_ZN3gpu12_GLOBAL__N_123__device_stub__softmax1EPKfPfmm: # @_ZN3gpu12_GLOBAL__N_123__device_stub__softmax1EPKfPfmm
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%rsp, %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.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
	retq
.Lfunc_end1:
	.size	_ZN3gpu12_GLOBAL__N_123__device_stub__softmax1EPKfPfmm, .Lfunc_end1-_ZN3gpu12_GLOBAL__N_123__device_stub__softmax1EPKfPfmm
	.cfi_endproc
                                        # -- End function
	.globl	_ZN3gpu18kernel_log_softmaxEPN2rt4NodeE # -- Begin function _ZN3gpu18kernel_log_softmaxEPN2rt4NodeE
	.type	_ZN3gpu18kernel_log_softmaxEPN2rt4NodeE,@function
_ZN3gpu18kernel_log_softmaxEPN2rt4NodeE: # @_ZN3gpu18kernel_log_softmaxEPN2rt4NodeE
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %r15
	movq	120(%rdi), %rbx
	movq	128(%rdi), %r14
	movl	%ebx, %edi
	btsq	$32, %rdi
	movabsq	$4294967296, %rdx               # imm = 0x100000000
	orq	$512, %rdx                      # imm = 0x200
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	je	.LBB2_2
# %bb.1:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB2_2:
	.cfi_def_cfa_offset 32
	movq	64(%r15), %rdi
	movq	88(%r15), %rsi
	movq	%rbx, %rdx
	movq	%r14, %rcx
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	_ZN3gpu12_GLOBAL__N_127__device_stub__log_softmax1EPKfPfmm # TAILCALL
.Lfunc_end2:
	.size	_ZN3gpu18kernel_log_softmaxEPN2rt4NodeE, .Lfunc_end2-_ZN3gpu18kernel_log_softmaxEPN2rt4NodeE
	.cfi_endproc
                                        # -- End function
	.type	_ZN3gpu12_GLOBAL__N_127__device_stub__log_softmax1EPKfPfmm,@function # -- Begin function _ZN3gpu12_GLOBAL__N_127__device_stub__log_softmax1EPKfPfmm
_ZN3gpu12_GLOBAL__N_127__device_stub__log_softmax1EPKfPfmm: # @_ZN3gpu12_GLOBAL__N_127__device_stub__log_softmax1EPKfPfmm
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%rsp, %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.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
	retq
.Lfunc_end3:
	.size	_ZN3gpu12_GLOBAL__N_127__device_stub__log_softmax1EPKfPfmm, .Lfunc_end3-_ZN3gpu12_GLOBAL__N_127__device_stub__log_softmax1EPKfPfmm
	.cfi_endproc
                                        # -- End function
	.globl	_ZN3gpu28kernel_softmax_cross_entropyEPN2rt4NodeE # -- Begin function _ZN3gpu28kernel_softmax_cross_entropyEPN2rt4NodeE
	.type	_ZN3gpu28kernel_softmax_cross_entropyEPN2rt4NodeE,@function
_ZN3gpu28kernel_softmax_cross_entropyEPN2rt4NodeE: # @_ZN3gpu28kernel_softmax_cross_entropyEPN2rt4NodeE
	.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	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movabsq	$4294967808, %r12               # imm = 0x100000200
	movq	120(%rdi), %rbx
	movq	128(%rdi), %r13
	movq	64(%rdi), %rbp
	movq	72(%rdi), %r15
	movq	88(%rdi), %rax
	movq	%rax, (%rsp)                    # 8-byte Spill
	movq	%rbx, %rdi
	callq	_Z12tensor_allocm
	movq	%rax, %r14
	movl	%ebx, %eax
	leaq	(%rax,%r12), %rdi
	addq	$-512, %rdi                     # imm = 0xFE00
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_2
# %bb.1:
	movq	%rbp, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movq	%rbx, %rcx
	movq	%r13, %r8
	callq	_ZN3gpu12_GLOBAL__N_129__device_stub__softmax_lcost1EPKfS2_Pfmm
.LBB4_2:
	callq	hipDeviceSynchronize
	leaq	-511(%r12), %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_4
# %bb.3:
	movq	%r14, %rdi
	movq	(%rsp), %rsi                    # 8-byte Reload
	movq	%rbx, %rdx
	callq	_ZN3gpu12_GLOBAL__N_129__device_stub__softmax_reduceEPKfPfm
.LBB4_4:
	callq	hipDeviceSynchronize
	movq	%r14, %rdi
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.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
	jmp	_Z11tensor_freePf               # TAILCALL
.Lfunc_end4:
	.size	_ZN3gpu28kernel_softmax_cross_entropyEPN2rt4NodeE, .Lfunc_end4-_ZN3gpu28kernel_softmax_cross_entropyEPN2rt4NodeE
	.cfi_endproc
                                        # -- End function
	.type	_ZN3gpu12_GLOBAL__N_129__device_stub__softmax_lcost1EPKfS2_Pfmm,@function # -- Begin function _ZN3gpu12_GLOBAL__N_129__device_stub__softmax_lcost1EPKfS2_Pfmm
_ZN3gpu12_GLOBAL__N_129__device_stub__softmax_lcost1EPKfS2_Pfmm: # @_ZN3gpu12_GLOBAL__N_129__device_stub__softmax_lcost1EPKfS2_Pfmm
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	popq	%rbx
	.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
	retq
.Lfunc_end5:
	.size	_ZN3gpu12_GLOBAL__N_129__device_stub__softmax_lcost1EPKfS2_Pfmm, .Lfunc_end5-_ZN3gpu12_GLOBAL__N_129__device_stub__softmax_lcost1EPKfS2_Pfmm
	.cfi_endproc
                                        # -- End function
	.type	_ZN3gpu12_GLOBAL__N_129__device_stub__softmax_reduceEPKfPfm,@function # -- Begin function _ZN3gpu12_GLOBAL__N_129__device_stub__softmax_reduceEPKfPfm
_ZN3gpu12_GLOBAL__N_129__device_stub__softmax_reduceEPKfPfm: # @_ZN3gpu12_GLOBAL__N_129__device_stub__softmax_reduceEPKfPfm
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.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
	retq
.Lfunc_end6:
	.size	_ZN3gpu12_GLOBAL__N_129__device_stub__softmax_reduceEPKfPfm, .Lfunc_end6-_ZN3gpu12_GLOBAL__N_129__device_stub__softmax_reduceEPKfPfm
	.cfi_endproc
                                        # -- End function
	.globl	_ZN3gpu33kernel_softmax_cross_entropy_gradEPN2rt4NodeE # -- Begin function _ZN3gpu33kernel_softmax_cross_entropy_gradEPN2rt4NodeE
	.type	_ZN3gpu33kernel_softmax_cross_entropy_gradEPN2rt4NodeE,@function
_ZN3gpu33kernel_softmax_cross_entropy_gradEPN2rt4NodeE: # @_ZN3gpu33kernel_softmax_cross_entropy_gradEPN2rt4NodeE
	.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	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movabsq	$4294967296, %r13               # imm = 0x100000000
	movq	64(%rdi), %rbx
	movq	72(%rdi), %rbp
	movq	88(%rdi), %r14
	movq	120(%rdi), %r15
	movq	128(%rdi), %r12
	movl	%r15d, %edi
	btsq	$32, %rdi
	leaq	512(%r13), %rdx
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB7_2
# %bb.1:
	movq	%rbp, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	movq	%r12, %rcx
	callq	_ZN3gpu12_GLOBAL__N_123__device_stub__softmax1EPKfPfmm
.LBB7_2:
	callq	hipDeviceSynchronize
	movq	%r12, %rax
	imulq	%r15, %rax
	addq	$511, %rax                      # imm = 0x1FF
	shrq	$9, %rax
	movl	%eax, %edi
	orq	%r13, %rdi
	addq	$512, %r13                      # imm = 0x200
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	je	.LBB7_4
# %bb.3:
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.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
.LBB7_4:
	.cfi_def_cfa_offset 64
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	movq	%r12, %rcx
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.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
	jmp	_ZN3gpu12_GLOBAL__N_141__device_stub__softmax_cross_entropy_gradEPKfPfmm # TAILCALL
.Lfunc_end7:
	.size	_ZN3gpu33kernel_softmax_cross_entropy_gradEPN2rt4NodeE, .Lfunc_end7-_ZN3gpu33kernel_softmax_cross_entropy_gradEPN2rt4NodeE
	.cfi_endproc
                                        # -- End function
	.type	_ZN3gpu12_GLOBAL__N_141__device_stub__softmax_cross_entropy_gradEPKfPfmm,@function # -- Begin function _ZN3gpu12_GLOBAL__N_141__device_stub__softmax_cross_entropy_gradEPKfPfmm
_ZN3gpu12_GLOBAL__N_141__device_stub__softmax_cross_entropy_gradEPKfPfmm: # @_ZN3gpu12_GLOBAL__N_141__device_stub__softmax_cross_entropy_gradEPKfPfmm
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%rsp, %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.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
	retq
.Lfunc_end8:
	.size	_ZN3gpu12_GLOBAL__N_141__device_stub__softmax_cross_entropy_gradEPKfPfmm, .Lfunc_end8-_ZN3gpu12_GLOBAL__N_141__device_stub__softmax_cross_entropy_gradEPKfPfmm
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB9_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB9_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm, %esi
	movl	$.L__unnamed_5, %edx
	movl	$.L__unnamed_5, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end9:
	.size	__hip_module_ctor, .Lfunc_end9-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB10_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB10_2:
	retq
.Lfunc_end10:
	.size	__hip_module_dtor, .Lfunc_end10-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm,@object # @_ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm
	.section	.rodata,"a",@progbits
	.p2align	3, 0x0
_ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm:
	.quad	_ZN3gpu12_GLOBAL__N_123__device_stub__softmax1EPKfPfmm
	.size	_ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm, 8

	.type	_ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm,@object # @_ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm
	.p2align	3, 0x0
_ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm:
	.quad	_ZN3gpu12_GLOBAL__N_127__device_stub__log_softmax1EPKfPfmm
	.size	_ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm, 8

	.type	_ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm,@object # @_ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm
	.p2align	3, 0x0
_ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm:
	.quad	_ZN3gpu12_GLOBAL__N_129__device_stub__softmax_lcost1EPKfS2_Pfmm
	.size	_ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm, 8

	.type	_ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm,@object # @_ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm
	.p2align	3, 0x0
_ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm:
	.quad	_ZN3gpu12_GLOBAL__N_129__device_stub__softmax_reduceEPKfPfm
	.size	_ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm, 8

	.type	_ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm,@object # @_ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm
	.p2align	3, 0x0
_ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm:
	.quad	_ZN3gpu12_GLOBAL__N_141__device_stub__softmax_cross_entropy_gradEPKfPfmm
	.size	_ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm, 8

	.type	.L__unnamed_1,@object           # @0
	.section	.rodata.str1.1,"aMS",@progbits,1
.L__unnamed_1:
	.asciz	"_ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm"
	.size	.L__unnamed_1, 39

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm"
	.size	.L__unnamed_2, 44

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm"
	.size	.L__unnamed_3, 49

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm"
	.size	.L__unnamed_4, 45

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"_ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm"
	.size	.L__unnamed_5, 58

	.type	__hip_fatbin_wrapper,@object    # @__hip_fatbin_wrapper
	.section	.hipFatBinSegment,"a",@progbits
	.p2align	3, 0x0
__hip_fatbin_wrapper:
	.long	1212764230                      # 0x48495046
	.long	1                               # 0x1
	.quad	__hip_fatbin
	.quad	0
	.size	__hip_fatbin_wrapper, 24

	.type	__hip_gpubin_handle,@object     # @__hip_gpubin_handle
	.local	__hip_gpubin_handle
	.comm	__hip_gpubin_handle,8,8
	.section	.init_array,"aw",@init_array
	.p2align	3, 0x0
	.quad	__hip_module_ctor
	.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 _ZN3gpu12_GLOBAL__N_123__device_stub__softmax1EPKfPfmm
	.addrsig_sym _ZN3gpu12_GLOBAL__N_127__device_stub__log_softmax1EPKfPfmm
	.addrsig_sym _ZN3gpu12_GLOBAL__N_129__device_stub__softmax_lcost1EPKfS2_Pfmm
	.addrsig_sym _ZN3gpu12_GLOBAL__N_129__device_stub__softmax_reduceEPKfPfm
	.addrsig_sym _ZN3gpu12_GLOBAL__N_141__device_stub__softmax_cross_entropy_gradEPKfPfmm
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm
	.addrsig_sym _ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm
	.addrsig_sym _ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm
	.addrsig_sym _ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm
	.addrsig_sym _ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.section	.text._ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm,"axG",@progbits,_ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm,comdat
	.globl	_ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm ; -- Begin function _ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm
	.p2align	8
	.type	_ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm,@function
_ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm: ; @_ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm
; %bb.0:
	s_clause 0x1
	s_load_b64 s[8:9], s[0:1], 0x18
	s_load_b128 s[4:7], s[0:1], 0x0
	v_dual_mov_b32 v1, 0 :: v_dual_mov_b32 v6, 0xda24260
	v_lshlrev_b32_e32 v8, 2, v0
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_cmp_gt_u64_e64 s0, s[8:9], v[0:1]
	s_mul_i32 s12, s9, s15
	s_mul_hi_u32 s13, s8, s15
	s_mul_i32 s10, s8, s15
	s_and_saveexec_b32 s2, s0
	s_cbranch_execz .LBB0_4
; %bb.1:                                ; %.lr.ph
	s_add_i32 s11, s13, s12
	v_dual_mov_b32 v6, 0xda24260 :: v_dual_mov_b32 v5, v1
	s_lshl_b64 s[16:17], s[10:11], 2
	v_mov_b32_e32 v4, v0
	s_add_u32 s1, s4, s16
	s_addc_u32 s3, s5, s17
	v_add_co_u32 v2, s1, s1, v8
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v3, null, s3, 0, s1
	s_mov_b32 s3, 0
.LBB0_2:                                ; =>This Inner Loop Header: Depth=1
	global_load_b32 v7, v[2:3], off
	v_add_co_u32 v4, vcc_lo, 0x200, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	v_max_f32_e32 v6, v6, v6
	v_add_co_u32 v2, s1, 0x800, v2
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_cmp_le_u64_e32 vcc_lo, s[8:9], v[4:5]
	v_add_co_ci_u32_e64 v3, s1, 0, v3, s1
	s_or_b32 s3, vcc_lo, s3
	s_waitcnt vmcnt(0)
	v_max_f32_e32 v7, v7, v7
	v_max_f32_e32 v6, v7, v6
	s_and_not1_b32 exec_lo, exec_lo, s3
	s_cbranch_execnz .LBB0_2
; %bb.3:                                ; %Flow185
	s_or_b32 exec_lo, exec_lo, s3
.LBB0_4:                                ; %Flow186
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s2
	s_mov_b64 s[2:3], 0x100
	ds_store_b32 v8, v6
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
.LBB0_5:                                ; =>This Inner Loop Header: Depth=1
	s_mov_b32 s1, exec_lo
	v_cmpx_gt_u64_e64 s[2:3], v[0:1]
	s_cbranch_execz .LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	v_lshl_add_u32 v2, s2, 2, v8
	ds_load_b32 v2, v2
	ds_load_b32 v3, v8
	s_waitcnt lgkmcnt(0)
	v_dual_max_f32 v2, v2, v2 :: v_dual_max_f32 v3, v3, v3
	s_delay_alu instid0(VALU_DEP_1)
	v_max_f32_e32 v2, v3, v2
	ds_store_b32 v8, v2
.LBB0_7:                                ;   in Loop: Header=BB0_5 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	v_cmp_gt_u64_e64 s1, 0x42, s[2:3]
	s_lshr_b64 s[2:3], s[2:3], 1
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_and_b32 vcc_lo, exec_lo, s1
	s_cbranch_vccz .LBB0_5
; %bb.8:
	v_cmp_gt_u32_e64 s1, 32, v0
	v_lshl_add_u32 v14, v0, 2, 0x80
	v_add_nc_u32_e32 v13, 64, v8
	v_add_nc_u32_e32 v12, 32, v8
	v_add_nc_u32_e32 v11, 16, v8
	v_add_nc_u32_e32 v10, 8, v8
	v_add_nc_u32_e32 v9, 4, v8
	s_and_saveexec_b32 s3, s1
	s_cbranch_execz .LBB0_10
; %bb.9:
	v_cmp_ne_u32_e32 vcc_lo, -1, v8
	v_cmp_ne_u32_e64 s2, -1, v14
	s_mov_b64 s[16:17], src_shared_base
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v5, 0, s17, vcc_lo
	v_cndmask_b32_e32 v4, 0, v8, vcc_lo
	v_cndmask_b32_e64 v2, 0, v14, s2
	v_cndmask_b32_e64 v3, 0, s17, s2
	v_cmp_ne_u32_e32 vcc_lo, -1, v13
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(1)
	v_max_f32_e32 v3, v6, v6
	s_waitcnt lgkmcnt(0)
	v_max_f32_e32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_max_f32_e32 v6, v3, v2
	v_cndmask_b32_e32 v2, 0, v13, vcc_lo
	v_cndmask_b32_e64 v3, 0, s17, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v12
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(1)
	v_max_f32_e32 v3, v6, v6
	s_waitcnt lgkmcnt(0)
	v_max_f32_e32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_max_f32_e32 v6, v3, v2
	v_cndmask_b32_e32 v2, 0, v12, vcc_lo
	v_cndmask_b32_e64 v3, 0, s17, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v11
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(1)
	v_max_f32_e32 v3, v6, v6
	s_waitcnt lgkmcnt(0)
	v_max_f32_e32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_max_f32_e32 v6, v3, v2
	v_cndmask_b32_e32 v2, 0, v11, vcc_lo
	v_cndmask_b32_e64 v3, 0, s17, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v10
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(1)
	v_max_f32_e32 v3, v6, v6
	s_waitcnt lgkmcnt(0)
	v_max_f32_e32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_max_f32_e32 v6, v3, v2
	v_cndmask_b32_e32 v2, 0, v10, vcc_lo
	v_cndmask_b32_e64 v3, 0, s17, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v9
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(1)
	v_max_f32_e32 v3, v6, v6
	s_waitcnt lgkmcnt(0)
	v_max_f32_e32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_max_f32_e32 v6, v3, v2
	v_cndmask_b32_e32 v2, 0, v9, vcc_lo
	v_cndmask_b32_e64 v3, 0, s17, vcc_lo
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(1)
	v_max_f32_e32 v3, v6, v6
	s_waitcnt lgkmcnt(0)
	v_max_f32_e32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_max_f32_e32 v2, v3, v2
	flat_store_b32 v[4:5], v2 dlc
	s_waitcnt_vscnt null, 0x0
.LBB0_10:
	s_or_b32 exec_lo, exec_lo, s3
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_and_saveexec_b32 s3, s0
	s_cbranch_execz .LBB0_13
; %bb.11:                               ; %.lr.ph141
	v_mad_u64_u32 v[2:3], null, s15, s8, v[0:1]
	v_dual_mov_b32 v7, v1 :: v_dual_mov_b32 v6, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[4:5], null, s15, s9, v[3:4]
	v_mov_b32_e32 v5, 0
	ds_load_b32 v15, v5
	v_mov_b32_e32 v3, v4
	v_lshlrev_b64 v[4:5], 2, v[2:3]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, s4, v4
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v5, vcc_lo
	v_add_co_u32 v4, vcc_lo, s6, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v5, vcc_lo
	s_mov_b32 s4, 0
.LBB0_12:                               ; =>This Inner Loop Header: Depth=1
	global_load_b32 v16, v[2:3], off
	v_add_co_u32 v6, vcc_lo, 0x200, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v7, vcc_lo
	v_add_co_u32 v2, vcc_lo, 0x800, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, 0, v3, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_cmp_le_u64_e32 vcc_lo, s[8:9], v[6:7]
	s_or_b32 s4, vcc_lo, s4
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_sub_f32_e32 v16, v16, v15
	v_mul_f32_e32 v17, 0x3fb8aa3b, v16
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f32 v18, 0x3fb8aa3b, v16, -v17
	v_rndne_f32_e32 v19, v17
	v_dual_fmac_f32 v18, 0x32a5705f, v16 :: v_dual_sub_f32 v17, v17, v19
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_add_f32_e32 v17, v17, v18
	v_cvt_i32_f32_e32 v18, v19
	v_cmp_ngt_f32_e64 s2, 0xc2ce8ed0, v16
	v_exp_f32_e32 v17, v17
	s_waitcnt_depctr 0xfff
	v_ldexp_f32 v17, v17, v18
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v17, 0, v17, s2
	v_cmp_nlt_f32_e64 s2, 0x42b17218, v16
	v_cndmask_b32_e64 v16, 0x7f800000, v17, s2
	global_store_b32 v[4:5], v16, off
	v_add_co_u32 v4, s2, 0x800, v4
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v5, s2, 0, v5, s2
	s_and_not1_b32 exec_lo, exec_lo, s4
	s_cbranch_execnz .LBB0_12
.LBB0_13:                               ; %Flow184
	s_or_b32 exec_lo, exec_lo, s3
	v_mov_b32_e32 v6, 0
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_and_saveexec_b32 s3, s0
	s_cbranch_execz .LBB0_17
; %bb.14:                               ; %.lr.ph146
	s_add_i32 s11, s13, s12
	v_dual_mov_b32 v6, 0 :: v_dual_mov_b32 v5, v1
	s_lshl_b64 s[4:5], s[10:11], 2
	v_mov_b32_e32 v4, v0
	s_add_u32 s2, s6, s4
	s_addc_u32 s4, s7, s5
	v_add_co_u32 v2, s2, s2, v8
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v3, null, s4, 0, s2
	s_mov_b32 s4, 0
.LBB0_15:                               ; =>This Inner Loop Header: Depth=1
	global_load_b32 v7, v[2:3], off
	v_add_co_u32 v4, vcc_lo, 0x200, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	v_add_co_u32 v2, s2, 0x800, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e64 v3, s2, 0, v3, s2
	v_cmp_le_u64_e32 vcc_lo, s[8:9], v[4:5]
	s_or_b32 s4, vcc_lo, s4
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v6, v6, v7
	s_and_not1_b32 exec_lo, exec_lo, s4
	s_cbranch_execnz .LBB0_15
; %bb.16:                               ; %Flow181
	s_or_b32 exec_lo, exec_lo, s4
.LBB0_17:                               ; %Flow182
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s3
	s_mov_b64 s[2:3], 0x100
	ds_store_b32 v8, v6
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
.LBB0_18:                               ; =>This Inner Loop Header: Depth=1
	s_mov_b32 s4, exec_lo
	v_cmpx_gt_u64_e64 s[2:3], v[0:1]
	s_cbranch_execz .LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	v_lshl_add_u32 v2, s2, 2, v8
	ds_load_b32 v2, v2
	ds_load_b32 v3, v8
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v2, v2, v3
	ds_store_b32 v8, v2
.LBB0_20:                               ;   in Loop: Header=BB0_18 Depth=1
	s_or_b32 exec_lo, exec_lo, s4
	v_cmp_gt_u64_e64 s4, 0x42, s[2:3]
	s_lshr_b64 s[2:3], s[2:3], 1
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_and_b32 vcc_lo, exec_lo, s4
	s_cbranch_vccz .LBB0_18
; %bb.21:
	s_and_saveexec_b32 s2, s1
	s_cbranch_execz .LBB0_23
; %bb.22:
	v_cmp_ne_u32_e32 vcc_lo, -1, v14
	v_cmp_ne_u32_e64 s1, -1, v8
	s_mov_b64 s[4:5], src_shared_base
	v_cndmask_b32_e32 v2, 0, v14, vcc_lo
	v_cndmask_b32_e64 v3, 0, s5, vcc_lo
	s_delay_alu instid0(VALU_DEP_3)
	v_cndmask_b32_e64 v5, 0, s5, s1
	v_cndmask_b32_e64 v4, 0, v8, s1
	v_cmp_ne_u32_e32 vcc_lo, -1, v13
	flat_load_b32 v3, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v2, 0, v13, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v6, v3, v6
	v_cndmask_b32_e64 v3, 0, s5, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v12
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v3, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v2, 0, v12, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v6, v3, v6
	v_cndmask_b32_e64 v3, 0, s5, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v11
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v3, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v2, 0, v11, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v6, v3, v6
	v_cndmask_b32_e64 v3, 0, s5, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v10
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v3, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v2, 0, v10, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v6, v3, v6
	v_cndmask_b32_e64 v3, 0, s5, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v9
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v3, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v2, 0, v9, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v6, v3, v6
	v_cndmask_b32_e64 v3, 0, s5, vcc_lo
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v3, v[4:5] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_add_f32_e32 v2, v2, v3
	flat_store_b32 v[4:5], v2 dlc
	s_waitcnt_vscnt null, 0x0
.LBB0_23:
	s_or_b32 exec_lo, exec_lo, s2
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_and_saveexec_b32 s1, s0
	s_cbranch_execz .LBB0_26
; %bb.24:                               ; %.lr.ph152
	v_mov_b32_e32 v2, 0
	s_add_i32 s11, s13, s12
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[0:1], s[10:11], 2
	s_add_u32 s0, s6, s0
	ds_load_b32 v4, v2
	s_addc_u32 s1, s7, s1
	v_add_co_u32 v2, s0, s0, v8
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v3, null, s1, 0, s0
	s_mov_b32 s1, 0
.LBB0_25:                               ; =>This Inner Loop Header: Depth=1
	global_load_b32 v5, v[2:3], off
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_div_scale_f32 v6, null, v4, v4, v5
	v_div_scale_f32 v9, vcc_lo, v5, v4, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f32_e32 v7, v6
	s_waitcnt_depctr 0xfff
	v_fma_f32 v8, -v6, v7, 1.0
	v_fmac_f32_e32 v7, v8, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v8, v9, v7
	v_fma_f32 v10, -v6, v8, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v8, v10, v7
	v_fma_f32 v6, -v6, v8, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_div_fmas_f32 v6, v6, v7, v8
	v_add_co_u32 v0, vcc_lo, 0x200, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
	v_div_fixup_f32 v5, v6, v4, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_cmp_le_u64_e32 vcc_lo, s[8:9], v[0:1]
	global_store_b32 v[2:3], v5, off
	v_add_co_u32 v2, s0, 0x800, v2
	v_add_co_ci_u32_e64 v3, s0, 0, v3, s0
	s_or_b32 s1, vcc_lo, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB0_25
.LBB0_26:                               ; %Flow180
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm
		.amdhsa_group_segment_fixed_size 4096
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 32
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 20
		.amdhsa_next_free_sgpr 18
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.section	.text._ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm,"axG",@progbits,_ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm,comdat
.Lfunc_end0:
	.size	_ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm, .Lfunc_end0-_ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 2176
; NumSgprs: 20
; NumVgprs: 20
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 4096 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 20
; NumVGPRsForWavesPerEU: 20
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.section	.text._ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm,"axG",@progbits,_ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm,comdat
	.globl	_ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm ; -- Begin function _ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm
	.p2align	8
	.type	_ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm,@function
_ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm: ; @_ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm
; %bb.0:
	s_clause 0x1
	s_load_b64 s[8:9], s[0:1], 0x18
	s_load_b128 s[4:7], s[0:1], 0x0
	v_dual_mov_b32 v1, 0 :: v_dual_lshlrev_b32 v6, 2, v0
	v_mov_b32_e32 v7, 0xda24260
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_cmp_gt_u64_e64 s0, s[8:9], v[0:1]
	s_mul_i32 s12, s9, s15
	s_mul_hi_u32 s13, s8, s15
	s_mul_i32 s10, s8, s15
	s_and_saveexec_b32 s2, s0
	s_cbranch_execz .LBB1_4
; %bb.1:                                ; %.lr.ph
	s_add_i32 s11, s13, s12
	v_mov_b32_e32 v5, v1
	s_lshl_b64 s[16:17], s[10:11], 2
	v_dual_mov_b32 v7, 0xda24260 :: v_dual_mov_b32 v4, v0
	s_add_u32 s1, s4, s16
	s_addc_u32 s3, s5, s17
	v_add_co_u32 v2, s1, s1, v6
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v3, null, s3, 0, s1
	s_mov_b32 s3, 0
.LBB1_2:                                ; =>This Inner Loop Header: Depth=1
	global_load_b32 v8, v[2:3], off
	v_add_co_u32 v4, vcc_lo, 0x200, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	v_max_f32_e32 v7, v7, v7
	v_add_co_u32 v2, s1, 0x800, v2
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_cmp_le_u64_e32 vcc_lo, s[8:9], v[4:5]
	v_add_co_ci_u32_e64 v3, s1, 0, v3, s1
	s_or_b32 s3, vcc_lo, s3
	s_waitcnt vmcnt(0)
	v_max_f32_e32 v8, v8, v8
	v_max_f32_e32 v7, v8, v7
	s_and_not1_b32 exec_lo, exec_lo, s3
	s_cbranch_execnz .LBB1_2
; %bb.3:                                ; %Flow169
	s_or_b32 exec_lo, exec_lo, s3
.LBB1_4:                                ; %Flow170
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s2
	s_mov_b64 s[2:3], 0x100
	ds_store_b32 v6, v7
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
.LBB1_5:                                ; =>This Inner Loop Header: Depth=1
	s_mov_b32 s1, exec_lo
	v_cmpx_gt_u64_e64 s[2:3], v[0:1]
	s_cbranch_execz .LBB1_7
; %bb.6:                                ;   in Loop: Header=BB1_5 Depth=1
	v_lshl_add_u32 v2, s2, 2, v6
	ds_load_b32 v2, v2
	ds_load_b32 v3, v6
	s_waitcnt lgkmcnt(0)
	v_dual_max_f32 v2, v2, v2 :: v_dual_max_f32 v3, v3, v3
	s_delay_alu instid0(VALU_DEP_1)
	v_max_f32_e32 v2, v3, v2
	ds_store_b32 v6, v2
.LBB1_7:                                ;   in Loop: Header=BB1_5 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	v_cmp_gt_u64_e64 s1, 0x42, s[2:3]
	s_lshr_b64 s[2:3], s[2:3], 1
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_and_b32 vcc_lo, exec_lo, s1
	s_cbranch_vccz .LBB1_5
; %bb.8:
	v_cmp_gt_u32_e64 s1, 32, v0
	v_lshl_add_u32 v12, v0, 2, 0x80
	v_add_nc_u32_e32 v11, 64, v6
	v_add_nc_u32_e32 v10, 32, v6
	v_add_nc_u32_e32 v9, 16, v6
	v_add_nc_u32_e32 v8, 8, v6
	v_add_nc_u32_e32 v7, 4, v6
	s_and_saveexec_b32 s3, s1
	s_cbranch_execz .LBB1_10
; %bb.9:
	v_cmp_ne_u32_e32 vcc_lo, -1, v6
	v_cmp_ne_u32_e64 s2, -1, v12
	s_mov_b64 s[16:17], src_shared_base
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v5, 0, s17, vcc_lo
	v_cndmask_b32_e32 v4, 0, v6, vcc_lo
	v_cndmask_b32_e64 v2, 0, v12, s2
	v_cndmask_b32_e64 v3, 0, s17, s2
	v_cmp_ne_u32_e32 vcc_lo, -1, v11
	flat_load_b32 v13, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_dual_max_f32 v3, v13, v13 :: v_dual_max_f32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_dual_max_f32 v13, v3, v2 :: v_dual_cndmask_b32 v2, 0, v11
	v_cndmask_b32_e64 v3, 0, s17, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v10
	flat_store_b32 v[4:5], v13 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v13, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_dual_max_f32 v3, v13, v13 :: v_dual_max_f32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_max_f32_e32 v13, v3, v2
	v_cndmask_b32_e32 v2, 0, v10, vcc_lo
	v_cndmask_b32_e64 v3, 0, s17, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v9
	flat_store_b32 v[4:5], v13 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v13, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_dual_max_f32 v3, v13, v13 :: v_dual_max_f32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_dual_max_f32 v13, v3, v2 :: v_dual_cndmask_b32 v2, 0, v9
	v_cndmask_b32_e64 v3, 0, s17, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v8
	flat_store_b32 v[4:5], v13 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v13, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_dual_max_f32 v3, v13, v13 :: v_dual_max_f32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_dual_max_f32 v13, v3, v2 :: v_dual_cndmask_b32 v2, 0, v8
	v_cndmask_b32_e64 v3, 0, s17, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v7
	flat_store_b32 v[4:5], v13 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v13, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_dual_max_f32 v3, v13, v13 :: v_dual_max_f32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_dual_max_f32 v13, v3, v2 :: v_dual_cndmask_b32 v2, 0, v7
	v_cndmask_b32_e64 v3, 0, s17, vcc_lo
	flat_store_b32 v[4:5], v13 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v13, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_dual_max_f32 v3, v13, v13 :: v_dual_max_f32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_max_f32_e32 v2, v3, v2
	flat_store_b32 v[4:5], v2 dlc
	s_waitcnt_vscnt null, 0x0
.LBB1_10:
	s_or_b32 exec_lo, exec_lo, s3
	v_mov_b32_e32 v14, 0
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	ds_load_b32 v13, v14
	s_and_saveexec_b32 s3, s0
	s_cbranch_execz .LBB1_14
; %bb.11:                               ; %.lr.ph135
	s_add_i32 s11, s13, s12
	v_dual_mov_b32 v14, 0 :: v_dual_mov_b32 v5, v1
	s_lshl_b64 s[10:11], s[10:11], 2
	v_mov_b32_e32 v4, v0
	s_add_u32 s2, s4, s10
	s_addc_u32 s10, s5, s11
	v_add_co_u32 v2, s2, s2, v6
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v3, null, s10, 0, s2
	s_mov_b32 s10, 0
.LBB1_12:                               ; =>This Inner Loop Header: Depth=1
	global_load_b32 v15, v[2:3], off
	v_add_co_u32 v4, vcc_lo, 0x200, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_cmp_le_u64_e32 vcc_lo, s[8:9], v[4:5]
	s_or_b32 s10, vcc_lo, s10
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_sub_f32_e32 v15, v15, v13
	v_mul_f32_e32 v16, 0x3fb8aa3b, v15
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f32 v17, 0x3fb8aa3b, v15, -v16
	v_rndne_f32_e32 v18, v16
	v_dual_sub_f32 v16, v16, v18 :: v_dual_fmac_f32 v17, 0x32a5705f, v15
	v_cmp_ngt_f32_e64 s2, 0xc2ce8ed0, v15
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_f32_e32 v16, v16, v17
	v_cvt_i32_f32_e32 v17, v18
	v_exp_f32_e32 v16, v16
	s_waitcnt_depctr 0xfff
	v_ldexp_f32 v16, v16, v17
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v16, 0, v16, s2
	v_cmp_nlt_f32_e64 s2, 0x42b17218, v15
	v_cndmask_b32_e64 v15, 0x7f800000, v16, s2
	v_add_co_u32 v2, s2, 0x800, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e64 v3, s2, 0, v3, s2
	v_add_f32_e32 v14, v14, v15
	s_and_not1_b32 exec_lo, exec_lo, s10
	s_cbranch_execnz .LBB1_12
; %bb.13:                               ; %Flow167
	s_or_b32 exec_lo, exec_lo, s10
.LBB1_14:                               ; %Flow168
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s3
	s_mov_b64 s[2:3], 0x100
	ds_store_b32 v6, v14
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
.LBB1_15:                               ; =>This Inner Loop Header: Depth=1
	s_mov_b32 s10, exec_lo
	v_cmpx_gt_u64_e64 s[2:3], v[0:1]
	s_cbranch_execz .LBB1_17
; %bb.16:                               ;   in Loop: Header=BB1_15 Depth=1
	v_lshl_add_u32 v2, s2, 2, v6
	ds_load_b32 v2, v2
	ds_load_b32 v3, v6
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v2, v2, v3
	ds_store_b32 v6, v2
.LBB1_17:                               ;   in Loop: Header=BB1_15 Depth=1
	s_or_b32 exec_lo, exec_lo, s10
	v_cmp_gt_u64_e64 s10, 0x42, s[2:3]
	s_lshr_b64 s[2:3], s[2:3], 1
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_and_b32 vcc_lo, exec_lo, s10
	s_cbranch_vccz .LBB1_15
; %bb.18:
	s_and_saveexec_b32 s2, s1
	s_cbranch_execz .LBB1_20
; %bb.19:
	v_cmp_ne_u32_e32 vcc_lo, -1, v12
	v_cmp_ne_u32_e64 s1, -1, v6
	s_mov_b64 s[10:11], src_shared_base
	v_cndmask_b32_e32 v2, 0, v12, vcc_lo
	v_cndmask_b32_e64 v3, 0, s11, vcc_lo
	s_delay_alu instid0(VALU_DEP_3)
	v_cndmask_b32_e64 v5, 0, s11, s1
	v_cndmask_b32_e64 v4, 0, v6, s1
	v_cmp_ne_u32_e32 vcc_lo, -1, v11
	flat_load_b32 v3, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v2, 0, v11, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v6, v3, v6
	v_cndmask_b32_e64 v3, 0, s11, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v10
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v3, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v2, 0, v10, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v6, v3, v6
	v_cndmask_b32_e64 v3, 0, s11, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v9
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v3, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v2, 0, v9, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v6, v3, v6
	v_cndmask_b32_e64 v3, 0, s11, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v8
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v3, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v2, 0, v8, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v6, v3, v6
	v_cndmask_b32_e64 v3, 0, s11, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v7
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v3, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v2, 0, v7, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v6, v3, v6
	v_cndmask_b32_e64 v3, 0, s11, vcc_lo
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v3, v[4:5] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_add_f32_e32 v2, v2, v3
	flat_store_b32 v[4:5], v2 dlc
	s_waitcnt_vscnt null, 0x0
.LBB1_20:
	s_or_b32 exec_lo, exec_lo, s2
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_and_saveexec_b32 s1, s0
	s_cbranch_execz .LBB1_23
; %bb.21:                               ; %.lr.ph141
	v_mov_b32_e32 v2, 0
	s_mov_b32 s1, 0
	ds_load_b32 v2, v2
	s_waitcnt lgkmcnt(0)
	v_cmp_gt_f32_e32 vcc_lo, 0x800000, v2
	v_cndmask_b32_e64 v3, 1.0, 0x4f800000, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v2, v2, v3
	v_log_f32_e32 v6, v2
	v_mad_u64_u32 v[2:3], null, s15, s8, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[4:5], null, s15, s9, v[3:4]
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v7, 0x3f317217, v6
	v_fma_f32 v8, 0x3f317217, v6, -v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmamk_f32 v3, v6, 0x3377d1cf, v8
	v_add_f32_e32 v5, v7, v3
	v_mov_b32_e32 v3, v4
	v_cndmask_b32_e64 v7, 0, 0x41b17218, vcc_lo
	v_cmp_gt_f32_e64 vcc_lo, 0x7f800000, |v6|
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cndmask_b32_e32 v6, v6, v5, vcc_lo
	v_lshlrev_b64 v[4:5], 2, v[2:3]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_f32_e32 v6, v6, v7
	v_add_co_u32 v2, vcc_lo, s4, v4
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v5, vcc_lo
	v_add_f32_e32 v6, v13, v6
	v_add_co_u32 v4, vcc_lo, s6, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v5, vcc_lo
.LBB1_22:                               ; =>This Inner Loop Header: Depth=1
	global_load_b32 v7, v[2:3], off
	v_add_co_u32 v0, vcc_lo, 0x200, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
	v_add_co_u32 v2, vcc_lo, 0x800, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, 0, v3, vcc_lo
	s_delay_alu instid0(VALU_DEP_3)
	v_cmp_le_u64_e32 vcc_lo, s[8:9], v[0:1]
	s_or_b32 s1, vcc_lo, s1
	s_waitcnt vmcnt(0)
	v_sub_f32_e32 v7, v7, v6
	global_store_b32 v[4:5], v7, off
	v_add_co_u32 v4, s0, 0x800, v4
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v5, s0, 0, v5, s0
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB1_22
.LBB1_23:                               ; %Flow166
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm
		.amdhsa_group_segment_fixed_size 4096
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 32
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 19
		.amdhsa_next_free_sgpr 18
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.section	.text._ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm,"axG",@progbits,_ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm,comdat
.Lfunc_end1:
	.size	_ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm, .Lfunc_end1-_ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 2024
; NumSgprs: 20
; NumVgprs: 19
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 4096 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 20
; NumVGPRsForWavesPerEU: 19
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.section	.text._ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm,"axG",@progbits,_ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm,comdat
	.globl	_ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm ; -- Begin function _ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm
	.p2align	8
	.type	_ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm,@function
_ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm: ; @_ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm
; %bb.0:
	s_clause 0x2
	s_load_b64 s[12:13], s[0:1], 0x20
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[10:11], s[0:1], 0x10
	v_dual_mov_b32 v1, 0 :: v_dual_mov_b32 v6, 0xda24260
	v_lshlrev_b32_e32 v8, 2, v0
	s_mov_b32 s8, s15
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_cmp_gt_u64_e64 s1, s[12:13], v[0:1]
	s_mul_i32 s9, s13, s15
	s_mul_hi_u32 s16, s12, s15
	s_mul_i32 s14, s12, s15
	s_and_saveexec_b32 s2, s1
	s_cbranch_execz .LBB2_4
; %bb.1:                                ; %.lr.ph
	s_add_i32 s15, s16, s9
	v_dual_mov_b32 v6, 0xda24260 :: v_dual_mov_b32 v5, v1
	s_lshl_b64 s[18:19], s[14:15], 2
	v_mov_b32_e32 v4, v0
	s_add_u32 s0, s6, s18
	s_addc_u32 s3, s7, s19
	v_add_co_u32 v2, s0, s0, v8
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v3, null, s3, 0, s0
	s_mov_b32 s3, 0
.LBB2_2:                                ; =>This Inner Loop Header: Depth=1
	global_load_b32 v7, v[2:3], off
	v_add_co_u32 v4, vcc_lo, 0x200, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	v_max_f32_e32 v6, v6, v6
	v_add_co_u32 v2, s0, 0x800, v2
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_cmp_le_u64_e32 vcc_lo, s[12:13], v[4:5]
	v_add_co_ci_u32_e64 v3, s0, 0, v3, s0
	s_or_b32 s3, vcc_lo, s3
	s_waitcnt vmcnt(0)
	v_max_f32_e32 v7, v7, v7
	v_max_f32_e32 v6, v7, v6
	s_and_not1_b32 exec_lo, exec_lo, s3
	s_cbranch_execnz .LBB2_2
; %bb.3:                                ; %Flow223
	s_or_b32 exec_lo, exec_lo, s3
.LBB2_4:                                ; %Flow224
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s2
	s_mov_b64 s[2:3], 0x100
	ds_store_b32 v8, v6
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
.LBB2_5:                                ; =>This Inner Loop Header: Depth=1
	s_mov_b32 s0, exec_lo
	v_cmpx_gt_u64_e64 s[2:3], v[0:1]
	s_cbranch_execz .LBB2_7
; %bb.6:                                ;   in Loop: Header=BB2_5 Depth=1
	v_lshl_add_u32 v2, s2, 2, v8
	ds_load_b32 v2, v2
	ds_load_b32 v3, v8
	s_waitcnt lgkmcnt(0)
	v_dual_max_f32 v2, v2, v2 :: v_dual_max_f32 v3, v3, v3
	s_delay_alu instid0(VALU_DEP_1)
	v_max_f32_e32 v2, v3, v2
	ds_store_b32 v8, v2
.LBB2_7:                                ;   in Loop: Header=BB2_5 Depth=1
	s_or_b32 exec_lo, exec_lo, s0
	v_cmp_gt_u64_e64 s0, 0x42, s[2:3]
	s_lshr_b64 s[2:3], s[2:3], 1
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_and_b32 vcc_lo, exec_lo, s0
	s_cbranch_vccz .LBB2_5
; %bb.8:
	v_cmp_gt_u32_e64 s0, 32, v0
	v_lshl_add_u32 v14, v0, 2, 0x80
	v_add_nc_u32_e32 v13, 64, v8
	v_add_nc_u32_e32 v12, 32, v8
	v_add_nc_u32_e32 v11, 16, v8
	v_add_nc_u32_e32 v10, 8, v8
	v_add_nc_u32_e32 v9, 4, v8
	s_and_saveexec_b32 s3, s0
	s_cbranch_execz .LBB2_10
; %bb.9:
	v_cmp_ne_u32_e32 vcc_lo, -1, v8
	v_cmp_ne_u32_e64 s2, -1, v14
	s_mov_b64 s[18:19], src_shared_base
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v5, 0, s19, vcc_lo
	v_cndmask_b32_e32 v4, 0, v8, vcc_lo
	v_cndmask_b32_e64 v2, 0, v14, s2
	v_cndmask_b32_e64 v3, 0, s19, s2
	v_cmp_ne_u32_e32 vcc_lo, -1, v13
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(1)
	v_max_f32_e32 v3, v6, v6
	s_waitcnt lgkmcnt(0)
	v_max_f32_e32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_max_f32_e32 v6, v3, v2
	v_cndmask_b32_e32 v2, 0, v13, vcc_lo
	v_cndmask_b32_e64 v3, 0, s19, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v12
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(1)
	v_max_f32_e32 v3, v6, v6
	s_waitcnt lgkmcnt(0)
	v_max_f32_e32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_max_f32_e32 v6, v3, v2
	v_cndmask_b32_e32 v2, 0, v12, vcc_lo
	v_cndmask_b32_e64 v3, 0, s19, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v11
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(1)
	v_max_f32_e32 v3, v6, v6
	s_waitcnt lgkmcnt(0)
	v_max_f32_e32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_max_f32_e32 v6, v3, v2
	v_cndmask_b32_e32 v2, 0, v11, vcc_lo
	v_cndmask_b32_e64 v3, 0, s19, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v10
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(1)
	v_max_f32_e32 v3, v6, v6
	s_waitcnt lgkmcnt(0)
	v_max_f32_e32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_max_f32_e32 v6, v3, v2
	v_cndmask_b32_e32 v2, 0, v10, vcc_lo
	v_cndmask_b32_e64 v3, 0, s19, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v9
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(1)
	v_max_f32_e32 v3, v6, v6
	s_waitcnt lgkmcnt(0)
	v_max_f32_e32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_max_f32_e32 v6, v3, v2
	v_cndmask_b32_e32 v2, 0, v9, vcc_lo
	v_cndmask_b32_e64 v3, 0, s19, vcc_lo
	flat_store_b32 v[4:5], v6 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v6, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(1)
	v_max_f32_e32 v3, v6, v6
	s_waitcnt lgkmcnt(0)
	v_max_f32_e32 v2, v2, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_max_f32_e32 v2, v3, v2
	flat_store_b32 v[4:5], v2 dlc
	s_waitcnt_vscnt null, 0x0
.LBB2_10:
	s_or_b32 exec_lo, exec_lo, s3
	v_mov_b32_e32 v7, 0
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	ds_load_b32 v6, v7
	s_and_saveexec_b32 s3, s1
	s_cbranch_execz .LBB2_14
; %bb.11:                               ; %.lr.ph177
	s_add_i32 s15, s16, s9
	v_mov_b32_e32 v5, v1
	s_lshl_b64 s[14:15], s[14:15], 2
	v_dual_mov_b32 v7, 0 :: v_dual_mov_b32 v4, v0
	s_add_u32 s2, s6, s14
	s_addc_u32 s9, s7, s15
	v_add_co_u32 v2, s2, s2, v8
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v3, null, s9, 0, s2
	s_mov_b32 s9, 0
.LBB2_12:                               ; =>This Inner Loop Header: Depth=1
	global_load_b32 v15, v[2:3], off
	v_add_co_u32 v4, vcc_lo, 0x200, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_cmp_le_u64_e32 vcc_lo, s[12:13], v[4:5]
	s_or_b32 s9, vcc_lo, s9
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_sub_f32_e32 v15, v15, v6
	v_mul_f32_e32 v16, 0x3fb8aa3b, v15
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f32 v17, 0x3fb8aa3b, v15, -v16
	v_rndne_f32_e32 v18, v16
	v_dual_fmac_f32 v17, 0x32a5705f, v15 :: v_dual_sub_f32 v16, v16, v18
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_add_f32_e32 v16, v16, v17
	v_cvt_i32_f32_e32 v17, v18
	v_cmp_ngt_f32_e64 s2, 0xc2ce8ed0, v15
	v_exp_f32_e32 v16, v16
	s_waitcnt_depctr 0xfff
	v_ldexp_f32 v16, v16, v17
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v16, 0, v16, s2
	v_cmp_nlt_f32_e64 s2, 0x42b17218, v15
	v_cndmask_b32_e64 v15, 0x7f800000, v16, s2
	v_add_co_u32 v2, s2, 0x800, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e64 v3, s2, 0, v3, s2
	v_add_f32_e32 v7, v7, v15
	s_and_not1_b32 exec_lo, exec_lo, s9
	s_cbranch_execnz .LBB2_12
; %bb.13:                               ; %Flow221
	s_or_b32 exec_lo, exec_lo, s9
.LBB2_14:                               ; %Flow222
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s3
	s_mov_b64 s[2:3], 0x100
	ds_store_b32 v8, v7
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
.LBB2_15:                               ; =>This Inner Loop Header: Depth=1
	s_mov_b32 s9, exec_lo
	v_cmpx_gt_u64_e64 s[2:3], v[0:1]
	s_cbranch_execz .LBB2_17
; %bb.16:                               ;   in Loop: Header=BB2_15 Depth=1
	v_lshl_add_u32 v2, s2, 2, v8
	ds_load_b32 v2, v2
	ds_load_b32 v3, v8
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v2, v2, v3
	ds_store_b32 v8, v2
.LBB2_17:                               ;   in Loop: Header=BB2_15 Depth=1
	s_or_b32 exec_lo, exec_lo, s9
	v_cmp_gt_u64_e64 s9, 0x42, s[2:3]
	s_lshr_b64 s[2:3], s[2:3], 1
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_and_b32 vcc_lo, exec_lo, s9
	s_cbranch_vccz .LBB2_15
; %bb.18:
	s_and_saveexec_b32 s3, s0
	s_cbranch_execz .LBB2_20
; %bb.19:
	v_cmp_ne_u32_e32 vcc_lo, -1, v14
	v_cmp_ne_u32_e64 s2, -1, v8
	s_mov_b64 s[14:15], src_shared_base
	v_cndmask_b32_e32 v2, 0, v14, vcc_lo
	v_cndmask_b32_e64 v3, 0, s15, vcc_lo
	s_delay_alu instid0(VALU_DEP_3)
	v_cndmask_b32_e64 v5, 0, s15, s2
	v_cndmask_b32_e64 v4, 0, v8, s2
	v_cmp_ne_u32_e32 vcc_lo, -1, v13
	flat_load_b32 v3, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v7, v[4:5] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_dual_cndmask_b32 v2, 0, v13 :: v_dual_add_f32 v7, v3, v7
	v_cndmask_b32_e64 v3, 0, s15, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v12
	flat_store_b32 v[4:5], v7 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v3, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v7, v[4:5] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_dual_cndmask_b32 v2, 0, v12 :: v_dual_add_f32 v7, v3, v7
	v_cndmask_b32_e64 v3, 0, s15, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v11
	flat_store_b32 v[4:5], v7 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v3, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v7, v[4:5] glc dlc
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v2, 0, v11, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v7, v3, v7
	v_cndmask_b32_e64 v3, 0, s15, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v10
	flat_store_b32 v[4:5], v7 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v3, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v7, v[4:5] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_dual_cndmask_b32 v2, 0, v10 :: v_dual_add_f32 v7, v3, v7
	v_cndmask_b32_e64 v3, 0, s15, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v9
	flat_store_b32 v[4:5], v7 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v3, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v7, v[4:5] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_dual_cndmask_b32 v2, 0, v9 :: v_dual_add_f32 v7, v3, v7
	v_cndmask_b32_e64 v3, 0, s15, vcc_lo
	flat_store_b32 v[4:5], v7 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v2, v[2:3] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v3, v[4:5] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_add_f32_e32 v2, v2, v3
	flat_store_b32 v[4:5], v2 dlc
	s_waitcnt_vscnt null, 0x0
.LBB2_20:
	s_or_b32 exec_lo, exec_lo, s3
	v_mov_b32_e32 v15, 0
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_and_saveexec_b32 s2, s1
	s_cbranch_execz .LBB2_24
; %bb.21:                               ; %.lr.ph184
	v_mov_b32_e32 v15, 0
	s_mov_b32 s3, 0
	ds_load_b32 v2, v15
	s_waitcnt lgkmcnt(0)
	v_cmp_gt_f32_e32 vcc_lo, 0x800000, v2
	v_cndmask_b32_e64 v3, 1.0, 0x4f800000, vcc_lo
	v_cndmask_b32_e64 v17, 0, 0x41b17218, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v2, v2, v3
	v_log_f32_e32 v7, v2
	v_mad_u64_u32 v[2:3], null, s8, s12, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[4:5], null, s8, s13, v[3:4]
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v16, 0x3f317217, v7
	v_cmp_gt_f32_e64 vcc_lo, 0x7f800000, |v7|
	v_fma_f32 v3, 0x3f317217, v7, -v16
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fmamk_f32 v5, v7, 0x3377d1cf, v3
	v_mov_b32_e32 v3, v4
	v_add_f32_e32 v16, v16, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[4:5], 2, v[2:3]
	v_cndmask_b32_e32 v7, v7, v16, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v2, vcc_lo, s4, v4
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_sub_f32_e32 v7, v7, v17
	v_add_co_u32 v4, vcc_lo, s6, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v5, vcc_lo
	v_dual_add_f32 v16, v6, v7 :: v_dual_mov_b32 v7, v1
	v_mov_b32_e32 v6, v0
.LBB2_22:                               ; =>This Inner Loop Header: Depth=1
	global_load_b32 v17, v[4:5], off
	global_load_b32 v18, v[2:3], off
	v_add_co_u32 v6, vcc_lo, 0x200, v6
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v7, vcc_lo
	v_add_co_u32 v2, vcc_lo, 0x800, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, 0, v3, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_le_u64_e32 vcc_lo, s[12:13], v[6:7]
	v_add_co_u32 v4, s1, 0x800, v4
	v_add_co_ci_u32_e64 v5, s1, 0, v5, s1
	s_or_b32 s3, vcc_lo, s3
	s_waitcnt vmcnt(1)
	v_sub_f32_e32 v17, v17, v16
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_fmac_f32_e32 v15, v18, v17
	s_and_not1_b32 exec_lo, exec_lo, s3
	s_cbranch_execnz .LBB2_22
; %bb.23:                               ; %Flow
	s_or_b32 exec_lo, exec_lo, s3
.LBB2_24:                               ; %Flow220
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s2
	s_mov_b64 s[2:3], 0x100
	ds_store_b32 v8, v15
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
.LBB2_25:                               ; =>This Inner Loop Header: Depth=1
	s_mov_b32 s1, exec_lo
	v_cmpx_gt_u64_e64 s[2:3], v[0:1]
	s_cbranch_execz .LBB2_27
; %bb.26:                               ;   in Loop: Header=BB2_25 Depth=1
	v_lshl_add_u32 v2, s2, 2, v8
	ds_load_b32 v2, v2
	ds_load_b32 v3, v8
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v2, v2, v3
	ds_store_b32 v8, v2
.LBB2_27:                               ;   in Loop: Header=BB2_25 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	v_cmp_gt_u64_e64 s1, 0x42, s[2:3]
	s_lshr_b64 s[2:3], s[2:3], 1
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_and_b32 vcc_lo, exec_lo, s1
	s_cbranch_vccz .LBB2_25
; %bb.28:
	s_and_saveexec_b32 s1, s0
	s_cbranch_execz .LBB2_30
; %bb.29:
	v_cmp_ne_u32_e32 vcc_lo, -1, v14
	v_cmp_ne_u32_e64 s0, -1, v8
	s_mov_b64 s[2:3], src_shared_base
	v_cndmask_b32_e32 v1, 0, v14, vcc_lo
	v_cndmask_b32_e64 v2, 0, s3, vcc_lo
	s_delay_alu instid0(VALU_DEP_3)
	v_cndmask_b32_e64 v4, 0, s3, s0
	v_cndmask_b32_e64 v3, 0, v8, s0
	v_cmp_ne_u32_e32 vcc_lo, -1, v13
	flat_load_b32 v2, v[1:2] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v5, v[3:4] glc dlc
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v1, 0, v13, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v5, v2, v5
	v_cndmask_b32_e64 v2, 0, s3, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v12
	flat_store_b32 v[3:4], v5 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v2, v[1:2] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v5, v[3:4] glc dlc
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v1, 0, v12, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v5, v2, v5
	v_cndmask_b32_e64 v2, 0, s3, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v11
	flat_store_b32 v[3:4], v5 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v2, v[1:2] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v5, v[3:4] glc dlc
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v1, 0, v11, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v5, v2, v5
	v_cndmask_b32_e64 v2, 0, s3, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v10
	flat_store_b32 v[3:4], v5 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v2, v[1:2] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v5, v[3:4] glc dlc
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v1, 0, v10, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v5, v2, v5
	v_cndmask_b32_e64 v2, 0, s3, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v9
	flat_store_b32 v[3:4], v5 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v2, v[1:2] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v5, v[3:4] glc dlc
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v1, 0, v9, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v5, v2, v5
	v_cndmask_b32_e64 v2, 0, s3, vcc_lo
	flat_store_b32 v[3:4], v5 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v1, v[1:2] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v2, v[3:4] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_add_f32_e32 v1, v1, v2
	flat_store_b32 v[3:4], v1 dlc
	s_waitcnt_vscnt null, 0x0
.LBB2_30:
	s_or_b32 exec_lo, exec_lo, s1
	s_mov_b32 s9, 0
	s_mov_b32 s0, exec_lo
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB2_32
; %bb.31:
	v_mov_b32_e32 v0, 0
	s_lshl_b64 s[0:1], s[8:9], 2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s0, s10, s0
	s_addc_u32 s1, s11, s1
	ds_load_b32 v1, v0
	s_waitcnt lgkmcnt(0)
	global_store_b32 v0, v1, s[0:1]
.LBB2_32:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm
		.amdhsa_group_segment_fixed_size 4096
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 40
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 19
		.amdhsa_next_free_sgpr 20
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.section	.text._ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm,"axG",@progbits,_ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm,comdat
.Lfunc_end2:
	.size	_ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm, .Lfunc_end2-_ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 2656
; NumSgprs: 22
; NumVgprs: 19
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 4096 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 22
; NumVGPRsForWavesPerEU: 19
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.section	.text._ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm,"axG",@progbits,_ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm,comdat
	.globl	_ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm ; -- Begin function _ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm
	.p2align	8
	.type	_ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm,@function
_ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm: ; @_ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm
; %bb.0:
	s_clause 0x1
	s_load_b64 s[4:5], s[0:1], 0x10
	s_load_b128 s[0:3], s[0:1], 0x0
	v_dual_mov_b32 v1, 0 :: v_dual_lshlrev_b32 v6, 2, v0
	s_mov_b32 s6, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_mov_b32_e32 v7, v1
	s_waitcnt lgkmcnt(0)
	v_cmpx_gt_u64_e64 s[4:5], v[0:1]
	s_cbranch_execz .LBB3_4
; %bb.1:                                ; %.lr.ph.preheader
	v_add_co_u32 v2, s0, s0, v6
	v_mov_b32_e32 v5, v1
	v_dual_mov_b32 v7, 0 :: v_dual_mov_b32 v4, v0
	v_add_co_ci_u32_e64 v3, null, s1, 0, s0
	s_mov_b32 s1, 0
.LBB3_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b32 v8, v[2:3], off
	v_add_co_u32 v4, vcc_lo, 0x200, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	v_add_co_u32 v2, s0, 0x800, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e64 v3, s0, 0, v3, s0
	v_cmp_le_u64_e32 vcc_lo, s[4:5], v[4:5]
	s_or_b32 s1, vcc_lo, s1
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v7, v7, v8
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB3_2
; %bb.3:                                ; %Flow
	s_or_b32 exec_lo, exec_lo, s1
.LBB3_4:                                ; %Flow63
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s6
	s_mov_b64 s[0:1], 0x100
	ds_store_b32 v6, v7
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
.LBB3_5:                                ; =>This Inner Loop Header: Depth=1
	s_mov_b32 s6, exec_lo
	v_cmpx_gt_u64_e64 s[0:1], v[0:1]
	s_cbranch_execz .LBB3_7
; %bb.6:                                ;   in Loop: Header=BB3_5 Depth=1
	v_lshl_add_u32 v2, s0, 2, v6
	ds_load_b32 v2, v2
	ds_load_b32 v3, v6
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v2, v2, v3
	ds_store_b32 v6, v2
.LBB3_7:                                ;   in Loop: Header=BB3_5 Depth=1
	s_or_b32 exec_lo, exec_lo, s6
	v_cmp_gt_u64_e64 s6, 0x42, s[0:1]
	s_lshr_b64 s[0:1], s[0:1], 1
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_and_b32 vcc_lo, exec_lo, s6
	s_cbranch_vccz .LBB3_5
; %bb.8:
	s_mov_b32 s1, exec_lo
	v_cmpx_gt_u32_e32 32, v0
	s_cbranch_execz .LBB3_10
; %bb.9:
	v_lshl_add_u32 v1, v0, 2, 0x80
	v_cmp_ne_u32_e64 s0, -1, v6
	s_mov_b64 s[6:7], src_shared_base
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_ne_u32_e32 vcc_lo, -1, v1
	v_cndmask_b32_e64 v2, 0, s7, s0
	v_cndmask_b32_e32 v3, 0, v1, vcc_lo
	v_cndmask_b32_e64 v4, 0, s7, vcc_lo
	v_cndmask_b32_e64 v1, 0, v6, s0
	flat_load_b32 v4, v[3:4] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v5, v[1:2] glc dlc
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v3, 64, v6
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_ne_u32_e32 vcc_lo, -1, v3
	v_cndmask_b32_e32 v3, 0, v3, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v5, v4, v5
	v_cndmask_b32_e64 v4, 0, s7, vcc_lo
	flat_store_b32 v[1:2], v5 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v4, v[3:4] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v5, v[1:2] glc dlc
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v3, 32, v6
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_ne_u32_e32 vcc_lo, -1, v3
	v_cndmask_b32_e32 v3, 0, v3, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v5, v4, v5
	v_cndmask_b32_e64 v4, 0, s7, vcc_lo
	flat_store_b32 v[1:2], v5 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v4, v[3:4] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v5, v[1:2] glc dlc
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v3, 16, v6
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_ne_u32_e32 vcc_lo, -1, v3
	v_cndmask_b32_e32 v3, 0, v3, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v5, v4, v5
	v_cndmask_b32_e64 v4, 0, s7, vcc_lo
	flat_store_b32 v[1:2], v5 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v4, v[3:4] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v5, v[1:2] glc dlc
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v3, 8, v6
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_ne_u32_e32 vcc_lo, -1, v3
	v_cndmask_b32_e32 v3, 0, v3, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v5, v4, v5
	v_cndmask_b32_e64 v4, 0, s7, vcc_lo
	flat_store_b32 v[1:2], v5 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v4, v[3:4] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v5, v[1:2] glc dlc
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v3, 4, v6
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_ne_u32_e32 vcc_lo, -1, v3
	v_cndmask_b32_e32 v3, 0, v3, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_add_f32_e32 v5, v4, v5
	v_cndmask_b32_e64 v4, 0, s7, vcc_lo
	flat_store_b32 v[1:2], v5 dlc
	s_waitcnt_vscnt null, 0x0
	flat_load_b32 v3, v[3:4] glc dlc
	s_waitcnt vmcnt(0)
	flat_load_b32 v4, v[1:2] glc dlc
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_add_f32_e32 v3, v3, v4
	flat_store_b32 v[1:2], v3 dlc
	s_waitcnt_vscnt null, 0x0
.LBB3_10:
	s_or_b32 exec_lo, exec_lo, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_mov_b32 s0, exec_lo
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB3_12
; %bb.11:
	v_mov_b32_e32 v0, 0
	s_clz_i32_u32 s0, s5
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_min_u32 s6, s0, 32
	s_lshl_b64 s[0:1], s[4:5], s6
	ds_load_b32 v1, v0
	s_min_u32 s0, s0, 1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_or_b32 s0, s1, s0
	v_cvt_f32_u32_e32 v2, s0
	s_sub_i32 s0, 32, s6
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_ldexp_f32 v2, v2, s0
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_scale_f32 v3, null, v2, v2, -v1
	v_rcp_f32_e32 v4, v3
	s_waitcnt_depctr 0xfff
	v_fma_f32 v5, -v3, v4, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v4, v5, v4
	v_div_scale_f32 v5, vcc_lo, -v1, v2, -v1
	v_mul_f32_e32 v6, v5, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v7, -v3, v6, v5
	v_fmac_f32_e32 v6, v7, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v3, -v3, v6, v5
	v_div_fmas_f32 v3, v3, v4, v6
	s_delay_alu instid0(VALU_DEP_1)
	v_div_fixup_f32 v1, v3, v2, -v1
	global_store_b32 v0, v1, s[2:3]
.LBB3_12:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm
		.amdhsa_group_segment_fixed_size 4096
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 24
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 9
		.amdhsa_next_free_sgpr 8
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.section	.text._ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm,"axG",@progbits,_ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm,comdat
.Lfunc_end3:
	.size	_ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm, .Lfunc_end3-_ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 948
; NumSgprs: 10
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 4096 bytes/workgroup (compile time only)
; SGPRBlocks: 1
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 10
; NumVGPRsForWavesPerEU: 9
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.section	.text._ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm,"axG",@progbits,_ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm,comdat
	.globl	_ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm ; -- Begin function _ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm
	.p2align	8
	.type	_ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm,@function
_ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm: ; @_ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm
; %bb.0:
	s_clause 0x1
	s_load_b256 s[4:11], s[0:1], 0x0
	s_load_b32 s2, s[0:1], 0x2c
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s3, s10, s9
	s_mul_hi_u32 s12, s10, s8
	s_mul_i32 s11, s11, s8
	s_add_i32 s3, s12, s3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_i32 s3, s3, s11
	s_add_u32 s0, s0, 32
	s_addc_u32 s1, s1, 0
	s_and_b32 s11, s2, 0xffff
	s_mul_i32 s2, s10, s8
	v_mad_u64_u32 v[1:2], null, s15, s11, v[0:1]
	v_mov_b32_e32 v2, 0
	s_mov_b32 s10, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_u64_e64 s[2:3], v[1:2]
	s_cbranch_execz .LBB4_3
; %bb.1:                                ; %.lr.ph
	s_load_b32 s10, s[0:1], 0x0
	s_clz_i32_u32 s0, s9
	v_lshlrev_b64 v[3:4], 2, v[1:2]
	s_min_u32 s12, s0, 32
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[0:1], s[8:9], s12
	s_mov_b32 s9, 0
	s_min_u32 s0, s0, 1
	s_or_b32 s0, s1, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	v_cvt_f32_u32_e32 v0, s0
	s_sub_i32 s0, 32, s12
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_ldexp_f32 v0, v0, s0
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s8, s10, s11
	s_delay_alu instid0(SALU_CYCLE_1)
	s_lshl_b64 s[10:11], s[8:9], 2
.LBB4_2:                                ; =>This Inner Loop Header: Depth=1
	v_add_co_u32 v5, vcc_lo, s6, v3
	v_add_co_ci_u32_e32 v6, vcc_lo, s7, v4, vcc_lo
	v_add_co_u32 v7, vcc_lo, s4, v3
	v_add_co_ci_u32_e32 v8, vcc_lo, s5, v4, vcc_lo
	v_add_co_u32 v1, s0, v1, s8
	global_load_b32 v9, v[5:6], off
	global_load_b32 v7, v[7:8], off
	v_add_co_ci_u32_e64 v2, s0, 0, v2, s0
	v_add_co_u32 v3, s0, v3, s10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v4, s0, s11, v4, s0
	s_waitcnt vmcnt(0)
	v_sub_f32_e32 v7, v9, v7
	v_div_scale_f32 v8, null, v0, v0, v7
	v_div_scale_f32 v11, vcc_lo, v7, v0, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f32_e32 v9, v8
	s_waitcnt_depctr 0xfff
	v_fma_f32 v10, -v8, v9, 1.0
	v_fmac_f32_e32 v9, v10, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v10, v11, v9
	v_fma_f32 v12, -v8, v10, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v10, v12, v9
	v_fma_f32 v8, -v8, v10, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_fmas_f32 v8, v8, v9, v10
	v_cmp_le_u64_e32 vcc_lo, s[2:3], v[1:2]
	v_div_fixup_f32 v7, v8, v0, v7
	s_or_b32 s9, vcc_lo, s9
	global_store_b32 v[5:6], v7, off
	s_and_not1_b32 exec_lo, exec_lo, s9
	s_cbranch_execnz .LBB4_2
.LBB4_3:                                ; %Flow28
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 13
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.section	.text._ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm,"axG",@progbits,_ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm,comdat
.Lfunc_end4:
	.size	_ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm, .Lfunc_end4-_ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 396
; NumSgprs: 18
; NumVgprs: 13
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 13
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.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_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           8
        .value_kind:     by_value
      - .offset:         24
        .size:           8
        .value_kind:     by_value
    .group_segment_fixed_size: 4096
    .kernarg_segment_align: 8
    .kernarg_segment_size: 32
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm
    .private_segment_fixed_size: 0
    .sgpr_count:     20
    .sgpr_spill_count: 0
    .symbol:         _ZN3gpu12_GLOBAL__N_18softmax1EPKfPfmm.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     20
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           8
        .value_kind:     by_value
      - .offset:         24
        .size:           8
        .value_kind:     by_value
    .group_segment_fixed_size: 4096
    .kernarg_segment_align: 8
    .kernarg_segment_size: 32
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm
    .private_segment_fixed_size: 0
    .sgpr_count:     20
    .sgpr_spill_count: 0
    .symbol:         _ZN3gpu12_GLOBAL__N_112log_softmax1EPKfPfmm.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     19
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           8
        .value_kind:     by_value
      - .offset:         32
        .size:           8
        .value_kind:     by_value
    .group_segment_fixed_size: 4096
    .kernarg_segment_align: 8
    .kernarg_segment_size: 40
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm
    .private_segment_fixed_size: 0
    .sgpr_count:     22
    .sgpr_spill_count: 0
    .symbol:         _ZN3gpu12_GLOBAL__N_114softmax_lcost1EPKfS2_Pfmm.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     19
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           8
        .value_kind:     by_value
    .group_segment_fixed_size: 4096
    .kernarg_segment_align: 8
    .kernarg_segment_size: 24
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm
    .private_segment_fixed_size: 0
    .sgpr_count:     10
    .sgpr_spill_count: 0
    .symbol:         _ZN3gpu12_GLOBAL__N_114softmax_reduceEPKfPfm.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           8
        .value_kind:     by_value
      - .offset:         24
        .size:           8
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _ZN3gpu12_GLOBAL__N_126softmax_cross_entropy_gradEPKfPfmm.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     13
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
