#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>

static struct timeval ti;

bool IN(int x, int y, int w, int h) {
	return (x) >= 0 && (y) >= 0 && (x) < (w) && (y) < (h);
}

int maxProf(unsigned char * arr, int matDim){
	int max_value = 0;

	for (int i = 0; i < matDim; ++i) {
		if (arr[i] > max_value)
			max_value = arr[i];
	}

	return max_value;
}

void displayMat(unsigned char * arr, char * name, int matDim){
	printf("Matrice de %s \n \n", name);
	for(int y = 0; y < matDim; ++y){
    	for(int x = 0; x < matDim; ++x){
        	printf("%d ", (int)arr[y * matDim + x]);
      	}
		printf("\n");
	}
	printf("\n");	
}

void initArraysDs(unsigned char * _tabDepth, int4 * _tabParents, int w, int h) {
	int sw1 = w - 1, sw2 = sw1 >> 1;
	int sh1 = h - 1, sh2 = sh1 >> 1;
	int niveau = 1;
	while(sw2){
		for(int y = sh2; y < h; y += sh1){
			for(int x = sw2; x < w; x += sw1){
				if(_tabDepth[y * w + x]) continue;
				_tabDepth[y * w + x] = niveau;
				_tabParents[y * w + x].x = (y - sh2) * w + x - sw2;
 				_tabParents[y * w + x].y = (y - sh2) * w + x + sw2;
 				_tabParents[y * w + x].z = (y + sh2) * w + x + sw2;
				_tabParents[y * w + x].w = (y + sh2) * w + x - sw2;
 			}

		}
		niveau++; 
		for(int y = 0; y < h; y += sh1){
			for(int x = sw2; x < w; x += sw1){
				int yp, xp;
				if(_tabDepth[y * w + x]) continue;
				yp = y - sh2; xp = x; // parent haut
				if(IN(xp, yp, w, h)){
					_tabParents[y * w + x].x = yp * w + xp;
				} else{
					_tabParents[y * w + x].x = -1;
				}
				yp = y; xp = x + sw2; // parent droit
				if(IN(xp, yp, w, h)){
					_tabParents[y * w + x].y = yp * w + xp;
				} else{
					_tabParents[y * w + x].y = -1;
				}
				yp = y + sh2; xp = x; // parent bas
				if(IN(xp, yp, w, h)){
					_tabParents[y * w + x].z = yp * w + xp;
				} else{
					_tabParents[y * w + x].z = -1;
				}
				yp = y; xp = x - sw2; // parent gauche
				if(IN(xp, yp, w, h)){
					_tabParents[y * w + x].w = yp * w + xp;
				} else{
					_tabParents[y * w + x].w = -1;
				}
				_tabDepth[y * w + x] = niveau;
 			}
			
		}
		for(int y = sh2; y < h; y += sh1){
			for(int x = 0; x < w; x += sw1){
				int yp, xp;
				if(_tabDepth[y * w + x]) continue;
				yp = y - sh2; xp = x; // parent haut
				if(IN(xp, yp, w, h)){
					_tabParents[y * w + x].x = yp * w + xp;
				} else{
					_tabParents[y * w + x].x = -1;
				}
				yp = y; xp = x + sw2; // parent droit
				if(IN(xp, yp, w, h)){
					_tabParents[y * w + x].y = yp * w + xp;
				} else{
					_tabParents[y * w + x].y = -1;
				}
				yp = y + sh2; xp = x; // parent bas
				if(IN(xp, yp, w, h)){
					_tabParents[y * w + x].z = yp * w + xp;
				} else{
					_tabParents[y * w + x].z = -1;
				}
				yp = y; xp = x - sw2; // parent gauche
				if(IN(xp, yp, w, h)){
					_tabParents[y * w + x].w = yp * w + xp;
				} else{
					_tabParents[y * w + x].w = -1;
				}
				_tabDepth[y * w + x] = niveau;
 			}
			
		}
		niveau ++;
		sw1 = sw2;
		sw2 >>= 1;
		sh1 = sh2;
		sh2 >>= 1;
	}
}

void initArraysTe(unsigned char * _tabDepth, int4 * _tabParents, int x0, int y0, int stride, int sx, int sy, int p) {
	int w_2 = sx >> 1, h_2 = sy >> 1, j;
    int x[9] = { x0, x0 + sx, x0 + sx,
    x0, x0 + w_2, x0 + sx, x0 + w_2,
    x0, x0 + w_2 };
    int y[9] = { y0,
    y0, y0 + sy, y0 + sy,
    y0, y0 + h_2, y0 + sy, y0 + h_2, y0 + h_2 };

    for(int i = 0, i1 = 1; i < 4; ++i, i1 = (i1 + 1) % 4) {
		if(_tabDepth[j = y[i + 4] * stride + x[i + 4]]) continue;
			//Parents			
			_tabParents[j].x = y[i] * stride + x[i];
			_tabParents[j].y = y[i1] * stride + x[i1];
			_tabParents[j].z = -1;
			_tabParents[j].w = -1;
			//prof
			_tabDepth[j] = p;
        }

		if(!_tabDepth[j = y[8] * stride + x[8]]) {
            for(int i = 0; i < 4; ++i) {
				//prof
				_tabDepth[j] = p;
				//Tab parent
				if(i == 1){
					_tabParents[j].x = y[i] * stride + x[i];
				} else if(i == 2){
					_tabParents[j].y = y[i] * stride + x[i];
				} else if(i == 3) {
					_tabParents[j].z = y[i] * stride + x[i];
				} else {
					_tabParents[j].w = y[i] * stride + x[i];
				}
			}
			
        }
        if(w_2 > 1) {
            initArraysTe(_tabDepth, _tabParents, x[0], y[0], stride, w_2, h_2, ++p);
            initArraysTe(_tabDepth, _tabParents, x[4], y[4], stride, w_2, h_2, p);
            initArraysTe(_tabDepth, _tabParents, x[8], y[8], stride, w_2, h_2, p);
            initArraysTe(_tabDepth, _tabParents, x[7], y[7], stride, w_2, h_2, p);
    }
}

void triangleEdgeCPU(unsigned char * data, int x0, int y0, int stride, int sx, int sy, int p) {
	int niveau = 1;
	
    int w_2 = sx >> 1, h_2 = sy >> 1, j;
    int x[9] = { x0, x0 + sx, x0 + sx,
    x0, x0 + w_2, x0 + sx, x0 + w_2,
    x0, x0 + w_2 };
    int y[9] = { y0,
    y0, y0 + sy, y0 + sy,
    y0, y0 + h_2, y0 + sy, y0 + h_2, y0 + h_2 };

    for(int i = 0, i1 = 1; i < 4; ++i, i1 = (i1 + 1) % 4) {
        if(data[j = y[i + 4] * stride + x[i + 4]]) continue;
            data[j] = ((int)data[y[i] * stride + x[i]] +
            data[y[i1] * stride + x[i1]]) >> 1;
        }
        if(!data[j = y[8] * stride + x[8]]) {
            int v = 0;
            for(int i = 0; i < 4; ++i)
            v += data[y[i] * stride + x[i]];
            data[j] = v >> 2;
        }
        if(w_2 > 1) {
            triangleEdgeCPU(data, x[0], y[0], stride, w_2, h_2, ++p);
            triangleEdgeCPU(data, x[4], y[4], stride, w_2, h_2, p);
            triangleEdgeCPU(data, x[8], y[8], stride, w_2, h_2, p);
            triangleEdgeCPU(data, x[7], y[7], stride, w_2, h_2, p);
    }
}

void diamontCPU(int w, int h, unsigned char * data) {
	int sw1 = w - 1, sw2 = sw1 >> 1;
	int sh1 = h - 1, sh2 = sh1 >> 1;

	while(sw2){
		for(int y = sh2; y < h; y += sh1){
			for(int x = sw2; x < w; x += sw1){
				if(data[y * w + x]) continue;

				data[y * w + x] = (data[(y - sh2) * w + x - sw2] +
				data[(y - sh2) * w + x + sw2] +
				data[(y + sh2) * w + x + sw2] +
				data[(y + sh2) * w + x - sw2]) >> 2;
 			}
		}

		for(int y = 0; y < h; y += sh1){
			for(int x = sw2; x < w; x += sw1){
				int yp, xp;
				int nbp = 0, v = 0;

				if(data[y * w + x]) continue;
				yp = y - sh2; xp = x; // parent haut
				if(IN(xp, yp, w, h)){
					++nbp;
					v += data[yp * w + xp] ;
				}

				yp = y; xp = x + sw2; // parent droit
				if(IN(xp, yp, w, h)){
					++nbp;
					v += data[yp * w + xp] ;
				}
				yp = y + sh2; xp = x; // parent bas
				if(IN(xp, yp, w, h)){
					++nbp;
					v += data[yp * w + xp] ;
				}
				yp = y; xp = x - sw2; // parent gauche
				if(IN(xp, yp, w, h)){
					++nbp;
					v += data[yp * w + xp] ;
				} 
				data[y * w + x] = v / nbp;
 			}	
		}
		for(int y = sh2; y < h; y += sh1){
			for(int x = 0; x < w; x += sw1){
				int yp, xp;
				int nbp = 0, v = 0;

				if(data[y * w + x]) continue;
				yp = y - sh2; xp = x; // parent haut
				if(IN(xp, yp, w, h)){
					++nbp;
					v += data[yp * w + xp] ;
				}
				yp = y; xp = x + sw2; // parent droit
				if(IN(xp, yp, w, h)){
					++nbp;
					v += data[yp * w + xp] ;
				}
				yp = y + sh2; xp = x; // parent bas
				if(IN(xp, yp, w, h)){
					++nbp;
					v += data[yp * w + xp] ;
				}

				yp = y; xp = x - sw2; // parent gauche
				if(IN(xp, yp, w, h)){
					++nbp;
					v += data[yp * w + xp] ;
				}
				data[y * w + x] = v / nbp;
 			}
			
		}
		sw1 = sw2;
		sw2 >>= 1;
		sh1 = sh2;
		sh2 >>= 1;
	}
}

__global__ void generateImg(unsigned char * data, unsigned char * img, unsigned char * tabDepth, int4 * _tabParents, int i, int tailleTab) {
	int thx = blockIdx.x * blockDim.x + threadIdx.x;
	int thy = blockIdx.y * blockDim.y + threadIdx.y;
	int ThId = thy * tailleTab + thx;
	int nbPar = 0;

	if(data[ThId] == 0 && tabDepth[ThId] == i  && i != 1) {
	
		if(_tabParents[ThId].x != -1) nbPar ++;
		if(_tabParents[ThId].y != -1) nbPar ++;
		if(_tabParents[ThId].z != -1) nbPar ++;
		if(_tabParents[ThId].w != -1) nbPar ++;
		
		data[ThId] = (data[_tabParents[ThId].x] + data[_tabParents[ThId].y] + data[_tabParents[ThId].z] + data[_tabParents[ThId].w]) / nbPar;

		img[ThId] = data[ThId];
	}
	
}

void initTime(void) {
    gettimeofday(&ti, (struct timezone*) 0);
}

double getTime(void) {
    struct timeval t;
    double diff;
    gettimeofday(&t, (struct timezone*) 0);
    diff = (t.tv_sec - ti.tv_sec) * 1000000
    + (t.tv_usec - ti.tv_usec);
    return diff/1000.;
}
	.file	"tmpxft_0026861a_00000000-6_functions.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2038:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2038:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z2INiiii
	.type	_Z2INiiii, @function
_Z2INiiii:
.LFB2027:
	.cfi_startproc
	endbr64
	movl	%edi, %r8d
	xorl	%eax, %eax
	orl	%esi, %r8d
	js	.L2
	cmpl	%edx, %edi
	setl	%al
	cmpl	%ecx, %esi
	setl	%dl
	andl	%edx, %eax
.L2:
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z2INiiii, .-_Z2INiiii
	.globl	_Z7maxProfPhi
	.type	_Z7maxProfPhi, @function
_Z7maxProfPhi:
.LFB2028:
	.cfi_startproc
	endbr64
	xorl	%edx, %edx
	xorl	%eax, %eax
.L7:
	cmpl	%edx, %esi
	jle	.L9
	movzbl	(%rdi,%rdx), %ecx
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	incq	%rdx
	jmp	.L7
.L9:
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z7maxProfPhi, .-_Z7maxProfPhi
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Matrice de %s \n \n"
.LC1:
	.string	"%d "
.LC2:
	.string	"\n"
	.text
	.globl	_Z10displayMatPhPci
	.type	_Z10displayMatPhPci, @function
