#include <stdio.h>
#include <iostream>
#include <fstream>

#define BUFLEN 500*1024*1024

using namespace std;
__constant__ int thread_counts;

__device__ unsigned int rol(const unsigned int value,
                const unsigned int steps)
        {
            return ((value << steps) | (value >> (32 - steps)));
        }


__device__ void clearWBuffert(unsigned int* buffert)
        {
            for (int pos = 16; --pos >= 0;)
            {
                buffert[pos] = 0;
            }
        }

__device__ void innerHash(unsigned int* result, unsigned int* w)
        {
            unsigned int a = result[0];
            unsigned int b = result[1];
            unsigned int c = result[2];
            unsigned int d = result[3];
            unsigned int e = result[4];

            int round = 0;

            #define sha1macro(func,val) \
            { \
                const unsigned int t = rol(a, 5) + (func) + e + val + w[round]; \
                e = d; \
                d = c; \
                c = rol(b, 30); \
                b = a; \
                a = t; \
            }

            while (round < 16)
            {
                sha1macro((b & c) | (~b & d), 0x5a827999)
                ++round;
            }
            while (round < 20)
            {
                w[round] = rol((w[round - 3] ^ w[round - 8] ^ w[round - 14] ^ w[round - 16]), 1);
                sha1macro((b & c) | (~b & d), 0x5a827999)
                ++round;
            }
            while (round < 40)
            {
                w[round] = rol((w[round - 3] ^ w[round - 8] ^ w[round - 14] ^ w[round - 16]), 1);
                sha1macro(b ^ c ^ d, 0x6ed9eba1)
                ++round;
            }
            while (round < 60)
            {
                w[round] = rol((w[round - 3] ^ w[round - 8] ^ w[round - 14] ^ w[round - 16]), 1);
                sha1macro((b & c) | (b & d) | (c & d), 0x8f1bbcdc)
                ++round;
            }
            while (round < 80)
            {
                w[round] = rol((w[round - 3] ^ w[round - 8] ^ w[round - 14] ^ w[round - 16]), 1);
                sha1macro(b ^ c ^ d, 0xca62c1d6)
                ++round;
            }

            #undef sha1macro

            result[0] += a;
            result[1] += b;
            result[2] += c;
            result[3] += d;
            result[4] += e;
        }





__device__ void calc(const void* src, const int bytelength, unsigned char* hash)
    {
        // Init the result array.
        unsigned int result[5] = { 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 };

        // Cast the void src pointer to be the byte array we can work with.
        const unsigned char* sarray = (const unsigned char*) src;

        // The reusable round buffer
        unsigned int w[80];

        // Loop through all complete 64byte blocks.
        const int endOfFullBlocks = bytelength - 64;
        int endCurrentBlock;
        int currentBlock = 0;

        while (currentBlock <= endOfFullBlocks)
        {
            endCurrentBlock = currentBlock + 64;

            // Init the round buffer with the 64 byte block data.
            for (int roundPos = 0; currentBlock < endCurrentBlock; currentBlock += 4)
            {
                // This line will swap endian on big endian and keep endian on little endian.
                w[roundPos++] = (unsigned int) sarray[currentBlock + 3]
                        | (((unsigned int) sarray[currentBlock + 2]) << 8)
                        | (((unsigned int) sarray[currentBlock + 1]) << 16)
                        | (((unsigned int) sarray[currentBlock]) << 24);
            }
            innerHash(result, w);
        }

        // Handle the last and not full 64 byte block if existing.
        endCurrentBlock = bytelength - currentBlock;
        clearWBuffert(w);
        int lastBlockBytes = 0;
        for (;lastBlockBytes < endCurrentBlock; ++lastBlockBytes)
        {
            w[lastBlockBytes >> 2] |= (unsigned int) sarray[lastBlockBytes + currentBlock] << ((3 - (lastBlockBytes & 3)) << 3);
        }
        w[lastBlockBytes >> 2] |= 0x80 << ((3 - (lastBlockBytes & 3)) << 3);
        if (endCurrentBlock >= 56)
        {
            innerHash(result, w);
            clearWBuffert(w);
        }
        w[15] = bytelength << 3;
        innerHash(result, w);

        // Store hash in result pointer, and make sure we get in in the correct order on both endian models.
        for (int hashByte = 20; --hashByte >= 0;)
        {
            hash[hashByte] = (result[hashByte >> 2] >> (((3 - hashByte) & 0x3) << 3)) & 0xff;
        }
    }


__global__
void calculateHash(unsigned char *gdata, unsigned char *hash)
{

    int i=blockIdx.x * blockDim.x + threadIdx.x,j=0;
    if(i<=thread_counts){
    calc(&gdata[i*1024*1024],1024*1024,&hash[i*20]);
    //printf("%d---- %c\n",i,gdata[i*1024*1024]);
    }
}




int readFile(char* filename, unsigned char * &buffer,int &charRead,int offset=0){

    ifstream fileObject;
    fileObject.open(filename, ios::in|ios::binary);

    if(fileObject.is_open()){

        fileObject.seekg (0, fileObject.end);
        int length = fileObject.tellg();
        fileObject.seekg (0, fileObject.beg);
        int l;
        if( offset >= length )
			return 1;
        if(length-offset >= BUFLEN){
            l =BUFLEN;
			buffer = new unsigned char[l];
        }
        else{
			l= length-offset;
            buffer = new unsigned char[l];
			buffer[0]='S';
			buffer[l-1] = 'B';
        }

        fileObject.seekg(offset);
        fileObject.read((char*)buffer,l);
        charRead = fileObject.gcount();
        fileObject.close();

        return 0;
    }

        return -1;

}


int main()
{

    unsigned char *data1;
    int charRead,offset=0,retStatus;

    while(1){

    	retStatus = readFile("/home/ajay/test2.txt",data1,charRead,offset);
        offset+= charRead;

        if (retStatus == -1 || retStatus == 1)
            break;

        unsigned char *gdata;
        unsigned char *hash;
        const int gdsize = charRead*sizeof(char);
        cudaMalloc((void**)&gdata,gdsize);
        cudaError_t cuda_result_code = cudaGetLastError();
        if (cuda_result_code!=cudaSuccess) {
           printf("gdata message: %s\n",cudaGetErrorString(cuda_result_code));
        }

        int threads = charRead/(1024*1024);
        //cout<<threads<<endl;
		int blocks = 1 + threads/32;
        //cout<<blocks<<endl;
        const int hash_size = 20 * blocks * 32 * sizeof(unsigned char);
        cudaMalloc((void**)&hash, hash_size);

        cuda_result_code = cudaGetLastError();

        if (cuda_result_code!=cudaSuccess) {
                  printf("hash message: %s\n",cudaGetErrorString(cuda_result_code));
               }

        cudaMemcpy( gdata, data1, gdsize, cudaMemcpyHostToDevice );

        if (cuda_result_code!=cudaSuccess) {
                   printf(" memcpy message: %s\n",cudaGetErrorString(cuda_result_code));
                }
        cudaMemcpyToSymbol(thread_counts, &threads, sizeof(int));

        calculateHash<<<blocks, 32>>>(gdata,hash);
        cudaDeviceSynchronize();
        if (cuda_result_code!=cudaSuccess) {
                   printf(" hashcalucation message: %s\n",cudaGetErrorString(cuda_result_code));
                }

        unsigned char * hash_host = new unsigned char[hash_size];
        cudaMemcpy( hash_host, hash, hash_size, cudaMemcpyDeviceToHost);
        cudaFree( gdata );
        cudaFree( hash );

        for(int i=0;i<=threads;i++)
        {
        	for(int j=0;j<20;j++)
        		printf("%02x",hash_host[i*20+j]);
        cout<<endl;
        }
        delete[] data1;
        delete[] hash_host;
        if(retStatus==1)
            break;
    }
    printf("Completed");
    return 1;
}

	.file	"tmpxft_00202059_00000000-6_hash.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3774:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3774:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z3roljj
	.type	_Z3roljj, @function
_Z3roljj:
.LFB3766:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE3766:
	.size	_Z3roljj, .-_Z3roljj
	.globl	_Z13clearWBuffertPj
	.type	_Z13clearWBuffertPj, @function
_Z13clearWBuffertPj:
.LFB3767:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE3767:
	.size	_Z13clearWBuffertPj, .-_Z13clearWBuffertPj
	.globl	_Z9innerHashPjS_
	.type	_Z9innerHashPjS_, @function
_Z9innerHashPjS_:
.LFB3768:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE3768:
	.size	_Z9innerHashPjS_, .-_Z9innerHashPjS_
	.globl	_Z4calcPKviPh
	.type	_Z4calcPKviPh, @function