_Z10displayMatPhPci:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	leaq	.LC1(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movslq	%edx, %r14
	movq	%rsi, %rdx
	leaq	.LC0(%rip), %rsi
	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
	movq	%r14, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	movl	$2, %edi
	pushq	%rcx
	.cfi_def_cfa_offset 64
	call	__printf_chk@PLT
.L11:
	cmpl	%r12d, %r13d
	jge	.L16
	movq	%rbx, %rbp
.L12:
	movzbl	0(%rbp), %edx
	movq	%r15, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incq	%rbp
	call	__printf_chk@PLT
	leaq	(%rbx,%r14), %rax
	cmpq	%rax, %rbp
	jne	.L12
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	incl	%r13d
	movq	%rbp, %rbx
	movl	$2, %edi
	call	__printf_chk@PLT
	jmp	.L11
.L16:
	popq	%rdx
	.cfi_def_cfa_offset 56
	leaq	.LC2(%rip), %rsi
	popq	%rbx
	.cfi_def_cfa_offset 48
	movl	$2, %edi
	popq	%rbp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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	__printf_chk@PLT
	.cfi_endproc
.LFE2029:
	.size	_Z10displayMatPhPci, .-_Z10displayMatPhPci
	.globl	_Z12initArraysDsPhP4int4ii
	.type	_Z12initArraysDsPhP4int4ii, @function
_Z12initArraysDsPhP4int4ii:
.LFB2030:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edx, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	decl	%eax
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%eax, %r9d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	sarl	%r9d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$80, %rsp
	.cfi_def_cfa_offset 136
	movl	%eax, 24(%rsp)
	leal	-1(%rcx), %eax
	movq	%rdi, 40(%rsp)
	movl	%eax, %r14d
	movq	%rsi, 48(%rsp)
	sarl	%r14d
	movl	%edx, (%rsp)
	movl	%eax, 8(%rsp)
	movb	$2, 31(%rsp)
.L18:
	testl	%r9d, %r9d
	je	.L17
	movl	(%rsp), %esi
	movl	8(%rsp), %eax
	movl	%r14d, %r8d
	xorl	%edi, %edi
	imull	%esi, %eax
	movl	%eax, 12(%rsp)
	movl	%esi, %eax
	imull	%r14d, %eax
	movl	%eax, 4(%rsp)
	leal	(%rax,%rax), %esi
	movslq	24(%rsp), %rax
	movl	4(%rsp), %r10d
	movq	%rax, 16(%rsp)
	salq	$4, %rax
	movq	%rax, 32(%rsp)
	movb	31(%rsp), %al
	leal	-1(%rax), %ebp
	leal	(%r9,%r9), %eax
	movl	%eax, 60(%rsp)
.L40:
	cmpl	%ecx, %r8d
	jge	.L41
	movslq	%r10d, %r11
	movslq	%r9d, %rdx
	movq	48(%rsp), %rbx
	movl	60(%rsp), %r15d
	leaq	(%rdx,%r11), %rax
	leal	(%r9,%rsi), %r13d
	salq	$4, %rax
	addq	%rbx, %rax
	movq	40(%rsp), %rbx
	addq	%r11, %rbx
	movl	%edi, %r11d
	subl	%r9d, %r11d
	leal	(%r15,%r11), %r12d
	movl	%esi, %r15d
	subl	%r9d, %r15d
	movl	%r15d, 56(%rsp)
.L22:
	cmpl	%edx, (%rsp)
	jle	.L60
	cmpb	$0, (%rbx,%rdx)
	jne	.L19
	leal	(%r11,%rdx), %r15d
	movb	%bpl, (%rbx,%rdx)
	movl	%r15d, (%rax)
	leal	(%r12,%rdx), %r15d
	movl	%r15d, 4(%rax)
	leal	0(%r13,%rdx), %r15d
	movl	%r15d, 8(%rax)
	movl	56(%rsp), %r15d
	addl	%edx, %r15d
	movl	%r15d, 12(%rax)
.L19:
	movq	16(%rsp), %r15
	addq	%r15, %rdx
	movq	32(%rsp), %r15
	addq	%r15, %rax
	jmp	.L22
.L60:
	movl	8(%rsp), %eax
	addl	%eax, %r8d
	movl	12(%rsp), %eax
	addl	%eax, %r10d
	addl	%eax, %edi
	addl	%eax, %esi
	jmp	.L40
.L41:
	xorl	%r11d, %r11d
	xorl	%ebx, %ebx
.L21:
	cmpl	%ecx, %ebx
	jge	.L46
	movl	%ebx, %eax
	movl	4(%rsp), %esi
	movslq	%r11d, %r12
	movslq	%r9d, %r13
	subl	%r14d, %eax
	leaq	0(%r13,%r12), %r10
	leal	(%r9,%r11), %r15d
	movl	%eax, 60(%rsp)
	movl	%r11d, %eax
	salq	$4, %r10
	subl	%esi, %eax
	movl	%eax, 72(%rsp)
	leal	(%rbx,%r14), %eax
	movl	%eax, 64(%rsp)
	movl	%esi, %eax
	addl	%r11d, %eax
	movl	%eax, 68(%rsp)
	movq	48(%rsp), %rax
	addq	%rax, %r10
	movq	40(%rsp), %rax
	addq	%rax, %r12
	movl	%r11d, %eax
	subl	%r9d, %eax
	movl	%eax, 76(%rsp)
.L30:
	cmpl	%r13d, (%rsp)
	jle	.L61
	cmpb	$0, (%r12,%r13)
	jne	.L23
	movl	(%rsp), %edx
	movl	60(%rsp), %esi
	movl	%r13d, %edi
	movl	%r13d, 56(%rsp)
	movl	%r13d, %ebp
	call	_Z2INiiii
	movl	%eax, %edx
	orl	$-1, %eax
	testb	%dl, %dl
	je	.L24
	movl	72(%rsp), %eax
	addl	%r13d, %eax
.L24:
	movl	%eax, (%r10)
	movl	(%rsp), %edx
	leal	0(%rbp,%r9), %edi
	movl	%ebx, %esi
	call	_Z2INiiii
	movl	%eax, %edx
	orl	$-1, %eax
	testb	%dl, %dl
	je	.L25
	leal	(%r15,%rbp), %eax
.L25:
	movl	(%rsp), %edx
	movl	64(%rsp), %esi
	movl	%eax, 4(%r10)
	movl	56(%rsp), %edi
	call	_Z2INiiii
	movl	%eax, %edx
	orl	$-1, %eax
	testb	%dl, %dl
	je	.L26
	movl	68(%rsp), %eax
	addl	%ebp, %eax
.L26:
	movl	%eax, 8(%r10)
	movl	(%rsp), %edx
	movl	%ebp, %edi
	movl	%ebx, %esi
	subl	%r9d, %edi
	call	_Z2INiiii
	movl	%eax, %edx
	orl	$-1, %eax
	testb	%dl, %dl
	je	.L27
	movl	76(%rsp), %eax
	addl	%ebp, %eax
.L27:
	movl	%eax, 12(%r10)
	movb	31(%rsp), %al
	movb	%al, (%r12,%r13)
.L23:
	movq	16(%rsp), %rax
	addq	%rax, %r13
	movq	32(%rsp), %rax
	addq	%rax, %r10
	jmp	.L30
.L61:
	movl	8(%rsp), %eax
	addl	%eax, %ebx
	movl	12(%rsp), %eax
	addl	%eax, %r11d
	jmp	.L21
.L46:
	movl	4(%rsp), %r11d
	movl	%r14d, %ebx
.L29:
	cmpl	%ecx, %ebx
	jge	.L37
	movl	%ebx, %eax
	movl	4(%rsp), %esi
	movslq	%r11d, %r10
	xorl	%r13d, %r13d
	subl	%r14d, %eax
	leal	(%r9,%r11), %r12d
	movl	%eax, 56(%rsp)
	movl	%r11d, %eax
	leal	(%r11,%rsi), %r15d
	subl	%esi, %eax
	movl	%eax, 64(%rsp)
	leal	(%rbx,%r14), %eax
	movl	%eax, 60(%rsp)
	movq	40(%rsp), %rax
	leaq	(%rax,%r10), %rbp
	movq	48(%rsp), %rax
	salq	$4, %r10
	addq	%rax, %r10
	movl	%r11d, %eax
	subl	%r9d, %eax
	movl	%eax, 68(%rsp)
.L38:
	movl	(%rsp), %eax
	cmpl	%eax, %r13d
	jge	.L62
	cmpb	$0, 0(%rbp)
	jne	.L31
	movl	(%rsp), %edx
	movl	56(%rsp), %esi
	movl	%r13d, %edi
	call	_Z2INiiii
	movl	%eax, %edx
	orl	$-1, %eax
	testb	%dl, %dl
	je	.L32
	movl	64(%rsp), %eax
	addl	%r13d, %eax
.L32:
	movl	%eax, (%r10)
	movl	(%rsp), %edx
	leal	(%r9,%r13), %edi
	movl	%ebx, %esi
	call	_Z2INiiii
	movl	%eax, %edx
	orl	$-1, %eax
	testb	%dl, %dl
	je	.L33
	leal	(%r12,%r13), %eax
.L33:
	movl	(%rsp), %edx
	movl	60(%rsp), %esi
	movl	%eax, 4(%r10)
	movl	%r13d, %edi
	call	_Z2INiiii
	movl	%eax, %edx
	orl	$-1, %eax
	testb	%dl, %dl
	je	.L34
	leal	(%r15,%r13), %eax
.L34:
	movl	%eax, 8(%r10)
	movl	(%rsp), %edx
	movl	%r13d, %edi
	movl	%ebx, %esi
	subl	%r9d, %edi
	call	_Z2INiiii
	movl	%eax, %edx
	orl	$-1, %eax
	testb	%dl, %dl
	je	.L35
	movl	68(%rsp), %eax
	addl	%r13d, %eax
.L35:
	movl	%eax, 12(%r10)
	movb	31(%rsp), %al
	movb	%al, 0(%rbp)
.L31:
	movl	24(%rsp), %eax
	addl	%eax, %r13d
	movq	16(%rsp), %rax
	addq	%rax, %rbp
	movq	32(%rsp), %rax
	addq	%rax, %r10
	jmp	.L38
.L62:
	movl	8(%rsp), %eax
	addl	%eax, %ebx
	movl	12(%rsp), %eax
	addl	%eax, %r11d
	jmp	.L29
.L37:
	movl	%r14d, 8(%rsp)
	sarl	%r14d
	movl	%r9d, 24(%rsp)
	sarl	%r9d
	addb	$2, 31(%rsp)
	jmp	.L18
.L17:
	addq	$80, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2030:
	.size	_Z12initArraysDsPhP4int4ii, .-_Z12initArraysDsPhP4int4ii
	.globl	_Z12initArraysTePhP4int4iiiiii
	.type	_Z12initArraysTePhP4int4iiiiii, @function
_Z12initArraysTePhP4int4iiiiii:
.LFB2031:
	.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
	movl	%edx, %r14d
	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
	movl	%ecx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%r8d, %ebx
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 16(%rsp)
	movl	192(%rsp), %eax
	movq	%rsi, 24(%rsp)
	movl	200(%rsp), %r12d
	movq	%fs:40, %rdx
	movq	%rdx, 120(%rsp)
	xorl	%edx, %edx
.L75:
	movl	%eax, %r13d
	leaq	100(%rsp), %rdi
	addl	%ebp, %eax
	movl	%r9d, %esi
	sarl	%r13d
	addl	%r14d, %r9d
	movq	%rdi, 32(%rsp)
	leaq	64(%rsp), %rdi
	leal	0(%r13,%rbp), %r15d
	sarl	%esi
	movl	%r14d, 48(%rsp)
	xorl	%ecx, %ecx
	movl	%r9d, 52(%rsp)
	leaq	84(%rsp), %r10
	movl	%r9d, 56(%rsp)
	movl	%r14d, 60(%rsp)
	movl	%r9d, 68(%rsp)
	movl	%r14d, 76(%rsp)
	movl	%ebp, 84(%rsp)
	movl	%ebp, 88(%rsp)
	movl	%eax, 92(%rsp)
	movl	%eax, 96(%rsp)
	movl	%ebp, 100(%rsp)
	movl	%r15d, 104(%rsp)
	movl	%eax, 108(%rsp)
	movl	%r15d, 112(%rsp)
	movq	%rdi, 40(%rsp)
	movl	%esi, 8(%rsp)
	leal	(%rsi,%r14), %esi
	movl	%esi, 12(%rsp)
	movl	%esi, 64(%rsp)
	movl	%esi, 72(%rsp)
	movl	$1, %esi
.L65:
	movq	32(%rsp), %rdi
	movl	(%rdi,%rcx), %edx
	movq	40(%rsp), %rdi
	imull	%ebx, %edx
	addl	(%rdi,%rcx), %edx
	movq	16(%rsp), %rdi
	movslq	%edx, %rdx
	leaq	(%rdi,%rdx), %r8
	cmpb	$0, (%r8)
	jne	.L64
	movq	24(%rsp), %rdi
	salq	$4, %rdx
	movslq	%esi, %r11
	addq	%rdi, %rdx
	movl	(%rcx,%r10), %edi
	movq	$-1, 8(%rdx)
	imull	%ebx, %edi
	addl	48(%rsp,%rcx), %edi
	movl	%edi, (%rdx)
	movl	84(%rsp,%r11,4), %edi
	imull	%ebx, %edi
	addl	48(%rsp,%r11,4), %edi
	movl	%edi, 4(%rdx)
	movb	%r12b, (%r8)
.L64:
	incl	%esi
	addq	$4, %rcx
	andl	$3, %esi
	cmpq	$16, %rcx
	jne	.L65
	movl	%r15d, %edx
	movl	12(%rsp), %esi
	imull	%ebx, %edx
	addl	%esi, %edx
	movq	16(%rsp), %rsi
	movslq	%edx, %rdx
	leaq	(%rsi,%rdx), %rdi
	cmpb	$0, (%rdi)
	je	.L66
.L73:
	cmpl	$1, 8(%rsp)
	jle	.L78
	incl	%r12d
	movl	%ebp, %ecx
	movl	%ebx, %r8d
	movl	%r14d, %edx
	pushq	%r12
	.cfi_def_cfa_offset 200
	pushq	%r13
	.cfi_def_cfa_offset 208
	movl	24(%rsp), %r9d
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdi
	call	_Z12initArraysTePhP4int4iiiiii
	pushq	%r12
	.cfi_def_cfa_offset 216
	movl	%ebp, %ecx
	movl	%ebx, %r8d
	pushq	%r13
	.cfi_def_cfa_offset 224
	movl	40(%rsp), %r9d
	movl	%r15d, %ebp
	movl	44(%rsp), %edx
	movq	56(%rsp), %rsi
	movq	48(%rsp), %rdi
	call	_Z12initArraysTePhP4int4iiiiii
	addq	$32, %rsp
	.cfi_def_cfa_offset 192
	movl	%ebx, %r8d
	movl	%r15d, %ecx
	pushq	%r12
	.cfi_def_cfa_offset 200
	pushq	%r13
	.cfi_def_cfa_offset 208
	movl	24(%rsp), %r9d
	movl	28(%rsp), %edx
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdi
	call	_Z12initArraysTePhP4int4iiiiii
	popq	%rax
	.cfi_def_cfa_offset 200
	movl	%r13d, %eax
	popq	%rdx
	.cfi_def_cfa_offset 192
	movl	8(%rsp), %r9d
	jmp	.L75
.L66:
	movq	24(%rsp), %rsi
	salq	$4, %rdx
	xorl	%ecx, %ecx
	addq	%rsi, %rdx
	movl	%ebx, %esi
	imull	%ebp, %esi
	addl	%r14d, %esi
.L74:
	movb	%r12b, (%rdi)
	cmpl	$1, %ecx
	jne	.L69
	movl	%ebp, %ecx
	imull	%ebx, %ecx
	addl	%r9d, %ecx
	movl	%ecx, (%rdx)
	movl	$2, %ecx
	jmp	.L74
.L69:
	cmpl	$2, %ecx
	jne	.L71
	movl	%eax, %ecx
	imull	%ebx, %ecx
	addl	%r9d, %ecx
	movl	%ecx, 4(%rdx)
	movl	$3, %ecx
	jmp	.L74
.L71:
	cmpl	$3, %ecx
	jne	.L72
	imull	%ebx, %eax
	addl	%r14d, %eax
	movl	%eax, 8(%rdx)
	jmp	.L73
.L72:
	movl	%esi, 12(%rdx)
	movl	$1, %ecx
	jmp	.L74
.L78:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L76
	call	__stack_chk_fail@PLT
.L76:
	addq	$136, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2031:
	.size	_Z12initArraysTePhP4int4iiiiii, .-_Z12initArraysTePhP4int4iiiiii
	.globl	_Z15triangleEdgeCPUPhiiiiii
	.type	_Z15triangleEdgeCPUPhiiiiii, @function
_Z15triangleEdgeCPUPhiiiiii:
.LFB2032:
	.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
	movl	%esi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%ecx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edx, %ebx
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
.L86:
	movl	%r8d, %eax
	movl	%r13d, 16(%rsp)
	addl	%r13d, %r8d
	xorl	%edx, %edx
	sarl	%eax
	movl	%ebx, 52(%rsp)
	movl	$1, %ecx
	leaq	68(%rsp), %r10
	movl	%eax, 8(%rsp)
	movl	%r9d, %eax
	addl	%ebx, %r9d
	leaq	32(%rsp), %r11
	sarl	%eax
	movl	%r13d, 28(%rsp)
	movl	%eax, 12(%rsp)
	movl	8(%rsp), %eax
	movl	%r13d, 44(%rsp)
	leal	(%rax,%r13), %r15d
	movl	12(%rsp), %eax
	movl	%ebx, 56(%rsp)
	movl	%r15d, 32(%rsp)
	leal	(%rax,%rbx), %r14d
	movl	%r15d, 40(%rsp)
	movl	%r9d, 60(%rsp)
	movl	%r9d, 64(%rsp)
	movl	%ebx, 68(%rsp)
	movl	%r14d, 72(%rsp)
	movl	%r9d, 76(%rsp)
	movl	%r14d, 80(%rsp)
	movl	%r8d, 20(%rsp)
	movl	%r8d, 24(%rsp)
	movl	%r8d, 36(%rsp)
	leaq	52(%rsp), %r8
.L82:
	movl	(%r10,%rdx), %eax
	imull	%r12d, %eax
	addl	(%r11,%rdx), %eax
	cltq
	addq	%rbp, %rax
	cmpb	$0, (%rax)
	jne	.L81
	movslq	%ecx, %r9
	movl	(%rdx,%r8), %esi
	movl	52(%rsp,%r9,4), %edi
	imull	%r12d, %esi
	addl	16(%rsp,%rdx), %esi
	imull	%r12d, %edi
	addl	16(%rsp,%r9,4), %edi
	movslq	%esi, %rsi
	movslq	%edi, %rdi
	movzbl	0(%rbp,%rsi), %esi
	movzbl	0(%rbp,%rdi), %edi
	addl	%edi, %esi
	sarl	%esi
	movb	%sil, (%rax)
.L81:
	incl	%ecx
	addq	$4, %rdx
	andl	$3, %ecx
	cmpq	$16, %rdx
	jne	.L82
	movl	%r14d, %eax
	imull	%r12d, %eax
	addl	%r15d, %eax
	cltq
	addq	%rbp, %rax
	cmpb	$0, (%rax)
	jne	.L83
	xorl	%ecx, %ecx
	xorl	%edx, %edx
.L84:
	movl	(%r8,%rcx), %esi
	imull	%r12d, %esi
	addl	16(%rsp,%rcx), %esi
	addq	$4, %rcx
	movslq	%esi, %rsi
	movzbl	0(%rbp,%rsi), %esi
	addl	%esi, %edx
	cmpq	$16, %rcx
	jne	.L84
	sarl	$2, %edx
	movb	%dl, (%rax)
.L83:
	cmpl	$1, 8(%rsp)
	jle	.L80
	incl	160(%rsp)
	movl	%ebx, %edx
	movl	%r12d, %ecx
	movl	%r13d, %esi
	pushq	%rax
	.cfi_def_cfa_offset 168
	movl	168(%rsp), %eax
	movq	%rbp, %rdi
	pushq	%rax
	.cfi_def_cfa_offset 176
	movl	28(%rsp), %r9d
	movl	24(%rsp), %r8d
	call	_Z15triangleEdgeCPUPhiiiiii
	movl	28(%rsp), %r9d
	movl	%ebx, %edx
	movl	%r12d, %ecx
	movl	176(%rsp), %eax
	movl	%r15d, %esi
	movq	%rbp, %rdi
	movl	%r14d, %ebx
	movl	24(%rsp), %r8d
	movl	%eax, (%rsp)
	call	_Z15triangleEdgeCPUPhiiiiii
	movl	28(%rsp), %r9d
	movl	%r12d, %ecx
	movl	%r14d, %edx
	movl	176(%rsp), %eax
	movl	24(%rsp), %r8d
	movl	%r15d, %esi
	movq	%rbp, %rdi
	movl	%eax, (%rsp)
	call	_Z15triangleEdgeCPUPhiiiiii
	popq	%rdx
	.cfi_def_cfa_offset 168
	popq	%rcx
	.cfi_def_cfa_offset 160
	movl	12(%rsp), %r9d
	movl	8(%rsp), %r8d
	jmp	.L86
.L80:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L87
	call	__stack_chk_fail@PLT
.L87:
	addq	$104, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2032:
	.size	_Z15triangleEdgeCPUPhiiiiii, .-_Z15triangleEdgeCPUPhiiiiii
	.globl	_Z10diamontCPUiiPh
	.type	_Z10diamontCPUiiPh, @function
_Z10diamontCPUiiPh:
.LFB2033:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edi, %eax
	movq	%rdx, %r10
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	decl	%eax
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%eax, %r9d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	sarl	%r9d
	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
	movl	%eax, 12(%rsp)
	movl	%esi, %eax
	decl	%eax
	movl	%edi, (%rsp)
	movl	%esi, 4(%rsp)
	movl	%eax, %r15d
	movl	%eax, 16(%rsp)
	sarl	%r15d
.L92:
	testl	%r9d, %r9d
	je	.L91
	movl	(%rsp), %ecx
	movl	16(%rsp), %eax
	movl	%r15d, %r8d
	xorl	%esi, %esi
	movslq	12(%rsp), %r12
	leal	(%r9,%r9), %ebp
	imull	%ecx, %eax
	movl	%eax, 20(%rsp)
	movl	%ecx, %eax
	imull	%r15d, %eax
	movl	%eax, 8(%rsp)
	leal	(%rax,%rax), %edi
.L114:
	movl	4(%rsp), %eax
	cmpl	%eax, %r8d
	jge	.L115
	movl	8(%rsp), %ecx
	movl	%edi, %edx
	movl	%esi, %ebx
	movslq	%r9d, %rax
	subl	%r9d, %edx
	subl	%r9d, %ebx
	leal	(%r9,%rdi), %r14d
	addl	%esi, %ecx
	movl	%edx, 24(%rsp)
	leal	0(%rbp,%rbx), %r13d
	movslq	%ecx, %rcx
	addq	%r10, %rcx
.L96:
	cmpl	%eax, (%rsp)
	jle	.L138
	cmpb	$0, (%rcx,%rax)
	jne	.L93
	leal	0(%r13,%rax), %edx
	leal	(%rbx,%rax), %r11d
	movslq	%edx, %rdx
	movslq	%r11d, %r11
	movzbl	(%r10,%r11), %r11d
	movzbl	(%r10,%rdx), %edx
	addl	%r11d, %edx
	leal	(%r14,%rax), %r11d
	movslq	%r11d, %r11
	movzbl	(%r10,%r11), %r11d
	addl	%r11d, %edx
	movl	24(%rsp), %r11d
	addl	%eax, %r11d
	movslq	%r11d, %r11
	movzbl	(%r10,%r11), %r11d
	addl	%r11d, %edx
	sarl	$2, %edx
	movb	%dl, (%rcx,%rax)
.L93:
	addq	%r12, %rax
	jmp	.L96
.L138:
	movl	16(%rsp), %eax
	addl	%eax, %r8d
	movl	20(%rsp), %eax
	addl	%eax, %esi
	addl	%eax, %edi
	jmp	.L114
.L115:
	movslq	12(%rsp), %rax
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	movq	%rax, 64(%rsp)
.L95:
	movl	4(%rsp), %eax
	cmpl	%eax, %r14d
	jge	.L117
	movl	%r14d, %eax
	movl	8(%rsp), %ecx
	movslq	%r9d, %r12
	subl	%r15d, %eax
	movl	%eax, 36(%rsp)
	movl	%r13d, %eax
	subl	%ecx, %eax
	movl	%eax, 56(%rsp)
	leal	(%r14,%r15), %eax
	movl	%eax, 40(%rsp)
	movl	%ecx, %eax
	addl	%r13d, %eax
	movl	%eax, 44(%rsp)
	movslq	%r13d, %rax
	addq	%r10, %rax
	movq	%rax, 24(%rsp)
	movl	%r13d, %eax
	subl	%r9d, %eax
	movl	%eax, 48(%rsp)
	leal	(%r9,%r13), %eax
	movl	%eax, 60(%rsp)
.L104:
	cmpl	%r12d, (%rsp)
	jle	.L139
	movq	24(%rsp), %rax
	cmpb	$0, (%rax,%r12)
	jne	.L97
	movl	4(%rsp), %ecx
	movl	(%rsp), %edx
	movl	%r12d, %edi
	movl	%r12d, 32(%rsp)
	movl	36(%rsp), %esi
	movl	%r12d, %ebx
	call	_Z2INiiii
	testb	%al, %al
	je	.L116
	movl	56(%rsp), %eax
	movl	$1, %ebp
	addl	%r12d, %eax
	cltq
	movzbl	(%r10,%rax), %r11d
	jmp	.L98
.L116:
	xorl	%r11d, %r11d
	xorl	%ebp, %ebp
.L98:
	movl	4(%rsp), %ecx
	movl	(%rsp), %edx
	leal	(%rbx,%r9), %edi
	movl	%r14d, %esi
	call	_Z2INiiii
	testb	%al, %al
	je	.L99
	movl	60(%rsp), %eax
	incl	%ebp
	addl	%ebx, %eax
	cltq
	movzbl	(%r10,%rax), %eax
	addl	%eax, %r11d
.L99:
	movl	4(%rsp), %ecx
	movl	(%rsp), %edx
	movl	40(%rsp), %esi
	movl	32(%rsp), %edi
	call	_Z2INiiii
	testb	%al, %al
	je	.L100
	movl	44(%rsp), %eax
	incl	%ebp
	addl	%ebx, %eax
	cltq
	movzbl	(%r10,%rax), %eax
	addl	%eax, %r11d
.L100:
	movl	%ebx, %edi
	movl	4(%rsp), %ecx
	movl	(%rsp), %edx
	movl	%r14d, %esi
	subl	%r9d, %edi
	call	_Z2INiiii
	testb	%al, %al
	je	.L101
	movl	48(%rsp), %eax
	incl	%ebp
	addl	%eax, %ebx
	movslq	%ebx, %rbx
	movzbl	(%r10,%rbx), %eax
	addl	%eax, %r11d
.L101:
	movl	%r11d, %eax
	movq	24(%rsp), %rsi
	cltd
	idivl	%ebp
	movb	%al, (%rsi,%r12)
.L97:
	movq	64(%rsp), %rax
	addq	%rax, %r12
	jmp	.L104
.L139:
	movl	16(%rsp), %eax
	addl	%eax, %r14d
	movl	20(%rsp), %eax
	addl	%eax, %r13d
	jmp	.L95
.L117:
	movslq	12(%rsp), %rax
	movl	8(%rsp), %ebp
	movl	%r15d, %r12d
	movq	%rax, 48(%rsp)
.L103:
	movl	4(%rsp), %eax
	cmpl	%eax, %r12d
	jge	.L111
	movl	%r12d, %eax
	movl	8(%rsp), %esi
	movslq	%ebp, %r13
	xorl	%r14d, %r14d
	subl	%r15d, %eax
	addq	%r10, %r13
	movl	%eax, 24(%rsp)
	movl	%ebp, %eax
	subl	%esi, %eax
	movl	%eax, 36(%rsp)
	leal	(%r12,%r15), %eax
	movl	%eax, 32(%rsp)
	movl	%esi, %eax
	addl	%ebp, %eax
	movl	%eax, 40(%rsp)
	movl	%ebp, %eax
	subl	%r9d, %eax
	movl	%eax, 44(%rsp)
	leal	(%r9,%rbp), %eax
	movl	%eax, 56(%rsp)
.L112:
	movl	(%rsp), %eax
	cmpl	%eax, %r14d
	jge	.L140
	cmpb	$0, 0(%r13)
	jne	.L105
	movl	4(%rsp), %ecx
	movl	(%rsp), %edx
	movl	%r14d, %edi
	movl	24(%rsp), %esi
	call	_Z2INiiii
	testb	%al, %al
	je	.L118
	movl	36(%rsp), %eax
	movl	$1, %ebx
	addl	%r14d, %eax
	cltq
	movzbl	(%r10,%rax), %r11d
	jmp	.L106
.L118:
	xorl	%r11d, %r11d
	xorl	%ebx, %ebx
.L106:
	movl	4(%rsp), %ecx
	movl	(%rsp), %edx
	leal	(%r9,%r14), %edi
	movl	%r12d, %esi
	call	_Z2INiiii
	testb	%al, %al
	je	.L107
	movl	56(%rsp), %eax
	incl	%ebx
	addl	%r14d, %eax
	cltq
	movzbl	(%r10,%rax), %eax
	addl	%eax, %r11d
.L107:
	movl	4(%rsp), %ecx
	movl	(%rsp), %edx
	movl	%r14d, %edi
	movl	32(%rsp), %esi
	call	_Z2INiiii
	testb	%al, %al
	je	.L108
	movl	40(%rsp), %eax
	incl	%ebx
	addl	%r14d, %eax
	cltq
	movzbl	(%r10,%rax), %eax
	addl	%eax, %r11d
.L108:
	movl	%r14d, %edi
	movl	4(%rsp), %ecx
	movl	(%rsp), %edx
	movl	%r12d, %esi
	subl	%r9d, %edi
	call	_Z2INiiii
	testb	%al, %al
	je	.L109
	movl	44(%rsp), %eax
	incl	%ebx
	addl	%r14d, %eax
	cltq
	movzbl	(%r10,%rax), %eax
	addl	%eax, %r11d
.L109:
	movl	%r11d, %eax
	cltd
	idivl	%ebx
	movb	%al, 0(%r13)
.L105:
	movl	12(%rsp), %eax
	addl	%eax, %r14d
	movq	48(%rsp), %rax
	addq	%rax, %r13
	jmp	.L112
.L140:
	movl	16(%rsp), %eax
	addl	%eax, %r12d
	movl	20(%rsp), %eax
	addl	%eax, %ebp
	jmp	.L103
.L111:
	movl	%r15d, 16(%rsp)
	sarl	%r15d
	movl	%r9d, 12(%rsp)
	sarl	%r9d
	jmp	.L92
.L91:
	addq	$72, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2033:
	.size	_Z10diamontCPUiiPh, .-_Z10diamontCPUiiPh
	.globl	_Z8initTimev
	.type	_Z8initTimev, @function
_Z8initTimev:
.LFB2034:
	.cfi_startproc
	endbr64
	xorl	%esi, %esi
	leaq	_ZL2ti(%rip), %rdi
	jmp	gettimeofday@PLT
	.cfi_endproc
.LFE2034:
	.size	_Z8initTimev, .-_Z8initTimev
	.globl	_Z7getTimev
	.type	_Z7getTimev, @function
_Z7getTimev:
.LFB2035:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
	call	gettimeofday@PLT
	movq	8(%rsp), %rax
	subq	_ZL2ti(%rip), %rax
	imulq	$1000000, %rax, %rax
	addq	16(%rsp), %rax
	subq	8+_ZL2ti(%rip), %rax
	cvtsi2sdq	%rax, %xmm0
	divsd	.LC3(%rip), %xmm0
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L143
	call	__stack_chk_fail@PLT
.L143:
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2035:
	.size	_Z7getTimev, .-_Z7getTimev
	.globl	_Z43__device_stub__Z11generateImgPhS_S_P4int4iiPhS_S_P4int4ii
	.type	_Z43__device_stub__Z11generateImgPhS_S_P4int4iiPhS_S_P4int4ii, @function
_Z43__device_stub__Z11generateImgPhS_S_P4int4iiPhS_S_P4int4ii:
.LFB2060:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	64(%rsp), %rcx
	movl	%r8d, 12(%rsp)
	movl	%r9d, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L145
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z11generateImgPhS_S_P4int4ii(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 208
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L145:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L147
	call	__stack_chk_fail@PLT
.L147:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2060:
	.size	_Z43__device_stub__Z11generateImgPhS_S_P4int4iiPhS_S_P4int4ii, .-_Z43__device_stub__Z11generateImgPhS_S_P4int4iiPhS_S_P4int4ii
	.globl	_Z11generateImgPhS_S_P4int4ii
	.type	_Z11generateImgPhS_S_P4int4ii, @function
_Z11generateImgPhS_S_P4int4ii:
.LFB2061:
	.cfi_startproc
	endbr64
	jmp	_Z43__device_stub__Z11generateImgPhS_S_P4int4iiPhS_S_P4int4ii
	.cfi_endproc
.LFE2061:
	.size	_Z11generateImgPhS_S_P4int4ii, .-_Z11generateImgPhS_S_P4int4ii
	.section	.rodata.str1.1
.LC4:
	.string	"_Z11generateImgPhS_S_P4int4ii"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2063:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 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	.LC4(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z11generateImgPhS_S_P4int4ii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	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	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2063:
	.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
	.local	_ZL2ti
	.comm	_ZL2ti,16,16
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	0
	.long	1083129856
	.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 <stdlib.h>
#include <sys/time.h>

static struct timeval ti;

bool IN(int x, int y, int w, int h) {
	return (x) >= 0 && (y) >= 0 && (x) < (w) && (y) < (h);
}

int maxProf(unsigned char * arr, int matDim){
	int max_value = 0;

	for (int i = 0; i < matDim; ++i) {
		if (arr[i] > max_value)
			max_value = arr[i];
	}

	return max_value;
}

void displayMat(unsigned char * arr, char * name, int matDim){
	printf("Matrice de %s \n \n", name);
	for(int y = 0; y < matDim; ++y){
    	for(int x = 0; x < matDim; ++x){
        	printf("%d ", (int)arr[y * matDim + x]);
      	}
		printf("\n");
	}
	printf("\n");	
}

void initArraysDs(unsigned char * _tabDepth, int4 * _tabParents, int w, int h) {
	int sw1 = w - 1, sw2 = sw1 >> 1;
	int sh1 = h - 1, sh2 = sh1 >> 1;
	int niveau = 1;
	while(sw2){
		for(int y = sh2; y < h; y += sh1){
			for(int x = sw2; x < w; x += sw1){
				if(_tabDepth[y * w + x]) continue;
				_tabDepth[y * w + x] = niveau;
				_tabParents[y * w + x].x = (y - sh2) * w + x - sw2;
 				_tabParents[y * w + x].y = (y - sh2) * w + x + sw2;
 				_tabParents[y * w + x].z = (y + sh2) * w + x + sw2;
				_tabParents[y * w + x].w = (y + sh2) * w + x - sw2;
 			}

		}
		niveau++; 
		for(int y = 0; y < h; y += sh1){
			for(int x = sw2; x < w; x += sw1){
				int yp, xp;
				if(_tabDepth[y * w + x]) continue;
				yp = y - sh2; xp = x; // parent haut
				if(IN(xp, yp, w, h)){
					_tabParents[y * w + x].x = yp * w + xp;
				} else{
					_tabParents[y * w + x].x = -1;
				}
				yp = y; xp = x + sw2; // parent droit
				if(IN(xp, yp, w, h)){
					_tabParents[y * w + x].y = yp * w + xp;
				} else{
					_tabParents[y * w + x].y = -1;
				}
				yp = y + sh2; xp = x; // parent bas
				if(IN(xp, yp, w, h)){
					_tabParents[y * w + x].z = yp * w + xp;
				} else{
					_tabParents[y * w + x].z = -1;
				}
				yp = y; xp = x - sw2; // parent gauche
				if(IN(xp, yp, w, h)){
					_tabParents[y * w + x].w = yp * w + xp;
				} else{
					_tabParents[y * w + x].w = -1;
				}
				_tabDepth[y * w + x] = niveau;
 			}
			
		}
		for(int y = sh2; y < h; y += sh1){
			for(int x = 0; x < w; x += sw1){
				int yp, xp;
				if(_tabDepth[y * w + x]) continue;
				yp = y - sh2; xp = x; // parent haut
				if(IN(xp, yp, w, h)){
					_tabParents[y * w + x].x = yp * w + xp;
				} else{
					_tabParents[y * w + x].x = -1;
				}
				yp = y; xp = x + sw2; // parent droit
				if(IN(xp, yp, w, h)){
					_tabParents[y * w + x].y = yp * w + xp;
				} else{
					_tabParents[y * w + x].y = -1;
				}
				yp = y + sh2; xp = x; // parent bas
				if(IN(xp, yp, w, h)){
					_tabParents[y * w + x].z = yp * w + xp;
				} else{
					_tabParents[y * w + x].z = -1;
				}
				yp = y; xp = x - sw2; // parent gauche
				if(IN(xp, yp, w, h)){
					_tabParents[y * w + x].w = yp * w + xp;
				} else{
					_tabParents[y * w + x].w = -1;
				}
				_tabDepth[y * w + x] = niveau;
 			}
			
		}
		niveau ++;
		sw1 = sw2;
		sw2 >>= 1;
		sh1 = sh2;
		sh2 >>= 1;
	}
}

void initArraysTe(unsigned char * _tabDepth, int4 * _tabParents, int x0, int y0, int stride, int sx, int sy, int p) {
	int w_2 = sx >> 1, h_2 = sy >> 1, j;
    int x[9] = { x0, x0 + sx, x0 + sx,
    x0, x0 + w_2, x0 + sx, x0 + w_2,
    x0, x0 + w_2 };
    int y[9] = { y0,
    y0, y0 + sy, y0 + sy,
    y0, y0 + h_2, y0 + sy, y0 + h_2, y0 + h_2 };

    for(int i = 0, i1 = 1; i < 4; ++i, i1 = (i1 + 1) % 4) {
		if(_tabDepth[j = y[i + 4] * stride + x[i + 4]]) continue;
			//Parents			
			_tabParents[j].x = y[i] * stride + x[i];
			_tabParents[j].y = y[i1] * stride + x[i1];
			_tabParents[j].z = -1;
			_tabParents[j].w = -1;
			//prof
			_tabDepth[j] = p;
        }

		if(!_tabDepth[j = y[8] * stride + x[8]]) {
            for(int i = 0; i < 4; ++i) {
				//prof
				_tabDepth[j] = p;
				//Tab parent
				if(i == 1){
					_tabParents[j].x = y[i] * stride + x[i];
				} else if(i == 2){
					_tabParents[j].y = y[i] * stride + x[i];
				} else if(i == 3) {
					_tabParents[j].z = y[i] * stride + x[i];
				} else {
					_tabParents[j].w = y[i] * stride + x[i];
				}
			}
			
        }
        if(w_2 > 1) {
            initArraysTe(_tabDepth, _tabParents, x[0], y[0], stride, w_2, h_2, ++p);
            initArraysTe(_tabDepth, _tabParents, x[4], y[4], stride, w_2, h_2, p);
            initArraysTe(_tabDepth, _tabParents, x[8], y[8], stride, w_2, h_2, p);
            initArraysTe(_tabDepth, _tabParents, x[7], y[7], stride, w_2, h_2, p);
    }
}

void triangleEdgeCPU(unsigned char * data, int x0, int y0, int stride, int sx, int sy, int p) {
	int niveau = 1;
	
    int w_2 = sx >> 1, h_2 = sy >> 1, j;
    int x[9] = { x0, x0 + sx, x0 + sx,
    x0, x0 + w_2, x0 + sx, x0 + w_2,
    x0, x0 + w_2 };
    int y[9] = { y0,
    y0, y0 + sy, y0 + sy,
    y0, y0 + h_2, y0 + sy, y0 + h_2, y0 + h_2 };

    for(int i = 0, i1 = 1; i < 4; ++i, i1 = (i1 + 1) % 4) {
        if(data[j = y[i + 4] * stride + x[i + 4]]) continue;
            data[j] = ((int)data[y[i] * stride + x[i]] +
            data[y[i1] * stride + x[i1]]) >> 1;
        }
        if(!data[j = y[8] * stride + x[8]]) {
            int v = 0;
            for(int i = 0; i < 4; ++i)
            v += data[y[i] * stride + x[i]];
            data[j] = v >> 2;
        }
        if(w_2 > 1) {
            triangleEdgeCPU(data, x[0], y[0], stride, w_2, h_2, ++p);
            triangleEdgeCPU(data, x[4], y[4], stride, w_2, h_2, p);
            triangleEdgeCPU(data, x[8], y[8], stride, w_2, h_2, p);
            triangleEdgeCPU(data, x[7], y[7], stride, w_2, h_2, p);
    }
}

void diamontCPU(int w, int h, unsigned char * data) {
	int sw1 = w - 1, sw2 = sw1 >> 1;
	int sh1 = h - 1, sh2 = sh1 >> 1;

	while(sw2){
		for(int y = sh2; y < h; y += sh1){
			for(int x = sw2; x < w; x += sw1){
				if(data[y * w + x]) continue;

				data[y * w + x] = (data[(y - sh2) * w + x - sw2] +
				data[(y - sh2) * w + x + sw2] +
				data[(y + sh2) * w + x + sw2] +
				data[(y + sh2) * w + x - sw2]) >> 2;
 			}
		}

		for(int y = 0; y < h; y += sh1){
			for(int x = sw2; x < w; x += sw1){
				int yp, xp;
				int nbp = 0, v = 0;

				if(data[y * w + x]) continue;
				yp = y - sh2; xp = x; // parent haut
				if(IN(xp, yp, w, h)){
					++nbp;
					v += data[yp * w + xp] ;
				}

				yp = y; xp = x + sw2; // parent droit
				if(IN(xp, yp, w, h)){
					++nbp;
					v += data[yp * w + xp] ;
				}
				yp = y + sh2; xp = x; // parent bas
				if(IN(xp, yp, w, h)){
					++nbp;
					v += data[yp * w + xp] ;
				}
				yp = y; xp = x - sw2; // parent gauche
				if(IN(xp, yp, w, h)){
					++nbp;
					v += data[yp * w + xp] ;
				} 
				data[y * w + x] = v / nbp;
 			}	
		}
		for(int y = sh2; y < h; y += sh1){
			for(int x = 0; x < w; x += sw1){
				int yp, xp;
				int nbp = 0, v = 0;

				if(data[y * w + x]) continue;
				yp = y - sh2; xp = x; // parent haut
				if(IN(xp, yp, w, h)){
					++nbp;
					v += data[yp * w + xp] ;
				}
				yp = y; xp = x + sw2; // parent droit
				if(IN(xp, yp, w, h)){
					++nbp;
					v += data[yp * w + xp] ;
				}
				yp = y + sh2; xp = x; // parent bas
				if(IN(xp, yp, w, h)){
					++nbp;
					v += data[yp * w + xp] ;
				}

				yp = y; xp = x - sw2; // parent gauche
				if(IN(xp, yp, w, h)){
					++nbp;
					v += data[yp * w + xp] ;
				}
				data[y * w + x] = v / nbp;
 			}
			
		}
		sw1 = sw2;
		sw2 >>= 1;
		sh1 = sh2;
		sh2 >>= 1;
	}
}

__global__ void generateImg(unsigned char * data, unsigned char * img, unsigned char * tabDepth, int4 * _tabParents, int i, int tailleTab) {
	int thx = blockIdx.x * blockDim.x + threadIdx.x;
	int thy = blockIdx.y * blockDim.y + threadIdx.y;
	int ThId = thy * tailleTab + thx;
	int nbPar = 0;

	if(data[ThId] == 0 && tabDepth[ThId] == i  && i != 1) {
	
		if(_tabParents[ThId].x != -1) nbPar ++;
		if(_tabParents[ThId].y != -1) nbPar ++;
		if(_tabParents[ThId].z != -1) nbPar ++;
		if(_tabParents[ThId].w != -1) nbPar ++;
		
		data[ThId] = (data[_tabParents[ThId].x] + data[_tabParents[ThId].y] + data[_tabParents[ThId].z] + data[_tabParents[ThId].w]) / nbPar;

		img[ThId] = data[ThId];
	}
	
}

void initTime(void) {
    gettimeofday(&ti, (struct timezone*) 0);
}

double getTime(void) {
    struct timeval t;
    double diff;
    gettimeofday(&t, (struct timezone*) 0);
    diff = (t.tv_sec - ti.tv_sec) * 1000000
    + (t.tv_usec - ti.tv_usec);
    return diff/1000.;
}
	.text
	.file	"functions.hip"
	.globl	_Z2INiiii                       # -- Begin function _Z2INiiii
	.type	_Z2INiiii,@function
_Z2INiiii:                              # @_Z2INiiii
	.cfi_startproc
# %bb.0:
	movl	%esi, %eax
	orl	%edi, %eax
	setns	%r8b
	cmpl	%edx, %edi
	setl	%dl
	cmpl	%ecx, %esi
	setl	%al
	andb	%dl, %al
	andb	%r8b, %al
	retq
.Lfunc_end0:
	.size	_Z2INiiii, .Lfunc_end0-_Z2INiiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z7maxProfPhi                   # -- Begin function _Z7maxProfPhi
	.type	_Z7maxProfPhi,@function
_Z7maxProfPhi:                          # @_Z7maxProfPhi
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB1_1
# %bb.3:                                # %.lr.ph.preheader
	movl	%esi, %ecx
	xorl	%edx, %edx
	xorl	%esi, %esi
.LBB1_4:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movzbl	(%rdi,%rdx), %eax
	cmpl	%eax, %esi
	cmovgl	%esi, %eax
	incq	%rdx
	movl	%eax, %esi
	cmpq	%rdx, %rcx
	jne	.LBB1_4
# %bb.2:                                # %._crit_edge
	retq
.LBB1_1:
	xorl	%eax, %eax
	retq
.Lfunc_end1:
	.size	_Z7maxProfPhi, .Lfunc_end1-_Z7maxProfPhi
	.cfi_endproc
                                        # -- End function
	.globl	_Z10displayMatPhPci             # -- Begin function _Z10displayMatPhPci
	.type	_Z10displayMatPhPci,@function
_Z10displayMatPhPci:                    # @_Z10displayMatPhPci
	.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
	movl	%edx, %ebx
	movq	%rdi, (%rsp)                    # 8-byte Spill
	movl	$.L.str, %edi
	xorl	%eax, %eax
	callq	printf
	testl	%ebx, %ebx
	jle	.LBB2_5
# %bb.1:                                # %.preheader.lr.ph
	movl	%ebx, %r15d
	xorl	%ebp, %ebp
	xorl	%r12d, %r12d
.LBB2_2:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_3 Depth 2
	movl	%ebp, %r13d
	addq	(%rsp), %r13                    # 8-byte Folded Reload
	xorl	%r14d, %r14d
.LBB2_3:                                #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movzbl	(%r13,%r14), %esi
	movl	$.L.str.1, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r14
	cmpq	%r14, %r15
	jne	.LBB2_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB2_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incq	%r12
	addl	%ebx, %ebp
	cmpq	%r15, %r12
	jne	.LBB2_2
.LBB2_5:                                # %._crit_edge15
	movl	$10, %edi
	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	putchar@PLT                     # TAILCALL
.Lfunc_end2:
	.size	_Z10displayMatPhPci, .Lfunc_end2-_Z10displayMatPhPci
	.cfi_endproc
                                        # -- End function
	.globl	_Z12initArraysDsPhP15HIP_vector_typeIiLj4EEii # -- Begin function _Z12initArraysDsPhP15HIP_vector_typeIiLj4EEii
	.type	_Z12initArraysDsPhP15HIP_vector_typeIiLj4EEii,@function
_Z12initArraysDsPhP15HIP_vector_typeIiLj4EEii: # @_Z12initArraysDsPhP15HIP_vector_typeIiLj4EEii
	.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	$40, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
                                        # kill: def $ecx killed $ecx def $rcx
	movq	%rcx, -48(%rsp)                 # 8-byte Spill
                                        # kill: def $edx killed $edx def $rdx
	movq	%rsi, -56(%rsp)                 # 8-byte Spill
	movq	%rdi, -8(%rsp)                  # 8-byte Spill
	movq	%rdx, %rax
	movq	%rdx, -120(%rsp)                # 8-byte Spill
	decl	%edx
	cmpl	$2, %edx
	jb	.LBB3_39
# %bb.1:                                # %.preheader284.lr.ph
	movq	-48(%rsp), %rax                 # 8-byte Reload
	leal	-1(%rax), %ecx
	movl	%ecx, -128(%rsp)                # 4-byte Spill
	movq	-120(%rsp), %rcx                # 8-byte Reload
	movslq	%ecx, %r15
	cltq
	movq	%rax, -112(%rsp)                # 8-byte Spill
	leal	(%rcx,%rcx), %eax
	movl	%eax, -60(%rsp)                 # 4-byte Spill
	addq	$12, -56(%rsp)                  # 8-byte Folded Spill
	movq	%r15, %rax
	shlq	$4, %rax
	movq	%rax, -16(%rsp)                 # 8-byte Spill
	movl	$1, %eax
	movq	%rax, -24(%rsp)                 # 8-byte Spill
.LBB3_2:                                # %.preheader284
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_4 Depth 2
                                        #       Child Loop BB3_14 Depth 3
                                        #     Child Loop BB3_8 Depth 2
                                        #       Child Loop BB3_10 Depth 3
                                        #     Child Loop BB3_19 Depth 2
                                        #       Child Loop BB3_21 Depth 3
	movl	-128(%rsp), %eax                # 4-byte Reload
	movslq	%eax, %rcx
	movq	%rcx, -104(%rsp)                # 8-byte Spill
	sarl	%eax
	movslq	%edx, %r12
	sarl	%edx
	movq	%rdx, -96(%rsp)                 # 8-byte Spill
	movslq	%edx, %r10
	movl	%eax, -128(%rsp)                # 4-byte Spill
	cmpl	-48(%rsp), %eax                 # 4-byte Folded Reload
	jge	.LBB3_6
# %bb.3:                                # %.preheader282.lr.ph
                                        #   in Loop: Header=BB3_2 Depth=1
	movl	-128(%rsp), %edx                # 4-byte Reload
	movslq	%edx, %rax
	movl	-60(%rsp), %ecx                 # 4-byte Reload
	imull	%edx, %ecx
	movq	-120(%rsp), %rdx                # 8-byte Reload
                                        # kill: def $edx killed $edx killed $rdx
	movq	-104(%rsp), %r9                 # 8-byte Reload
	imull	%r9d, %edx
	movl	%edx, -124(%rsp)                # 4-byte Spill
	leal	(%r10,%r10), %esi
	movq	%r15, %rdi
	imulq	%rax, %rdi
	movq	-8(%rsp), %rdx                  # 8-byte Reload
	leaq	(%rdx,%rdi), %r8
	movq	%r15, %rdx
	imulq	%r9, %rdx
	movq	%rdx, -72(%rsp)                 # 8-byte Spill
	addq	%r10, %rdi
	shlq	$4, %rdi
	addq	-56(%rsp), %rdi                 # 8-byte Folded Reload
	movq	-16(%rsp), %rdx                 # 8-byte Reload
	imulq	%r9, %rdx
	movq	%rdx, -80(%rsp)                 # 8-byte Spill
	movq	%r12, %rbx
	shlq	$4, %rbx
	xorl	%ebp, %ebp
.LBB3_4:                                # %.preheader282
                                        #   Parent Loop BB3_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB3_14 Depth 3
	movq	%rdi, %r14
	movl	%ebp, %r9d
	movl	%ecx, %r11d
	movq	%r10, %r13
	movq	-96(%rsp), %rdx                 # 8-byte Reload
	cmpl	-120(%rsp), %edx                # 4-byte Folded Reload
	jge	.LBB3_5
.LBB3_14:                               #   Parent Loop BB3_2 Depth=1
                                        #     Parent Loop BB3_4 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	cmpb	$0, (%r8,%r13)
	jne	.LBB3_16
# %bb.15:                               #   in Loop: Header=BB3_14 Depth=3
	movq	-24(%rsp), %rdx                 # 8-byte Reload
	movb	%dl, (%r8,%r13)
	movl	%r9d, -12(%r14)
	leal	(%rsi,%r9), %edx
	movl	%edx, -8(%r14)
	leal	(%rsi,%r11), %edx
	movl	%edx, -4(%r14)
	movl	%r11d, (%r14)
.LBB3_16:                               #   in Loop: Header=BB3_14 Depth=3
	addq	%r12, %r13
	addl	%r12d, %r11d
	addl	%r12d, %r9d
	addq	%rbx, %r14
	cmpq	%r15, %r13
	jl	.LBB3_14
.LBB3_5:                                # %._crit_edge
                                        #   in Loop: Header=BB3_4 Depth=2
	addq	-104(%rsp), %rax                # 8-byte Folded Reload
	movl	-124(%rsp), %edx                # 4-byte Reload
	addl	%edx, %ecx
	addl	%edx, %ebp
	addq	-72(%rsp), %r8                  # 8-byte Folded Reload
	addq	-80(%rsp), %rdi                 # 8-byte Folded Reload
	cmpq	-112(%rsp), %rax                # 8-byte Folded Reload
	jl	.LBB3_4
.LBB3_6:                                # %._crit_edge287
                                        #   in Loop: Header=BB3_2 Depth=1
	movq	-24(%rsp), %rax                 # 8-byte Reload
	incl	%eax
	movl	%eax, -124(%rsp)                # 4-byte Spill
	cmpl	$0, -48(%rsp)                   # 4-byte Folded Reload
	jle	.LBB3_17
# %bb.7:                                # %.preheader281.lr.ph
                                        #   in Loop: Header=BB3_2 Depth=1
	movl	-128(%rsp), %ecx                # 4-byte Reload
	movslq	%ecx, %rax
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movq	-120(%rsp), %rax                # 8-byte Reload
	movl	%eax, %edx
	movq	-104(%rsp), %rsi                # 8-byte Reload
	imull	%esi, %edx
	movl	%edx, 8(%rsp)                   # 4-byte Spill
                                        # kill: def $eax killed $eax killed $rax def $rax
	imull	%ecx, %eax
	movq	-96(%rsp), %rcx                 # 8-byte Reload
	leal	(%rcx,%rax), %edx
	movq	%rdx, 16(%rsp)                  # 8-byte Spill
	leaq	(%r10,%r10), %rdx
	movq	%rdx, -72(%rsp)                 # 8-byte Spill
	leal	(%rcx,%rcx), %edx
	movq	%rdx, -32(%rsp)                 # 8-byte Spill
                                        # kill: def $ecx killed $ecx killed $rcx def $rcx
	subl	%eax, %ecx
	movq	%rcx, -80(%rsp)                 # 8-byte Spill
	movq	%r10, %rax
	shlq	$4, %rax
	addq	-56(%rsp), %rax                 # 8-byte Folded Reload
	movq	%rax, -40(%rsp)                 # 8-byte Spill
	movq	-16(%rsp), %rax                 # 8-byte Reload
	imulq	%rsi, %rax
	movq	%rax, (%rsp)                    # 8-byte Spill
	movq	%r12, %rdx
	shlq	$4, %rdx
	movq	%r15, %rax
	imulq	%rsi, %rax
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	xorl	%eax, %eax
	movq	%rax, -88(%rsp)                 # 8-byte Spill
	movq	-8(%rsp), %r9                   # 8-byte Reload
	xorl	%r14d, %r14d
.LBB3_8:                                # %.preheader281
                                        #   Parent Loop BB3_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB3_10 Depth 3
	movq	-96(%rsp), %rax                 # 8-byte Reload
	cmpl	-120(%rsp), %eax                # 4-byte Folded Reload
	jge	.LBB3_36
# %bb.9:                                # %.lr.ph299
                                        #   in Loop: Header=BB3_8 Depth=2
	movq	%r14, %rcx
	movq	24(%rsp), %rax                  # 8-byte Reload
	subq	%rax, %rcx
	addq	%r14, %rax
	leaq	(%r9,%r10), %rbp
	movq	-40(%rsp), %r8                  # 8-byte Reload
	movq	-88(%rsp), %rdi                 # 8-byte Reload
                                        # kill: def $edi killed $edi killed $rdi def $rdi
	xorl	%ebx, %ebx
.LBB3_10:                               #   Parent Loop BB3_2 Depth=1
                                        #     Parent Loop BB3_8 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	cmpb	$0, (%rbp,%rbx)
	jne	.LBB3_35
# %bb.11:                               #   in Loop: Header=BB3_10 Depth=3
	leaq	(%r10,%rbx), %r11
	movq	-80(%rsp), %rsi                 # 8-byte Reload
	leal	(%rsi,%rdi), %r13d
	movl	%r11d, %esi
	orl	%ecx, %esi
	movl	$-1, %esi
	cmovsl	%esi, %r13d
	cmpq	-112(%rsp), %rcx                # 8-byte Folded Reload
	cmovgel	%esi, %r13d
	movl	%r13d, -12(%r8)
	movq	-72(%rsp), %rsi                 # 8-byte Reload
	leaq	(%rsi,%rbx), %r13
	cmpq	%r15, %r13
	jge	.LBB3_25
# %bb.12:                               #   in Loop: Header=BB3_10 Depth=3
	movl	%r14d, %esi
	orl	%r13d, %esi
	andl	$-2147483648, %esi              # imm = 0x80000000
	jne	.LBB3_25
# %bb.13:                               #   in Loop: Header=BB3_10 Depth=3
	movq	-32(%rsp), %rsi                 # 8-byte Reload
	addl	%edi, %esi
	movl	%esi, -8(%r8)
	jmp	.LBB3_26
.LBB3_25:                               #   in Loop: Header=BB3_10 Depth=3
	movl	$-1, -8(%r8)
.LBB3_26:                               #   in Loop: Header=BB3_10 Depth=3
	cmpq	-112(%rsp), %rax                # 8-byte Folded Reload
	jge	.LBB3_29
# %bb.27:                               #   in Loop: Header=BB3_10 Depth=3
	orl	%eax, %r11d
	andl	$-2147483648, %r11d             # imm = 0x80000000
	jne	.LBB3_29
# %bb.28:                               #   in Loop: Header=BB3_10 Depth=3
	movq	16(%rsp), %rsi                  # 8-byte Reload
	addl	%edi, %esi
	movl	%esi, -4(%r8)
	jmp	.LBB3_30
.LBB3_29:                               #   in Loop: Header=BB3_10 Depth=3
	movl	$-1, -4(%r8)
.LBB3_30:                               #   in Loop: Header=BB3_10 Depth=3
	cmpq	%r15, %rbx
	jge	.LBB3_33
# %bb.31:                               #   in Loop: Header=BB3_10 Depth=3
	movl	%ebx, %esi
	orl	%r14d, %esi
	andl	$-2147483648, %esi              # imm = 0x80000000
	jne	.LBB3_33
# %bb.32:                               #   in Loop: Header=BB3_10 Depth=3
	movl	%edi, (%r8)
	jmp	.LBB3_34
.LBB3_33:                               #   in Loop: Header=BB3_10 Depth=3
	movl	$-1, (%r8)
.LBB3_34:                               #   in Loop: Header=BB3_10 Depth=3
	movl	-124(%rsp), %esi                # 4-byte Reload
	movb	%sil, (%rbp,%rbx)
.LBB3_35:                               #   in Loop: Header=BB3_10 Depth=3
	addq	%r12, %rbx
	leaq	(%r10,%rbx), %rsi
	addl	%r12d, %edi
	addq	%rdx, %r8
	cmpq	%r15, %rsi
	jl	.LBB3_10
.LBB3_36:                               # %._crit_edge300
                                        #   in Loop: Header=BB3_8 Depth=2
	addq	-104(%rsp), %r14                # 8-byte Folded Reload
	movq	-88(%rsp), %rax                 # 8-byte Reload
	addl	8(%rsp), %eax                   # 4-byte Folded Reload
	movq	%rax, -88(%rsp)                 # 8-byte Spill
	movq	(%rsp), %rax                    # 8-byte Reload
	addq	%rax, -40(%rsp)                 # 8-byte Folded Spill
	addq	32(%rsp), %r9                   # 8-byte Folded Reload
	cmpq	-112(%rsp), %r14                # 8-byte Folded Reload
	jl	.LBB3_8
.LBB3_17:                               # %.preheader283
                                        #   in Loop: Header=BB3_2 Depth=1
	movl	-128(%rsp), %eax                # 4-byte Reload
	cmpl	-48(%rsp), %eax                 # 4-byte Folded Reload
	jge	.LBB3_38
# %bb.18:                               # %.preheader.lr.ph
                                        #   in Loop: Header=BB3_2 Depth=1
	movl	-128(%rsp), %ecx                # 4-byte Reload
	movslq	%ecx, %rsi
	movq	%r10, %rdi
	negq	%rdi
	movq	-120(%rsp), %rax                # 8-byte Reload
	movl	%eax, %r8d
	imull	%ecx, %r8d
	movq	-104(%rsp), %rdx                # 8-byte Reload
	movl	%edx, %r9d
	imull	%eax, %r9d
	movl	%r9d, -88(%rsp)                 # 4-byte Spill
	movl	-60(%rsp), %eax                 # 4-byte Reload
                                        # kill: def $eax killed $eax def $rax
	imull	%ecx, %eax
	movq	%rax, -80(%rsp)                 # 8-byte Spill
	movq	-96(%rsp), %rax                 # 8-byte Reload
	leal	(%rax,%r8), %ecx
	movq	%rcx, 16(%rsp)                  # 8-byte Spill
	subl	%eax, %r8d
	movq	%r8, -72(%rsp)                  # 8-byte Spill
	movq	-16(%rsp), %rax                 # 8-byte Reload
	movq	%rax, %rcx
	imulq	%rsi, %rcx
	addq	-56(%rsp), %rcx                 # 8-byte Folded Reload
	movq	%rcx, -32(%rsp)                 # 8-byte Spill
	imulq	%rdx, %rax
	movq	%rax, -40(%rsp)                 # 8-byte Spill
	movq	%r12, %r8
	shlq	$4, %r8
	movq	%r15, %r9
	imulq	%rsi, %r9
	addq	-8(%rsp), %r9                   # 8-byte Folded Reload
	movq	%r15, %rax
	imulq	%rdx, %rax
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	xorl	%ebx, %ebx
	movq	%rsi, (%rsp)                    # 8-byte Spill
	movq	%rsi, %rcx
.LBB3_19:                               # %.preheader
                                        #   Parent Loop BB3_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB3_21 Depth 3
	cmpl	$0, -120(%rsp)                  # 4-byte Folded Reload
	jle	.LBB3_37
# %bb.20:                               # %.lr.ph315
                                        #   in Loop: Header=BB3_19 Depth=2
	movq	%rcx, %r14
	movq	(%rsp), %rax                    # 8-byte Reload
	subq	%rax, %r14
	leaq	(%rcx,%rax), %rbp
	movq	-32(%rsp), %r11                 # 8-byte Reload
	movl	%ebx, %eax
	xorl	%edx, %edx
.LBB3_21:                               #   Parent Loop BB3_2 Depth=1
                                        #     Parent Loop BB3_19 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	cmpb	$0, (%r9,%rdx)
	jne	.LBB3_50
# %bb.22:                               #   in Loop: Header=BB3_21 Depth=3
	movl	%edx, %r13d
	orl	%r14d, %r13d
	movl	$-1, %r13d
	cmovnsl	%eax, %r13d
	cmpq	-112(%rsp), %r14                # 8-byte Folded Reload
	movl	$-1, %esi
	cmovgel	%esi, %r13d
	movl	%r13d, -12(%r11)
	leaq	(%r10,%rdx), %r13
	cmpq	%r15, %r13
	jge	.LBB3_40
# %bb.23:                               #   in Loop: Header=BB3_21 Depth=3
	movl	%ecx, %esi
	orl	%r13d, %esi
	andl	$-2147483648, %esi              # imm = 0x80000000
	jne	.LBB3_40
# %bb.24:                               #   in Loop: Header=BB3_21 Depth=3
	movq	16(%rsp), %rsi                  # 8-byte Reload
	addl	%eax, %esi
	movl	%esi, -8(%r11)
	jmp	.LBB3_41
.LBB3_40:                               #   in Loop: Header=BB3_21 Depth=3
	movl	$-1, -8(%r11)
.LBB3_41:                               #   in Loop: Header=BB3_21 Depth=3
	cmpq	-112(%rsp), %rbp                # 8-byte Folded Reload
	jge	.LBB3_44
# %bb.42:                               #   in Loop: Header=BB3_21 Depth=3
	movl	%edx, %esi
	orl	%ebp, %esi
	andl	$-2147483648, %esi              # imm = 0x80000000
	jne	.LBB3_44
# %bb.43:                               #   in Loop: Header=BB3_21 Depth=3
	movq	-80(%rsp), %rsi                 # 8-byte Reload
	addl	%eax, %esi
	movl	%esi, -4(%r11)
	jmp	.LBB3_45
.LBB3_44:                               #   in Loop: Header=BB3_21 Depth=3
	movl	$-1, -4(%r11)
.LBB3_45:                               #   in Loop: Header=BB3_21 Depth=3
	leaq	(%rdi,%rdx), %r13
	cmpq	%r15, %r13
	jge	.LBB3_48
# %bb.46:                               #   in Loop: Header=BB3_21 Depth=3
	movl	%ecx, %esi
	orl	%r13d, %esi
	andl	$-2147483648, %esi              # imm = 0x80000000
	jne	.LBB3_48
# %bb.47:                               #   in Loop: Header=BB3_21 Depth=3
	movq	-72(%rsp), %rsi                 # 8-byte Reload
	addl	%eax, %esi
	movl	%esi, (%r11)
	jmp	.LBB3_49
.LBB3_48:                               #   in Loop: Header=BB3_21 Depth=3
	movl	$-1, (%r11)
.LBB3_49:                               #   in Loop: Header=BB3_21 Depth=3
	movl	-124(%rsp), %esi                # 4-byte Reload
	movb	%sil, (%r9,%rdx)
.LBB3_50:                               #   in Loop: Header=BB3_21 Depth=3
	addq	%r12, %rdx
	addl	%r12d, %eax
	addq	%r8, %r11
	cmpq	%r15, %rdx
	jl	.LBB3_21
.LBB3_37:                               # %._crit_edge316
                                        #   in Loop: Header=BB3_19 Depth=2
	addq	-104(%rsp), %rcx                # 8-byte Folded Reload
	addl	-88(%rsp), %ebx                 # 4-byte Folded Reload
	movq	-40(%rsp), %rax                 # 8-byte Reload
	addq	%rax, -32(%rsp)                 # 8-byte Folded Spill
	addq	8(%rsp), %r9                    # 8-byte Folded Reload
	cmpq	-112(%rsp), %rcx                # 8-byte Folded Reload
	jl	.LBB3_19
.LBB3_38:                               # %._crit_edge318
                                        #   in Loop: Header=BB3_2 Depth=1
	movq	-24(%rsp), %rax                 # 8-byte Reload
	addl	$2, %eax
	movq	%rax, -24(%rsp)                 # 8-byte Spill
	movq	-96(%rsp), %rdx                 # 8-byte Reload
	cmpl	$2, %edx
	jae	.LBB3_2
.LBB3_39:                               # %._crit_edge327
	addq	$40, %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_end3:
	.size	_Z12initArraysDsPhP15HIP_vector_typeIiLj4EEii, .Lfunc_end3-_Z12initArraysDsPhP15HIP_vector_typeIiLj4EEii
	.cfi_endproc
                                        # -- End function
	.globl	_Z12initArraysTePhP15HIP_vector_typeIiLj4EEiiiiii # -- Begin function _Z12initArraysTePhP15HIP_vector_typeIiLj4EEiiiiii
	.type	_Z12initArraysTePhP15HIP_vector_typeIiLj4EEiiiiii,@function
_Z12initArraysTePhP15HIP_vector_typeIiLj4EEiiiiii: # @_Z12initArraysTePhP15HIP_vector_typeIiLj4EEiiiiii
	.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	$136, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%r8d, %ebx
                                        # kill: def $ecx killed $ecx def $rcx
                                        # kill: def $edx killed $edx def $rdx
	movq	%rsi, %r15
	movq	%rdi, %r13
	movl	200(%rsp), %r12d
	movl	192(%rsp), %eax
	movl	%r9d, %esi
	sarl	%esi
	movl	%eax, %edi
	sarl	%edi
	movl	%edx, 80(%rsp)
	addl	%edx, %r9d
	movl	%r9d, 84(%rsp)
	movl	%r9d, 88(%rsp)
	movl	%edx, 92(%rsp)
	movq	%rsi, %rbp
	addl	%edx, %esi
	movl	%esi, 96(%rsp)
	movl	%r9d, 100(%rsp)
	movl	%esi, 104(%rsp)
	movl	%edx, 108(%rsp)
	movl	%esi, 12(%rsp)                  # 4-byte Spill
	movl	%esi, 112(%rsp)
	movl	%ecx, 32(%rsp)
	movl	%ecx, 36(%rsp)
	addl	%ecx, %eax
	movl	%eax, 40(%rsp)
	movl	%eax, 44(%rsp)
	movl	%ecx, 48(%rsp)
	movq	%rdi, 16(%rsp)                  # 8-byte Spill
	movq	%rcx, 24(%rsp)                  # 8-byte Spill
	addl	%edi, %ecx
	movl	%ecx, 52(%rsp)
	movl	%eax, 56(%rsp)
	movl	%ecx, 60(%rsp)
	movl	%ecx, 8(%rsp)                   # 4-byte Spill
	movl	%ecx, 64(%rsp)
	movl	$1, %ecx
	movl	$4, %r14d
	movslq	%r8d, %rsi
.LBB4_1:                                # =>This Inner Loop Header: Depth=1
	movslq	32(%rsp,%r14,4), %r8
	imulq	%rsi, %r8
	movslq	80(%rsp,%r14,4), %rdi
	addq	%r8, %rdi
	cmpb	$0, (%r13,%rdi)
	jne	.LBB4_3
# %bb.2:                                #   in Loop: Header=BB4_1 Depth=1
	movl	16(%rsp,%r14,4), %r8d
	imull	%ebx, %r8d
	addl	64(%rsp,%r14,4), %r8d
	movq	%rdi, %r10
	shlq	$4, %r10
	movl	%r8d, (%r15,%r10)
	movslq	%ecx, %r8
	movl	32(%rsp,%r8,4), %r11d
	imull	%ebx, %r11d
	addl	80(%rsp,%r8,4), %r11d
	movl	%r11d, 4(%r15,%r10)
	movq	$-1, 8(%r15,%r10)
	movb	%r12b, (%r13,%rdi)
.LBB4_3:                                #   in Loop: Header=BB4_1 Depth=1
	leal	1(%rcx), %edi
	leal	4(%rcx), %r8d
	testl	%edi, %edi
	cmovnsl	%edi, %r8d
	andl	$-4, %r8d
	negl	%r8d
	addl	%r8d, %ecx
	incl	%ecx
	incq	%r14
	cmpq	$8, %r14
	jne	.LBB4_1
# %bb.4:
	movl	8(%rsp), %ecx                   # 4-byte Reload
	imull	%ebx, %ecx
	addl	12(%rsp), %ecx                  # 4-byte Folded Reload
	movslq	%ecx, %rcx
	cmpb	$0, (%r13,%rcx)
	jne	.LBB4_14
# %bb.5:                                # %.preheader
	imull	%ebx, %eax
	leal	(%rax,%rdx), %r10d
	movq	%rcx, %rsi
	shlq	$4, %rsi
	addq	%r15, %rsi
	addl	%r9d, %eax
	movl	%ebx, %edi
	imull	24(%rsp), %edi                  # 4-byte Folded Reload
	addl	%r9d, %edi
	xorl	%r8d, %r8d
.LBB4_6:                                # =>This Inner Loop Header: Depth=1
	movb	%r12b, (%r13,%rcx)
	cmpl	$3, %r8d
	je	.LBB4_11
# %bb.7:                                #   in Loop: Header=BB4_6 Depth=1
	cmpl	$2, %r8d
	je	.LBB4_10
# %bb.8:                                #   in Loop: Header=BB4_6 Depth=1
	cmpl	$1, %r8d
	jne	.LBB4_12
# %bb.9:                                #   in Loop: Header=BB4_6 Depth=1
	movl	%edi, (%rsi)
	jmp	.LBB4_13
.LBB4_10:                               #   in Loop: Header=BB4_6 Depth=1
	movl	%eax, 4(%rsi)
	jmp	.LBB4_13
.LBB4_11:                               #   in Loop: Header=BB4_6 Depth=1
	movl	%r10d, 8(%rsi)
	jmp	.LBB4_13
.LBB4_12:                               #   in Loop: Header=BB4_6 Depth=1
	movl	32(%rsp,%r8,4), %r9d
	imull	%ebx, %r9d
	addl	80(%rsp,%r8,4), %r9d
	movl	%r9d, 12(%rsi)
.LBB4_13:                               #   in Loop: Header=BB4_6 Depth=1
	incq	%r8
	cmpq	$4, %r8
	jne	.LBB4_6
.LBB4_14:                               # %.loopexit
	cmpl	$2, %ebp
	jl	.LBB4_16
# %bb.15:
	incl	%r12d
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	24(%rsp), %r14                  # 8-byte Reload
	movl	%r14d, %ecx
	movl	%ebx, %r8d
	movq	%rbp, %r9
	movq	%rbp, 120(%rsp)                 # 8-byte Spill
                                        # kill: def $r9d killed $r9d killed $r9
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	movq	%rdx, 136(%rsp)                 # 8-byte Spill
	pushq	24(%rsp)                        # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	callq	_Z12initArraysTePhP15HIP_vector_typeIiLj4EEiiiiii
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	12(%rsp), %ebp                  # 4-byte Reload
	movl	%ebp, %edx
	movl	%r14d, %ecx
	movl	%ebx, %r8d
	movq	120(%rsp), %r14                 # 8-byte Reload
	movl	%r14d, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	24(%rsp)                        # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	callq	_Z12initArraysTePhP15HIP_vector_typeIiLj4EEiiiiii
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	%ebp, %edx
	movl	8(%rsp), %ecx                   # 4-byte Reload
	movl	%ebx, %r8d
	movl	%r14d, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	movq	24(%rsp), %rbp                  # 8-byte Reload
	pushq	%rbp
	.cfi_adjust_cfa_offset 8
	callq	_Z12initArraysTePhP15HIP_vector_typeIiLj4EEiiiiii
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	128(%rsp), %rdx                 # 8-byte Reload
                                        # kill: def $edx killed $edx killed $rdx
	movl	8(%rsp), %ecx                   # 4-byte Reload
	movl	%ebx, %r8d
	movl	%r14d, %r9d
	pushq	%r12
	.cfi_adjust_cfa_offset 8
	pushq	%rbp
	.cfi_adjust_cfa_offset 8
	callq	_Z12initArraysTePhP15HIP_vector_typeIiLj4EEiiiiii
	addq	$152, %rsp
	.cfi_adjust_cfa_offset -152
	jmp	.LBB4_17
.LBB4_16:
	.cfi_def_cfa_offset 192
	addq	$136, %rsp
	.cfi_def_cfa_offset 56
.LBB4_17:
	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_end4:
	.size	_Z12initArraysTePhP15HIP_vector_typeIiLj4EEiiiiii, .Lfunc_end4-_Z12initArraysTePhP15HIP_vector_typeIiLj4EEiiiiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z15triangleEdgeCPUPhiiiiii     # -- Begin function _Z15triangleEdgeCPUPhiiiiii
	.type	_Z15triangleEdgeCPUPhiiiiii,@function
_Z15triangleEdgeCPUPhiiiiii:            # @_Z15triangleEdgeCPUPhiiiiii
	.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	$120, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edx, %ebp
                                        # kill: def $esi killed $esi def $rsi
	movq	%rdi, %r13
	movl	176(%rsp), %ebx
	movl	%r8d, %r11d
	sarl	%r11d
	movl	%r9d, %eax
	sarl	%eax
	movl	%esi, 64(%rsp)
	addl	%esi, %r8d
	movl	%r8d, 68(%rsp)
	movl	%r8d, 72(%rsp)
	movl	%esi, 76(%rsp)
	leal	(%r11,%rsi), %r15d
	movl	%r15d, 80(%rsp)
	movl	%r8d, 84(%rsp)
	movl	%r15d, 88(%rsp)
	movl	%esi, 92(%rsp)
	movl	%r15d, 96(%rsp)
	movl	%edx, 16(%rsp)
	movl	%edx, 20(%rsp)
	addl	%edx, %r9d
	movl	%r9d, 24(%rsp)
	movl	%r9d, 28(%rsp)
	movl	%edx, 32(%rsp)
	movq	%rax, %r12
	addl	%ebp, %eax
	movl	%eax, 36(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%eax, 44(%rsp)
	movl	%eax, 8(%rsp)                   # 4-byte Spill
	movl	%eax, 48(%rsp)
	movl	$1, %r10d
	movl	$4, %edx
	movslq	%ecx, %rax
.LBB5_1:                                # =>This Inner Loop Header: Depth=1
	movslq	16(%rsp,%rdx,4), %rdi
	imulq	%rax, %rdi
	movslq	64(%rsp,%rdx,4), %r14
	addq	%rdi, %r14
	cmpb	$0, (%r13,%r14)
	jne	.LBB5_3
# %bb.2:                                #   in Loop: Header=BB5_1 Depth=1
	movslq	(%rsp,%rdx,4), %rdi
	imulq	%rax, %rdi
	movslq	48(%rsp,%rdx,4), %r8
	addq	%rdi, %r8
	movzbl	(%r13,%r8), %edi
	movslq	%r10d, %r8
	movslq	16(%rsp,%r8,4), %r9
	imulq	%rax, %r9
	movslq	64(%rsp,%r8,4), %r8
	addq	%r9, %r8
	movzbl	(%r13,%r8), %r8d
	addl	%edi, %r8d
	shrl	%r8d
	movb	%r8b, (%r13,%r14)
.LBB5_3:                                #   in Loop: Header=BB5_1 Depth=1
	leal	1(%r10), %r8d
	leal	4(%r10), %edi
	testl	%r8d, %r8d
	cmovnsl	%r8d, %edi
	andl	$-4, %edi
	negl	%edi
	addl	%edi, %r10d
	incl	%r10d
	incq	%rdx
	cmpq	$8, %rdx
	jne	.LBB5_1
# %bb.4:
	movl	8(%rsp), %edx                   # 4-byte Reload
	imull	%ecx, %edx
	addl	%r15d, %edx
	movslq	%edx, %r9
	cmpb	$0, (%r13,%r9)
	jne	.LBB5_8
# %bb.5:                                # %.preheader.preheader
	xorl	%r10d, %r10d
	xorl	%edx, %edx
.LBB5_6:                                # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movslq	16(%rsp,%r10,4), %rdi
	imulq	%rax, %rdi
	movslq	64(%rsp,%r10,4), %r8
	addq	%rdi, %r8
	movzbl	(%r13,%r8), %edi
	addl	%edi, %edx
	incq	%r10
	cmpq	$4, %r10
	jne	.LBB5_6
# %bb.7:
	shrl	$2, %edx
	movb	%dl, (%r13,%r9)
.LBB5_8:
	cmpl	$2, %r11d
	jl	.LBB5_10
# %bb.9:
	incl	%ebx
	movl	%ebx, (%rsp)
	movq	%r13, %rdi
	movl	%ebp, %edx
	movl	%r11d, %r8d
	movq	%r12, %r14
	movl	%r14d, %r9d
	movq	%rsi, 112(%rsp)                 # 8-byte Spill
	movl	%ecx, %r12d
	movl	%r15d, 12(%rsp)                 # 4-byte Spill
	movq	%r11, 104(%rsp)                 # 8-byte Spill
	callq	_Z15triangleEdgeCPUPhiiiiii
	movl	%ebx, (%rsp)
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	%ebp, %edx
	movl	%r12d, %ecx
	movq	104(%rsp), %r15                 # 8-byte Reload
	movl	%r15d, %r8d
	movl	%r14d, %r9d
	callq	_Z15triangleEdgeCPUPhiiiiii
	movl	%ebx, (%rsp)
	movq	%r13, %rdi
	movl	12(%rsp), %esi                  # 4-byte Reload
	movl	8(%rsp), %ebp                   # 4-byte Reload
	movl	%ebp, %edx
	movl	%r12d, %ecx
	movl	%r15d, %r8d
	movl	%r14d, %r9d
	callq	_Z15triangleEdgeCPUPhiiiiii
	movl	%ebx, (%rsp)
	movq	%r13, %rdi
	movq	112(%rsp), %rsi                 # 8-byte Reload
                                        # kill: def $esi killed $esi killed $rsi
	movl	%ebp, %edx
	movl	%r12d, %ecx
	movl	%r15d, %r8d
	movl	%r14d, %r9d
	callq	_Z15triangleEdgeCPUPhiiiiii
.LBB5_10:
	addq	$120, %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_end5:
	.size	_Z15triangleEdgeCPUPhiiiiii, .Lfunc_end5-_Z15triangleEdgeCPUPhiiiiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z10diamontCPUiiPh              # -- Begin function _Z10diamontCPUiiPh
	.type	_Z10diamontCPUiiPh,@function
_Z10diamontCPUiiPh:                     # @_Z10diamontCPUiiPh
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdx, -40(%rsp)                 # 8-byte Spill
                                        # kill: def $esi killed $esi def $rsi
	movq	%rsi, -64(%rsp)                 # 8-byte Spill
                                        # kill: def $edi killed $edi def $rdi
	movq	%rdi, %rax
	movq	%rdi, -56(%rsp)                 # 8-byte Spill
	leal	-1(%rdi), %ecx
	cmpl	$2, %ecx
	jb	.LBB6_53
# %bb.1:                                # %.preheader249.lr.ph
	movq	-64(%rsp), %rax                 # 8-byte Reload
	leal	-1(%rax), %edx
	movl	%edx, -96(%rsp)                 # 4-byte Spill
	movslq	-56(%rsp), %r10                 # 4-byte Folded Reload
	movslq	%eax, %r11
	leaq	(%r10,%r10), %rax
	movq	%rax, -16(%rsp)                 # 8-byte Spill
.LBB6_3:                                # %.preheader249
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_5 Depth 2
                                        #       Child Loop BB6_7 Depth 3
                                        #     Child Loop BB6_13 Depth 2
                                        #       Child Loop BB6_15 Depth 3
                                        #     Child Loop BB6_20 Depth 2
                                        #       Child Loop BB6_22 Depth 3
	movl	-96(%rsp), %eax                 # 4-byte Reload
	movslq	%eax, %rdx
	movq	%rdx, -88(%rsp)                 # 8-byte Spill
	sarl	%eax
	movslq	%ecx, %r15
	sarl	%ecx
	movl	%ecx, -92(%rsp)                 # 4-byte Spill
	movslq	%ecx, %r12
	movl	%eax, -96(%rsp)                 # 4-byte Spill
	cmpl	-64(%rsp), %eax                 # 4-byte Folded Reload
	jge	.LBB6_11
# %bb.4:                                # %.preheader246.lr.ph
                                        #   in Loop: Header=BB6_3 Depth=1
	movslq	-96(%rsp), %rax                 # 4-byte Folded Reload
	movq	%r10, %rcx
	imulq	%rax, %rcx
	movq	-40(%rsp), %r9                  # 8-byte Reload
	addq	%r9, %rcx
	addq	%r12, %rcx
	movq	%r10, %rdx
	imulq	-88(%rsp), %rdx                 # 8-byte Folded Reload
	movq	-16(%rsp), %rsi                 # 8-byte Reload
	imulq	%rax, %rsi
	leaq	(%rsi,%r12,2), %rdi
	addq	%r9, %rdi
	addq	%r9, %rsi
	leaq	(%r9,%r12,2), %r8
.LBB6_5:                                # %.preheader246
                                        #   Parent Loop BB6_3 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB6_7 Depth 3
	movl	-92(%rsp), %ebx                 # 4-byte Reload
	cmpl	-56(%rsp), %ebx                 # 4-byte Folded Reload
	jge	.LBB6_10
# %bb.6:                                # %.lr.ph
                                        #   in Loop: Header=BB6_5 Depth=2
	xorl	%ebx, %ebx
.LBB6_7:                                #   Parent Loop BB6_3 Depth=1
                                        #     Parent Loop BB6_5 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	cmpb	$0, (%rcx,%rbx)
	jne	.LBB6_9
# %bb.8:                                #   in Loop: Header=BB6_7 Depth=3
	movzbl	(%r9,%rbx), %ebp
	movzbl	(%r8,%rbx), %r14d
	addl	%ebp, %r14d
	movzbl	(%rdi,%rbx), %ebp
	movzbl	(%rsi,%rbx), %r13d
	addl	%ebp, %r13d
	addl	%r14d, %r13d
	shrl	$2, %r13d
	movb	%r13b, (%rcx,%rbx)
.LBB6_9:                                #   in Loop: Header=BB6_7 Depth=3
	addq	%r15, %rbx
	leaq	(%r12,%rbx), %r14
	cmpq	%r10, %r14
	jl	.LBB6_7
.LBB6_10:                               # %._crit_edge
                                        #   in Loop: Header=BB6_5 Depth=2
	addq	-88(%rsp), %rax                 # 8-byte Folded Reload
	addq	%rdx, %rcx
	addq	%rdx, %rdi
	addq	%rdx, %rsi
	addq	%rdx, %r8
	addq	%rdx, %r9
	cmpq	%r11, %rax
	jl	.LBB6_5
.LBB6_11:                               # %.preheader248
                                        #   in Loop: Header=BB6_3 Depth=1
	cmpl	$0, -64(%rsp)                   # 4-byte Folded Reload
	jle	.LBB6_18
# %bb.12:                               # %.preheader245.lr.ph
                                        #   in Loop: Header=BB6_3 Depth=1
	movslq	-96(%rsp), %rcx                 # 4-byte Folded Reload
	movq	%r10, %rax
	movq	%rcx, -8(%rsp)                  # 8-byte Spill
	imulq	%rcx, %rax
	movq	-40(%rsp), %r13                 # 8-byte Reload
	leaq	(%r12,%r13), %rbx
	leaq	(%rbx,%rax), %rcx
	movq	%rcx, -72(%rsp)                 # 8-byte Spill
	movq	%r10, %rcx
	imulq	-88(%rsp), %rcx                 # 8-byte Folded Reload
	movq	%rcx, -32(%rsp)                 # 8-byte Spill
	movq	%r12, %rcx
	subq	%rax, %rcx
	addq	%r13, %rcx
	movq	%rcx, -80(%rsp)                 # 8-byte Spill
	leaq	(%r12,%r12), %rax
	movq	%rax, -24(%rsp)                 # 8-byte Spill
	leaq	(,%r12,2), %rax
	addq	%r13, %rax
	movq	%rax, -48(%rsp)                 # 8-byte Spill
	xorl	%edi, %edi
.LBB6_13:                               # %.preheader245
                                        #   Parent Loop BB6_3 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB6_15 Depth 3
	movl	-92(%rsp), %eax                 # 4-byte Reload
	cmpl	-56(%rsp), %eax                 # 4-byte Folded Reload
	jge	.LBB6_38
# %bb.14:                               # %.lr.ph253
                                        #   in Loop: Header=BB6_13 Depth=2
	movq	%rdi, %r14
	movq	-8(%rsp), %rax                  # 8-byte Reload
	subq	%rax, %r14
	leaq	(%rdi,%rax), %rbp
	xorl	%esi, %esi
.LBB6_15:                               #   Parent Loop BB6_3 Depth=1
                                        #     Parent Loop BB6_13 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	cmpb	$0, (%rbx,%rsi)
	jne	.LBB6_37
# %bb.16:                               #   in Loop: Header=BB6_15 Depth=3
	leaq	(%r12,%rsi), %rdx
	xorl	%r9d, %r9d
	cmpq	%r11, %r14
	jge	.LBB6_17
# %bb.25:                               #   in Loop: Header=BB6_15 Depth=3
	movl	%edx, %r8d
	orl	%r14d, %r8d
	movl	$0, %eax
	andl	$-2147483648, %r8d              # imm = 0x80000000
	jne	.LBB6_27
# %bb.26:                               #   in Loop: Header=BB6_15 Depth=3
	movq	-80(%rsp), %rax                 # 8-byte Reload
	movzbl	(%rax,%rsi), %eax
	movw	$1, %r9w
	jmp	.LBB6_27
.LBB6_17:                               #   in Loop: Header=BB6_15 Depth=3
	xorl	%eax, %eax
.LBB6_27:                               #   in Loop: Header=BB6_15 Depth=3
	movq	-24(%rsp), %rcx                 # 8-byte Reload
	leaq	(%rcx,%rsi), %r8
	cmpq	%r10, %r8
	jge	.LBB6_30
# %bb.28:                               #   in Loop: Header=BB6_15 Depth=3
	movl	%edi, %ecx
	orl	%r8d, %ecx
	andl	$-2147483648, %ecx              # imm = 0x80000000
	jne	.LBB6_30
# %bb.29:                               #   in Loop: Header=BB6_15 Depth=3
	movzwl	%r9w, %r9d
	incl	%r9d
	movq	-48(%rsp), %rcx                 # 8-byte Reload
	movzbl	(%rcx,%rsi), %ecx
	movzwl	%ax, %eax
	addl	%ecx, %eax
.LBB6_30:                               #   in Loop: Header=BB6_15 Depth=3
	cmpq	%r11, %rbp
	jge	.LBB6_33
# %bb.31:                               #   in Loop: Header=BB6_15 Depth=3
	orl	%ebp, %edx
	andl	$-2147483648, %edx              # imm = 0x80000000
	jne	.LBB6_33
# %bb.32:                               #   in Loop: Header=BB6_15 Depth=3
	movzwl	%r9w, %r9d
	incl	%r9d
	movq	-72(%rsp), %rcx                 # 8-byte Reload
	movzbl	(%rcx,%rsi), %ecx
	movzwl	%ax, %eax
	addl	%ecx, %eax
.LBB6_33:                               #   in Loop: Header=BB6_15 Depth=3
	cmpq	%r10, %rsi
	jge	.LBB6_36
# %bb.34:                               #   in Loop: Header=BB6_15 Depth=3
	movl	%esi, %ecx
	orl	%edi, %ecx
	andl	$-2147483648, %ecx              # imm = 0x80000000
	jne	.LBB6_36
# %bb.35:                               #   in Loop: Header=BB6_15 Depth=3
	movzwl	%r9w, %r9d
	incl	%r9d
	movzbl	(%r13,%rsi), %ecx
	movzwl	%ax, %eax
	addl	%ecx, %eax
.LBB6_36:                               #   in Loop: Header=BB6_15 Depth=3
                                        # kill: def $ax killed $ax killed $eax
	xorl	%edx, %edx
	divw	%r9w
	movb	%al, (%rbx,%rsi)
.LBB6_37:                               #   in Loop: Header=BB6_15 Depth=3
	addq	%r15, %rsi
	leaq	(%r12,%rsi), %rax
	cmpq	%r10, %rax
	jl	.LBB6_15
.LBB6_38:                               # %._crit_edge254
                                        #   in Loop: Header=BB6_13 Depth=2
	addq	-88(%rsp), %rdi                 # 8-byte Folded Reload
	movq	-32(%rsp), %rax                 # 8-byte Reload
	addq	%rax, -72(%rsp)                 # 8-byte Folded Spill
	addq	%rax, -80(%rsp)                 # 8-byte Folded Spill
	addq	%rax, %rbx
	addq	%rax, %r13
	addq	%rax, -48(%rsp)                 # 8-byte Folded Spill
	cmpq	%r11, %rdi
	jl	.LBB6_13
.LBB6_18:                               # %.preheader247
                                        #   in Loop: Header=BB6_3 Depth=1
	movl	-96(%rsp), %eax                 # 4-byte Reload
	cmpl	-64(%rsp), %eax                 # 4-byte Folded Reload
	jge	.LBB6_2
# %bb.19:                               # %.preheader.preheader
                                        #   in Loop: Header=BB6_3 Depth=1
	movslq	-96(%rsp), %rdi                 # 4-byte Folded Reload
	movq	-16(%rsp), %rax                 # 8-byte Reload
	imulq	%rdi, %rax
	movq	-40(%rsp), %r13                 # 8-byte Reload
	addq	%r13, %rax
	movq	%rax, -72(%rsp)                 # 8-byte Spill
	movq	%r10, %rax
	imulq	-88(%rsp), %rax                 # 8-byte Folded Reload
	movq	%rax, -48(%rsp)                 # 8-byte Spill
	movq	%r10, %r9
	imulq	%rdi, %r9
	leaq	(%r9,%r13), %rsi
	movq	%r9, %rax
	subq	%r12, %rax
	addq	%r13, %rax
	movq	%rax, -80(%rsp)                 # 8-byte Spill
	movq	%r12, %rax
	negq	%rax
	movq	%rax, -24(%rsp)                 # 8-byte Spill
	addq	%r13, %r9
	addq	%r12, %r9
	movq	%rdi, -32(%rsp)                 # 8-byte Spill
.LBB6_20:                               # %.preheader
                                        #   Parent Loop BB6_3 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB6_22 Depth 3
	cmpl	$0, -56(%rsp)                   # 4-byte Folded Reload
	jle	.LBB6_52
# %bb.21:                               # %.lr.ph257
                                        #   in Loop: Header=BB6_20 Depth=2
	movq	%rdi, %r14
	movq	-32(%rsp), %rax                 # 8-byte Reload
	subq	%rax, %r14
	leaq	(%rdi,%rax), %rbx
	xorl	%r8d, %r8d
.LBB6_22:                               #   Parent Loop BB6_3 Depth=1
                                        #     Parent Loop BB6_20 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	cmpb	$0, (%rsi,%r8)
	jne	.LBB6_51
# %bb.23:                               #   in Loop: Header=BB6_22 Depth=3
	xorl	%ebp, %ebp
	cmpq	%r11, %r14
	jge	.LBB6_24
# %bb.39:                               #   in Loop: Header=BB6_22 Depth=3
	movl	%r8d, %edx
	orl	%r14d, %edx
	movl	$0, %eax
	andl	$-2147483648, %edx              # imm = 0x80000000
	jne	.LBB6_41
# %bb.40:                               #   in Loop: Header=BB6_22 Depth=3
	movzbl	(%r13,%r8), %eax
	movw	$1, %bp
	jmp	.LBB6_41
.LBB6_24:                               #   in Loop: Header=BB6_22 Depth=3
	xorl	%eax, %eax
.LBB6_41:                               #   in Loop: Header=BB6_22 Depth=3
	leaq	(%r12,%r8), %rdx
	cmpq	%r10, %rdx
	jge	.LBB6_44
# %bb.42:                               #   in Loop: Header=BB6_22 Depth=3
	movl	%edi, %ecx
	orl	%edx, %ecx
	andl	$-2147483648, %ecx              # imm = 0x80000000
	jne	.LBB6_44
# %bb.43:                               #   in Loop: Header=BB6_22 Depth=3
	movzwl	%bp, %ebp
	incl	%ebp
	movzbl	(%r9,%r8), %ecx
	movzwl	%ax, %eax
	addl	%ecx, %eax
.LBB6_44:                               #   in Loop: Header=BB6_22 Depth=3
	cmpq	%r11, %rbx
	jge	.LBB6_47
# %bb.45:                               #   in Loop: Header=BB6_22 Depth=3
	movl	%r8d, %ecx
	orl	%ebx, %ecx
	andl	$-2147483648, %ecx              # imm = 0x80000000
	jne	.LBB6_47
# %bb.46:                               #   in Loop: Header=BB6_22 Depth=3
	movzwl	%bp, %ebp
	incl	%ebp
	movq	-72(%rsp), %rcx                 # 8-byte Reload
	movzbl	(%rcx,%r8), %ecx
	movzwl	%ax, %eax
	addl	%ecx, %eax
.LBB6_47:                               #   in Loop: Header=BB6_22 Depth=3
	movq	-24(%rsp), %rcx                 # 8-byte Reload
	leaq	(%rcx,%r8), %rdx
	cmpq	%r10, %rdx
	jge	.LBB6_50
# %bb.48:                               #   in Loop: Header=BB6_22 Depth=3
	movl	%edi, %ecx
	orl	%edx, %ecx
	andl	$-2147483648, %ecx              # imm = 0x80000000
	jne	.LBB6_50
# %bb.49:                               #   in Loop: Header=BB6_22 Depth=3
	movzwl	%bp, %ebp
	incl	%ebp
	movq	-80(%rsp), %rcx                 # 8-byte Reload
	movzbl	(%rcx,%r8), %ecx
	movzwl	%ax, %eax
	addl	%ecx, %eax
.LBB6_50:                               #   in Loop: Header=BB6_22 Depth=3
                                        # kill: def $ax killed $ax killed $eax
	xorl	%edx, %edx
	divw	%bp
	movb	%al, (%rsi,%r8)
.LBB6_51:                               #   in Loop: Header=BB6_22 Depth=3
	addq	%r15, %r8
	cmpq	%r10, %r8
	jl	.LBB6_22
.LBB6_52:                               # %._crit_edge258
                                        #   in Loop: Header=BB6_20 Depth=2
	addq	-88(%rsp), %rdi                 # 8-byte Folded Reload
	movq	-48(%rsp), %rax                 # 8-byte Reload
	addq	%rax, -72(%rsp)                 # 8-byte Folded Spill
	addq	%rax, %r13
	addq	%rax, %rsi
	addq	%rax, -80(%rsp)                 # 8-byte Folded Spill
	addq	%rax, %r9
	cmpq	%r11, %rdi
	jl	.LBB6_20
.LBB6_2:                                # %.loopexit
                                        #   in Loop: Header=BB6_3 Depth=1
	movl	-92(%rsp), %ecx                 # 4-byte Reload
	cmpl	$2, %ecx
	jae	.LBB6_3
.LBB6_53:                               # %._crit_edge267
	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_end6:
	.size	_Z10diamontCPUiiPh, .Lfunc_end6-_Z10diamontCPUiiPh
	.cfi_endproc
                                        # -- End function
	.globl	_Z26__device_stub__generateImgPhS_S_P15HIP_vector_typeIiLj4EEii # -- Begin function _Z26__device_stub__generateImgPhS_S_P15HIP_vector_typeIiLj4EEii
	.type	_Z26__device_stub__generateImgPhS_S_P15HIP_vector_typeIiLj4EEii,@function
_Z26__device_stub__generateImgPhS_S_P15HIP_vector_typeIiLj4EEii: # @_Z26__device_stub__generateImgPhS_S_P15HIP_vector_typeIiLj4EEii
	.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	12(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	8(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%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	$_Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii, %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_end7:
	.size	_Z26__device_stub__generateImgPhS_S_P15HIP_vector_typeIiLj4EEii, .Lfunc_end7-_Z26__device_stub__generateImgPhS_S_P15HIP_vector_typeIiLj4EEii
	.cfi_endproc
                                        # -- End function
	.globl	_Z8initTimev                    # -- Begin function _Z8initTimev
	.type	_Z8initTimev,@function
_Z8initTimev:                           # @_Z8initTimev
	.cfi_startproc
# %bb.0:
	movl	$_ZL2ti, %edi
	xorl	%esi, %esi
	jmp	gettimeofday                    # TAILCALL
.Lfunc_end8:
	.size	_Z8initTimev, .Lfunc_end8-_Z8initTimev
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z7getTimev
.LCPI9_0:
	.quad	0x408f400000000000              # double 1000
	.text
	.globl	_Z7getTimev
	.type	_Z7getTimev,@function
_Z7getTimev:                            # @_Z7getTimev
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -16
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%rbx), %rax
	movq	8(%rbx), %rcx
	subq	_ZL2ti(%rip), %rax
	subq	_ZL2ti+8(%rip), %rcx
	imulq	$1000000, %rax, %rax            # imm = 0xF4240
	addq	%rax, %rcx
	cvtsi2sd	%rcx, %xmm0
	divsd	.LCPI9_0(%rip), %xmm0
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	_Z7getTimev, .Lfunc_end9-_Z7getTimev
	.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:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB10_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB10_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end10:
	.size	__hip_module_ctor, .Lfunc_end10-__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	.LBB11_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
.LBB11_2:
	retq
.Lfunc_end11:
	.size	__hip_module_dtor, .Lfunc_end11-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Matrice de %s \n \n"
	.size	.L.str, 18

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"%d "
	.size	.L.str.1, 4

	.type	_Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii,@object # @_Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii
	.section	.rodata,"a",@progbits
	.globl	_Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii
	.p2align	3, 0x0
_Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii:
	.quad	_Z26__device_stub__generateImgPhS_S_P15HIP_vector_typeIiLj4EEii
	.size	_Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii, 8

	.type	_ZL2ti,@object                  # @_ZL2ti
	.local	_ZL2ti
	.comm	_ZL2ti,16,8
	.type	.L__unnamed_1,@object           # @0
	.section	.rodata.str1.1,"aMS",@progbits,1
.L__unnamed_1:
	.asciz	"_Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii"
	.size	.L__unnamed_1, 49

	.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 _Z26__device_stub__generateImgPhS_S_P15HIP_vector_typeIiLj4EEii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii
	.addrsig_sym _ZL2ti
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii ; -- Begin function _Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii
	.globl	_Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii
	.p2align	8
	.type	_Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii,@function
_Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii: ; @_Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii
; %bb.0:
	s_clause 0x1
	s_load_b32 s10, s[0:1], 0x34
	s_load_b64 s[8:9], s[0:1], 0x20
	v_bfe_u32 v1, v0, 10, 10
	v_and_b32_e32 v0, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s2, s10, 16
	s_delay_alu instid0(VALU_DEP_2) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[2:3], null, s15, s2, v[1:2]
	s_load_b256 s[0:7], s[0:1], 0x0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_mul_lo_u32 v1, v2, s9
	s_and_b32 s9, s10, 0xffff
	s_mul_i32 s14, s14, s9
	s_mov_b32 s9, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add3_u32 v0, s14, v0, v1
	v_ashrrev_i32_e32 v1, 31, v0
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s0, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v1, vcc_lo
	global_load_u8 v4, v[2:3], off
	s_waitcnt vmcnt(0)
	v_cmpx_eq_u16_e32 0, v4
	s_cbranch_execz .LBB0_3
; %bb.1:
	v_add_co_u32 v4, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v1, vcc_lo
	s_cmp_lg_u32 s8, 1
	s_cselect_b32 s4, -1, 0
	global_load_u8 v4, v[4:5], off
	s_waitcnt vmcnt(0)
	v_cmp_eq_u32_e32 vcc_lo, s8, v4
	s_and_b32 s4, s4, vcc_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 exec_lo, exec_lo, s4
	s_cbranch_execz .LBB0_3
; %bb.2:
	v_lshlrev_b64 v[4:5], 4, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, s6, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v5, vcc_lo
	global_load_b128 v[4:7], v[4:5], off
	s_waitcnt vmcnt(0)
	v_ashrrev_i32_e32 v9, 31, v4
	v_ashrrev_i32_e32 v11, 31, v5
	v_add_co_u32 v8, vcc_lo, s0, v4
	v_ashrrev_i32_e32 v13, 31, v6
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_ci_u32_e32 v9, vcc_lo, s1, v9, vcc_lo
	v_add_co_u32 v10, vcc_lo, s0, v5
	v_add_co_ci_u32_e32 v11, vcc_lo, s1, v11, vcc_lo
	v_ashrrev_i32_e32 v14, 31, v7
	v_add_co_u32 v12, vcc_lo, s0, v6
	v_add_co_ci_u32_e32 v13, vcc_lo, s1, v13, vcc_lo
	s_clause 0x1
	global_load_u8 v15, v[8:9], off
	global_load_u8 v10, v[10:11], off
	v_add_co_u32 v8, vcc_lo, s0, v7
	v_add_co_ci_u32_e32 v9, vcc_lo, s1, v14, vcc_lo
	s_clause 0x1
	global_load_u8 v11, v[12:13], off
	global_load_u8 v8, v[8:9], off
	v_cmp_ne_u32_e32 vcc_lo, -1, v4
	v_cndmask_b32_e64 v4, 0, 1, vcc_lo
	v_cndmask_b32_e64 v9, 1, 2, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v6
	v_cndmask_b32_e64 v6, 0, 1, vcc_lo
	v_cmp_eq_u32_e32 vcc_lo, -1, v5
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v4, v9, v4, vcc_lo
	v_cmp_ne_u32_e32 vcc_lo, -1, v7
	v_add_nc_u16 v4, v4, v6
	v_cndmask_b32_e64 v5, 0, 1, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u16 v4, v4, v5
	v_cvt_f32_ubyte0_e32 v4, v4
	s_waitcnt vmcnt(2)
	v_add_nc_u16 v6, v10, v15
	s_waitcnt vmcnt(1)
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_nc_u16 v5, v6, v11
	v_rcp_iflag_f32_e32 v6, v4
	s_waitcnt vmcnt(0)
	v_add_nc_u16 v5, v5, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_and_b32_e32 v5, 0xffff, v5
	v_cvt_f32_u32_e32 v5, v5
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v6, v5, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_trunc_f32_e32 v6, v6
	v_fma_f32 v5, -v6, v4, v5
	v_cvt_u32_f32_e32 v6, v6
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_ge_f32_e64 vcc_lo, |v5|, v4
	v_add_co_ci_u32_e32 v4, vcc_lo, 0, v6, vcc_lo
	v_add_co_u32 v0, vcc_lo, s2, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s3, v1, vcc_lo
	global_store_b8 v[2:3], v4, off
	global_store_b8 v[0:1], v4, off
.LBB0_3:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.amdhsa_user_sgpr_count 14
		.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 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 16
		.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	_Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii, .Lfunc_end0-_Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 568
; NumSgprs: 18
; NumVgprs: 16
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 16
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.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
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         36
        .size:           4
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         44
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         52
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         54
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         56
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         58
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         60
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         62
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         104
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 296
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z11generateImgPhS_S_P15HIP_vector_typeIiLj4EEii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     16
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