_Z4calcPKviPh:
.LFB3769:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE3769:
	.size	_Z4calcPKviPh, .-_Z4calcPKviPh
	.globl	_Z35__device_stub__Z13calculateHashPhS_PhS_
	.type	_Z35__device_stub__Z13calculateHashPhS_PhS_, @function
_Z35__device_stub__Z13calculateHashPhS_PhS_:
.LFB3796:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movq	%rsi, (%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L10
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z13calculateHashPhS_(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L10:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3796:
	.size	_Z35__device_stub__Z13calculateHashPhS_PhS_, .-_Z35__device_stub__Z13calculateHashPhS_PhS_
	.globl	_Z13calculateHashPhS_
	.type	_Z13calculateHashPhS_, @function
_Z13calculateHashPhS_:
.LFB3797:
	.cfi_startproc
	endbr64
	jmp	_Z35__device_stub__Z13calculateHashPhS_PhS_
	.cfi_endproc
.LFE3797:
	.size	_Z13calculateHashPhS_, .-_Z13calculateHashPhS_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z13calculateHashPhS_"
.LC1:
	.string	"thread_counts"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3799:
	.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	_Z13calculateHashPhS_(%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	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC1(%rip), %rdx
	movl	$4, %r9d
	leaq	_ZL13thread_counts(%rip), %rsi
	pushq	$1
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.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
.LFE3799:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.text
	.globl	_Z8readFilePcRPhRii
	.type	_Z8readFilePcRPhRii, @function
_Z8readFilePcRPhRii:
.LFB3770:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3770
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdx, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%ecx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	subq	$536, %rsp
	.cfi_def_cfa_offset 592
	movq	%fs:40, %rax
	movq	%rax, 520(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %r12
	movq	%r12, %rdi
.LEHB0:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev@PLT
.LEHE0:
	movl	$12, %edx
	movq	%rbx, %rsi
	movq	%r12, %rdi
.LEHB1:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode@PLT
	leaq	120(%rsp), %rdi
	call	_ZNKSt12__basic_fileIcE7is_openEv@PLT
	testb	%al, %al
	je	.L25
	movl	$2, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	_ZNSi5seekgElSt12_Ios_Seekdir@PLT
	movq	%r12, %rdi
	call	_ZNSi5tellgEv@PLT
	xorl	%edx, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	movq	%rax, %rbx
	call	_ZNSi5seekgElSt12_Ios_Seekdir@PLT
	cmpl	%ebp, %ebx
	jle	.L26
	subl	%ebp, %ebx
	cmpl	$524287999, %ebx
	jle	.L20
	movl	$524288000, %edi
	call	_Znam@PLT
	movq	%rax, 0(%r13)
	movl	$524288000, %ebx
	jmp	.L21
.L20:
	movslq	%ebx, %r15
	movq	%r15, %rdi
	call	_Znam@PLT
	movb	$83, (%rax)
	movq	%rax, 0(%r13)
	movb	$66, -1(%rax,%r15)
.L21:
	movslq	%ebp, %rsi
	xorl	%edx, %edx
	movq	%r12, %rdi
	call	_ZNSi5seekgESt4fposI11__mbstate_tE@PLT
	movq	0(%r13), %rsi
	movslq	%ebx, %rdx
	movq	%r12, %rdi
	call	_ZNSi4readEPcl@PLT
	movq	8(%rsp), %rax
	movq	%r12, %rdi
	movl	%eax, (%r14)
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv@PLT
.LEHE1:
	xorl	%ebx, %ebx
	jmp	.L19
.L25:
	orl	$-1, %ebx
	jmp	.L19
.L26:
	movl	$1, %ebx
.L19:
	movq	%r12, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	je	.L24
	jmp	.L28
.L27:
	endbr64
	movq	%rax, %rbx
.L22:
	movq	%r12, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	movq	%rbx, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L28:
	call	__stack_chk_fail@PLT
.L24:
	addq	$536, %rsp
	.cfi_def_cfa_offset 56
	movl	%ebx, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3770:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3770:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3770-.LLSDACSB3770
.LLSDACSB3770:
	.uleb128 .LEHB0-.LFB3770
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3770
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L27-.LFB3770
	.uleb128 0
	.uleb128 .LEHB2-.LFB3770
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE3770:
	.text
	.size	_Z8readFilePcRPhRii, .-_Z8readFilePcRPhRii
	.section	.rodata.str1.1
.LC2:
	.string	"/home/ajay/test2.txt"
.LC3:
	.string	"gdata message: %s\n"
.LC4:
	.string	"hash message: %s\n"
.LC5:
	.string	" memcpy message: %s\n"
.LC6:
	.string	" hashcalucation message: %s\n"
.LC7:
	.string	"%02x"
.LC8:
	.string	"Completed"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB3771:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
.L41:
	movl	%r13d, %ecx
	movq	%rsp, %rdx
	leaq	8(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	call	_Z8readFilePcRPhRii
	movl	(%rsp), %ebx
	incl	%eax
	addl	%ebx, %r13d
	andl	$-3, %eax
	je	.L31
	movslq	%ebx, %r15
	leaq	16(%rsp), %rdi
	movq	%r15, %rsi
	call	cudaMalloc@PLT
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L32
	call	cudaGetErrorString@PLT
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L32:
	movl	%ebx, %eax
	movl	$1048576, %ecx
	leaq	24(%rsp), %rdi
	cltd
	idivl	%ecx
	movl	$33554432, %ecx
	movl	%eax, 4(%rsp)
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	movl	%eax, %ebx
	incl	%ebx
	imull	$640, %ebx, %r12d
	movslq	%r12d, %r12
	movq	%r12, %rsi
	call	cudaMalloc@PLT
	call	cudaGetLastError@PLT
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.L33
	movl	%eax, %edi
	call	cudaGetErrorString@PLT
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L33:
	movq	8(%rsp), %r14
	movq	16(%rsp), %rdi
	movl	$1, %ecx
	movq	%r15, %rdx
	movq	%r14, %rsi
	call	cudaMemcpy@PLT
	testl	%ebp, %ebp
	je	.L34
	movl	%ebp, %edi
	call	cudaGetErrorString@PLT
	leaq	.LC5(%rip), %rsi
	movl	$2, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L34:
	xorl	%ecx, %ecx
	leaq	4(%rsp), %rsi
	movl	$1, %r8d
	movl	$4, %edx
	leaq	_ZL13thread_counts(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	movl	%ebx, 32(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rax
	movl	$134217729, %edx
	movl	$1, %ecx
	movq	%rax, 36(%rsp)
	movq	32(%rsp), %rdi
	salq	$5, %rdx
	movl	40(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L35
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdi
	call	_Z35__device_stub__Z13calculateHashPhS_PhS_
.L35:
	call	cudaDeviceSynchronize@PLT
	testl	%ebp, %ebp
	je	.L36
	movl	%ebp, %edi
	call	cudaGetErrorString@PLT
	leaq	.LC6(%rip), %rsi
	movl	$2, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L36:
	movq	%r12, %rdi
	xorl	%ebp, %ebp
	call	_Znam@PLT
	movq	24(%rsp), %rsi
	movl	$2, %ecx
	movq	%r12, %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
.L37:
	cmpl	%ebp, 4(%rsp)
	jl	.L60
	imulq	$20, %rbp, %r12
	xorl	%r15d, %r15d
	addq	%rbx, %r12
.L38:
	movzbl	(%r12,%r15), %edx
	leaq	.LC7(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incq	%r15
	call	__printf_chk@PLT
	cmpq	$20, %r15
	jne	.L38
	leaq	_ZSt4cout(%rip), %rdi
	incq	%rbp
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	jmp	.L37
.L60:
	testq	%r14, %r14
	je	.L40
	movq	%r14, %rdi
	call	_ZdaPv@PLT
.L40:
	movq	%rbx, %rdi
	call	_ZdaPv@PLT
	jmp	.L41
.L31:
	xorl	%eax, %eax
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L42
	call	__stack_chk_fail@PLT
.L42:
	addq	$72, %rsp
	.cfi_def_cfa_offset 56
	movl	$1, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3771:
	.size	main, .-main
	.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
	.local	_ZL13thread_counts
	.comm	_ZL13thread_counts,4,4
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.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 <stdio.h>
#include <iostream>
#include <fstream>

#define BUFLEN 500*1024*1024

using namespace std;
__constant__ int thread_counts;

__device__ unsigned int rol(const unsigned int value,
                const unsigned int steps)
        {
            return ((value << steps) | (value >> (32 - steps)));
        }


__device__ void clearWBuffert(unsigned int* buffert)
        {
            for (int pos = 16; --pos >= 0;)
            {
                buffert[pos] = 0;
            }
        }

__device__ void innerHash(unsigned int* result, unsigned int* w)
        {
            unsigned int a = result[0];
            unsigned int b = result[1];
            unsigned int c = result[2];
            unsigned int d = result[3];
            unsigned int e = result[4];

            int round = 0;

            #define sha1macro(func,val) \
            { \
                const unsigned int t = rol(a, 5) + (func) + e + val + w[round]; \
                e = d; \
                d = c; \
                c = rol(b, 30); \
                b = a; \
                a = t; \
            }

            while (round < 16)
            {
                sha1macro((b & c) | (~b & d), 0x5a827999)
                ++round;
            }
            while (round < 20)
            {
                w[round] = rol((w[round - 3] ^ w[round - 8] ^ w[round - 14] ^ w[round - 16]), 1);
                sha1macro((b & c) | (~b & d), 0x5a827999)
                ++round;
            }
            while (round < 40)
            {
                w[round] = rol((w[round - 3] ^ w[round - 8] ^ w[round - 14] ^ w[round - 16]), 1);
                sha1macro(b ^ c ^ d, 0x6ed9eba1)
                ++round;
            }
            while (round < 60)
            {
                w[round] = rol((w[round - 3] ^ w[round - 8] ^ w[round - 14] ^ w[round - 16]), 1);
                sha1macro((b & c) | (b & d) | (c & d), 0x8f1bbcdc)
                ++round;
            }
            while (round < 80)
            {
                w[round] = rol((w[round - 3] ^ w[round - 8] ^ w[round - 14] ^ w[round - 16]), 1);
                sha1macro(b ^ c ^ d, 0xca62c1d6)
                ++round;
            }

            #undef sha1macro

            result[0] += a;
            result[1] += b;
            result[2] += c;
            result[3] += d;
            result[4] += e;
        }





__device__ void calc(const void* src, const int bytelength, unsigned char* hash)
    {
        // Init the result array.
        unsigned int result[5] = { 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 };

        // Cast the void src pointer to be the byte array we can work with.
        const unsigned char* sarray = (const unsigned char*) src;

        // The reusable round buffer
        unsigned int w[80];

        // Loop through all complete 64byte blocks.
        const int endOfFullBlocks = bytelength - 64;
        int endCurrentBlock;
        int currentBlock = 0;

        while (currentBlock <= endOfFullBlocks)
        {
            endCurrentBlock = currentBlock + 64;

            // Init the round buffer with the 64 byte block data.
            for (int roundPos = 0; currentBlock < endCurrentBlock; currentBlock += 4)
            {
                // This line will swap endian on big endian and keep endian on little endian.
                w[roundPos++] = (unsigned int) sarray[currentBlock + 3]
                        | (((unsigned int) sarray[currentBlock + 2]) << 8)
                        | (((unsigned int) sarray[currentBlock + 1]) << 16)
                        | (((unsigned int) sarray[currentBlock]) << 24);
            }
            innerHash(result, w);
        }

        // Handle the last and not full 64 byte block if existing.
        endCurrentBlock = bytelength - currentBlock;
        clearWBuffert(w);
        int lastBlockBytes = 0;
        for (;lastBlockBytes < endCurrentBlock; ++lastBlockBytes)
        {
            w[lastBlockBytes >> 2] |= (unsigned int) sarray[lastBlockBytes + currentBlock] << ((3 - (lastBlockBytes & 3)) << 3);
        }
        w[lastBlockBytes >> 2] |= 0x80 << ((3 - (lastBlockBytes & 3)) << 3);
        if (endCurrentBlock >= 56)
        {
            innerHash(result, w);
            clearWBuffert(w);
        }
        w[15] = bytelength << 3;
        innerHash(result, w);

        // Store hash in result pointer, and make sure we get in in the correct order on both endian models.
        for (int hashByte = 20; --hashByte >= 0;)
        {
            hash[hashByte] = (result[hashByte >> 2] >> (((3 - hashByte) & 0x3) << 3)) & 0xff;
        }
    }


__global__
void calculateHash(unsigned char *gdata, unsigned char *hash)
{

    int i=blockIdx.x * blockDim.x + threadIdx.x,j=0;
    if(i<=thread_counts){
    calc(&gdata[i*1024*1024],1024*1024,&hash[i*20]);
    //printf("%d---- %c\n",i,gdata[i*1024*1024]);
    }
}




int readFile(char* filename, unsigned char * &buffer,int &charRead,int offset=0){

    ifstream fileObject;
    fileObject.open(filename, ios::in|ios::binary);

    if(fileObject.is_open()){

        fileObject.seekg (0, fileObject.end);
        int length = fileObject.tellg();
        fileObject.seekg (0, fileObject.beg);
        int l;
        if( offset >= length )
			return 1;
        if(length-offset >= BUFLEN){
            l =BUFLEN;
			buffer = new unsigned char[l];
        }
        else{
			l= length-offset;
            buffer = new unsigned char[l];
			buffer[0]='S';
			buffer[l-1] = 'B';
        }

        fileObject.seekg(offset);
        fileObject.read((char*)buffer,l);
        charRead = fileObject.gcount();
        fileObject.close();

        return 0;
    }

        return -1;

}


int main()
{

    unsigned char *data1;
    int charRead,offset=0,retStatus;

    while(1){

    	retStatus = readFile("/home/ajay/test2.txt",data1,charRead,offset);
        offset+= charRead;

        if (retStatus == -1 || retStatus == 1)
            break;

        unsigned char *gdata;
        unsigned char *hash;
        const int gdsize = charRead*sizeof(char);
        hipMalloc((void**)&gdata,gdsize);
        hipError_t cuda_result_code = hipGetLastError();
        if (cuda_result_code!=hipSuccess) {
           printf("gdata message: %s\n",hipGetErrorString(cuda_result_code));
        }

        int threads = charRead/(1024*1024);
        //cout<<threads<<endl;
		int blocks = 1 + threads/32;
        //cout<<blocks<<endl;
        const int hash_size = 20 * blocks * 32 * sizeof(unsigned char);
        hipMalloc((void**)&hash, hash_size);

        cuda_result_code = hipGetLastError();

        if (cuda_result_code!=hipSuccess) {
                  printf("hash message: %s\n",hipGetErrorString(cuda_result_code));
               }

        hipMemcpy( gdata, data1, gdsize, hipMemcpyHostToDevice );

        if (cuda_result_code!=hipSuccess) {
                   printf(" memcpy message: %s\n",hipGetErrorString(cuda_result_code));
                }
        hipMemcpyToSymbol(HIP_SYMBOL(thread_counts), &threads, sizeof(int));

        calculateHash<<<blocks, 32>>>(gdata,hash);
        hipDeviceSynchronize();
        if (cuda_result_code!=hipSuccess) {
                   printf(" hashcalucation message: %s\n",hipGetErrorString(cuda_result_code));
                }

        unsigned char * hash_host = new unsigned char[hash_size];
        hipMemcpy( hash_host, hash, hash_size, hipMemcpyDeviceToHost);
        hipFree( gdata );
        hipFree( hash );

        for(int i=0;i<=threads;i++)
        {
        	for(int j=0;j<20;j++)
        		printf("%02x",hash_host[i*20+j]);
        cout<<endl;
        }
        delete[] data1;
        delete[] hash_host;
        if(retStatus==1)
            break;
    }
    printf("Completed");
    return 1;
}

	.text
	.file	"hash.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z28__device_stub__calculateHashPhS_ # -- Begin function _Z28__device_stub__calculateHashPhS_
	.type	_Z28__device_stub__calculateHashPhS_,@function
_Z28__device_stub__calculateHashPhS_:   # @_Z28__device_stub__calculateHashPhS_
	.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	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	16(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%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	$_Z13calculateHashPhS_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	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_end0:
	.size	_Z28__device_stub__calculateHashPhS_, .Lfunc_end0-_Z28__device_stub__calculateHashPhS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z8readFilePcRPhRii             # -- Begin function _Z8readFilePcRPhRii
	.type	_Z8readFilePcRPhRii,@function
_Z8readFilePcRPhRii:                    # @_Z8readFilePcRPhRii
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$528, %rsp                      # imm = 0x210
	.cfi_def_cfa_offset 576
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%ecx, %ebp
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	8(%rsp), %r12
	movq	%r12, %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev
.Ltmp0:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	$12, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode
.Ltmp1:
# %bb.1:
	leaq	128(%rsp), %rdi
	callq	_ZNKSt12__basic_fileIcE7is_openEv
	movl	$-1, %r12d
	testb	%al, %al
	je	.LBB1_17
# %bb.2:
.Ltmp2:
	leaq	8(%rsp), %rdi
	xorl	%esi, %esi
	movl	$2, %edx
	callq	_ZNSi5seekgElSt12_Ios_Seekdir
.Ltmp3:
# %bb.3:
.Ltmp5:
	leaq	8(%rsp), %rdi
	callq	_ZNSi5tellgEv
.Ltmp6:
# %bb.4:
.Ltmp8:
	movq	%rax, %r15
	leaq	8(%rsp), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_ZNSi5seekgElSt12_Ios_Seekdir
.Ltmp9:
# %bb.5:
	movl	$1, %r12d
	subl	%ebp, %r15d
	jle	.LBB1_17
# %bb.6:
	cmpl	$524288000, %r15d               # imm = 0x1F400000
	jl	.LBB1_12
# %bb.7:
.Ltmp13:
	movl	$524288000, %r15d               # imm = 0x1F400000
	movl	$524288000, %edi                # imm = 0x1F400000
	callq	_Znam
.Ltmp14:
# %bb.8:
	movq	%rax, (%r14)
	jmp	.LBB1_14
.LBB1_12:
	movslq	%r15d, %r15
.Ltmp11:
	movq	%r15, %rdi
	callq	_Znam
.Ltmp12:
# %bb.13:
	movq	%rax, (%r14)
	movb	$83, (%rax)
	movb	$66, -1(%rax,%r15)
.LBB1_14:
	movslq	%ebp, %rsi
.Ltmp15:
	leaq	8(%rsp), %rdi
	xorl	%edx, %edx
	callq	_ZNSi5seekgESt4fposI11__mbstate_tE
.Ltmp16:
# %bb.15:
	movq	(%r14), %rsi
.Ltmp17:
	leaq	8(%rsp), %rdi
	movq	%r15, %rdx
	callq	_ZNSi4readEPcl
.Ltmp18:
# %bb.16:
	leaq	8(%rsp), %rdi
	movl	8(%rdi), %eax
	movl	%eax, (%rbx)
	xorl	%r12d, %r12d
.Ltmp19:
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv
.Ltmp20:
.LBB1_17:
	leaq	8(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movl	%r12d, %eax
	addq	$528, %rsp                      # imm = 0x210
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.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
.LBB1_10:
	.cfi_def_cfa_offset 576
.Ltmp10:
	jmp	.LBB1_19
.LBB1_9:
.Ltmp7:
	jmp	.LBB1_19
.LBB1_11:
.Ltmp21:
	jmp	.LBB1_19
.LBB1_18:
.Ltmp4:
.LBB1_19:
	movq	%rax, %rbx
	leaq	8(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end1:
	.size	_Z8readFilePcRPhRii, .Lfunc_end1-_Z8readFilePcRPhRii
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table1:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp3-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp3
	.uleb128 .Ltmp4-.Lfunc_begin0           #     jumps to .Ltmp4
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp5-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp6-.Ltmp5                  #   Call between .Ltmp5 and .Ltmp6
	.uleb128 .Ltmp7-.Lfunc_begin0           #     jumps to .Ltmp7
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp8-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp9-.Ltmp8                  #   Call between .Ltmp8 and .Ltmp9
	.uleb128 .Ltmp10-.Lfunc_begin0          #     jumps to .Ltmp10
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp13-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp20-.Ltmp13                #   Call between .Ltmp13 and .Ltmp20
	.uleb128 .Ltmp21-.Lfunc_begin0          #     jumps to .Ltmp21
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp20-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Lfunc_end1-.Ltmp20            #   Call between .Ltmp20 and .Lfunc_end1
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	.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, %rax               # imm = 0x100000000
	addq	$32, %rax
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	movl	$_ZSt4cout, %ebp
	xorl	%ebx, %ebx
.LBB2_1:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_14 Depth 2
                                        #       Child Loop BB2_15 Depth 3
	movl	$.L.str, %edi
	leaq	40(%rsp), %rsi
	leaq	28(%rsp), %rdx
	movl	%ebx, %ecx
	callq	_Z8readFilePcRPhRii
	cmpl	$-1, %eax
	je	.LBB2_20
# %bb.2:                                #   in Loop: Header=BB2_1 Depth=1
	cmpl	$1, %eax
	je	.LBB2_20
# %bb.3:                                #   in Loop: Header=BB2_1 Depth=1
	movl	%ebx, 24(%rsp)                  # 4-byte Spill
	movslq	28(%rsp), %r12
	leaq	8(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	callq	hipGetLastError
	testl	%eax, %eax
	je	.LBB2_5
# %bb.4:                                #   in Loop: Header=BB2_1 Depth=1
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.1, %edi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
.LBB2_5:                                #   in Loop: Header=BB2_1 Depth=1
	leal	1048575(%r12), %eax
	leal	33554431(%r12), %r15d
	testl	%r12d, %r12d
	cmovnsl	%r12d, %eax
	cmovnsl	%r12d, %r15d
	sarl	$20, %eax
	movl	%eax, 4(%rsp)
	sarl	$25, %r15d
	incl	%r15d
	movl	%r15d, %eax
	shll	$7, %eax
	leal	(%rax,%rax,4), %eax
	movslq	%eax, %rbx
	leaq	16(%rsp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	callq	hipGetLastError
	movl	%eax, %r14d
	testl	%eax, %eax
	je	.LBB2_7
# %bb.6:                                #   in Loop: Header=BB2_1 Depth=1
	movl	%r14d, %edi
	callq	hipGetErrorString
	movl	$.L.str.2, %edi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
	movq	8(%rsp), %rdi
	movq	40(%rsp), %rsi
	movq	%rsi, 32(%rsp)                  # 8-byte Spill
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movl	%r14d, %edi
	callq	hipGetErrorString
	movl	$.L.str.3, %edi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
	jmp	.LBB2_8
.LBB2_7:                                # %.critedge
                                        #   in Loop: Header=BB2_1 Depth=1
	movq	8(%rsp), %rdi
	movq	40(%rsp), %rsi
	movq	%rsi, 32(%rsp)                  # 8-byte Spill
	movq	%r12, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
.LBB2_8:                                #   in Loop: Header=BB2_1 Depth=1
	movl	$thread_counts, %edi
	movl	$4, %edx
	leaq	4(%rsp), %rsi
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	movl	%r15d, %edi
	movabsq	$4294967296, %rax               # imm = 0x100000000
	orq	%rax, %rdi
	movl	$1, %esi
	movq	48(%rsp), %rdx                  # 8-byte Reload
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_10
# %bb.9:                                #   in Loop: Header=BB2_1 Depth=1
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rsi
	callq	_Z28__device_stub__calculateHashPhS_
.LBB2_10:                               #   in Loop: Header=BB2_1 Depth=1
	callq	hipDeviceSynchronize
	testl	%r14d, %r14d
	je	.LBB2_12
# %bb.11:                               #   in Loop: Header=BB2_1 Depth=1
	movl	%r14d, %edi
	callq	hipGetErrorString
	movl	$.L.str.4, %edi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
.LBB2_12:                               #   in Loop: Header=BB2_1 Depth=1
	movq	%rbx, %rdi
	callq	_Znam
	movq	%rax, %r14
	movq	16(%rsp), %rsi
	movq	%rax, %rdi
	movq	%rbx, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	8(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	cmpl	$0, 4(%rsp)
	js	.LBB2_17
# %bb.13:                               # %.preheader.preheader
                                        #   in Loop: Header=BB2_1 Depth=1
	movq	%r14, %rbx
	xorl	%r15d, %r15d
.LBB2_14:                               # %.preheader
                                        #   Parent Loop BB2_1 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB2_15 Depth 3
	movq	$-20, %r13
.LBB2_15:                               #   Parent Loop BB2_1 Depth=1
                                        #     Parent Loop BB2_14 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movzbl	20(%rbx,%r13), %esi
	movl	$.L.str.5, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r13
	jne	.LBB2_15
# %bb.16:                               #   in Loop: Header=BB2_14 Depth=2
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbp, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	leaq	1(%r15), %rax
	movslq	4(%rsp), %rcx
	addq	$20, %rbx
	cmpq	%rcx, %r15
	movq	%rax, %r15
	jl	.LBB2_14
.LBB2_17:                               # %._crit_edge
                                        #   in Loop: Header=BB2_1 Depth=1
	movq	32(%rsp), %rdi                  # 8-byte Reload
	testq	%rdi, %rdi
	je	.LBB2_19
# %bb.18:                               #   in Loop: Header=BB2_1 Depth=1
	callq	_ZdaPv
.LBB2_19:                               #   in Loop: Header=BB2_1 Depth=1
	addl	24(%rsp), %r12d                 # 4-byte Folded Reload
	movq	%r14, %rdi
	callq	_ZdaPv
	movl	%r12d, %ebx
	jmp	.LBB2_1
.LBB2_20:
	movl	$.L.str.6, %edi
	xorl	%eax, %eax
	callq	printf
	movl	$1, %eax
	addq	$56, %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
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.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	.LBB3_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB3_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z13calculateHashPhS_, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$0, 8(%rsp)
	movl	$1, (%rsp)
	movl	$thread_counts, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	__hipRegisterVar
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end3:
	.size	__hip_module_ctor, .Lfunc_end3-__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	.LBB4_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
.LBB4_2:
	retq
.Lfunc_end4:
	.size	__hip_module_dtor, .Lfunc_end4-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	thread_counts,@object           # @thread_counts
	.local	thread_counts
	.comm	thread_counts,4,4
	.type	_Z13calculateHashPhS_,@object   # @_Z13calculateHashPhS_
	.section	.rodata,"a",@progbits
	.globl	_Z13calculateHashPhS_
	.p2align	3, 0x0
_Z13calculateHashPhS_:
	.quad	_Z28__device_stub__calculateHashPhS_
	.size	_Z13calculateHashPhS_, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"/home/ajay/test2.txt"
	.size	.L.str, 21

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"gdata message: %s\n"
	.size	.L.str.1, 19

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"hash message: %s\n"
	.size	.L.str.2, 18

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	" memcpy message: %s\n"
	.size	.L.str.3, 21

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	" hashcalucation message: %s\n"
	.size	.L.str.4, 29

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"%02x"
	.size	.L.str.5, 5

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"Completed"
	.size	.L.str.6, 10

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z13calculateHashPhS_"
	.size	.L__unnamed_1, 22

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"thread_counts"
	.size	.L__unnamed_2, 14

	.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 _Z28__device_stub__calculateHashPhS_
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym thread_counts
	.addrsig_sym _Z13calculateHashPhS_
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z13calculateHashPhS_   ; -- Begin function _Z13calculateHashPhS_
	.globl	_Z13calculateHashPhS_
	.p2align	8
	.type	_Z13calculateHashPhS_,@function
_Z13calculateHashPhS_:                  ; @_Z13calculateHashPhS_
; %bb.0:
	s_load_b32 s4, s[0:1], 0x1c
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, thread_counts@rel32@lo+4
	s_addc_u32 s3, s3, thread_counts@rel32@hi+12
	s_load_b32 s2, s[2:3], 0x0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s3, s4, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s3, v[0:1]
	v_cmp_ge_i32_e32 vcc_lo, s2, v1
	s_and_saveexec_b32 s2, vcc_lo
	s_cbranch_execz .LBB0_46
; %bb.1:
	s_load_b128 s[0:3], s[0:1], 0x0
	v_dual_mov_b32 v5, 0xefcdab89 :: v_dual_lshlrev_b32 v6, 20, v1
	v_mov_b32_e32 v4, 0x67452301
	v_mov_b32_e32 v2, 0x98badcfe
	v_mov_b32_e32 v3, 0x10325476
	s_delay_alu instid0(VALU_DEP_4)
	v_ashrrev_i32_e32 v8, 31, v6
	v_mov_b32_e32 v0, 0xc3d2e1f0
	s_mov_b32 s4, 0
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v7, vcc_lo, s0, v6
	v_mov_b32_e32 v6, 16
	v_add_co_ci_u32_e32 v8, vcc_lo, s1, v8, vcc_lo
.LBB0_2:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
                                        ;     Child Loop BB0_5 Depth 2
                                        ;     Child Loop BB0_7 Depth 2
                                        ;     Child Loop BB0_9 Depth 2
                                        ;     Child Loop BB0_11 Depth 2
                                        ;     Child Loop BB0_13 Depth 2
	s_ashr_i32 s0, s4, 31
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v9, vcc_lo, v7, s4
	v_add_co_ci_u32_e32 v10, vcc_lo, s0, v8, vcc_lo
	v_mov_b32_e32 v11, 16
	s_mov_b64 s[0:1], 0
.LBB0_3:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(VALU_DEP_3) | instid1(SALU_CYCLE_1)
	v_add_co_u32 v12, vcc_lo, v9, s0
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v13, vcc_lo, s1, v10, vcc_lo
	s_add_u32 s0, s0, 4
	s_addc_u32 s1, s1, 0
	s_cmp_eq_u32 s0, 64
	global_load_b32 v12, v[12:13], off
	s_waitcnt vmcnt(0)
	v_perm_b32 v12, v12, v12, 0x4050607
	scratch_store_b32 v11, v12, off
	v_add_nc_u32_e32 v11, 4, v11
	s_cbranch_scc0 .LBB0_3
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	v_dual_mov_b32 v12, v4 :: v_dual_mov_b32 v9, v5
	v_dual_mov_b32 v11, v2 :: v_dual_mov_b32 v10, v3
	v_mov_b32_e32 v14, v0
	s_mov_b32 s1, 0
.LBB0_5:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	s_add_i32 s5, s1, 16
	v_dual_mov_b32 v13, v10 :: v_dual_mov_b32 v16, v9
	scratch_load_b32 v15, off, s5
	v_dual_mov_b32 v9, v12 :: v_dual_mov_b32 v10, v11
	s_add_i32 s1, s1, 4
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_cmp_lg_u32 s1, 64
	v_alignbit_b32 v11, v9, v9, 27
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_bfi_b32 v12, v16, v10, v13
	v_add3_u32 v12, v11, v14, v12
	v_alignbit_b32 v11, v16, v16, 2
	v_mov_b32_e32 v14, v13
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_3)
	v_add3_u32 v12, v12, v15, 0x5a827999
	s_cbranch_scc1 .LBB0_5
; %bb.6:                                ; %.lr.ph.i.i.preheader
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_mov_b32 s1, 0
.LBB0_7:                                ; %.lr.ph.i.i
                                        ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	v_readfirstlane_b32 s5, v6
	v_dual_mov_b32 v14, v10 :: v_dual_mov_b32 v19, v9
	v_dual_mov_b32 v9, v12 :: v_dual_mov_b32 v10, v11
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_add_i32 s5, s5, s1
	s_add_i32 s6, s5, 52
	s_add_i32 s7, s5, 32
	s_clause 0x1
	scratch_load_b32 v15, off, s6
	scratch_load_b32 v16, off, s7
	s_add_i32 s7, s5, 8
	s_add_i32 s6, s1, 16
	s_clause 0x1
	scratch_load_b32 v17, off, s7
	scratch_load_b32 v18, off, s6
	v_alignbit_b32 v12, v9, v9, 27
	s_add_i32 s1, s1, 4
	s_add_i32 s5, s5, 64
	s_cmp_lg_u32 s1, 16
	s_waitcnt vmcnt(2)
	v_xor_b32_e32 v11, v16, v15
	v_bfi_b32 v15, v19, v10, v14
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_xor3_b32 v11, v11, v17, v18
	v_add3_u32 v12, v12, v13, v15
	v_mov_b32_e32 v13, v14
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_alignbit_b32 v15, v11, v11, 31
	v_alignbit_b32 v11, v19, v19, 2
	v_add3_u32 v12, v12, v15, 0x5a827999
	scratch_store_b32 off, v15, s5
	s_cbranch_scc1 .LBB0_7
; %bb.8:                                ; %.lr.ph180.i.i.preheader
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_mov_b32 s1, 0
.LBB0_9:                                ; %.lr.ph180.i.i
                                        ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	v_readfirstlane_b32 s5, v6
	v_dual_mov_b32 v13, v10 :: v_dual_mov_b32 v10, v11
	v_mov_b32_e32 v19, v9
	v_mov_b32_e32 v9, v12
	s_delay_alu instid0(VALU_DEP_4)
	s_add_i32 s5, s5, s1
	s_add_i32 s1, s1, 4
	s_add_i32 s6, s5, 0x44
	s_add_i32 s7, s5, 48
	s_clause 0x1
	scratch_load_b32 v15, off, s6
	scratch_load_b32 v16, off, s7
	s_add_i32 s6, s5, 24
	s_add_i32 s7, s5, 16
	s_clause 0x1
	scratch_load_b32 v17, off, s6
	scratch_load_b32 v18, off, s7
	v_alignbit_b32 v12, v9, v9, 27
	s_addk_i32 s5, 0x50
	s_cmpk_lg_i32 s1, 0x50
	s_waitcnt vmcnt(2)
	v_xor_b32_e32 v11, v16, v15
	v_xor3_b32 v15, v10, v19, v13
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_xor3_b32 v11, v11, v17, v18
	v_add3_u32 v12, v12, v14, v15
	v_mov_b32_e32 v14, v13
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_alignbit_b32 v15, v11, v11, 31
	v_alignbit_b32 v11, v19, v19, 2
	v_add3_u32 v12, v12, v15, 0x6ed9eba1
	scratch_store_b32 off, v15, s5
	s_cbranch_scc1 .LBB0_9
; %bb.10:                               ; %.lr.ph193.i.i.preheader
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_mov_b32 s1, 0
.LBB0_11:                               ; %.lr.ph193.i.i
                                        ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	v_readfirstlane_b32 s5, v6
	v_dual_mov_b32 v14, v10 :: v_dual_mov_b32 v19, v9
	v_dual_mov_b32 v10, v11 :: v_dual_mov_b32 v9, v12
	s_delay_alu instid0(VALU_DEP_3)
	s_add_i32 s5, s5, s1
	s_add_i32 s1, s1, 4
	s_add_i32 s6, s5, 0x94
	s_add_i32 s7, s5, 0x80
	s_clause 0x1
	scratch_load_b32 v15, off, s6
	scratch_load_b32 v16, off, s7
	s_add_i32 s6, s5, 0x68
	s_add_i32 s7, s5, 0x60
	s_clause 0x1
	scratch_load_b32 v17, off, s6
	scratch_load_b32 v18, off, s7
	v_xor_b32_e32 v11, v14, v19
	s_addk_i32 s5, 0xa0
	s_cmpk_lg_i32 s1, 0x50
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_2)
	v_bfi_b32 v11, v11, v10, v19
	s_waitcnt vmcnt(2)
	v_xor_b32_e32 v12, v16, v15
	v_alignbit_b32 v15, v9, v9, 27
	s_waitcnt vmcnt(0)
	v_xor3_b32 v12, v12, v17, v18
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_4)
	v_add3_u32 v15, v15, v13, v11
	v_alignbit_b32 v11, v19, v19, 2
	v_mov_b32_e32 v13, v14
	v_alignbit_b32 v16, v12, v12, 31
	s_delay_alu instid0(VALU_DEP_1)
	v_add3_u32 v12, v15, v16, 0x8f1bbcdc
	scratch_store_b32 off, v16, s5
	s_cbranch_scc1 .LBB0_11
; %bb.12:                               ; %.lr.ph206.i.i.preheader
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_mov_b32 s1, 0
.LBB0_13:                               ; %.lr.ph206.i.i
                                        ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	v_readfirstlane_b32 s5, v6
	v_dual_mov_b32 v13, v10 :: v_dual_mov_b32 v10, v11
	v_mov_b32_e32 v19, v9
	v_mov_b32_e32 v9, v12
	s_delay_alu instid0(VALU_DEP_4)
	s_add_i32 s5, s5, s1
	s_add_i32 s1, s1, 4
	s_add_i32 s6, s5, 0xe4
	s_add_i32 s7, s5, 0xd0
	s_clause 0x1
	scratch_load_b32 v15, off, s6
	scratch_load_b32 v16, off, s7
	s_add_i32 s6, s5, 0xb8
	s_add_i32 s7, s5, 0xb0
	s_clause 0x1
	scratch_load_b32 v17, off, s6
	scratch_load_b32 v18, off, s7
	v_alignbit_b32 v12, v9, v9, 27
	s_addk_i32 s5, 0xf0
	s_cmpk_lg_i32 s1, 0x50
	s_waitcnt vmcnt(2)
	v_xor_b32_e32 v11, v16, v15
	v_xor3_b32 v15, v10, v19, v13
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_xor3_b32 v11, v11, v17, v18
	v_add3_u32 v12, v12, v14, v15
	v_mov_b32_e32 v14, v13
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_alignbit_b32 v15, v11, v11, 31
	v_alignbit_b32 v11, v19, v19, 2
	v_add3_u32 v12, v12, v15, 0xca62c1d6
	scratch_store_b32 off, v15, s5
	s_cbranch_scc1 .LBB0_13
; %bb.14:                               ; %_Z9innerHashPjS_.exit.i
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_add_i32 s4, s4, s0
	v_add_nc_u32_e32 v4, v12, v4
	v_add_nc_u32_e32 v5, v9, v5
	v_add_nc_u32_e32 v2, v11, v2
	v_add_nc_u32_e32 v3, v10, v3
	v_add_nc_u32_e32 v0, v13, v0
	s_add_i32 s5, s4, -4
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lt_i32 s5, 0xfffbd
	s_cbranch_scc1 .LBB0_2
; %bb.15:                               ; %.preheader6.preheader
	v_add_nc_u32_e64 v6, 16, 60
	v_mov_b32_e32 v9, 0
	s_mov_b32 s0, 17
	s_delay_alu instid0(VALU_DEP_2)
	v_mov_b32_e32 v10, v6
.LBB0_16:                               ; %.preheader6
                                        ; =>This Inner Loop Header: Depth=1
	scratch_store_b32 v10, v9, off
	v_add_nc_u32_e32 v10, -4, v10
	s_add_i32 s0, s0, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_gt_u32 s0, 1
	s_cbranch_scc1 .LBB0_16
; %bb.17:                               ; %_Z13clearWBuffertPj.exit.preheader.i
	s_cmp_gt_i32 s5, 0xffffb
	s_mov_b32 s0, 0
	s_cbranch_scc1 .LBB0_20
; %bb.18:                               ; %_Z13clearWBuffertPj.exit.i.preheader
	v_add_co_u32 v7, vcc_lo, v7, s4
	v_add_co_ci_u32_e32 v8, vcc_lo, 0, v8, vcc_lo
	s_sub_i32 s4, 0xffffc, s5
	s_mov_b32 s6, 0
	s_mov_b64 s[0:1], 0
.LBB0_19:                               ; %_Z13clearWBuffertPj.exit.i
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	v_add_co_u32 v9, vcc_lo, v7, s0
	v_add_co_ci_u32_e32 v10, vcc_lo, s1, v8, vcc_lo
	s_and_b32 s7, s0, -4
	s_and_not1_b32 s8, 24, s6
	s_add_i32 s7, s7, 16
	scratch_load_b32 v11, off, s7
	global_load_u8 v9, v[9:10], off
	s_add_u32 s0, s0, 1
	s_addc_u32 s1, s1, 0
	s_add_i32 s6, s6, 8
	s_cmp_lt_i32 s0, s4
	s_waitcnt vmcnt(0)
	v_lshl_or_b32 v9, v9, s8, v11
	scratch_store_b32 off, v9, s7
	s_cbranch_scc1 .LBB0_19
.LBB0_20:                               ; %_Z13clearWBuffertPj.exit._crit_edge.i
	s_and_b32 s1, s0, -4
	s_not_b32 s0, s0
	s_add_i32 s1, s1, 16
	s_lshl_b32 s0, s0, 3
	scratch_load_b32 v7, off, s1
	s_cmp_gt_i32 s5, 0xfffc4
	s_waitcnt vmcnt(0)
	v_lshl_or_b32 v7, 0x80, s0, v7
	scratch_store_b32 off, v7, s1
	s_cbranch_scc1 .LBB0_34
; %bb.21:                               ; %.preheader.preheader
	v_dual_mov_b32 v10, v4 :: v_dual_mov_b32 v7, v5
	v_dual_mov_b32 v9, v2 :: v_dual_mov_b32 v8, v3
	v_mov_b32_e32 v12, v0
	s_mov_b32 s0, 0
.LBB0_22:                               ; %.preheader
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	s_add_i32 s1, s0, 16
	v_dual_mov_b32 v11, v8 :: v_dual_mov_b32 v14, v7
	scratch_load_b32 v13, off, s1
	v_dual_mov_b32 v7, v10 :: v_dual_mov_b32 v8, v9
	s_add_i32 s0, s0, 4
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_cmp_lg_u32 s0, 64
	v_alignbit_b32 v9, v7, v7, 27
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_bfi_b32 v10, v14, v8, v11
	v_add3_u32 v10, v9, v12, v10
	v_alignbit_b32 v9, v14, v14, 2
	v_mov_b32_e32 v12, v11
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_3)
	v_add3_u32 v10, v10, v13, 0x5a827999
	s_cbranch_scc1 .LBB0_22
; %bb.23:                               ; %.lr.ph.i47.i.preheader
	v_mov_b32_e32 v13, 16
	s_mov_b32 s0, 0
.LBB0_24:                               ; %.lr.ph.i47.i
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_4)
	v_readfirstlane_b32 s1, v13
	v_mov_b32_e32 v12, v8
	v_dual_mov_b32 v18, v7 :: v_dual_mov_b32 v7, v10
	v_mov_b32_e32 v8, v9
	s_add_i32 s1, s1, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_i32 s4, s1, 52
	s_add_i32 s5, s1, 32
	s_clause 0x1
	scratch_load_b32 v14, off, s4
	scratch_load_b32 v15, off, s5
	s_add_i32 s5, s1, 8
	s_add_i32 s4, s0, 16
	s_clause 0x1
	scratch_load_b32 v16, off, s5
	scratch_load_b32 v17, off, s4
	v_alignbit_b32 v10, v7, v7, 27
	s_add_i32 s0, s0, 4
	s_add_i32 s1, s1, 64
	s_cmp_lg_u32 s0, 16
	s_waitcnt vmcnt(2)
	v_xor_b32_e32 v9, v15, v14
	v_bfi_b32 v14, v18, v8, v12
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_xor3_b32 v9, v9, v16, v17
	v_add3_u32 v10, v10, v11, v14
	v_mov_b32_e32 v11, v12
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_alignbit_b32 v14, v9, v9, 31
	v_alignbit_b32 v9, v18, v18, 2
	v_add3_u32 v10, v10, v14, 0x5a827999
	scratch_store_b32 off, v14, s1
	s_cbranch_scc1 .LBB0_24
; %bb.25:                               ; %.lr.ph180.i55.i.preheader
	v_mov_b32_e32 v13, 16
	s_mov_b32 s0, 0
.LBB0_26:                               ; %.lr.ph180.i55.i
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_readfirstlane_b32 s1, v13
	v_dual_mov_b32 v11, v8 :: v_dual_mov_b32 v18, v7
	v_dual_mov_b32 v7, v10 :: v_dual_mov_b32 v8, v9
	s_add_i32 s1, s1, s0
	s_add_i32 s0, s0, 4
	s_add_i32 s4, s1, 0x44
	s_add_i32 s5, s1, 48
	s_clause 0x1
	scratch_load_b32 v14, off, s4
	scratch_load_b32 v15, off, s5
	s_add_i32 s4, s1, 24
	s_add_i32 s5, s1, 16
	s_clause 0x1
	scratch_load_b32 v16, off, s4
	scratch_load_b32 v17, off, s5
	v_alignbit_b32 v10, v7, v7, 27
	s_addk_i32 s1, 0x50
	s_cmpk_lg_i32 s0, 0x50
	s_waitcnt vmcnt(2)
	v_xor_b32_e32 v9, v15, v14
	v_xor3_b32 v14, v8, v18, v11
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_xor3_b32 v9, v9, v16, v17
	v_add3_u32 v10, v10, v12, v14
	v_mov_b32_e32 v12, v11
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_alignbit_b32 v14, v9, v9, 31
	v_alignbit_b32 v9, v18, v18, 2
	v_add3_u32 v10, v10, v14, 0x6ed9eba1
	scratch_store_b32 off, v14, s1
	s_cbranch_scc1 .LBB0_26
; %bb.27:                               ; %.lr.ph193.i63.i.preheader
	v_mov_b32_e32 v13, 16
	s_mov_b32 s0, 0
.LBB0_28:                               ; %.lr.ph193.i63.i
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_4)
	v_readfirstlane_b32 s1, v13
	v_mov_b32_e32 v12, v8
	v_mov_b32_e32 v18, v7
	v_dual_mov_b32 v8, v9 :: v_dual_mov_b32 v7, v10
	s_add_i32 s1, s1, s0
	s_add_i32 s0, s0, 4
	s_add_i32 s4, s1, 0x94
	s_add_i32 s5, s1, 0x80
	s_clause 0x1
	scratch_load_b32 v14, off, s4
	scratch_load_b32 v15, off, s5
	s_add_i32 s4, s1, 0x68
	s_add_i32 s5, s1, 0x60
	s_clause 0x1
	scratch_load_b32 v16, off, s4
	scratch_load_b32 v17, off, s5
	v_xor_b32_e32 v9, v12, v18
	s_addk_i32 s1, 0xa0
	s_cmpk_lg_i32 s0, 0x50
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_2)
	v_bfi_b32 v9, v9, v8, v18
	s_waitcnt vmcnt(2)
	v_xor_b32_e32 v10, v15, v14
	v_alignbit_b32 v14, v7, v7, 27
	s_waitcnt vmcnt(0)
	v_xor3_b32 v10, v10, v16, v17
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_4)
	v_add3_u32 v14, v14, v11, v9
	v_mov_b32_e32 v11, v12
	v_alignbit_b32 v9, v18, v18, 2
	v_alignbit_b32 v15, v10, v10, 31
	s_delay_alu instid0(VALU_DEP_1)
	v_add3_u32 v10, v14, v15, 0x8f1bbcdc
	scratch_store_b32 off, v15, s1
	s_cbranch_scc1 .LBB0_28
; %bb.29:                               ; %.lr.ph206.i71.i.preheader
	v_mov_b32_e32 v11, 16
	s_mov_b32 s0, 0
.LBB0_30:                               ; %.lr.ph206.i71.i
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_readfirstlane_b32 s1, v11
	v_dual_mov_b32 v13, v8 :: v_dual_mov_b32 v18, v7
	v_dual_mov_b32 v7, v10 :: v_dual_mov_b32 v8, v9
	s_add_i32 s1, s1, s0
	s_add_i32 s0, s0, 4
	s_add_i32 s4, s1, 0xe4
	s_add_i32 s5, s1, 0xd0
	s_clause 0x1
	scratch_load_b32 v14, off, s4
	scratch_load_b32 v15, off, s5
	s_add_i32 s4, s1, 0xb8
	s_add_i32 s5, s1, 0xb0
	s_clause 0x1
	scratch_load_b32 v16, off, s4
	scratch_load_b32 v17, off, s5
	v_alignbit_b32 v10, v7, v7, 27
	s_addk_i32 s1, 0xf0
	s_cmpk_lg_i32 s0, 0x50
	s_waitcnt vmcnt(2)
	v_xor_b32_e32 v9, v15, v14
	v_xor3_b32 v14, v8, v18, v13
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_xor3_b32 v9, v9, v16, v17
	v_add3_u32 v10, v10, v12, v14
	v_mov_b32_e32 v12, v13
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_alignbit_b32 v14, v9, v9, 31
	v_alignbit_b32 v9, v18, v18, 2
	v_add3_u32 v10, v10, v14, 0xca62c1d6
	scratch_store_b32 off, v14, s1
	s_cbranch_scc1 .LBB0_30
; %bb.31:                               ; %_Z9innerHashPjS_.exit79.i
	v_mov_b32_e32 v11, 0
	s_mov_b32 s0, 17
.LBB0_32:                               ; =>This Inner Loop Header: Depth=1
	scratch_store_b32 v6, v11, off
	v_add_nc_u32_e32 v6, -4, v6
	s_add_i32 s0, s0, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_gt_u32 s0, 1
	s_cbranch_scc1 .LBB0_32
; %bb.33:                               ; %_Z13clearWBuffertPj.exit81.loopexit.i
	v_add_nc_u32_e32 v5, v7, v5
	v_add_nc_u32_e32 v3, v8, v3
	v_add_nc_u32_e32 v4, v10, v4
	v_add_nc_u32_e32 v2, v9, v2
	v_add_nc_u32_e32 v0, v13, v0
.LBB0_34:                               ; %_Z13clearWBuffertPj.exit81.i
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_dual_mov_b32 v10, 0x800000 :: v_dual_mov_b32 v9, v4
	v_dual_mov_b32 v6, v5 :: v_dual_mov_b32 v7, v3
	v_dual_mov_b32 v8, v2 :: v_dual_mov_b32 v11, v0
	s_mov_b32 s0, 0
	scratch_store_b32 off, v10, off offset:76
.LBB0_35:                               ; =>This Inner Loop Header: Depth=1
	s_add_i32 s1, s0, 16
	v_dual_mov_b32 v10, v7 :: v_dual_mov_b32 v13, v6
	scratch_load_b32 v12, off, s1
	v_dual_mov_b32 v6, v9 :: v_dual_mov_b32 v7, v8
	s_add_i32 s0, s0, 4
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_cmp_lg_u32 s0, 64
	v_alignbit_b32 v8, v6, v6, 27
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_bfi_b32 v9, v13, v7, v10
	v_add3_u32 v9, v8, v11, v9
	v_alignbit_b32 v8, v13, v13, 2
	v_mov_b32_e32 v11, v10
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_3)
	v_add3_u32 v9, v9, v12, 0x5a827999
	s_cbranch_scc1 .LBB0_35
; %bb.36:                               ; %.lr.ph.i89.i.preheader
	v_mov_b32_e32 v12, 16
	s_mov_b32 s0, 0
.LBB0_37:                               ; %.lr.ph.i89.i
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_4)
	v_readfirstlane_b32 s1, v12
	v_mov_b32_e32 v11, v7
	v_dual_mov_b32 v17, v6 :: v_dual_mov_b32 v6, v9
	v_mov_b32_e32 v7, v8
	s_add_i32 s1, s1, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_i32 s4, s1, 52
	s_add_i32 s5, s1, 32
	s_clause 0x1
	scratch_load_b32 v13, off, s4
	scratch_load_b32 v14, off, s5
	s_add_i32 s5, s1, 8
	s_add_i32 s4, s0, 16
	s_clause 0x1
	scratch_load_b32 v15, off, s5
	scratch_load_b32 v16, off, s4
	v_alignbit_b32 v9, v6, v6, 27
	s_add_i32 s0, s0, 4
	s_add_i32 s1, s1, 64
	s_cmp_lg_u32 s0, 16
	s_waitcnt vmcnt(2)
	v_xor_b32_e32 v8, v14, v13
	v_bfi_b32 v13, v17, v7, v11
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_xor3_b32 v8, v8, v15, v16
	v_add3_u32 v9, v9, v10, v13
	v_mov_b32_e32 v10, v11
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_alignbit_b32 v13, v8, v8, 31
	v_alignbit_b32 v8, v17, v17, 2
	v_add3_u32 v9, v9, v13, 0x5a827999
	scratch_store_b32 off, v13, s1
	s_cbranch_scc1 .LBB0_37
; %bb.38:                               ; %.lr.ph180.i97.i.preheader
	v_mov_b32_e32 v12, 16
	s_mov_b32 s0, 0
.LBB0_39:                               ; %.lr.ph180.i97.i
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_readfirstlane_b32 s1, v12
	v_dual_mov_b32 v10, v7 :: v_dual_mov_b32 v17, v6
	v_dual_mov_b32 v6, v9 :: v_dual_mov_b32 v7, v8
	s_add_i32 s1, s1, s0
	s_add_i32 s0, s0, 4
	s_add_i32 s4, s1, 0x44
	s_add_i32 s5, s1, 48
	s_clause 0x1
	scratch_load_b32 v13, off, s4
	scratch_load_b32 v14, off, s5
	s_add_i32 s4, s1, 24
	s_add_i32 s5, s1, 16
	s_clause 0x1
	scratch_load_b32 v15, off, s4
	scratch_load_b32 v16, off, s5
	v_alignbit_b32 v9, v6, v6, 27
	s_addk_i32 s1, 0x50
	s_cmpk_lg_i32 s0, 0x50
	s_waitcnt vmcnt(2)
	v_xor_b32_e32 v8, v14, v13
	v_xor3_b32 v13, v7, v17, v10
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_xor3_b32 v8, v8, v15, v16
	v_add3_u32 v9, v9, v11, v13
	v_mov_b32_e32 v11, v10
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_alignbit_b32 v13, v8, v8, 31
	v_alignbit_b32 v8, v17, v17, 2
	v_add3_u32 v9, v9, v13, 0x6ed9eba1
	scratch_store_b32 off, v13, s1
	s_cbranch_scc1 .LBB0_39
; %bb.40:                               ; %.lr.ph193.i105.i.preheader
	v_mov_b32_e32 v12, 16
	s_mov_b32 s0, 0
.LBB0_41:                               ; %.lr.ph193.i105.i
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_4)
	v_readfirstlane_b32 s1, v12
	v_mov_b32_e32 v11, v7
	v_mov_b32_e32 v17, v6
	v_dual_mov_b32 v7, v8 :: v_dual_mov_b32 v6, v9
	s_add_i32 s1, s1, s0
	s_add_i32 s0, s0, 4
	s_add_i32 s4, s1, 0x94
	s_add_i32 s5, s1, 0x80
	s_clause 0x1
	scratch_load_b32 v13, off, s4
	scratch_load_b32 v14, off, s5
	s_add_i32 s4, s1, 0x68
	s_add_i32 s5, s1, 0x60
	s_clause 0x1
	scratch_load_b32 v15, off, s4
	scratch_load_b32 v16, off, s5
	v_xor_b32_e32 v8, v11, v17
	s_addk_i32 s1, 0xa0
	s_cmpk_lg_i32 s0, 0x50
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_2)
	v_bfi_b32 v8, v8, v7, v17
	s_waitcnt vmcnt(2)
	v_xor_b32_e32 v9, v14, v13
	v_alignbit_b32 v13, v6, v6, 27
	s_waitcnt vmcnt(0)
	v_xor3_b32 v9, v9, v15, v16
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_4)
	v_add3_u32 v13, v13, v10, v8
	v_mov_b32_e32 v10, v11
	v_alignbit_b32 v8, v17, v17, 2
	v_alignbit_b32 v14, v9, v9, 31
	s_delay_alu instid0(VALU_DEP_1)
	v_add3_u32 v9, v13, v14, 0x8f1bbcdc
	scratch_store_b32 off, v14, s1
	s_cbranch_scc1 .LBB0_41
; %bb.42:                               ; %.lr.ph206.i113.i.preheader
	v_mov_b32_e32 v10, 16
	s_mov_b32 s0, 0
.LBB0_43:                               ; %.lr.ph206.i113.i
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_readfirstlane_b32 s1, v10
	v_dual_mov_b32 v12, v7 :: v_dual_mov_b32 v17, v6
	v_dual_mov_b32 v6, v9 :: v_dual_mov_b32 v7, v8
	s_add_i32 s1, s1, s0
	s_add_i32 s0, s0, 4
	s_add_i32 s4, s1, 0xe4
	s_add_i32 s5, s1, 0xd0
	s_clause 0x1
	scratch_load_b32 v13, off, s4
	scratch_load_b32 v14, off, s5
	s_add_i32 s4, s1, 0xb8
	s_add_i32 s5, s1, 0xb0
	s_clause 0x1
	scratch_load_b32 v15, off, s4
	scratch_load_b32 v16, off, s5
	v_alignbit_b32 v9, v6, v6, 27
	s_addk_i32 s1, 0xf0
	s_cmpk_lg_i32 s0, 0x50
	s_waitcnt vmcnt(2)
	v_xor_b32_e32 v8, v14, v13
	v_xor3_b32 v13, v7, v17, v12
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_xor3_b32 v8, v8, v15, v16
	v_add3_u32 v9, v9, v11, v13
	v_mov_b32_e32 v11, v12
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_alignbit_b32 v13, v8, v8, 31
	v_alignbit_b32 v8, v17, v17, 2
	v_add3_u32 v9, v9, v13, 0xca62c1d6
	scratch_store_b32 off, v13, s1
	s_cbranch_scc1 .LBB0_43
; %bb.44:                               ; %_Z9innerHashPjS_.exit121.i
	v_mul_lo_u32 v1, v1, 20
	v_add_nc_u32_e32 v5, v6, v5
	v_add_nc_u32_e32 v3, v7, v3
	v_add_nc_u32_e32 v4, v9, v4
	v_add_nc_u32_e32 v2, v8, v2
	s_mov_b32 s0, 21
	s_movk_i32 s1, 0x1e0
	v_ashrrev_i32_e32 v6, 31, v1
	v_add_co_u32 v1, vcc_lo, v1, s2
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e32 v7, vcc_lo, s3, v6, vcc_lo
	v_add_nc_u32_e32 v6, v12, v0
	v_add_co_u32 v0, vcc_lo, v1, 19
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v1, vcc_lo, 0, v7, vcc_lo
.LBB0_45:                               ; =>This Inner Loop Header: Depth=1
	s_add_i32 s2, s0, -2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshr_b32 s2, s2, 2
	s_cmp_eq_u32 s2, 1
	s_cselect_b32 vcc_lo, -1, 0
	s_cmp_eq_u32 s2, 2
	v_cndmask_b32_e32 v7, v4, v5, vcc_lo
	s_cselect_b32 vcc_lo, -1, 0
	s_cmp_eq_u32 s2, 3
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v7, v7, v2, vcc_lo
	s_cselect_b32 vcc_lo, -1, 0
	s_cmp_eq_u32 s2, 4
	v_cndmask_b32_e32 v7, v7, v3, vcc_lo
	s_cselect_b32 vcc_lo, -1, 0
	s_and_b32 s2, s1, 24
	s_add_i32 s0, s0, -1
	s_sub_i32 s1, s1, 24
	v_cndmask_b32_e32 v7, v7, v6, vcc_lo
	s_cmp_gt_u32 s0, 1
	s_delay_alu instid0(VALU_DEP_1)
	v_lshrrev_b32_e32 v7, s2, v7
	global_store_b8 v[0:1], v7, off
	v_add_co_u32 v0, vcc_lo, v0, -1
	v_add_co_ci_u32_e32 v1, vcc_lo, -1, v1, vcc_lo
	s_cbranch_scc1 .LBB0_45
.LBB0_46:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z13calculateHashPhS_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 336
		.amdhsa_kernarg_size 272
		.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 1
		.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 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
	.text
.Lfunc_end0:
	.size	_Z13calculateHashPhS_, .Lfunc_end0-_Z13calculateHashPhS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 3720
; NumSgprs: 18
; NumVgprs: 20
; ScratchSize: 336
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 20
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 1
; 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
	.protected	thread_counts           ; @thread_counts
	.type	thread_counts,@object
	.section	.bss,"aw",@nobits
	.globl	thread_counts
	.p2align	2, 0x0
thread_counts:
	.long	0                               ; 0x0
	.size	thread_counts, 4

	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.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 thread_counts
	.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:           4
        .value_kind:     hidden_block_count_x
      - .offset:         20
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         28
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         30
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         32
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         34
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         36
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         38
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         80
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 272
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z13calculateHashPhS_
    .private_segment_fixed_size: 336
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z13calculateHashPhS_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     20
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
