#include <iostream>
#include <cstdlib>
#include <cassert>
#include <zlib.h>
#include <png.h>
#include <queue>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <vector>
using namespace std;

#define MASK_N 2
#define MASK_X 5
#define MASK_Y 5
#define SCALE 8
#define NUM_THREAD 512

__constant__ int _mask[MASK_N][MASK_X][MASK_Y] = { 
    {{ -1, -4, -6, -4, -1},
     { -2, -8,-12, -8, -2},
     {  0,  0,  0,  0,  0}, 
     {  2,  8, 12,  8,  2}, 
     {  1,  4,  6,  4,  1}},
    {{ -1, -2,  0,  2,  1}, 
     { -4, -8,  0,  8,  4}, 
     { -6,-12,  0, 12,  6}, 
     { -4, -8,  0,  8,  4}, 
     { -1, -2,  0,  2,  1}} 
};

int read_png(const char* filename, unsigned char** image, unsigned* height, 
			 unsigned* width, unsigned* channels) {

	unsigned char sig[8];
	FILE* infile;
	infile = fopen(filename, "rb");

    fread(sig, 1, 8, infile);
    if (!png_check_sig(sig, 8))
        return 1;   /* bad signature */

	png_structp png_ptr;
	png_infop info_ptr;

    png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
    if (!png_ptr)
        return 4;   /* out of memory */
  
    info_ptr = png_create_info_struct(png_ptr);
    if (!info_ptr) {
        png_destroy_read_struct(&png_ptr, NULL, NULL);
        return 4;   /* out of memory */
    }

	png_init_io(png_ptr, infile);
    png_set_sig_bytes(png_ptr, 8);
    png_read_info(png_ptr, info_ptr);
	int bit_depth, color_type;
	png_get_IHDR(png_ptr, info_ptr, width, height, &bit_depth, &color_type, NULL, NULL, NULL);

	png_uint_32  i, rowbytes;
    png_bytep  row_pointers[*height];
    png_read_update_info(png_ptr, info_ptr);
    rowbytes = png_get_rowbytes(png_ptr, info_ptr);
    *channels = (int) png_get_channels(png_ptr, info_ptr);

    if ((*image = (unsigned char *) malloc(rowbytes * *height)) == NULL) {
        png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
        return 3;
    }

    for (i = 0;  i < *height;  ++i)
        row_pointers[i] = *image + i * rowbytes;
	png_read_image(png_ptr, row_pointers);
	png_read_end(png_ptr, NULL);
	return 0;
}

void write_png(const char* filename, png_bytep image, const unsigned height, const unsigned width, 
			   const unsigned channels) {
    FILE* fp = fopen(filename, "wb");
    png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
    png_infop info_ptr = png_create_info_struct(png_ptr);
    png_init_io(png_ptr, fp);
    png_set_IHDR(png_ptr, info_ptr, width, height, 8,
                 PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
                 PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
    png_set_filter(png_ptr, 0, PNG_NO_FILTERS);
    png_write_info(png_ptr, info_ptr);
	png_set_compression_level(png_ptr, 1);

	png_bytep row_ptr[height];
	for (int i = 0; i < height; ++ i) {
		row_ptr[i] = image + i * width * channels * sizeof(unsigned char);
	}
	png_write_image(png_ptr, row_ptr);
    png_write_end(png_ptr, NULL);
    png_destroy_write_struct(&png_ptr, &info_ptr);
    fclose(fp);
}

__global__ void sobel (unsigned char* s, unsigned char* t, unsigned height, unsigned width, unsigned channels, size_t pitch, int y) {
	int  x, i, v, u;
	int  R, G, B;
	double val[MASK_N*3] = {0.0};
    const int adjustX=1, adjustY=1, xBound=2, yBound=2;
    x = (blockIdx.x * NUM_THREAD + threadIdx.x)%width;

    __shared__ int mask[MASK_N][MASK_X][MASK_Y];
    mask[(x/25)%2][(x/5)%5][x%5] = _mask[(x/25)%2][(x/5)%5][x%5];
    __syncthreads();

    for (i = 0; i < MASK_N; ++i) {

        val[i*3+2] = 0.0;
        val[i*3+1] = 0.0;
        val[i*3] = 0.0;
        for (v = -yBound; v < yBound + adjustY; ++v) {
            #pragma unroll 5
            for (u = -xBound; u < xBound + adjustX; ++u) {
                int valid = (x + u) >= 0 && (x + u) < width && y + v >= 0 && y + v < height;
                R = s[((pitch * (y+v) + (x+u)*channels) + 2)*valid]*valid;
                G = s[((pitch * (y+v) + (x+u)*channels) + 1)*valid]*valid;
                B = s[((pitch * (y+v) + (x+u)*channels) + 0)*valid]*valid;
                val[i*3+2] += R * mask[i][u + xBound][v + yBound];
                val[i*3+1] += G * mask[i][u + xBound][v + yBound];
                val[i*3+0] += B * mask[i][u + xBound][v + yBound];
            }
        }
    }

    double totalR = 0.0;
    double totalG = 0.0;
    double totalB = 0.0;
    
    #pragma unroll 5
    for (i = 0; i < MASK_N; ++i) {
        totalR += val[i * 3 + 2] * val[i * 3 + 2];
        totalG += val[i * 3 + 1] * val[i * 3 + 1];
        totalB += val[i * 3 + 0] * val[i * 3 + 0];
    }

    totalR = sqrt(totalR) / SCALE;
    totalG = sqrt(totalG) / SCALE;
    totalB = sqrt(totalB) / SCALE;
    const unsigned char cR = min(255.0,totalR);
    const unsigned char cG = min(255.0,totalG);
    const unsigned char cB = min(255.0,totalB);
    t[(pitch * y + x*channels) + 2] = cR;
    t[(pitch * y + x*channels) + 1] = cG;
    t[(pitch * y + x*channels) + 0] = cB;
}

queue<int> q;
mutex qLock;
mutex cvLock;
condition_variable cv;

void png_writer(int n,png_structp png_ptr,png_bytep* row_ptr,unsigned char* host_t,unsigned char* device_t,size_t pitch,int width,int height,int channels){
    while(n--){
        if(q.empty()){
            unique_lock<mutex> ul(cvLock);
            cv.wait(ul);
        }
        qLock.lock();
        int i = q.front();
        q.pop();
        qLock.unlock();
        
        // cudaMemcpy2D(host_t+sizeof(char)*width*channels*i,sizeof(char)*width*channels,device_t+pitch*i,pitch,width*channels,1,cudaMemcpyDeviceToHost);
        png_write_row(png_ptr,host_t + i * width * channels * sizeof(unsigned char));
    }
}

int main(int argc, char** argv) {

    assert(argc == 3);
	unsigned height, width, channels;
	unsigned char* host_s = NULL;
	read_png(argv[1], &host_s, &height, &width, &channels);
    unsigned char* host_t = (unsigned char*) malloc(height * width * channels * sizeof(unsigned char));

    unsigned char* device_s;
    unsigned char* device_t;
    size_t pitch;
    cudaMallocPitch(&device_s,&pitch,sizeof(unsigned char)*width*channels,height);
    cudaMallocPitch(&device_t,&pitch,sizeof(unsigned char)*width*channels,height);
    FILE* fp = fopen(argv[2], "wb");
    png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
    png_infop info_ptr = png_create_info_struct(png_ptr);
    png_init_io(png_ptr, fp);
    png_set_IHDR(png_ptr, info_ptr, width, height, 8,
                 PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
                 PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
    png_set_filter(png_ptr, 0, PNG_NO_FILTERS);
    png_write_info(png_ptr, info_ptr);
	png_set_compression_level(png_ptr, 1);

	png_bytep* row_ptr = new png_bytep[height];
	for (int i = 0; i < height; ++ i) {
		row_ptr[i] = host_t + i * width * channels * sizeof(unsigned char);
    } 
    
    thread t(png_writer,height,png_ptr,row_ptr,host_t,device_t,pitch,width,height,channels);

    cudaStream_t streams[height];
    cudaMemcpy2D(device_s,pitch,host_s,sizeof(char)*width*channels,width*channels,height,cudaMemcpyHostToDevice);
    for(int i=0;i<height;i++){
        cudaStreamCreate(&streams[i]);
        sobel<<<width/NUM_THREAD+1,NUM_THREAD,sizeof(int)*50,streams[i]>>> (device_s, device_t, height, width, channels, pitch, i);
        cudaMemcpy2DAsync(host_t+sizeof(char)*width*channels*i,sizeof(char)*width*channels,device_t+pitch*i,pitch,width*channels,1,cudaMemcpyDeviceToHost,streams[i]);        // lock_guard<mutex> lg(qLock);
        // q.push(i);
        // cv.notify_all();
    }
    for(int i=0;i<height;i++){
        cudaStreamSynchronize(streams[i]);
        q.push(i);
        cv.notify_all();
    }
    t.join();
    
    cudaFree(device_s);
    cudaFree(device_t);

    
    // png_write_image(png_ptr, row_ptr);
    png_write_end(png_ptr, NULL);
    png_destroy_write_struct(&png_ptr, &info_ptr);
    fclose(fp);

    return 0;
}

	.file	"tmpxft_0022fef6_00000000-6_sobel.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.section	.text._ZNSt6thread24_M_thread_deps_never_runEv,"axG",@progbits,_ZNSt6thread24_M_thread_deps_never_runEv,comdat
	.weak	_ZNSt6thread24_M_thread_deps_never_runEv
	.type	_ZNSt6thread24_M_thread_deps_never_runEv, @function
_ZNSt6thread24_M_thread_deps_never_runEv:
.LFB4353:
	.cfi_startproc
	endbr64
	ret
	.cfi_endproc
.LFE4353:
	.size	_ZNSt6thread24_M_thread_deps_never_runEv, .-_ZNSt6thread24_M_thread_deps_never_runEv
	.section	.text._ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED2Ev,"axG",@progbits,_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED5Ev,comdat
	.align 2
	.weak	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED2Ev
	.type	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED2Ev, @function
_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED2Ev:
.LFB6016:
	.cfi_startproc
	endbr64
	leaq	16+_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE(%rip), %rax
	movq	%rax, (%rdi)
	jmp	_ZNSt6thread6_StateD2Ev@PLT
	.cfi_endproc
.LFE6016:
	.size	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED2Ev, .-_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED2Ev
	.weak	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED1Ev
	.set	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED1Ev,_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED2Ev
	.section	.text._ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED0Ev,"axG",@progbits,_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED5Ev,comdat
	.align 2
	.weak	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED0Ev
	.type	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED0Ev, @function
_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED0Ev:
.LFB6018:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movq	%rdi, 8(%rsp)
	call	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED1Ev
	movq	8(%rsp), %rdi
	movl	$80, %esi
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	jmp	_ZdlPvm@PLT
	.cfi_endproc
.LFE6018:
	.size	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED0Ev, .-_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED0Ev
	.text
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4944:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4944:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.text._ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv,"axG",@progbits,_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv,comdat
	.align 2
	.weak	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv
	.type	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv, @function
_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv:
.LFB6030:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	subq	$16, %rsp
	.cfi_def_cfa_offset 24
	movq	40(%rdi), %rcx
	movq	48(%rdi), %rdx
	movl	8(%rax), %r8d
	movq	56(%rdi), %rsi
	movl	64(%rdi), %edi
	movq	24(%rax), %r9
	pushq	%r8
	.cfi_def_cfa_offset 32
	movl	12(%rax), %r8d
	pushq	%r8
	.cfi_def_cfa_offset 40
	movl	16(%rax), %r8d
	pushq	%r8
	.cfi_def_cfa_offset 48
	movq	32(%rax), %r8
	call	*72(%rax)
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE6030:
	.size	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv, .-_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv
	.section	.text._ZNSt5queueIiSt5dequeIiSaIiEEED2Ev,"axG",@progbits,_ZNSt5queueIiSt5dequeIiSaIiEEED5Ev,comdat
	.align 2
	.weak	_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev
	.type	_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev, @function
_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev:
.LFB6021:
	.cfi_startproc
	endbr64
	cmpq	$0, (%rdi)
	je	.L8
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	72(%rdi), %rax
	movq	%rdi, %rbx
	movq	40(%rdi), %rbp
	leaq	8(%rax), %r12
.L10:
	cmpq	%r12, %rbp
	jnb	.L16
	movq	0(%rbp), %rdi
	movl	$512, %esi
	addq	$8, %rbp
	call	_ZdlPvm@PLT
	jmp	.L10
.L16:
	movq	8(%rbx), %rax
	movq	(%rbx), %rdi
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 16
	leaq	0(,%rax,8), %rsi
	popq	%r12
	.cfi_restore 12
	.cfi_def_cfa_offset 8
	jmp	_ZdlPvm@PLT
.L8:
	ret
	.cfi_endproc
.LFE6021:
	.size	_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev, .-_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev
	.weak	_ZNSt5queueIiSt5dequeIiSaIiEEED1Ev
	.set	_ZNSt5queueIiSt5dequeIiSaIiEEED1Ev,_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev
	.section	.text._ZNSt5mutex4lockEv,"axG",@progbits,_ZNSt5mutex4lockEv,comdat
	.align 2
	.weak	_ZNSt5mutex4lockEv
	.type	_ZNSt5mutex4lockEv, @function
_ZNSt5mutex4lockEv:
.LFB4484:
	.cfi_startproc
	endbr64
	pushq	%rdx
	.cfi_def_cfa_offset 16
	call	pthread_mutex_lock@PLT
	testl	%eax, %eax
	je	.L17
	movl	%eax, %edi
	call	_ZSt20__throw_system_errori@PLT
.L17:
	popq	%rax
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4484:
	.size	_ZNSt5mutex4lockEv, .-_ZNSt5mutex4lockEv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"rb"
.LC1:
	.string	"1.6.43"
	.text
	.globl	_Z8read_pngPKcPPhPjS3_S3_
	.type	_Z8read_pngPKcPPhPjS3_S3_, @function
_Z8read_pngPKcPPhPjS3_S3_:
.LFB4931:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	.cfi_offset 15, -24
	movq	%r8, %r15
	pushq	%r14
	.cfi_offset 14, -32
	movq	%rsi, %r14
	leaq	.LC0(%rip), %rsi
	pushq	%r13
	pushq	%r12
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	movq	%rdx, %r12
	pushq	%rbx
	.cfi_offset 3, -56
	leaq	-64(%rbp), %rbx
	subq	$72, %rsp
	movq	%rcx, -104(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	fopen@PLT
	movq	%rbx, %rdi
	movl	$8, %ecx
	movl	$1, %edx
	movq	%rax, %r8
	movl	$8, %esi
	movq	%rax, %r13
	call	__fread_chk@PLT
	movq	%rbx, %rdi
	movl	$8, %edx
	xorl	%esi, %esi
	call	png_sig_cmp@PLT
	movl	$1, %ebx
	testl	%eax, %eax
	jne	.L20
	leaq	.LC1(%rip), %rdi
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	xorl	%esi, %esi
	movl	%eax, %ebx
	call	png_create_read_struct@PLT
	movq	%rax, -80(%rbp)
	movq	%rax, %rdi
	testq	%rax, %rax
	je	.L22
	call	png_create_info_struct@PLT
	movq	%rax, -72(%rbp)
	testq	%rax, %rax
	jne	.L23
	leaq	-80(%rbp), %rdi
	xorl	%edx, %edx
	xorl	%esi, %esi
	call	png_destroy_read_struct@PLT
.L22:
	movl	$4, %ebx
	jmp	.L20
.L23:
	movq	-80(%rbp), %rdi
	movq	%r13, %rsi
	call	png_init_io@PLT
	movq	-80(%rbp), %rdi
	movl	$8, %esi
	call	png_set_sig_bytes@PLT
	movq	-72(%rbp), %rsi
	movq	-80(%rbp), %rdi
	call	png_read_info@PLT
	movq	%r12, %rcx
	leaq	-84(%rbp), %r9
	leaq	-88(%rbp), %r8
	pushq	%rax
	movq	-104(%rbp), %rdx
	movq	-72(%rbp), %rsi
	movq	-80(%rbp), %rdi
	pushq	$0
	pushq	$0
	pushq	$0
	call	png_get_IHDR@PLT
	movl	(%r12), %eax
	addq	$32, %rsp
	movq	%rsp, %rdx
	leaq	15(,%rax,8), %rax
	shrq	$4, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	subq	%rcx, %rdx
.L24:
	cmpq	%rdx, %rsp
	je	.L25
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L24
.L25:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L26
	orq	$0, -8(%rsp,%rax)
.L26:
	movq	-72(%rbp), %rsi
	movq	-80(%rbp), %rdi
	movq	%rsp, -104(%rbp)
	call	png_read_update_info@PLT
	movq	-72(%rbp), %rsi
	movq	-80(%rbp), %rdi
	call	png_get_rowbytes@PLT
	movq	-72(%rbp), %rsi
	movq	-80(%rbp), %rdi
	movq	%rax, -112(%rbp)
	movl	%eax, %r13d
	call	png_get_channels@PLT
	movq	-112(%rbp), %rdx
	movzbl	%al, %eax
	movl	%eax, (%r15)
	movl	(%r12), %r12d
	movl	%edx, %edi
	imull	%r12d, %edi
	call	malloc@PLT
	xorl	%esi, %esi
	xorl	%edx, %edx
	movq	%rax, (%r14)
	testq	%rax, %rax
	jne	.L27
	leaq	-72(%rbp), %rsi
	leaq	-80(%rbp), %rdi
	movl	$3, %ebx
	call	png_destroy_read_struct@PLT
	jmp	.L20
.L27:
	cmpl	%r12d, %edx
	jnb	.L40
	movl	%esi, %edi
	movq	-104(%rbp), %rcx
	addl	%r13d, %esi
	addq	%rax, %rdi
	movq	%rdi, (%rcx,%rdx,8)
	incq	%rdx
	jmp	.L27
.L40:
	movq	-104(%rbp), %rsi
	movq	-80(%rbp), %rdi
	call	png_read_image@PLT
	movq	-80(%rbp), %rdi
	xorl	%esi, %esi
	call	png_read_end@PLT
.L20:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	leaq	-40(%rbp), %rsp
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4931:
	.size	_Z8read_pngPKcPPhPjS3_S3_, .-_Z8read_pngPKcPPhPjS3_S3_
	.section	.rodata.str1.1
.LC2:
	.string	"wb"
	.text
	.globl	_Z9write_pngPKcPhjjj
	.type	_Z9write_pngPKcPhjjj, @function
_Z9write_pngPKcPhjjj:
.LFB4932:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	.cfi_offset 15, -24
	movl	%r8d, %r15d
	pushq	%r14
	.cfi_offset 14, -32
	movq	%rsi, %r14
	leaq	.LC2(%rip), %rsi
	pushq	%r13
	pushq	%r12
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	movl	%edx, %r12d
	pushq	%rbx
	.cfi_offset 3, -56
	movl	%ecx, %ebx
	subq	$40, %rsp
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	fopen@PLT
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	xorl	%esi, %esi
	leaq	.LC1(%rip), %rdi
	movq	%rax, %r13
	call	png_create_write_struct@PLT
	movq	%rax, %rdi
	movq	%rax, -72(%rbp)
	call	png_create_info_struct@PLT
	movq	-72(%rbp), %rdi
	movq	%r13, %rsi
	movq	%rax, -64(%rbp)
	call	png_init_io@PLT
	movl	%r12d, %ecx
	movl	$2, %r9d
	movl	%ebx, %edx
	pushq	%rax
	movq	-64(%rbp), %rsi
	movl	$8, %r8d
	pushq	$0
	movq	-72(%rbp), %rdi
	pushq	$0
	pushq	$0
	call	png_set_IHDR@PLT
	movq	-72(%rbp), %rdi
	addq	$32, %rsp
	xorl	%edx, %edx
	xorl	%esi, %esi
	call	png_set_filter@PLT
	movq	-64(%rbp), %rsi
	movq	-72(%rbp), %rdi
	call	png_write_info@PLT
	movq	-72(%rbp), %rdi
	movl	$1, %esi
	call	png_set_compression_level@PLT
	movl	%r12d, %eax
	movq	%rsp, %rdx
	leaq	15(,%rax,8), %rax
	shrq	$4, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	subq	%rcx, %rdx
.L42:
	cmpq	%rdx, %rsp
	je	.L43
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L42
.L43:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L44
	orq	$0, -8(%rsp,%rax)
.L44:
	imull	%r15d, %ebx
	movq	%rsp, %rsi
	xorl	%edx, %edx
	xorl	%eax, %eax
.L45:
	cmpl	%r12d, %eax
	jnb	.L52
	movl	%edx, %ecx
	addl	%ebx, %edx
	addq	%r14, %rcx
	movq	%rcx, (%rsi,%rax,8)
	incq	%rax
	jmp	.L45
.L52:
	movq	-72(%rbp), %rdi
	call	png_write_image@PLT
	movq	-72(%rbp), %rdi
	xorl	%esi, %esi
	call	png_write_end@PLT
	leaq	-72(%rbp), %rdi
	leaq	-64(%rbp), %rsi
	call	png_destroy_write_struct@PLT
	movq	%r13, %rdi
	call	fclose@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L47
	call	__stack_chk_fail@PLT
.L47:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4932:
	.size	_Z9write_pngPKcPhjjj, .-_Z9write_pngPKcPhjjj
	.globl	_Z31__device_stub__Z5sobelPhS_jjjmiPhS_jjjmi
	.type	_Z31__device_stub__Z5sobelPhS_jjjmiPhS_jjjmi, @function
_Z31__device_stub__Z5sobelPhS_jjjmiPhS_jjjmi:
.LFB4966:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movl	%edx, 28(%rsp)
	leaq	48(%rsp), %rdx
	movl	%ecx, 24(%rsp)
	leaq	56(%rsp), %rcx
	movl	%r8d, 20(%rsp)
	movq	%r9, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	28(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	192(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L53
	pushq	56(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z5sobelPhS_jjjmi(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 208
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L53:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L55
	call	__stack_chk_fail@PLT
.L55:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4966:
	.size	_Z31__device_stub__Z5sobelPhS_jjjmiPhS_jjjmi, .-_Z31__device_stub__Z5sobelPhS_jjjmiPhS_jjjmi
	.globl	_Z5sobelPhS_jjjmi
	.type	_Z5sobelPhS_jjjmi, @function
_Z5sobelPhS_jjjmi:
.LFB4967:
	.cfi_startproc
	endbr64
	jmp	_Z31__device_stub__Z5sobelPhS_jjjmiPhS_jjjmi
	.cfi_endproc
.LFE4967:
	.size	_Z5sobelPhS_jjjmi, .-_Z5sobelPhS_jjjmi
	.section	.rodata.str1.1
.LC3:
	.string	"_Z5sobelPhS_jjjmi"
.LC4:
	.string	"_mask"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4969:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC3(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z5sobelPhS_jjjmi(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC4(%rip), %rdx
	movl	$200, %r9d
	leaq	_ZL5_mask(%rip), %rsi
	pushq	$1
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE4969:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt11unique_lockISt5mutexED2Ev,"axG",@progbits,_ZNSt11unique_lockISt5mutexED5Ev,comdat
	.align 2
	.weak	_ZNSt11unique_lockISt5mutexED2Ev
	.type	_ZNSt11unique_lockISt5mutexED2Ev, @function
_ZNSt11unique_lockISt5mutexED2Ev:
.LFB5326:
	.cfi_startproc
	endbr64
	cmpb	$0, 8(%rdi)
	je	.L60
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	je	.L60
	jmp	pthread_mutex_unlock@PLT
.L60:
	ret
	.cfi_endproc
.LFE5326:
	.size	_ZNSt11unique_lockISt5mutexED2Ev, .-_ZNSt11unique_lockISt5mutexED2Ev
	.weak	_ZNSt11unique_lockISt5mutexED1Ev
	.set	_ZNSt11unique_lockISt5mutexED1Ev,_ZNSt11unique_lockISt5mutexED2Ev
	.text
	.globl	_Z10png_writeriP14png_struct_defPPhS1_S1_miii
	.type	_Z10png_writeriP14png_struct_defPPhS1_S1_miii, @function
_Z10png_writeriP14png_struct_defPPhS1_S1_miii:
.LFB4940:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4940
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	cvLock(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rcx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
.L66:
	testl	%ebp, %ebp
	je	.L78
	movq	48+q(%rip), %rax
	cmpq	%rax, 16+q(%rip)
	jne	.L67
	movq	%r14, %rdi
	leaq	8(%rsp), %rbx
	movq	%r14, 8(%rsp)
	movb	$0, 16(%rsp)
.LEHB0:
	call	_ZNSt5mutex4lockEv
.LEHE0:
	movq	%rbx, %rsi
	movb	$1, 16(%rsp)
	leaq	cv(%rip), %rdi
.LEHB1:
	call	_ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE@PLT
.LEHE1:
	movq	%rbx, %rdi
	call	_ZNSt11unique_lockISt5mutexED1Ev
.L67:
	leaq	qLock(%rip), %r15
	movq	%r15, %rdi
.LEHB2:
	call	_ZNSt5mutex4lockEv
	movq	32+q(%rip), %rcx
	movq	16+q(%rip), %rax
	movq	24+q(%rip), %rdi
	leaq	-4(%rcx), %rdx
	movl	(%rax), %ebx
	cmpq	%rdx, %rax
	je	.L68
	addq	$4, %rax
	jmp	.L69
.L68:
	movl	$512, %esi
	call	_ZdlPvm@PLT
	movq	40+q(%rip), %rax
	leaq	8(%rax), %rdx
	movq	8(%rax), %rax
	movq	%rdx, 40+q(%rip)
	leaq	512(%rax), %rdx
	movq	%rax, 24+q(%rip)
	movq	%rdx, 32+q(%rip)
.L69:
	movq	%r15, %rdi
	movq	%rax, 16+q(%rip)
	decl	%ebp
	call	pthread_mutex_unlock@PLT
	imull	96(%rsp), %ebx
	movl	112(%rsp), %esi
	movq	%r12, %rdi
	imull	%ebx, %esi
	movslq	%esi, %rsi
	addq	%r13, %rsi
	call	png_write_row@PLT
	jmp	.L66
.L74:
	endbr64
	movq	%rax, %rbp
.L71:
	movq	%rbx, %rdi
	call	_ZNSt11unique_lockISt5mutexED1Ev
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L77
	movq	%rbp, %rdi
	call	_Unwind_Resume@PLT
.LEHE2:
.L78:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L73
.L77:
	call	__stack_chk_fail@PLT
.L73:
	addq	$40, %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
.LFE4940:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4940:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4940-.LLSDACSB4940
.LLSDACSB4940:
	.uleb128 .LEHB0-.LFB4940
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4940
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L74-.LFB4940
	.uleb128 0
	.uleb128 .LEHB2-.LFB4940
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE4940:
	.text
	.size	_Z10png_writeriP14png_struct_defPPhS1_S1_miii, .-_Z10png_writeriP14png_struct_defPPhS1_S1_miii
	.section	.text._ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev,"axG",@progbits,_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED5Ev,comdat
	.align 2
	.weak	_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev
	.type	_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev, @function
_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev:
.LFB5556:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	je	.L79
	movq	(%rdi), %rax
	jmp	*8(%rax)
.L79:
	ret
	.cfi_endproc
.LFE5556:
	.size	_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev, .-_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev
	.weak	_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED1Ev
	.set	_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED1Ev,_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev
	.section	.rodata.str1.1
.LC5:
	.string	"cannot create std::deque larger than max_size()"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4941:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4941
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	movq	%rsi, %r14
	leaq	-148(%rbp), %r8
	leaq	-156(%rbp), %rdx
	pushq	%r13
	leaq	-144(%rbp), %rsi
	leaq	-152(%rbp), %rcx
	pushq	%r12
	pushq	%rbx
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$168, %rsp
	movq	8(%r14), %rdi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rbx, -144(%rbp)
.LEHB3:
	call	_Z8read_pngPKcPPhPjS3_S3_
	movl	-156(%rbp), %ecx
	movl	-152(%rbp), %r12d
	movl	-148(%rbp), %r15d
	movl	%ecx, %edi
	movl	%ecx, -168(%rbp)
	imull	%r12d, %edi
	movq	%r15, %rbx
	imull	%r15d, %edi
	call	malloc@PLT
	movl	%r12d, %edx
	leaq	-120(%rbp), %r12
	movl	-168(%rbp), %ecx
	imulq	%r15, %rdx
	movq	%r12, %rsi
	leaq	-136(%rbp), %rdi
	movq	%rax, %r13
	call	cudaMallocPitch@PLT
	movl	-152(%rbp), %edx
	movq	%r12, %rsi
	leaq	-128(%rbp), %rdi
	movl	-156(%rbp), %ecx
	imulq	%r15, %rdx
	call	cudaMallocPitch@PLT
	movq	16(%r14), %rdi
	leaq	.LC2(%rip), %rsi
	call	fopen@PLT
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	xorl	%esi, %esi
	leaq	.LC1(%rip), %rdi
	movq	%rax, -176(%rbp)
	call	png_create_write_struct@PLT
	movq	%rax, %rdi
	movq	%rax, -112(%rbp)
	call	png_create_info_struct@PLT
	movq	-176(%rbp), %rsi
	movq	-112(%rbp), %rdi
	movq	%rax, -104(%rbp)
	call	png_init_io@PLT
	pushq	%r12
	movq	-104(%rbp), %rsi
	movl	$2, %r9d
	pushq	$0
	movq	-112(%rbp), %rdi
	movl	$8, %r8d
	pushq	$0
	pushq	$0
	movl	-156(%rbp), %ecx
	movl	-152(%rbp), %edx
	call	png_set_IHDR@PLT
	movq	-112(%rbp), %rdi
	xorl	%edx, %edx
	addq	$32, %rsp
	xorl	%esi, %esi
	call	png_set_filter@PLT
	movq	-104(%rbp), %rsi
	movq	-112(%rbp), %rdi
	call	png_write_info@PLT
	movq	-112(%rbp), %rdi
	movl	$1, %esi
	call	png_set_compression_level@PLT
	movl	-156(%rbp), %edi
	salq	$3, %rdi
	call	_Znam@PLT
	movl	-152(%rbp), %edi
	movl	-156(%rbp), %esi
	xorl	%edx, %edx
	movq	%rax, %r12
	xorl	%eax, %eax
	imull	%r15d, %edi
.L82:
	cmpl	%esi, %eax
	jnb	.L126
	movl	%edx, %ecx
	addl	%edi, %edx
	addq	%r13, %rcx
	movq	%rcx, (%r12,%rax,8)
	incq	%rax
	jmp	.L82
.L126:
	xorl	%r11d, %r11d
	movl	$80, %edi
	movq	%r11, -96(%rbp)
	call	_Znwm@PLT
.LEHE3:
	movl	-152(%rbp), %ecx
	movl	-156(%rbp), %edx
	leaq	16+_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE(%rip), %rsi
	movq	%rsi, (%rax)
	leaq	_Z10png_writeriP14png_struct_defPPhS1_S1_miii(%rip), %rsi
	movl	%ecx, 16(%rax)
	movq	-120(%rbp), %rcx
	movl	%edx, 12(%rax)
	movq	%rcx, 24(%rax)
	movq	-128(%rbp), %rcx
	movq	%r12, 48(%rax)
	leaq	-72(%rbp), %r12
	movq	%rcx, 32(%rax)
	movq	-112(%rbp), %rcx
	movl	%edx, 64(%rax)
	leaq	_ZNSt6thread24_M_thread_deps_never_runEv(%rip), %rdx
	movq	%rsi, 72(%rax)
	movq	%r12, %rsi
	movl	%ebx, 8(%rax)
	movq	%r13, 40(%rax)
	movq	%rcx, 56(%rax)
	movq	%rax, -72(%rbp)
	leaq	-96(%rbp), %rax
	movq	%rax, %rdi
	movq	%rax, -192(%rbp)
.LEHB4:
	call	_ZNSt6thread15_M_start_threadESt10unique_ptrINS_6_StateESt14default_deleteIS1_EEPFvvE@PLT
.LEHE4:
	movq	%r12, %rdi
	call	_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED1Ev
	movl	-156(%rbp), %r9d
	movq	%rsp, %rdx
	leaq	15(,%r9,8), %rax
	shrq	$4, %rax
	salq	$4, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	subq	%rcx, %rdx
.L84:
	cmpq	%rdx, %rsp
	je	.L85
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L84
.L85:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L86
	orq	$0, -8(%rsp,%rax)
.L86:
	movl	-152(%rbp), %ecx
	movq	%rsp, -200(%rbp)
	pushq	%r10
	movq	-144(%rbp), %rdx
	movq	%rcx, %r8
	pushq	$1
	imulq	%r15, %rcx
	movq	-120(%rbp), %rsi
	imull	%ebx, %r8d
	movq	-136(%rbp), %rdi
.LEHB5:
	.cfi_escape 0x2e,0x10
	call	cudaMemcpy2D@PLT
	popq	%r8
	movq	-200(%rbp), %r14
	xorl	%r12d, %r12d
	popq	%r9
	jmp	.L87
.L118:
	endbr64
	movq	%rax, %rbx
.L88:
	movq	%r12, %rdi
	call	_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED1Ev
	movq	%rbx, %rdi
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L115
	jmp	.L122
.L91:
	movq	%r14, %rdi
	.cfi_escape 0x2e,0
	call	cudaStreamCreate@PLT
	movl	$8388609, %eax
	movl	$8388609, %edx
	movq	(%r14), %r9
	movl	$200, %r8d
	salq	$9, %rax
	salq	$9, %rdx
	movl	$1, %ecx
	movl	$1, -64(%rbp)
	movq	%rax, -72(%rbp)
	movl	-152(%rbp), %eax
	shrl	$9, %eax
	incl	%eax
	movl	%eax, -84(%rbp)
	movabsq	$4294967297, %rax
	movq	%rax, -80(%rbp)
	movq	-84(%rbp), %rdi
	movl	-76(%rbp), %esi
	call	__cudaPushCallConfiguration@PLT
	movq	-120(%rbp), %r9
	movl	-152(%rbp), %ecx
	movq	-128(%rbp), %rsi
	testl	%eax, %eax
	je	.L127
.L90:
	movl	-152(%rbp), %esi
	movq	-120(%rbp), %rcx
	movl	$1, %r9d
	movq	%rsi, %r8
	imulq	%r15, %rsi
	movq	%rcx, %rdx
	imulq	%r12, %rdx
	addq	-128(%rbp), %rdx
	pushq	(%r14)
	imull	%ebx, %r8d
	pushq	$2
	movq	%rsi, %rdi
	imulq	%r12, %rdi
	addq	%r13, %rdi
	.cfi_escape 0x2e,0x10
	call	cudaMemcpy2DAsync@PLT
	popq	%rax
	incq	%r12
	popq	%rdx
	addq	$8, %r14
.L87:
	cmpl	-156(%rbp), %r12d
	jb	.L91
	jmp	.L128
.L127:
	pushq	%rdi
	movq	-136(%rbp), %rdi
	movl	%ebx, %r8d
	pushq	%r12
	movl	-156(%rbp), %edx
	call	_Z31__device_stub__Z5sobelPhS_jjjmiPhS_jjjmi
	popq	%rcx
	popq	%rsi
	jmp	.L90
.L128:
	xorl	%r12d, %r12d
	leaq	q(%rip), %r15
.L92:
	movl	%r12d, -180(%rbp)
	cmpl	-156(%rbp), %r12d
	jnb	.L129
	movq	-200(%rbp), %rax
	movq	(%rax,%r12,8), %rdi
	.cfi_escape 0x2e,0
	call	cudaStreamSynchronize@PLT
	movq	64+q(%rip), %rbx
	movq	48+q(%rip), %rax
	leaq	-4(%rbx), %rdx
	cmpq	%rdx, %rax
	je	.L93
	movl	-180(%rbp), %ebx
	addq	$4, %rax
	movl	%ebx, -4(%rax)
	jmp	.L94
.L93:
	movq	72+q(%rip), %rdx
	movq	40+q(%rip), %rsi
	movabsq	$2305843009213693951, %rdi
	movq	%rdx, %rbx
	subq	%rsi, %rbx
	movq	%rbx, -168(%rbp)
	sarq	$3, %rbx
	cmpq	$1, %rdx
	movq	%rbx, %rcx
	adcq	$-1, %rcx
	subq	56+q(%rip), %rax
	salq	$7, %rcx
	sarq	$2, %rax
	addq	%rcx, %rax
	movq	32+q(%rip), %rcx
	subq	16+q(%rip), %rcx
	sarq	$2, %rcx
	addq	%rcx, %rax
	cmpq	%rdi, %rax
	jne	.L95
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L122
	leaq	.LC5(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L95:
	movq	(%r15), %r8
	movq	8+q(%rip), %rax
	movq	%rdx, %rcx
	subq	%r8, %rcx
	movq	%rax, %r9
	sarq	$3, %rcx
	subq	%rcx, %r9
	cmpq	$1, %r9
	ja	.L97
	addq	$2, %rbx
	leaq	(%rbx,%rbx), %rcx
	cmpq	%rax, %rcx
	jnb	.L98
	subq	%rbx, %rax
	addq	$8, %rdx
	shrq	%rax
	subq	%rsi, %rdx
	leaq	(%r8,%rax,8), %rbx
	cmpq	%rsi, %rbx
	jnb	.L99
	movq	%rbx, %rdi
	cmpq	$8, %rdx
	jg	.L124
	jne	.L104
	movq	(%rsi), %rax
	movq	%rax, (%rbx)
	jmp	.L104
.L99:
	movq	-168(%rbp), %rax
	leaq	8(%rbx,%rax), %rdi
	cmpq	$8, %rdx
	jle	.L102
	subq	%rdx, %rdi
.L124:
	call	memmove@PLT
	jmp	.L104
.L102:
	jne	.L104
	movq	(%rsi), %rax
	movq	%rax, -8(%rdi)
	jmp	.L104
.L98:
	testq	%rax, %rax
	movl	$1, %edx
	cmovne	%rax, %rdx
	leaq	2(%rax,%rdx), %r13
	movabsq	$1152921504606846975, %rax
	cmpq	%r13, %rax
	jnb	.L105
	cmpq	%r13, %rdi
	jnb	.L106
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L122
	call	_ZSt28__throw_bad_array_new_lengthv@PLT
.L106:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L122
	call	_ZSt17__throw_bad_allocv@PLT
.L105:
	leaq	0(,%r13,8), %rdi
	call	_Znwm@PLT
	movq	%rax, %r14
	movq	%r13, %rax
	movq	40+q(%rip), %rsi
	subq	%rbx, %rax
	shrq	%rax
	leaq	(%r14,%rax,8), %rbx
	movq	72+q(%rip), %rax
	leaq	8(%rax), %rdx
	subq	%rsi, %rdx
	cmpq	$8, %rdx
	jle	.L109
	movq	%rbx, %rdi
	call	memmove@PLT
	jmp	.L110
.L109:
	jne	.L110
	movq	(%rsi), %rax
	movq	%rax, (%rbx)
.L110:
	movq	8+q(%rip), %rax
	movq	(%r15), %rdi
	leaq	0(,%rax,8), %rsi
	call	_ZdlPvm@PLT
	movq	%r14, (%r15)
	movq	%r13, 8+q(%rip)
.L104:
	movq	(%rbx), %rax
	movq	%rbx, 40+q(%rip)
	movq	%rax, 24+q(%rip)
	addq	$512, %rax
	movq	%rax, 32+q(%rip)
	movq	-168(%rbp), %rax
	addq	%rax, %rbx
	movq	(%rbx), %rax
	movq	%rbx, 72+q(%rip)
	movq	%rax, 56+q(%rip)
	addq	$512, %rax
	movq	%rax, 64+q(%rip)
.L97:
	movl	$512, %edi
	movq	72+q(%rip), %rbx
	call	_Znwm@PLT
	movq	%rax, 8(%rbx)
	movl	-180(%rbp), %ebx
	movq	48+q(%rip), %rax
	movl	%ebx, (%rax)
	movq	72+q(%rip), %rax
	leaq	8(%rax), %rdx
	movq	8(%rax), %rax
	movq	%rdx, 72+q(%rip)
	leaq	512(%rax), %rdx
	movq	%rax, 56+q(%rip)
	movq	%rdx, 64+q(%rip)
.L94:
	leaq	cv(%rip), %rdi
	movq	%rax, 48+q(%rip)
	incq	%r12
	call	_ZNSt18condition_variable10notify_allEv@PLT
	jmp	.L92
.L129:
	movq	-192(%rbp), %rdi
	call	_ZNSt6thread4joinEv@PLT
	movq	-136(%rbp), %rdi
	call	cudaFree@PLT
	movq	-128(%rbp), %rdi
	call	cudaFree@PLT
	movq	-112(%rbp), %rdi
	xorl	%esi, %esi
	call	png_write_end@PLT
	leaq	-104(%rbp), %rsi
	leaq	-112(%rbp), %rdi
	call	png_destroy_write_struct@PLT
	movq	-176(%rbp), %rdi
	call	fclose@PLT
.LEHE5:
	cmpq	$0, -96(%rbp)
	je	.L112
.L114:
	call	_ZSt9terminatev@PLT
.L112:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L116
	jmp	.L122
.L117:
	endbr64
	movq	%rax, %rdi
.L113:
	cmpq	$0, -96(%rbp)
	jne	.L114
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L122
.L115:
.LEHB6:
	call	_Unwind_Resume@PLT
.LEHE6:
.L122:
	call	__stack_chk_fail@PLT
.L116:
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4941:
	.section	.gcc_except_table
.LLSDA4941:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4941-.LLSDACSB4941
.LLSDACSB4941:
	.uleb128 .LEHB3-.LFB4941
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB4-.LFB4941
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L118-.LFB4941
	.uleb128 0
	.uleb128 .LEHB5-.LFB4941
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L117-.LFB4941
	.uleb128 0
	.uleb128 .LEHB6-.LFB4941
	.uleb128 .LEHE6-.LEHB6
	.uleb128 0
	.uleb128 0
.LLSDACSE4941:
	.section	.text.startup
	.size	main, .-main
	.type	_GLOBAL__sub_I__Z8read_pngPKcPPhPjS3_S3_, @function
_GLOBAL__sub_I__Z8read_pngPKcPPhPjS3_S3_:
.LFB6087:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA6087
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%edi, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	pushq	%rsi
	.cfi_def_cfa_offset 32
	movq	%rdi, q(%rip)
	movq	%rdi, 16+q(%rip)
	movq	%rdi, 24+q(%rip)
	movq	%rdi, 32+q(%rip)
	movq	%rdi, 40+q(%rip)
	movq	%rdi, 48+q(%rip)
	movq	%rdi, 56+q(%rip)
	movq	%rdi, 64+q(%rip)
	movq	%rdi, 72+q(%rip)
	movl	$64, %edi
	movq	$8, 8+q(%rip)
.LEHB7:
	call	_Znwm@PLT
.LEHE7:
	movq	8+q(%rip), %rdx
	movl	$512, %edi
	movq	%rax, q(%rip)
	leaq	-4(,%rdx,4), %rdx
	andq	$-8, %rdx
	leaq	(%rax,%rdx), %rbx
.LEHB8:
	call	_Znwm@PLT
.LEHE8:
	movq	%rax, (%rbx)
	leaq	512(%rax), %rdx
	leaq	__dso_handle(%rip), %rbp
	leaq	q(%rip), %rsi
	movq	%rbx, 40+q(%rip)
	leaq	_ZNSt5queueIiSt5dequeIiSaIiEEED1Ev(%rip), %rdi
	movq	%rdx, 32+q(%rip)
	movq	%rbx, 72+q(%rip)
	leaq	cv(%rip), %rbx
	movq	%rdx, 64+q(%rip)
	movq	%rbp, %rdx
	movq	%rax, 24+q(%rip)
	movq	%rax, 56+q(%rip)
	movq	%rax, 16+q(%rip)
	movq	%rax, 48+q(%rip)
	call	__cxa_atexit@PLT
	movq	%rbx, %rdi
	call	_ZNSt18condition_variableC1Ev@PLT
	movq	_ZNSt18condition_variableD1Ev@GOTPCREL(%rip), %rdi
	movq	%rbp, %rdx
	popq	%rcx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movq	%rbx, %rsi
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	__cxa_atexit@PLT
.L135:
	.cfi_restore_state
	endbr64
	movq	%rax, %rdi
.L131:
	call	__cxa_begin_catch@PLT
.LEHB9:
	call	__cxa_rethrow@PLT
.LEHE9:
.L136:
	endbr64
	movq	%rax, %rbx
.L132:
	call	__cxa_end_catch@PLT
	movq	%rbx, %rdi
	call	__cxa_begin_catch@PLT
	movq	8+q(%rip), %rax
	movq	q(%rip), %rdi
	leaq	0(,%rax,8), %rsi
	call	_ZdlPvm@PLT
	xorl	%eax, %eax
	movq	%rax, q(%rip)
	movq	%rax, 8+q(%rip)
.LEHB10:
	call	__cxa_rethrow@PLT
.LEHE10:
.L134:
	endbr64
	movq	%rax, %rbx
.L133:
	call	__cxa_end_catch@PLT
	movq	%rbx, %rdi
.LEHB11:
	call	_Unwind_Resume@PLT
.LEHE11:
	.cfi_endproc
.LFE6087:
	.section	.gcc_except_table
	.align 4
.LLSDA6087:
	.byte	0xff
	.byte	0x9b
	.uleb128 .LLSDATT6087-.LLSDATTD6087
.LLSDATTD6087:
	.byte	0x1
	.uleb128 .LLSDACSE6087-.LLSDACSB6087
.LLSDACSB6087:
	.uleb128 .LEHB7-.LFB6087
	.uleb128 .LEHE7-.LEHB7
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB8-.LFB6087
	.uleb128 .LEHE8-.LEHB8
	.uleb128 .L135-.LFB6087
	.uleb128 0x1
	.uleb128 .LEHB9-.LFB6087
	.uleb128 .LEHE9-.LEHB9
	.uleb128 .L136-.LFB6087
	.uleb128 0x3
	.uleb128 .LEHB10-.LFB6087
	.uleb128 .LEHE10-.LEHB10
	.uleb128 .L134-.LFB6087
	.uleb128 0
	.uleb128 .LEHB11-.LFB6087
	.uleb128 .LEHE11-.LEHB11
	.uleb128 0
	.uleb128 0
.LLSDACSE6087:
	.byte	0x1
	.byte	0
	.byte	0
	.byte	0x7d
	.align 4
	.long	0

.LLSDATT6087:
	.section	.text.startup
	.size	_GLOBAL__sub_I__Z8read_pngPKcPPhPjS3_S3_, .-_GLOBAL__sub_I__Z8read_pngPKcPPhPjS3_S3_
	.section	.init_array
	.align 8
	.quad	_GLOBAL__sub_I__Z8read_pngPKcPPhPjS3_S3_
	.weak	_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE
	.section	.rodata._ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE,"aG",@progbits,_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE,comdat
	.align 32
	.type	_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE, @object
	.size	_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE, 106
_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE:
	.string	"NSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE"
	.weak	_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE
	.section	.data.rel.ro._ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE,"awG",@progbits,_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE,comdat
	.align 8
	.type	_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE, @object
	.size	_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE, 24
_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE:
	.quad	_ZTVN10__cxxabiv120__si_class_type_infoE+16
	.quad	_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE
	.quad	_ZTINSt6thread6_StateE
	.weak	_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE
	.section	.data.rel.ro.local._ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE,"awG",@progbits,_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE,comdat
	.align 8
	.type	_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE, @object
	.size	_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE, 40
_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE:
	.quad	0
	.quad	_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE
	.quad	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED1Ev
	.quad	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED0Ev
	.quad	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv
	.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
	.globl	cv
	.bss
	.align 32
	.type	cv, @object
	.size	cv, 48
cv:
	.zero	48
	.globl	cvLock
	.align 32
	.type	cvLock, @object
	.size	cvLock, 40
cvLock:
	.zero	40
	.globl	qLock
	.align 32
	.type	qLock, @object
	.size	qLock, 40
qLock:
	.zero	40
	.globl	q
	.align 32
	.type	q, @object
	.size	q, 80
q:
	.zero	80
	.local	_ZL5_mask
	.comm	_ZL5_mask,200,32
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.hidden	__dso_handle
	.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 <iostream>
#include <cstdlib>
#include <cassert>
#include <zlib.h>
#include <png.h>
#include <queue>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <vector>
using namespace std;

#define MASK_N 2
#define MASK_X 5
#define MASK_Y 5
#define SCALE 8
#define NUM_THREAD 512

__constant__ int _mask[MASK_N][MASK_X][MASK_Y] = { 
    {{ -1, -4, -6, -4, -1},
     { -2, -8,-12, -8, -2},
     {  0,  0,  0,  0,  0}, 
     {  2,  8, 12,  8,  2}, 
     {  1,  4,  6,  4,  1}},
    {{ -1, -2,  0,  2,  1}, 
     { -4, -8,  0,  8,  4}, 
     { -6,-12,  0, 12,  6}, 
     { -4, -8,  0,  8,  4}, 
     { -1, -2,  0,  2,  1}} 
};

int read_png(const char* filename, unsigned char** image, unsigned* height, 
			 unsigned* width, unsigned* channels) {

	unsigned char sig[8];
	FILE* infile;
	infile = fopen(filename, "rb");

    fread(sig, 1, 8, infile);
    if (!png_check_sig(sig, 8))
        return 1;   /* bad signature */

	png_structp png_ptr;
	png_infop info_ptr;

    png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
    if (!png_ptr)
        return 4;   /* out of memory */
  
    info_ptr = png_create_info_struct(png_ptr);
    if (!info_ptr) {
        png_destroy_read_struct(&png_ptr, NULL, NULL);
        return 4;   /* out of memory */
    }

	png_init_io(png_ptr, infile);
    png_set_sig_bytes(png_ptr, 8);
    png_read_info(png_ptr, info_ptr);
	int bit_depth, color_type;
	png_get_IHDR(png_ptr, info_ptr, width, height, &bit_depth, &color_type, NULL, NULL, NULL);

	png_uint_32  i, rowbytes;
    png_bytep  row_pointers[*height];
    png_read_update_info(png_ptr, info_ptr);
    rowbytes = png_get_rowbytes(png_ptr, info_ptr);
    *channels = (int) png_get_channels(png_ptr, info_ptr);

    if ((*image = (unsigned char *) malloc(rowbytes * *height)) == NULL) {
        png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
        return 3;
    }

    for (i = 0;  i < *height;  ++i)
        row_pointers[i] = *image + i * rowbytes;
	png_read_image(png_ptr, row_pointers);
	png_read_end(png_ptr, NULL);
	return 0;
}

void write_png(const char* filename, png_bytep image, const unsigned height, const unsigned width, 
			   const unsigned channels) {
    FILE* fp = fopen(filename, "wb");
    png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
    png_infop info_ptr = png_create_info_struct(png_ptr);
    png_init_io(png_ptr, fp);
    png_set_IHDR(png_ptr, info_ptr, width, height, 8,
                 PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
                 PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
    png_set_filter(png_ptr, 0, PNG_NO_FILTERS);
    png_write_info(png_ptr, info_ptr);
	png_set_compression_level(png_ptr, 1);

	png_bytep row_ptr[height];
	for (int i = 0; i < height; ++ i) {
		row_ptr[i] = image + i * width * channels * sizeof(unsigned char);
	}
	png_write_image(png_ptr, row_ptr);
    png_write_end(png_ptr, NULL);
    png_destroy_write_struct(&png_ptr, &info_ptr);
    fclose(fp);
}

__global__ void sobel (unsigned char* s, unsigned char* t, unsigned height, unsigned width, unsigned channels, size_t pitch, int y) {
	int  x, i, v, u;
	int  R, G, B;
	double val[MASK_N*3] = {0.0};
    const int adjustX=1, adjustY=1, xBound=2, yBound=2;
    x = (blockIdx.x * NUM_THREAD + threadIdx.x)%width;

    __shared__ int mask[MASK_N][MASK_X][MASK_Y];
    mask[(x/25)%2][(x/5)%5][x%5] = _mask[(x/25)%2][(x/5)%5][x%5];
    __syncthreads();

    for (i = 0; i < MASK_N; ++i) {

        val[i*3+2] = 0.0;
        val[i*3+1] = 0.0;
        val[i*3] = 0.0;
        for (v = -yBound; v < yBound + adjustY; ++v) {
            #pragma unroll 5
            for (u = -xBound; u < xBound + adjustX; ++u) {
                int valid = (x + u) >= 0 && (x + u) < width && y + v >= 0 && y + v < height;
                R = s[((pitch * (y+v) + (x+u)*channels) + 2)*valid]*valid;
                G = s[((pitch * (y+v) + (x+u)*channels) + 1)*valid]*valid;
                B = s[((pitch * (y+v) + (x+u)*channels) + 0)*valid]*valid;
                val[i*3+2] += R * mask[i][u + xBound][v + yBound];
                val[i*3+1] += G * mask[i][u + xBound][v + yBound];
                val[i*3+0] += B * mask[i][u + xBound][v + yBound];
            }
        }
    }

    double totalR = 0.0;
    double totalG = 0.0;
    double totalB = 0.0;
    
    #pragma unroll 5
    for (i = 0; i < MASK_N; ++i) {
        totalR += val[i * 3 + 2] * val[i * 3 + 2];
        totalG += val[i * 3 + 1] * val[i * 3 + 1];
        totalB += val[i * 3 + 0] * val[i * 3 + 0];
    }

    totalR = sqrt(totalR) / SCALE;
    totalG = sqrt(totalG) / SCALE;
    totalB = sqrt(totalB) / SCALE;
    const unsigned char cR = min(255.0,totalR);
    const unsigned char cG = min(255.0,totalG);
    const unsigned char cB = min(255.0,totalB);
    t[(pitch * y + x*channels) + 2] = cR;
    t[(pitch * y + x*channels) + 1] = cG;
    t[(pitch * y + x*channels) + 0] = cB;
}

queue<int> q;
mutex qLock;
mutex cvLock;
condition_variable cv;

void png_writer(int n,png_structp png_ptr,png_bytep* row_ptr,unsigned char* host_t,unsigned char* device_t,size_t pitch,int width,int height,int channels){
    while(n--){
        if(q.empty()){
            unique_lock<mutex> ul(cvLock);
            cv.wait(ul);
        }
        qLock.lock();
        int i = q.front();
        q.pop();
        qLock.unlock();
        
        // cudaMemcpy2D(host_t+sizeof(char)*width*channels*i,sizeof(char)*width*channels,device_t+pitch*i,pitch,width*channels,1,cudaMemcpyDeviceToHost);
        png_write_row(png_ptr,host_t + i * width * channels * sizeof(unsigned char));
    }
}

int main(int argc, char** argv) {

    assert(argc == 3);
	unsigned height, width, channels;
	unsigned char* host_s = NULL;
	read_png(argv[1], &host_s, &height, &width, &channels);
    unsigned char* host_t = (unsigned char*) malloc(height * width * channels * sizeof(unsigned char));

    unsigned char* device_s;
    unsigned char* device_t;
    size_t pitch;
    hipMallocPitch(&device_s,&pitch,sizeof(unsigned char)*width*channels,height);
    hipMallocPitch(&device_t,&pitch,sizeof(unsigned char)*width*channels,height);
    FILE* fp = fopen(argv[2], "wb");
    png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
    png_infop info_ptr = png_create_info_struct(png_ptr);
    png_init_io(png_ptr, fp);
    png_set_IHDR(png_ptr, info_ptr, width, height, 8,
                 PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
                 PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
    png_set_filter(png_ptr, 0, PNG_NO_FILTERS);
    png_write_info(png_ptr, info_ptr);
	png_set_compression_level(png_ptr, 1);

	png_bytep* row_ptr = new png_bytep[height];
	for (int i = 0; i < height; ++ i) {
		row_ptr[i] = host_t + i * width * channels * sizeof(unsigned char);
    } 
    
    thread t(png_writer,height,png_ptr,row_ptr,host_t,device_t,pitch,width,height,channels);

    hipStream_t streams[height];
    hipMemcpy2D(device_s,pitch,host_s,sizeof(char)*width*channels,width*channels,height,hipMemcpyHostToDevice);
    for(int i=0;i<height;i++){
        hipStreamCreate(&streams[i]);
        sobel<<<width/NUM_THREAD+1,NUM_THREAD,sizeof(int)*50,streams[i]>>> (device_s, device_t, height, width, channels, pitch, i);
        hipMemcpy2DAsync(host_t+sizeof(char)*width*channels*i,sizeof(char)*width*channels,device_t+pitch*i,pitch,width*channels,1,hipMemcpyDeviceToHost,streams[i]);        // lock_guard<mutex> lg(qLock);
        // q.push(i);
        // cv.notify_all();
    }
    for(int i=0;i<height;i++){
        hipStreamSynchronize(streams[i]);
        q.push(i);
        cv.notify_all();
    }
    t.join();
    
    hipFree(device_s);
    hipFree(device_t);

    
    // png_write_image(png_ptr, row_ptr);
    png_write_end(png_ptr, NULL);
    png_destroy_write_struct(&png_ptr, &info_ptr);
    fclose(fp);

    return 0;
}

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

                                        # End of file scope inline assembly
	.globl	_Z8read_pngPKcPPhPjS3_S3_       # -- Begin function _Z8read_pngPKcPPhPjS3_S3_
	.type	_Z8read_pngPKcPPhPjS3_S3_,@function
_Z8read_pngPKcPPhPjS3_S3_:              # @_Z8read_pngPKcPPhPjS3_S3_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -72(%rbp)                  # 8-byte Spill
	movq	%rcx, %r13
	movq	%rdx, %r12
	movq	%rsi, %r15
	movl	$.L.str, %esi
	callq	fopen
	movq	%rax, %rbx
	leaq	-96(%rbp), %r14
	movl	$1, %esi
	movl	$8, %edx
	movq	%r14, %rdi
	movq	%rax, %rcx
	callq	fread
	movl	$8, %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	png_sig_cmp
	movl	$1, %r14d
	testl	%eax, %eax
	je	.LBB0_1
.LBB0_10:
	movl	%r14d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	retq
.LBB0_1:
	.cfi_def_cfa %rbp, 16
	movq	%r15, -64(%rbp)                 # 8-byte Spill
	movq	%r13, -56(%rbp)                 # 8-byte Spill
	movl	$.L.str.1, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	png_create_read_struct
	movq	%rax, -48(%rbp)
	movl	$4, %r14d
	testq	%rax, %rax
	je	.LBB0_10
# %bb.2:
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	png_create_info_struct
	movq	%rax, -80(%rbp)
	testq	%rax, %rax
	je	.LBB0_3
# %bb.4:
	movq	%rax, %r13
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	png_init_io
	movq	-48(%rbp), %rdi
	movl	$8, %esi
	callq	png_set_sig_bytes
	movq	-48(%rbp), %rdi
	movq	%r13, %rsi
	callq	png_read_info
	movq	-48(%rbp), %rdi
	subq	$32, %rsp
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rsp)
	movq	$0, 16(%rsp)
	leaq	-88(%rbp), %r8
	leaq	-84(%rbp), %r9
	movq	%r13, %rsi
	movq	-56(%rbp), %rdx                 # 8-byte Reload
	movq	%r12, %r14
	movq	%r12, %rcx
	callq	png_get_IHDR
	addq	$32, %rsp
	movq	%rsp, %r15
	movl	(%r12), %eax
	movq	%rsp, %r12
	leaq	15(,%rax,8), %rax
	andq	$-16, %rax
	subq	%rax, %r12
	movq	%r12, %rsp
	movq	-48(%rbp), %rdi
	movq	%r13, %rsi
	callq	png_read_update_info
	movq	-48(%rbp), %rdi
	movq	%r13, %rsi
	callq	png_get_rowbytes
	movq	%rax, %rbx
	movq	-48(%rbp), %rdi
	movq	%r13, %rsi
	callq	png_get_channels
	movzbl	%al, %eax
	movq	-72(%rbp), %rcx                 # 8-byte Reload
	movl	%eax, (%rcx)
	movl	(%r14), %r14d
	movl	%r14d, %edi
	imull	%ebx, %edi
	callq	malloc
	movq	-64(%rbp), %rcx                 # 8-byte Reload
	movq	%rax, (%rcx)
	testq	%rax, %rax
	je	.LBB0_11
# %bb.5:                                # %.preheader
	testq	%r14, %r14
	je	.LBB0_8
# %bb.6:                                # %.lr.ph.preheader
	xorl	%ecx, %ecx
	xorl	%edx, %edx
.LBB0_7:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	%ecx, %esi
	addq	%rax, %rsi
	movq	%rsi, (%r12,%rdx,8)
	incq	%rdx
	addq	%rbx, %rcx
	cmpq	%rdx, %r14
	jne	.LBB0_7
.LBB0_8:                                # %._crit_edge
	movq	-48(%rbp), %rdi
	movq	%r12, %rsi
	callq	png_read_image
	movq	-48(%rbp), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	png_read_end
	jmp	.LBB0_9
.LBB0_3:
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	png_destroy_read_struct
	jmp	.LBB0_10
.LBB0_11:
	leaq	-48(%rbp), %rdi
	leaq	-80(%rbp), %rsi
	xorl	%edx, %edx
	callq	png_destroy_read_struct
	movl	$3, %r14d
.LBB0_9:
	movq	%r15, %rsp
	jmp	.LBB0_10
.Lfunc_end0:
	.size	_Z8read_pngPKcPPhPjS3_S3_, .Lfunc_end0-_Z8read_pngPKcPPhPjS3_S3_
	.cfi_endproc
                                        # -- End function
	.globl	_Z9write_pngPKcPhjjj            # -- Begin function _Z9write_pngPKcPhjjj
	.type	_Z9write_pngPKcPhjjj,@function
_Z9write_pngPKcPhjjj:                   # @_Z9write_pngPKcPhjjj
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r14d
	movl	%ecx, -44(%rbp)                 # 4-byte Spill
	movl	%edx, -48(%rbp)                 # 4-byte Spill
	movq	%rsi, %r15
	movl	$.L.str.2, %esi
	callq	fopen
	movq	%rax, -56(%rbp)                 # 8-byte Spill
	xorl	%ebx, %ebx
	movl	$.L.str.1, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	png_create_write_struct
	movq	%rax, %r12
	movq	%rax, -72(%rbp)
	movq	%rax, %rdi
	callq	png_create_info_struct
	movq	%rax, %r13
	movq	%rax, -64(%rbp)
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 # 8-byte Reload
	callq	png_init_io
	subq	$8, %rsp
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	-44(%rbp), %edx                 # 4-byte Reload
	movl	-48(%rbp), %ecx                 # 4-byte Reload
	movl	$8, %r8d
	movl	$2, %r9d
	pushq	%rbx
	pushq	%rbx
	pushq	%rbx
	callq	png_set_IHDR
	addq	$32, %rsp
	movq	%r12, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	png_set_filter
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	png_write_info
	movq	%r12, %rdi
	movl	$1, %esi
	callq	png_set_compression_level
	movq	%rsp, %r13
	movl	-48(%rbp), %edx                 # 4-byte Reload
	movl	%edx, %eax
	movq	%rsp, %rsi
	leaq	15(,%rax,8), %rcx
	andq	$-16, %rcx
	subq	%rcx, %rsi
	movq	%rsi, %rsp
	testl	%edx, %edx
	je	.LBB1_3
# %bb.1:                                # %.lr.ph
	imull	-44(%rbp), %r14d                # 4-byte Folded Reload
	xorl	%ecx, %ecx
.LBB1_2:                                # =>This Inner Loop Header: Depth=1
	movl	%ebx, %edx
	addq	%r15, %rdx
	movq	%rdx, (%rsi,%rcx,8)
	incq	%rcx
	addl	%r14d, %ebx
	cmpq	%rcx, %rax
	jne	.LBB1_2
.LBB1_3:                                # %._crit_edge
	movq	%r12, %rdi
	callq	png_write_image
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	png_write_end
	leaq	-72(%rbp), %rdi
	leaq	-64(%rbp), %rsi
	callq	png_destroy_write_struct
	movq	-56(%rbp), %rdi                 # 8-byte Reload
	callq	fclose
	movq	%r13, %rsp
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	retq
.Lfunc_end1:
	.size	_Z9write_pngPKcPhjjj, .Lfunc_end1-_Z9write_pngPKcPhjjj
	.cfi_endproc
                                        # -- End function
	.globl	_Z20__device_stub__sobelPhS_jjjmi # -- Begin function _Z20__device_stub__sobelPhS_jjjmi
	.type	_Z20__device_stub__sobelPhS_jjjmi,@function
_Z20__device_stub__sobelPhS_jjjmi:      # @_Z20__device_stub__sobelPhS_jjjmi
	.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	$160, %rsp
	.cfi_def_cfa_offset 208
	.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	20(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	16(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	12(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	40(%rsp), %r8
	movq	%r9, (%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	208(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%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	$_Z5sobelPhS_jjjmi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$176, %rsp
	.cfi_adjust_cfa_offset -176
	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_end2:
	.size	_Z20__device_stub__sobelPhS_jjjmi, .Lfunc_end2-_Z20__device_stub__sobelPhS_jjjmi
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt5queueIiSt5dequeIiSaIiEEED2Ev,"axG",@progbits,_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev,comdat
	.weak	_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev # -- Begin function _ZNSt5queueIiSt5dequeIiSaIiEEED2Ev
	.p2align	1, 0x90
	.type	_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev,@function
_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev:     # @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev
	.cfi_startproc
# %bb.0:
	jmp	_ZNSt11_Deque_baseIiSaIiEED2Ev  # TAILCALL
.Lfunc_end3:
	.size	_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev, .Lfunc_end3-_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev
	.cfi_endproc
                                        # -- End function
	.text
	.globl	_Z10png_writeriP14png_struct_defPPhS1_S1_miii # -- Begin function _Z10png_writeriP14png_struct_defPPhS1_S1_miii
	.type	_Z10png_writeriP14png_struct_defPPhS1_S1_miii,@function
_Z10png_writeriP14png_struct_defPPhS1_S1_miii: # @_Z10png_writeriP14png_struct_defPPhS1_S1_miii
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	testl	%edi, %edi
	je	.LBB4_7
# %bb.1:                                # %.lr.ph
	movq	%rcx, %rbx
	movq	%rsi, %r14
	movl	%edi, %ebp
	movl	80(%rsp), %r12d
	imull	96(%rsp), %r12d
	leaq	8(%rsp), %r15
.LBB4_2:                                # =>This Inner Loop Header: Depth=1
	movq	q+48(%rip), %rax
	cmpq	q+16(%rip), %rax
	jne	.LBB4_5
# %bb.3:                                #   in Loop: Header=BB4_2 Depth=1
	movq	$cvLock, 8(%rsp)
	movb	$0, 16(%rsp)
	movq	%r15, %rdi
	callq	_ZNSt11unique_lockISt5mutexE4lockEv
	movb	$1, 16(%rsp)
.Ltmp0:
	movl	$cv, %edi
	movq	%r15, %rsi
	callq	_ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE
.Ltmp1:
# %bb.4:                                #   in Loop: Header=BB4_2 Depth=1
	movq	%r15, %rdi
	callq	_ZNSt11unique_lockISt5mutexED2Ev
.LBB4_5:                                #   in Loop: Header=BB4_2 Depth=1
	movl	$qLock, %edi
	callq	pthread_mutex_lock
	testl	%eax, %eax
	jne	.LBB4_9
# %bb.6:                                # %_ZNSt5mutex4lockEv.exit
                                        #   in Loop: Header=BB4_2 Depth=1
	decl	%ebp
	movq	q+16(%rip), %rax
	movl	(%rax), %r13d
	imull	%r12d, %r13d
	movl	$q, %edi
	callq	_ZNSt5dequeIiSaIiEE9pop_frontEv
	movl	$qLock, %edi
	callq	pthread_mutex_unlock
	movslq	%r13d, %rsi
	addq	%rbx, %rsi
	movq	%r14, %rdi
	callq	png_write_row
	testl	%ebp, %ebp
	jne	.LBB4_2
.LBB4_7:                                # %._crit_edge
	addq	$24, %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
.LBB4_9:
	.cfi_def_cfa_offset 80
	movl	%eax, %edi
	callq	_ZSt20__throw_system_errori
.LBB4_8:
.Ltmp2:
	movq	%rax, %rbx
	leaq	8(%rsp), %rdi
	callq	_ZNSt11unique_lockISt5mutexED2Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end4:
	.size	_Z10png_writeriP14png_struct_defPPhS1_S1_miii, .Lfunc_end4-_Z10png_writeriP14png_struct_defPPhS1_S1_miii
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table4:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp1-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Lfunc_end4-.Ltmp1             #   Call between .Ltmp1 and .Lfunc_end4
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt11unique_lockISt5mutexED2Ev,"axG",@progbits,_ZNSt11unique_lockISt5mutexED2Ev,comdat
	.weak	_ZNSt11unique_lockISt5mutexED2Ev # -- Begin function _ZNSt11unique_lockISt5mutexED2Ev
	.p2align	1, 0x90
	.type	_ZNSt11unique_lockISt5mutexED2Ev,@function
_ZNSt11unique_lockISt5mutexED2Ev:       # @_ZNSt11unique_lockISt5mutexED2Ev
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	cmpb	$0, 8(%rdi)
	je	.LBB5_2
# %bb.1:
.Ltmp3:
	callq	_ZNSt11unique_lockISt5mutexE6unlockEv
.Ltmp4:
.LBB5_2:
	popq	%rax
	.cfi_def_cfa_offset 8
	retq
.LBB5_3:
	.cfi_def_cfa_offset 16
.Ltmp5:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end5:
	.size	_ZNSt11unique_lockISt5mutexED2Ev, .Lfunc_end5-_ZNSt11unique_lockISt5mutexED2Ev
	.cfi_endproc
	.section	.gcc_except_table._ZNSt11unique_lockISt5mutexED2Ev,"aG",@progbits,_ZNSt11unique_lockISt5mutexED2Ev,comdat
	.p2align	2, 0x0
GCC_except_table5:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Ltmp3-.Lfunc_begin1           # >> Call Site 1 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin1           #     jumps to .Ltmp5
	.byte	1                               #   On action: 1
.Lcst_end1:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
.Lfunc_begin2:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception2
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	leaq	-144(%rbp), %rsi
	movq	$0, (%rsi)
	movq	8(%rbx), %rdi
	.cfi_escape 0x2e, 0x00
	leaq	-48(%rbp), %r12
	leaq	-44(%rbp), %r15
	leaq	-56(%rbp), %r14
	movq	%r12, %rdx
	movq	%r15, %rcx
	movq	%r14, %r8
	callq	_Z8read_pngPKcPPhPjS3_S3_
	movl	(%r12), %r12d
	movl	(%r15), %r13d
	movl	%r13d, %edi
	imull	%r12d, %edi
	movl	(%r14), %r15d
	imull	%r15d, %edi
	.cfi_escape 0x2e, 0x00
	callq	malloc
	movq	%rax, -104(%rbp)
	imulq	%r15, %r13
	.cfi_escape 0x2e, 0x00
	leaq	-96(%rbp), %rdi
	leaq	-64(%rbp), %r14
	movq	%r14, %rsi
	movq	%r13, %rdx
	movq	%r12, %rcx
	callq	hipMallocPitch
	leaq	-44(%rbp), %rax
	movl	(%rax), %edx
	imulq	%r15, %rdx
	leaq	-48(%rbp), %rax
	movl	(%rax), %ecx
	.cfi_escape 0x2e, 0x00
	leaq	-72(%rbp), %rdi
	movq	%r14, %rsi
	callq	hipMallocPitch
	movq	16(%rbx), %rdi
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.2, %esi
	callq	fopen
	movq	%rax, %r14
	.cfi_escape 0x2e, 0x00
	xorl	%r13d, %r13d
	movl	$.L.str.1, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	png_create_write_struct
	movq	%rax, %rbx
	movq	%rax, -88(%rbp)
	.cfi_escape 0x2e, 0x00
	movq	%rax, %rdi
	callq	png_create_info_struct
	movq	%rax, %r12
	movq	%rax, -136(%rbp)
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	movq	%r14, -128(%rbp)                # 8-byte Spill
	movq	%r14, %rsi
	leaq	-48(%rbp), %r14
	callq	png_init_io
	leaq	-44(%rbp), %rax
	movl	(%rax), %edx
	movl	(%r14), %ecx
	.cfi_escape 0x2e, 0x20
	subq	$8, %rsp
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	$8, %r8d
	movl	$2, %r9d
	pushq	%r13
	pushq	%r13
	pushq	%r13
	callq	png_set_IHDR
	addq	$32, %rsp
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	png_set_filter
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	png_write_info
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	png_set_compression_level
	movl	(%r14), %ebx
	leaq	(,%rbx,8), %rdi
	.cfi_escape 0x2e, 0x00
	callq	_Znam
	movq	%rax, -112(%rbp)
	testq	%rbx, %rbx
	je	.LBB6_3
# %bb.1:                                # %.lr.ph
	movl	-44(%rbp), %eax
	imull	%r15d, %eax
	xorl	%ecx, %ecx
.LBB6_2:                                # =>This Inner Loop Header: Depth=1
	movl	%r13d, %edx
	addq	-104(%rbp), %rdx
	movq	-112(%rbp), %rsi
	movq	%rdx, (%rsi,%rcx,8)
	incq	%rcx
	addl	%eax, %r13d
	cmpq	%rcx, %rbx
	jne	.LBB6_2
.LBB6_3:                                # %._crit_edge
	.cfi_escape 0x2e, 0x30
	subq	$8, %rsp
	leaq	-80(%rbp), %rdi
	leaq	-88(%rbp), %rcx
	leaq	-112(%rbp), %r8
	leaq	-104(%rbp), %r9
	movl	$_Z10png_writeriP14png_struct_defPPhS1_S1_miii, %esi
	movq	%r14, %rdx
	leaq	-56(%rbp), %rax
	pushq	%rax
	pushq	%r14
	leaq	-44(%rbp), %rax
	pushq	%rax
	leaq	-64(%rbp), %rax
	pushq	%rax
	leaq	-72(%rbp), %rax
	pushq	%rax
	callq	_ZNSt6threadC2IRFviP14png_struct_defPPhS3_S3_miiiEJRjRS2_RS4_RS3_SA_RmS7_S7_S7_EvEEOT_DpOT0_
	addq	$48, %rsp
	movq	%rsp, %r14
	movl	-48(%rbp), %eax
	.cfi_escape 0x2e, 0x00
	movq	%rsp, %r15
	leaq	15(,%rax,8), %rax
	andq	$-16, %rax
	subq	%rax, %r15
	movq	%r15, %rsp
	movq	-96(%rbp), %rdi
	movq	-64(%rbp), %rsi
	movq	-144(%rbp), %rdx
	movl	-44(%rbp), %eax
	movl	-56(%rbp), %r8d
	movq	%r8, %rcx
	imulq	%rax, %rcx
	imull	%eax, %r8d
	movl	-48(%rbp), %r9d
.Ltmp6:
	.cfi_escape 0x2e, 0x10
	subq	$8, %rsp
	pushq	$1
	callq	hipMemcpy2D
	addq	$16, %rsp
.Ltmp7:
# %bb.4:                                # %.preheader
	cmpl	$0, -48(%rbp)
	je	.LBB6_20
# %bb.5:                                # %.lr.ph34.preheader
	movq	%r14, -120(%rbp)                # 8-byte Spill
	xorl	%r12d, %r12d
	movabsq	$4294967297, %r13               # imm = 0x100000001
	movabsq	$4294967808, %rbx               # imm = 0x100000200
	xorl	%r14d, %r14d
.LBB6_6:                                # %.lr.ph34
                                        # =>This Inner Loop Header: Depth=1
	leaq	(%r15,%r12), %rdi
.Ltmp8:
	.cfi_escape 0x2e, 0x00
	callq	hipStreamCreate
.Ltmp9:
# %bb.7:                                #   in Loop: Header=BB6_6 Depth=1
	movl	-44(%rbp), %edi
	shrl	$9, %edi
	addq	%r13, %rdi
	movq	(%r15,%r14,8), %r9
.Ltmp10:
	.cfi_escape 0x2e, 0x00
	movl	$200, %r8d
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	__hipPushCallConfiguration
.Ltmp11:
# %bb.8:                                #   in Loop: Header=BB6_6 Depth=1
	testl	%eax, %eax
	jne	.LBB6_10
# %bb.9:                                #   in Loop: Header=BB6_6 Depth=1
	movq	-96(%rbp), %rdi
	movq	-72(%rbp), %rsi
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %ecx
	movl	-56(%rbp), %r8d
	movq	-64(%rbp), %r9
.Ltmp12:
	.cfi_escape 0x2e, 0x10
	subq	$8, %rsp
	pushq	%r14
	callq	_Z20__device_stub__sobelPhS_jjjmi
	addq	$16, %rsp
.Ltmp13:
.LBB6_10:                               #   in Loop: Header=BB6_6 Depth=1
	movl	-44(%rbp), %eax
	movl	-56(%rbp), %r8d
	movq	%r8, %rsi
	imulq	%rax, %rsi
	movq	%rsi, %rdi
	imulq	%r14, %rdi
	addq	-104(%rbp), %rdi
	movq	-64(%rbp), %rcx
	movq	%rcx, %rdx
	imulq	%r14, %rdx
	addq	-72(%rbp), %rdx
	imull	%eax, %r8d
.Ltmp14:
	.cfi_escape 0x2e, 0x10
	movl	$1, %r9d
	pushq	(%r15,%r14,8)
	pushq	$2
	callq	hipMemcpy2DAsync
	addq	$16, %rsp
.Ltmp15:
# %bb.11:                               #   in Loop: Header=BB6_6 Depth=1
	incq	%r14
	movl	-48(%rbp), %eax
	addq	$8, %r12
	cmpq	%rax, %r14
	jb	.LBB6_6
# %bb.12:                               # %._crit_edge35
	movl	$0, -52(%rbp)
	testl	%eax, %eax
	movq	-120(%rbp), %r14                # 8-byte Reload
	je	.LBB6_20
# %bb.13:                               # %.lr.ph38.preheader
	xorl	%eax, %eax
	leaq	-52(%rbp), %rbx
.LBB6_14:                               # %.lr.ph38
                                        # =>This Inner Loop Header: Depth=1
	cltq
	movq	(%r15,%rax,8), %rdi
.Ltmp17:
	.cfi_escape 0x2e, 0x00
	callq	hipStreamSynchronize
.Ltmp18:
# %bb.15:                               #   in Loop: Header=BB6_14 Depth=1
	movq	q+48(%rip), %rax
	movq	q+64(%rip), %rcx
	addq	$-4, %rcx
	cmpq	%rcx, %rax
	je	.LBB6_18
# %bb.16:                               #   in Loop: Header=BB6_14 Depth=1
	movl	-52(%rbp), %ecx
	movl	%ecx, (%rax)
	addq	$4, %rax
	movq	%rax, q+48(%rip)
	jmp	.LBB6_19
.LBB6_18:                               #   in Loop: Header=BB6_14 Depth=1
.Ltmp19:
	.cfi_escape 0x2e, 0x00
	movl	$q, %edi
	movq	%rbx, %rsi
	callq	_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_
.Ltmp20:
.LBB6_19:                               # %_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi.exit
                                        #   in Loop: Header=BB6_14 Depth=1
	.cfi_escape 0x2e, 0x00
	movl	$cv, %edi
	callq	_ZNSt18condition_variable10notify_allEv
	movl	-52(%rbp), %eax
	incl	%eax
	movl	%eax, -52(%rbp)
	cmpl	-48(%rbp), %eax
	jb	.LBB6_14
.LBB6_20:                               # %._crit_edge39
.Ltmp22:
	.cfi_escape 0x2e, 0x00
	leaq	-80(%rbp), %rdi
	callq	_ZNSt6thread4joinEv
.Ltmp23:
# %bb.21:
	movq	-96(%rbp), %rdi
.Ltmp24:
	.cfi_escape 0x2e, 0x00
	callq	hipFree
.Ltmp25:
# %bb.22:
	movq	-72(%rbp), %rdi
.Ltmp26:
	.cfi_escape 0x2e, 0x00
	callq	hipFree
.Ltmp27:
# %bb.23:
	movq	-88(%rbp), %rdi
.Ltmp28:
	.cfi_escape 0x2e, 0x00
	xorl	%esi, %esi
	callq	png_write_end
.Ltmp29:
# %bb.24:
.Ltmp30:
	.cfi_escape 0x2e, 0x00
	leaq	-88(%rbp), %rdi
	leaq	-136(%rbp), %rsi
	callq	png_destroy_write_struct
.Ltmp31:
# %bb.25:
	.cfi_escape 0x2e, 0x00
	movq	-128(%rbp), %rdi                # 8-byte Reload
	callq	fclose
	movq	%r14, %rsp
	cmpq	$0, -80(%rbp)
	jne	.LBB6_31
# %bb.26:                               # %_ZNSt6threadD2Ev.exit
	xorl	%eax, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	retq
.LBB6_31:
	.cfi_def_cfa %rbp, 16
	.cfi_escape 0x2e, 0x00
	callq	_ZSt9terminatev
.LBB6_27:
.Ltmp32:
	jmp	.LBB6_28
.LBB6_30:
.Ltmp21:
	jmp	.LBB6_28
.LBB6_17:
.Ltmp16:
.LBB6_28:
	cmpq	$0, -80(%rbp)
	jne	.LBB6_32
# %bb.29:                               # %_ZNSt6threadD2Ev.exit28
	.cfi_escape 0x2e, 0x00
	movq	%rax, %rdi
	callq	_Unwind_Resume@PLT
.LBB6_32:
	.cfi_escape 0x2e, 0x00
	callq	_ZSt9terminatev
.Lfunc_end6:
	.size	main, .Lfunc_end6-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table6:
.Lexception2:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end2-.Lcst_begin2
.Lcst_begin2:
	.uleb128 .Lfunc_begin2-.Lfunc_begin2    # >> Call Site 1 <<
	.uleb128 .Ltmp6-.Lfunc_begin2           #   Call between .Lfunc_begin2 and .Ltmp6
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin2           # >> Call Site 2 <<
	.uleb128 .Ltmp7-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp7
	.uleb128 .Ltmp32-.Lfunc_begin2          #     jumps to .Ltmp32
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp8-.Lfunc_begin2           # >> Call Site 3 <<
	.uleb128 .Ltmp15-.Ltmp8                 #   Call between .Ltmp8 and .Ltmp15
	.uleb128 .Ltmp16-.Lfunc_begin2          #     jumps to .Ltmp16
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp17-.Lfunc_begin2          # >> Call Site 4 <<
	.uleb128 .Ltmp20-.Ltmp17                #   Call between .Ltmp17 and .Ltmp20
	.uleb128 .Ltmp21-.Lfunc_begin2          #     jumps to .Ltmp21
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp22-.Lfunc_begin2          # >> Call Site 5 <<
	.uleb128 .Ltmp31-.Ltmp22                #   Call between .Ltmp22 and .Ltmp31
	.uleb128 .Ltmp32-.Lfunc_begin2          #     jumps to .Ltmp32
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp31-.Lfunc_begin2          # >> Call Site 6 <<
	.uleb128 .Lfunc_end6-.Ltmp31            #   Call between .Ltmp31 and .Lfunc_end6
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end2:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt6threadC2IRFviP14png_struct_defPPhS3_S3_miiiEJRjRS2_RS4_RS3_SA_RmS7_S7_S7_EvEEOT_DpOT0_,"axG",@progbits,_ZNSt6threadC2IRFviP14png_struct_defPPhS3_S3_miiiEJRjRS2_RS4_RS3_SA_RmS7_S7_S7_EvEEOT_DpOT0_,comdat
	.weak	_ZNSt6threadC2IRFviP14png_struct_defPPhS3_S3_miiiEJRjRS2_RS4_RS3_SA_RmS7_S7_S7_EvEEOT_DpOT0_ # -- Begin function _ZNSt6threadC2IRFviP14png_struct_defPPhS3_S3_miiiEJRjRS2_RS4_RS3_SA_RmS7_S7_S7_EvEEOT_DpOT0_
	.p2align	1, 0x90
	.type	_ZNSt6threadC2IRFviP14png_struct_defPPhS3_S3_miiiEJRjRS2_RS4_RS3_SA_RmS7_S7_S7_EvEEOT_DpOT0_,@function
_ZNSt6threadC2IRFviP14png_struct_defPPhS3_S3_miiiEJRjRS2_RS4_RS3_SA_RmS7_S7_S7_EvEEOT_DpOT0_: # @_ZNSt6threadC2IRFviP14png_struct_defPPhS3_S3_miiiEJRjRS2_RS4_RS3_SA_RmS7_S7_S7_EvEEOT_DpOT0_
.Lfunc_begin3:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception3
# %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
	movq	%r9, %r12
	movq	%r8, %r13
	movq	%rcx, %rbp
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	$0, (%rdi)
	movl	$80, %edi
	callq	_Znwm
	movq	$_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE+16, (%rax)
	movq	96(%rsp), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 8(%rax)
	movq	88(%rsp), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 12(%rax)
	movq	80(%rsp), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%rax)
	movq	72(%rsp), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 24(%rax)
	movq	64(%rsp), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 32(%rax)
	movq	(%r12), %rcx
	movq	%rcx, 40(%rax)
	movq	(%r13), %rcx
	movq	%rcx, 48(%rax)
	movq	(%rbp), %rcx
	movq	%rcx, 56(%rax)
	movl	(%r15), %ecx
	movl	%ecx, 64(%rax)
	movq	%r14, 72(%rax)
	movq	%rsp, %rsi
	movq	%rax, (%rsi)
.Ltmp33:
	movl	$_ZNSt6thread24_M_thread_deps_never_runEv, %edx
	movq	%rbx, %rdi
	callq	_ZNSt6thread15_M_start_threadESt10unique_ptrINS_6_StateESt14default_deleteIS1_EEPFvvE
.Ltmp34:
# %bb.1:
	movq	(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB7_3
# %bb.2:                                # %_ZNKSt14default_deleteINSt6thread6_StateEEclEPS1_.exit.i
	movq	(%rdi), %rax
	callq	*8(%rax)
.LBB7_3:                                # %_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev.exit
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB7_4:
	.cfi_def_cfa_offset 64
.Ltmp35:
	movq	%rax, %rbx
	movq	(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB7_6
# %bb.5:                                # %_ZNKSt14default_deleteINSt6thread6_StateEEclEPS1_.exit.i15
	movq	(%rdi), %rax
	callq	*8(%rax)
.LBB7_6:                                # %_ZNSt10unique_ptrINSt6thread6_StateESt14default_deleteIS1_EED2Ev.exit16
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end7:
	.size	_ZNSt6threadC2IRFviP14png_struct_defPPhS3_S3_miiiEJRjRS2_RS4_RS3_SA_RmS7_S7_S7_EvEEOT_DpOT0_, .Lfunc_end7-_ZNSt6threadC2IRFviP14png_struct_defPPhS3_S3_miiiEJRjRS2_RS4_RS3_SA_RmS7_S7_S7_EvEEOT_DpOT0_
	.cfi_endproc
	.section	.gcc_except_table._ZNSt6threadC2IRFviP14png_struct_defPPhS3_S3_miiiEJRjRS2_RS4_RS3_SA_RmS7_S7_S7_EvEEOT_DpOT0_,"aG",@progbits,_ZNSt6threadC2IRFviP14png_struct_defPPhS3_S3_miiiEJRjRS2_RS4_RS3_SA_RmS7_S7_S7_EvEEOT_DpOT0_,comdat
	.p2align	2, 0x0
GCC_except_table7:
.Lexception3:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end3-.Lcst_begin3
.Lcst_begin3:
	.uleb128 .Lfunc_begin3-.Lfunc_begin3    # >> Call Site 1 <<
	.uleb128 .Ltmp33-.Lfunc_begin3          #   Call between .Lfunc_begin3 and .Ltmp33
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp33-.Lfunc_begin3          # >> Call Site 2 <<
	.uleb128 .Ltmp34-.Ltmp33                #   Call between .Ltmp33 and .Ltmp34
	.uleb128 .Ltmp35-.Lfunc_begin3          #     jumps to .Ltmp35
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp34-.Lfunc_begin3          # >> Call Site 3 <<
	.uleb128 .Lfunc_end7-.Ltmp34            #   Call between .Ltmp34 and .Lfunc_end7
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end3:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text.__clang_call_terminate,"axG",@progbits,__clang_call_terminate,comdat
	.hidden	__clang_call_terminate          # -- Begin function __clang_call_terminate
	.weak	__clang_call_terminate
	.type	__clang_call_terminate,@function
__clang_call_terminate:                 # @__clang_call_terminate
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__cxa_begin_catch
	callq	_ZSt9terminatev
.Lfunc_end8:
	.size	__clang_call_terminate, .Lfunc_end8-__clang_call_terminate
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt11_Deque_baseIiSaIiEED2Ev,"axG",@progbits,_ZNSt11_Deque_baseIiSaIiEED2Ev,comdat
	.weak	_ZNSt11_Deque_baseIiSaIiEED2Ev  # -- Begin function _ZNSt11_Deque_baseIiSaIiEED2Ev
	.p2align	1, 0x90
	.type	_ZNSt11_Deque_baseIiSaIiEED2Ev,@function
_ZNSt11_Deque_baseIiSaIiEED2Ev:         # @_ZNSt11_Deque_baseIiSaIiEED2Ev
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	je	.LBB9_6
# %bb.1:
	movq	40(%rbx), %r14
	movq	72(%rbx), %r15
	leaq	8(%r15), %rax
	cmpq	%rax, %r14
	jae	.LBB9_5
# %bb.2:                                # %.lr.ph.i.preheader
	addq	$-8, %r14
.LBB9_3:                                # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rdi
	addq	$8, %r14
	callq	_ZdlPv
	cmpq	%r15, %r14
	jb	.LBB9_3
# %bb.4:                                # %_ZNSt11_Deque_baseIiSaIiEE16_M_destroy_nodesEPPiS3_.exit.loopexit
	movq	(%rbx), %rdi
.LBB9_5:                                # %_ZNSt11_Deque_baseIiSaIiEE16_M_destroy_nodesEPPiS3_.exit
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	_ZdlPv                          # TAILCALL
.LBB9_6:
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	_ZNSt11_Deque_baseIiSaIiEED2Ev, .Lfunc_end9-_ZNSt11_Deque_baseIiSaIiEED2Ev
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm,"axG",@progbits,_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm,comdat
	.weak	_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm # -- Begin function _ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm
	.p2align	1, 0x90
	.type	_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm,@function
_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm: # @_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm
.Lfunc_begin4:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception4
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	%rsi, %r12
	shrq	$7, %r12
	leaq	1(%r12), %r15
	cmpq	$6, %r12
	movl	$5, %esi
	cmovaeq	%r12, %rsi
	addq	$3, %rsi
	movq	%rsi, 8(%rdi)
	leaq	7(%rsp), %rdi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIPiE8allocateEmPKv
	movq	%rax, (%rbx)
	movq	8(%rbx), %rcx
	subq	%r15, %rcx
	andq	$-2, %rcx
	leaq	(%rax,%rcx,4), %r15
	leaq	(%r15,%r12,8), %rdx
	addq	$8, %rdx
.Ltmp36:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_
.Ltmp37:
# %bb.1:
	movq	%r15, 40(%rbx)
	movq	(%r15), %rax
	movq	%rax, 24(%rbx)
	movl	$512, %ecx                      # imm = 0x200
	leaq	(%rax,%rcx), %rdx
	movq	%rdx, 32(%rbx)
	leaq	(%r15,%r12,8), %rdx
	movq	%rdx, 72(%rbx)
	movq	(%rdx), %rdx
	movq	%rdx, 56(%rbx)
	addq	%rdx, %rcx
	movq	%rcx, 64(%rbx)
	movq	%rax, 16(%rbx)
	andl	$127, %r14d
	leaq	(%rdx,%r14,4), %rax
	movq	%rax, 48(%rbx)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB10_5:
	.cfi_def_cfa_offset 48
.Ltmp38:
	movq	%rax, %rdi
	callq	__cxa_begin_catch
	movq	(%rbx), %rdi
	callq	_ZdlPv
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rbx)
.Ltmp39:
	callq	__cxa_rethrow
.Ltmp40:
# %bb.6:
.LBB10_2:
.Ltmp41:
	movq	%rax, %rbx
.Ltmp42:
	callq	__cxa_end_catch
.Ltmp43:
# %bb.3:
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.LBB10_4:
.Ltmp44:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end10:
	.size	_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm, .Lfunc_end10-_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm
	.cfi_endproc
	.section	.gcc_except_table._ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm,"aG",@progbits,_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm,comdat
	.p2align	2, 0x0
GCC_except_table10:
.Lexception4:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase1-.Lttbaseref1
.Lttbaseref1:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end4-.Lcst_begin4
.Lcst_begin4:
	.uleb128 .Lfunc_begin4-.Lfunc_begin4    # >> Call Site 1 <<
	.uleb128 .Ltmp36-.Lfunc_begin4          #   Call between .Lfunc_begin4 and .Ltmp36
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp36-.Lfunc_begin4          # >> Call Site 2 <<
	.uleb128 .Ltmp37-.Ltmp36                #   Call between .Ltmp36 and .Ltmp37
	.uleb128 .Ltmp38-.Lfunc_begin4          #     jumps to .Ltmp38
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp37-.Lfunc_begin4          # >> Call Site 3 <<
	.uleb128 .Ltmp39-.Ltmp37                #   Call between .Ltmp37 and .Ltmp39
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp39-.Lfunc_begin4          # >> Call Site 4 <<
	.uleb128 .Ltmp40-.Ltmp39                #   Call between .Ltmp39 and .Ltmp40
	.uleb128 .Ltmp41-.Lfunc_begin4          #     jumps to .Ltmp41
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp42-.Lfunc_begin4          # >> Call Site 5 <<
	.uleb128 .Ltmp43-.Ltmp42                #   Call between .Ltmp42 and .Ltmp43
	.uleb128 .Ltmp44-.Lfunc_begin4          #     jumps to .Ltmp44
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp43-.Lfunc_begin4          # >> Call Site 6 <<
	.uleb128 .Lfunc_end10-.Ltmp43           #   Call between .Ltmp43 and .Lfunc_end10
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end4:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase1:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_,"axG",@progbits,_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_,comdat
	.weak	_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_ # -- Begin function _ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_
	.p2align	1, 0x90
	.type	_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_,@function
_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_: # @_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_
.Lfunc_begin5:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception5
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	cmpq	%rdx, %rsi
	jae	.LBB11_4
# %bb.1:                                # %.lr.ph.preheader
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rsi, %r15
.LBB11_2:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
.Ltmp45:
	movl	$512, %edi                      # imm = 0x200
	callq	_Znwm
.Ltmp46:
# %bb.3:                                # %_ZNSt11_Deque_baseIiSaIiEE16_M_allocate_nodeEv.exit
                                        #   in Loop: Header=BB11_2 Depth=1
	movq	%rax, (%r15)
	addq	$8, %r15
	cmpq	%r14, %r15
	jb	.LBB11_2
.LBB11_4:                               # %._crit_edge
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB11_5:
	.cfi_def_cfa_offset 32
.Ltmp47:
	movq	%rax, %rdi
	callq	__cxa_begin_catch
	cmpq	%rbx, %r15
	jbe	.LBB11_7
.LBB11_6:                               # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdi
	callq	_ZdlPv
	addq	$8, %rbx
	cmpq	%r15, %rbx
	jb	.LBB11_6
.LBB11_7:                               # %_ZNSt11_Deque_baseIiSaIiEE16_M_destroy_nodesEPPiS3_.exit
.Ltmp48:
	callq	__cxa_rethrow
.Ltmp49:
# %bb.11:
.LBB11_8:
.Ltmp50:
	movq	%rax, %rbx
.Ltmp51:
	callq	__cxa_end_catch
.Ltmp52:
# %bb.9:
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.LBB11_10:
.Ltmp53:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end11:
	.size	_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_, .Lfunc_end11-_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_
	.cfi_endproc
	.section	.gcc_except_table._ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_,"aG",@progbits,_ZNSt11_Deque_baseIiSaIiEE15_M_create_nodesEPPiS3_,comdat
	.p2align	2, 0x0
GCC_except_table11:
.Lexception5:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase2-.Lttbaseref2
.Lttbaseref2:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end5-.Lcst_begin5
.Lcst_begin5:
	.uleb128 .Ltmp45-.Lfunc_begin5          # >> Call Site 1 <<
	.uleb128 .Ltmp46-.Ltmp45                #   Call between .Ltmp45 and .Ltmp46
	.uleb128 .Ltmp47-.Lfunc_begin5          #     jumps to .Ltmp47
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp46-.Lfunc_begin5          # >> Call Site 2 <<
	.uleb128 .Ltmp48-.Ltmp46                #   Call between .Ltmp46 and .Ltmp48
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp48-.Lfunc_begin5          # >> Call Site 3 <<
	.uleb128 .Ltmp49-.Ltmp48                #   Call between .Ltmp48 and .Ltmp49
	.uleb128 .Ltmp50-.Lfunc_begin5          #     jumps to .Ltmp50
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp51-.Lfunc_begin5          # >> Call Site 4 <<
	.uleb128 .Ltmp52-.Ltmp51                #   Call between .Ltmp51 and .Ltmp52
	.uleb128 .Ltmp53-.Lfunc_begin5          #     jumps to .Ltmp53
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp52-.Lfunc_begin5          # >> Call Site 5 <<
	.uleb128 .Lfunc_end11-.Ltmp52           #   Call between .Ltmp52 and .Lfunc_end11
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end5:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase2:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIPiE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIPiE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIPiE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIPiE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIPiE8allocateEmPKv,@function
_ZNSt15__new_allocatorIPiE8allocateEmPKv: # @_ZNSt15__new_allocatorIPiE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$60, %rax
	jne	.LBB12_1
# %bb.3:
	shlq	$3, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB12_1:
	.cfi_def_cfa_offset 16
	shrq	$61, %rsi
	je	.LBB12_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB12_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end12:
	.size	_ZNSt15__new_allocatorIPiE8allocateEmPKv, .Lfunc_end12-_ZNSt15__new_allocatorIPiE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt11unique_lockISt5mutexE4lockEv,"axG",@progbits,_ZNSt11unique_lockISt5mutexE4lockEv,comdat
	.weak	_ZNSt11unique_lockISt5mutexE4lockEv # -- Begin function _ZNSt11unique_lockISt5mutexE4lockEv
	.p2align	1, 0x90
	.type	_ZNSt11unique_lockISt5mutexE4lockEv,@function
_ZNSt11unique_lockISt5mutexE4lockEv:    # @_ZNSt11unique_lockISt5mutexE4lockEv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	je	.LBB13_4
# %bb.1:
	cmpb	$0, 8(%rbx)
	jne	.LBB13_5
# %bb.2:
	callq	pthread_mutex_lock
	testl	%eax, %eax
	jne	.LBB13_6
# %bb.3:                                # %_ZNSt5mutex4lockEv.exit
	movb	$1, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.LBB13_4:
	.cfi_def_cfa_offset 16
	movl	$1, %edi
	callq	_ZSt20__throw_system_errori
.LBB13_5:
	movl	$35, %edi
	callq	_ZSt20__throw_system_errori
.LBB13_6:
	movl	%eax, %edi
	callq	_ZSt20__throw_system_errori
.Lfunc_end13:
	.size	_ZNSt11unique_lockISt5mutexE4lockEv, .Lfunc_end13-_ZNSt11unique_lockISt5mutexE4lockEv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt11unique_lockISt5mutexE6unlockEv,"axG",@progbits,_ZNSt11unique_lockISt5mutexE6unlockEv,comdat
	.weak	_ZNSt11unique_lockISt5mutexE6unlockEv # -- Begin function _ZNSt11unique_lockISt5mutexE6unlockEv
	.p2align	1, 0x90
	.type	_ZNSt11unique_lockISt5mutexE6unlockEv,@function
_ZNSt11unique_lockISt5mutexE6unlockEv:  # @_ZNSt11unique_lockISt5mutexE6unlockEv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	cmpb	$0, 8(%rdi)
	je	.LBB14_4
# %bb.1:
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	je	.LBB14_3
# %bb.2:
	callq	pthread_mutex_unlock
	movb	$0, 8(%rbx)
.LBB14_3:
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.LBB14_4:
	.cfi_def_cfa_offset 16
	movl	$1, %edi
	callq	_ZSt20__throw_system_errori
.Lfunc_end14:
	.size	_ZNSt11unique_lockISt5mutexE6unlockEv, .Lfunc_end14-_ZNSt11unique_lockISt5mutexE6unlockEv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt5dequeIiSaIiEE9pop_frontEv,"axG",@progbits,_ZNSt5dequeIiSaIiEE9pop_frontEv,comdat
	.weak	_ZNSt5dequeIiSaIiEE9pop_frontEv # -- Begin function _ZNSt5dequeIiSaIiEE9pop_frontEv
	.p2align	1, 0x90
	.type	_ZNSt5dequeIiSaIiEE9pop_frontEv,@function
_ZNSt5dequeIiSaIiEE9pop_frontEv:        # @_ZNSt5dequeIiSaIiEE9pop_frontEv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	movq	32(%rdi), %rcx
	addq	$-4, %rcx
	cmpq	%rcx, %rax
	je	.LBB15_2
# %bb.1:
	addq	$4, %rax
	jmp	.LBB15_3
.LBB15_2:
	movq	24(%rbx), %rdi
	callq	_ZdlPv
	movq	40(%rbx), %rax
	leaq	8(%rax), %rcx
	movq	%rcx, 40(%rbx)
	movq	8(%rax), %rax
	movq	%rax, 24(%rbx)
	leaq	512(%rax), %rcx
	movq	%rcx, 32(%rbx)
.LBB15_3:
	movq	%rax, 16(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end15:
	.size	_ZNSt5dequeIiSaIiEE9pop_frontEv, .Lfunc_end15-_ZNSt5dequeIiSaIiEE9pop_frontEv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6thread24_M_thread_deps_never_runEv,"axG",@progbits,_ZNSt6thread24_M_thread_deps_never_runEv,comdat
	.weak	_ZNSt6thread24_M_thread_deps_never_runEv # -- Begin function _ZNSt6thread24_M_thread_deps_never_runEv
	.p2align	1, 0x90
	.type	_ZNSt6thread24_M_thread_deps_never_runEv,@function
_ZNSt6thread24_M_thread_deps_never_runEv: # @_ZNSt6thread24_M_thread_deps_never_runEv
	.cfi_startproc
# %bb.0:
	retq
.Lfunc_end16:
	.size	_ZNSt6thread24_M_thread_deps_never_runEv, .Lfunc_end16-_ZNSt6thread24_M_thread_deps_never_runEv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED0Ev,"axG",@progbits,_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED0Ev,comdat
	.weak	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED0Ev # -- Begin function _ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED0Ev
	.p2align	1, 0x90
	.type	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED0Ev,@function
_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED0Ev: # @_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED0Ev
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	callq	_ZNSt6thread6_StateD2Ev
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	_ZdlPv                          # TAILCALL
.Lfunc_end17:
	.size	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED0Ev, .Lfunc_end17-_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED0Ev
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv,"axG",@progbits,_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv,comdat
	.weak	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv # -- Begin function _ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv
	.p2align	1, 0x90
	.type	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv,@function
_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv: # @_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rax
	movl	64(%rdi), %edi
	movq	56(%rax), %rsi
	movq	48(%rax), %rdx
	movq	40(%rax), %rcx
	movq	32(%rax), %r8
	movq	24(%rax), %r9
	movl	16(%rax), %r10d
	movl	8(%rax), %r11d
	movl	12(%rax), %ebx
	subq	$8, %rsp
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	pushq	%rbx
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	callq	*72(%rax)
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end18:
	.size	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv, .Lfunc_end18-_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_,"axG",@progbits,_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_,comdat
	.weak	_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_ # -- Begin function _ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_
	.p2align	1, 0x90
	.type	_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_,@function
_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_: # @_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	72(%rdi), %r15
	movq	%r15, %rax
	subq	40(%rdi), %rax
	shrq	$3, %rax
	cmpq	$1, %r15
	adcq	$-1, %rax
	shlq	$7, %rax
	movq	32(%rdi), %rcx
	movq	48(%rdi), %rdx
	subq	56(%rdi), %rdx
	sarq	$2, %rdx
	subq	16(%rdi), %rcx
	sarq	$2, %rcx
	addq	%rdx, %rcx
	addq	%rax, %rcx
	movabsq	$2305843009213693951, %rax      # imm = 0x1FFFFFFFFFFFFFFF
	cmpq	%rax, %rcx
	je	.LBB19_4
# %bb.1:
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	%r15, %rax
	subq	(%rdi), %rax
	movq	8(%rdi), %rcx
	sarq	$3, %rax
	subq	%rax, %rcx
	cmpq	$1, %rcx
	ja	.LBB19_3
# %bb.2:
	movl	$1, %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb
	movq	72(%rbx), %r15
.LBB19_3:                               # %_ZNSt5dequeIiSaIiEE22_M_reserve_map_at_backEm.exit
	movl	$512, %edi                      # imm = 0x200
	callq	_Znwm
	movq	%rax, 8(%r15)
	movq	48(%rbx), %rax
	movl	(%r14), %ecx
	movl	%ecx, (%rax)
	movq	72(%rbx), %rax
	leaq	8(%rax), %rcx
	movq	%rcx, 72(%rbx)
	movq	8(%rax), %rax
	movq	%rax, 56(%rbx)
	leaq	512(%rax), %rcx
	movq	%rcx, 64(%rbx)
	movq	%rax, 48(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB19_4:
	.cfi_def_cfa_offset 32
	movl	$.L.str.4, %edi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end19:
	.size	_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_, .Lfunc_end19-_ZNSt5dequeIiSaIiEE16_M_push_back_auxIJRKiEEEvDpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb,"axG",@progbits,_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb,comdat
	.weak	_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb # -- Begin function _ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb
	.p2align	1, 0x90
	.type	_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb,@function
_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb: # @_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb
	.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	$24, %rsp
	.cfi_def_cfa_offset 80
	.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, %r8d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	72(%rdi), %rax
	movq	8(%rdi), %rcx
	movq	40(%rdi), %rsi
	subq	%rsi, %rax
	movq	%rax, %r13
	sarq	$3, %r13
	leaq	(%r14,%r13), %r12
	incq	%r12
	incq	%r13
	leaq	(%r12,%r12), %rdx
	cmpq	%rdx, %rcx
	jbe	.LBB20_4
# %bb.1:
	subq	%r12, %rcx
	andq	$-2, %rcx
	shlq	$2, %rcx
	addq	(%rbx), %rcx
	xorl	%edx, %edx
	testb	%r8b, %r8b
	cmovneq	%r14, %rdx
	leaq	(%rcx,%rdx,8), %r14
	leaq	8(%rax), %rdx
	cmpq	%rsi, %r14
	jae	.LBB20_7
# %bb.2:
	cmpq	$9, %rdx
	jl	.LBB20_13
# %bb.3:
	movq	%r14, %rdi
	jmp	.LBB20_9
.LBB20_4:
	cmpq	%r14, %rcx
	movq	%r14, %rax
	cmovaq	%rcx, %rax
	leaq	(%rcx,%rax), %rbp
	addq	$2, %rbp
	xorl	%r15d, %r15d
	leaq	11(%rsp), %rdi
	movq	%rbp, %rsi
	xorl	%edx, %edx
	movl	%r8d, 12(%rsp)                  # 4-byte Spill
	callq	_ZNSt15__new_allocatorIPiE8allocateEmPKv
	movq	%rbp, 16(%rsp)                  # 8-byte Spill
	subq	%r12, %rbp
	movq	%rax, %r12
	andq	$-2, %rbp
	leaq	(%rax,%rbp,4), %rax
	cmpb	$0, 12(%rsp)                    # 1-byte Folded Reload
	cmovneq	%r14, %r15
	leaq	(%rax,%r15,8), %r14
	movq	40(%rbx), %rsi
	movq	72(%rbx), %rdx
	subq	%rsi, %rdx
	addq	$8, %rdx
	cmpq	$9, %rdx
	jl	.LBB20_11
# %bb.5:
	movq	%r14, %rdi
	callq	memmove@PLT
.LBB20_6:                               # %_ZSt4copyIPPiS1_ET0_T_S3_S2_.exit24
	movq	(%rbx), %rdi
	callq	_ZdlPv
	movq	%r12, (%rbx)
	movq	16(%rsp), %rax                  # 8-byte Reload
	movq	%rax, 8(%rbx)
	jmp	.LBB20_10
.LBB20_7:
	movq	%rdx, %rcx
	sarq	$3, %rcx
	cmpq	$2, %rcx
	jl	.LBB20_15
# %bb.8:
	leaq	(%r14,%r13,8), %rdi
	shlq	$3, %rcx
	subq	%rcx, %rdi
.LBB20_9:                               # %_ZSt4copyIPPiS1_ET0_T_S3_S2_.exit
	callq	memmove@PLT
.LBB20_10:                              # %_ZSt4copyIPPiS1_ET0_T_S3_S2_.exit
	movq	%r14, 40(%rbx)
	movq	(%r14), %rax
	movq	%rax, 24(%rbx)
	movl	$512, %ecx                      # imm = 0x200
	addq	%rcx, %rax
	movq	%rax, 32(%rbx)
	leaq	(%r14,%r13,8), %rax
	addq	$-8, %rax
	movq	%rax, 72(%rbx)
	movq	(%rax), %rax
	movq	%rax, 56(%rbx)
	addq	%rcx, %rax
	movq	%rax, 64(%rbx)
	addq	$24, %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
.LBB20_11:
	.cfi_def_cfa_offset 80
	cmpq	$8, %rdx
	jne	.LBB20_6
# %bb.12:
	movq	(%rsi), %rax
	movq	%rax, (%r14)
	jmp	.LBB20_6
.LBB20_13:
	cmpq	$8, %rdx
	jne	.LBB20_10
# %bb.14:
	movq	(%rsi), %rax
	movq	%rax, (%r14)
	jmp	.LBB20_10
.LBB20_15:
	cmpq	$8, %rdx
	jne	.LBB20_10
# %bb.16:
	movq	(%rsi), %rcx
	movq	%rcx, (%r14,%rax)
	jmp	.LBB20_10
.Lfunc_end20:
	.size	_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb, .Lfunc_end20-_ZNSt5dequeIiSaIiEE17_M_reallocate_mapEmb
	.cfi_endproc
                                        # -- End function
	.section	.text.startup,"ax",@progbits
	.type	_GLOBAL__sub_I_sobel.hip,@function # -- Begin function _GLOBAL__sub_I_sobel.hip
_GLOBAL__sub_I_sobel.hip:               # @_GLOBAL__sub_I_sobel.hip
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	xorps	%xmm0, %xmm0
	movups	%xmm0, q+64(%rip)
	movups	%xmm0, q+48(%rip)
	movups	%xmm0, q+32(%rip)
	movups	%xmm0, q+16(%rip)
	movups	%xmm0, q(%rip)
	movl	$q, %edi
	xorl	%esi, %esi
	callq	_ZNSt11_Deque_baseIiSaIiEE17_M_initialize_mapEm
	movl	$_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev, %edi
	movl	$q, %esi
	movl	$__dso_handle, %edx
	callq	__cxa_atexit
	movl	$cv, %edi
	callq	_ZNSt18condition_variableC1Ev
	movl	$_ZNSt18condition_variableD1Ev, %edi
	movl	$cv, %esi
	movl	$__dso_handle, %edx
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	__cxa_atexit                    # TAILCALL
.Lfunc_end21:
	.size	_GLOBAL__sub_I_sobel.hip, .Lfunc_end21-_GLOBAL__sub_I_sobel.hip
	.cfi_endproc
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB22_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB22_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z5sobelPhS_jjjmi, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$0, 8(%rsp)
	movl	$1, (%rsp)
	movl	$_mask, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movl	$200, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	__hipRegisterVar
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end22:
	.size	__hip_module_ctor, .Lfunc_end22-__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	.LBB23_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
.LBB23_2:
	retq
.Lfunc_end23:
	.size	__hip_module_dtor, .Lfunc_end23-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_mask,@object                   # @_mask
	.local	_mask
	.comm	_mask,200,16
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"rb"
	.size	.L.str, 3

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"1.6.43"
	.size	.L.str.1, 7

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"wb"
	.size	.L.str.2, 3

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

	.type	q,@object                       # @q
	.bss
	.globl	q
	.p2align	3, 0x0
q:
	.zero	80
	.size	q, 80

	.hidden	__dso_handle
	.type	qLock,@object                   # @qLock
	.globl	qLock
	.p2align	3, 0x0
qLock:
	.zero	40
	.size	qLock, 40

	.type	cvLock,@object                  # @cvLock
	.globl	cvLock
	.p2align	3, 0x0
cvLock:
	.zero	40
	.size	cvLock, 40

	.type	cv,@object                      # @cv
	.globl	cv
	.p2align	3, 0x0
cv:
	.zero	48
	.size	cv, 48

	.type	_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE,@object # @_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE
	.section	.rodata._ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE,"aG",@progbits,_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE,comdat
	.weak	_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE
	.p2align	3, 0x0
_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE:
	.quad	0
	.quad	_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE
	.quad	_ZNSt6thread6_StateD2Ev
	.quad	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEED0Ev
	.quad	_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEE6_M_runEv
	.size	_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE, 40

	.type	_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE,@object # @_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE
	.section	.rodata._ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE,"aG",@progbits,_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE,comdat
	.weak	_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE
_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE:
	.asciz	"NSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE"
	.size	_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE, 106

	.type	_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE,@object # @_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE
	.section	.rodata._ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE,"aG",@progbits,_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE,comdat
	.weak	_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE
	.p2align	3, 0x0
_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE:
	.quad	_ZTVN10__cxxabiv120__si_class_type_infoE+16
	.quad	_ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE
	.quad	_ZTINSt6thread6_StateE
	.size	_ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE, 24

	.type	.L.str.4,@object                # @.str.4
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.4:
	.asciz	"cannot create std::deque larger than max_size()"
	.size	.L.str.4, 48

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z5sobelPhS_jjjmi"
	.size	.L__unnamed_1, 18

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_mask"
	.size	.L__unnamed_2, 6

	.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	_GLOBAL__sub_I_sobel.hip
	.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 _Z20__device_stub__sobelPhS_jjjmi
	.addrsig_sym _Z10png_writeriP14png_struct_defPPhS1_S1_miii
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym _ZNSt6thread24_M_thread_deps_never_runEv
	.addrsig_sym _GLOBAL__sub_I_sobel.hip
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _mask
	.addrsig_sym _Z5sobelPhS_jjjmi
	.addrsig_sym q
	.addrsig_sym __dso_handle
	.addrsig_sym qLock
	.addrsig_sym cvLock
	.addrsig_sym cv
	.addrsig_sym _ZTVN10__cxxabiv120__si_class_type_infoE
	.addrsig_sym _ZTSNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE
	.addrsig_sym _ZTINSt6thread6_StateE
	.addrsig_sym _ZTINSt6thread11_State_implINS_8_InvokerISt5tupleIJPFviP14png_struct_defPPhS5_S5_miiiEjS4_S6_S5_S5_mjjjEEEEEE
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z5sobelPhS_jjjmi       ; -- Begin function _Z5sobelPhS_jjjmi
	.globl	_Z5sobelPhS_jjjmi
	.p2align	8
	.type	_Z5sobelPhS_jjjmi,@function
_Z5sobelPhS_jjjmi:                      ; @_Z5sobelPhS_jjjmi
; %bb.0:
	s_load_b256 s[16:23], s[0:1], 0x0
	v_lshl_add_u32 v0, s15, 9, v0
	s_clause 0x1
	s_load_b32 s10, s[0:1], 0x28
	s_load_b64 s[8:9], s[0:1], 0x20
	s_mov_b32 s12, 0
	s_mov_b32 s13, -1
	s_waitcnt lgkmcnt(0)
	v_cvt_f32_u32_e32 v1, s21
	s_sub_i32 s2, 0, s21
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_iflag_f32_e32 v1, v1
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v1, 0x4f7ffffe, v1
	v_cvt_u32_f32_e32 v1, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v2, s2, v1
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, _mask@rel32@lo+4
	s_addc_u32 s3, s3, _mask@rel32@hi+12
	s_add_i32 s11, s10, -2
	v_mul_hi_u32 v2, v1, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v1, v1, v2
	v_mul_hi_u32 v1, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v1, v1, s21
	v_sub_nc_u32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v1, s21, v0
	v_cmp_le_u32_e32 vcc_lo, s21, v0
	v_cndmask_b32_e32 v0, v0, v1, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v1, s21, v0
	v_cmp_le_u32_e32 vcc_lo, s21, v0
	v_cndmask_b32_e32 v17, v0, v1, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_hi_i32 v0, 0x66666667, v17
	v_lshrrev_b32_e32 v1, 31, v0
	v_ashrrev_i32_e32 v0, 1, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v0, v0, v1
	v_mul_hi_i32 v1, 0x51eb851f, v17
	v_mul_hi_i32 v2, 0x66666667, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_lshrrev_b32_e32 v3, 31, v1
	v_ashrrev_i32_e32 v1, 3, v1
	v_lshrrev_b32_e32 v4, 31, v2
	v_ashrrev_i32_e32 v2, 1, v2
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v1, v1, v3
	v_add_nc_u32_e32 v2, v2, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_lshrrev_b32_e32 v3, 31, v1
	v_lshl_add_u32 v4, v0, 2, v0
	v_lshl_add_u32 v2, v2, 2, v2
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v3, v1, v3
	v_sub_nc_u32_e32 v0, v0, v2
	s_delay_alu instid0(VALU_DEP_2)
	v_and_b32_e32 v2, -2, v3
	v_sub_nc_u32_e32 v12, v17, v4
	v_mul_lo_u32 v16, v17, s22
	v_add_nc_u32_e32 v19, -1, v17
	v_mad_i64_i32 v[14:15], null, v0, 20, 0
	v_sub_nc_u32_e32 v18, v1, v2
	v_ashrrev_i32_e32 v13, 31, v12
	v_cmp_lt_i32_e64 s1, 0, v17
	v_cmp_lt_i32_e64 s0, -1, v17
	v_add_nc_u32_e32 v21, 2, v17
	v_cmp_gt_u32_e64 s5, s21, v19
	v_mad_i64_i32 v[0:1], null, 0x64, v18, v[14:15]
	v_lshlrev_b64 v[2:3], 2, v[12:13]
	v_add_nc_u32_e32 v15, -2, v17
	v_lshlrev_b32_e32 v12, 2, v12
	v_cmp_gt_u32_e64 s7, s21, v21
	s_and_b32 s5, s1, s5
	v_add_nc_u32_e32 v20, 1, v17
	v_add_co_u32 v0, vcc_lo, v0, v2
	v_add_co_ci_u32_e32 v1, vcc_lo, v1, v3, vcc_lo
	v_cmp_gt_u32_e64 s4, s21, v15
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v0, vcc_lo, v0, s2
	v_add_co_ci_u32_e32 v1, vcc_lo, s3, v1, vcc_lo
	v_cmp_lt_i32_e32 vcc_lo, 1, v17
	v_cmp_lt_i32_e64 s2, -2, v17
	v_cmp_lt_i32_e64 s3, -3, v17
	global_load_b32 v13, v[0:1], off
	v_mov_b32_e32 v0, 0
	v_mov_b32_e32 v1, 0
	v_mul_lo_u32 v17, v15, s22
	v_mul_lo_u32 v15, 0x64, v18
	v_add_nc_u32_e32 v18, s22, v16
	v_cmp_gt_u32_e64 s6, s21, v20
	v_dual_mov_b32 v3, v1 :: v_dual_mov_b32 v2, v0
	v_dual_mov_b32 v5, v1 :: v_dual_mov_b32 v4, v0
	v_dual_mov_b32 v7, v1 :: v_dual_mov_b32 v6, v0
	v_dual_mov_b32 v9, v1 :: v_dual_mov_b32 v8, v0
	v_dual_mov_b32 v11, v1 :: v_dual_mov_b32 v10, v0
	v_add3_u32 v12, v15, v14, v12
	v_add_nc_u32_e32 v19, s22, v17
	v_add_nc_u32_e32 v20, s22, v18
	s_and_b32 s4, vcc_lo, s4
	s_and_b32 s2, s2, s6
	s_and_b32 s3, s3, s7
	s_waitcnt vmcnt(0)
	ds_store_b32 v12, v13
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
.LBB0_1:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_2 Depth 2
	s_mul_i32 s1, s12, 3
	s_mul_i32 s7, s12, 0x64
	s_add_i32 s14, s1, 2
	s_add_i32 s15, s1, 1
	s_lshl_b32 s6, s14, 1
	s_lshl_b32 s12, s14, 1
	s_mov_b32 m0, s6
	s_lshl_b32 s6, s15, 1
	v_movreld_b32_e32 v0, 0
	v_movreld_b32_e32 v1, 0
	s_mov_b32 m0, s6
	s_lshl_b32 s6, s1, 1
	v_movreld_b32_e32 v0, 0
	v_movreld_b32_e32 v1, 0
	s_mov_b32 m0, s6
	s_xor_b32 s6, s13, -1
	s_lshl_b32 s13, s15, 1
	s_lshl_b32 s14, s1, 1
	s_mov_b32 s15, s11
	s_mov_b32 s21, 0
	v_movreld_b32_e32 v0, 0
	v_movreld_b32_e32 v1, 0
.LBB0_2:                                ; %.preheader115
                                        ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_cmp_gt_i32 s15, -1
	s_mul_i32 s1, s15, s9
	s_cselect_b32 s24, -1, 0
	s_cmp_lt_u32 s15, s20
	s_mul_hi_u32 s23, s15, s8
	s_cselect_b32 s25, -1, 0
	s_ashr_i32 s26, s15, 31
	s_mul_i32 s22, s15, s8
	s_add_i32 s1, s23, s1
	s_mul_i32 s26, s26, s8
	s_and_b32 s23, s24, s25
	s_add_i32 s24, s1, s26
	v_add_co_u32 v23, s1, s22, v17
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_co_ci_u32_e64 v24, null, s24, 0, s1
	s_mov_b32 m0, s12
	v_add_co_u32 v21, vcc_lo, v23, 2
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_add_co_ci_u32_e32 v22, vcc_lo, 0, v24, vcc_lo
	s_and_b32 vcc_lo, s4, s23
	v_movrels_b32_e32 v26, v1
	v_dual_cndmask_b32 v21, 0, v21 :: v_dual_cndmask_b32 v22, 0, v22
	s_add_i32 s15, s15, 1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v21, s1, s16, v21
	v_add_co_ci_u32_e64 v22, s1, s17, v22, s1
	global_load_u8 v25, v[21:22], off
	v_add_co_u32 v21, s1, v23, 1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v22, s1, 0, v24, s1
	v_dual_cndmask_b32 v21, 0, v21 :: v_dual_cndmask_b32 v22, 0, v22
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v21, s1, s16, v21
	v_add_co_ci_u32_e64 v22, s1, s17, v22, s1
	global_load_u8 v27, v[21:22], off
	v_dual_cndmask_b32 v21, 0, v23 :: v_dual_cndmask_b32 v22, 0, v24
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v21, s1, s16, v21
	v_add_co_ci_u32_e64 v22, s1, s17, v22, s1
	s_add_i32 s1, s7, s21
	s_add_i32 s21, s21, 4
	v_mov_b32_e32 v30, s1
	global_load_u8 v29, v[21:22], off
	s_waitcnt vmcnt(2)
	v_cndmask_b32_e32 v23, 0, v25, vcc_lo
	ds_load_2addr_b32 v[21:22], v30 offset1:5
	v_movrels_b32_e32 v25, v0
	s_waitcnt vmcnt(1)
	v_cndmask_b32_e32 v27, 0, v27, vcc_lo
	s_waitcnt lgkmcnt(0)
	v_mul_lo_u32 v23, v21, v23
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_cvt_f64_i32_e32 v[23:24], v23
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v29, 0, v29, vcc_lo
	v_add_f64 v[23:24], v[25:26], v[23:24]
	v_mul_lo_u32 v25, v27, v21
	s_delay_alu instid0(VALU_DEP_3)
	v_mul_lo_u32 v21, v29, v21
	ds_load_2addr_b32 v[27:28], v30 offset0:10 offset1:15
	v_cvt_f64_i32_e32 v[25:26], v25
	v_movreld_b32_e32 v0, v23
	v_movreld_b32_e32 v1, v24
	s_mov_b32 m0, s13
	v_movrels_b32_e32 v24, v1
	v_movrels_b32_e32 v23, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_f64 v[23:24], v[23:24], v[25:26]
	v_cvt_f64_i32_e32 v[25:26], v21
	v_add_co_u32 v21, s1, s22, v19
	v_add_co_ci_u32_e64 v29, null, s24, 0, s1
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_movreld_b32_e32 v0, v23
	v_movreld_b32_e32 v1, v24
	s_mov_b32 m0, s14
	v_movrels_b32_e32 v24, v1
	v_movrels_b32_e32 v23, v0
	v_add_f64 v[23:24], v[23:24], v[25:26]
	v_add_co_u32 v25, vcc_lo, v21, 2
	v_add_co_ci_u32_e32 v26, vcc_lo, 0, v29, vcc_lo
	s_and_b32 vcc_lo, s5, s23
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_cndmask_b32 v25, 0, v25 :: v_dual_cndmask_b32 v26, 0, v26
	v_add_co_u32 v25, s1, s16, v25
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v26, s1, s17, v26, s1
	global_load_u8 v25, v[25:26], off
	v_movreld_b32_e32 v0, v23
	v_add_co_u32 v23, s1, v21, 1
	v_movreld_b32_e32 v1, v24
	v_add_co_ci_u32_e64 v24, s1, 0, v29, s1
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_cndmask_b32_e32 v23, 0, v23, vcc_lo
	v_cndmask_b32_e32 v21, 0, v21, vcc_lo
	s_mov_b32 m0, s12
	v_cndmask_b32_e32 v24, 0, v24, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v23, s1, s16, v23
	v_add_co_ci_u32_e64 v24, s1, s17, v24, s1
	global_load_u8 v31, v[23:24], off
	v_cndmask_b32_e32 v24, 0, v29, vcc_lo
	v_add_co_u32 v23, s1, s16, v21
	v_movrels_b32_e32 v26, v1
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_4) | instid1(VALU_DEP_2)
	v_add_co_ci_u32_e64 v24, s1, s17, v24, s1
	global_load_u8 v21, v[23:24], off
	s_waitcnt vmcnt(2)
	v_cndmask_b32_e32 v23, 0, v25, vcc_lo
	v_movrels_b32_e32 v25, v0
	v_mul_lo_u32 v23, v22, v23
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_3)
	v_cvt_f64_i32_e32 v[23:24], v23
	s_waitcnt vmcnt(1)
	v_cndmask_b32_e32 v29, 0, v31, vcc_lo
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v21, 0, v21, vcc_lo
	v_add_f64 v[23:24], v[25:26], v[23:24]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mul_lo_u32 v25, v29, v22
	v_mul_lo_u32 v21, v21, v22
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_f64_i32_e32 v[25:26], v25
	v_cvt_f64_i32_e32 v[21:22], v21
	v_movreld_b32_e32 v0, v23
	v_movreld_b32_e32 v1, v24
	s_mov_b32 m0, s13
	v_movrels_b32_e32 v24, v1
	v_movrels_b32_e32 v23, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_f64 v[23:24], v[23:24], v[25:26]
	v_add_co_u32 v25, s1, s22, v16
	v_add_co_ci_u32_e64 v26, null, s24, 0, s1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_movreld_b32_e32 v0, v23
	v_movreld_b32_e32 v1, v24
	s_mov_b32 m0, s14
	v_movrels_b32_e32 v24, v1
	v_movrels_b32_e32 v23, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_f64 v[21:22], v[23:24], v[21:22]
	v_add_co_u32 v23, vcc_lo, v25, 2
	v_add_co_ci_u32_e32 v24, vcc_lo, 0, v26, vcc_lo
	s_and_b32 vcc_lo, s0, s23
	v_dual_cndmask_b32 v23, 0, v23 :: v_dual_cndmask_b32 v24, 0, v24
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v23, s1, s16, v23
	v_add_co_ci_u32_e64 v24, s1, s17, v24, s1
	global_load_u8 v23, v[23:24], off
	v_movreld_b32_e32 v0, v21
	v_add_co_u32 v21, s1, v25, 1
	v_movreld_b32_e32 v1, v22
	v_add_co_ci_u32_e64 v22, s1, 0, v26, s1
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v21, 0, v21, vcc_lo
	s_mov_b32 m0, s12
	v_cndmask_b32_e32 v22, 0, v22, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v21, s1, s16, v21
	v_add_co_ci_u32_e64 v22, s1, s17, v22, s1
	global_load_u8 v29, v[21:22], off
	v_dual_cndmask_b32 v21, 0, v25 :: v_dual_cndmask_b32 v22, 0, v26
	v_movrels_b32_e32 v24, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v21, s1, s16, v21
	v_add_co_ci_u32_e64 v22, s1, s17, v22, s1
	global_load_u8 v25, v[21:22], off
	s_waitcnt vmcnt(2)
	v_cndmask_b32_e32 v21, 0, v23, vcc_lo
	v_movrels_b32_e32 v23, v0
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v21, v27, v21
	v_cvt_f64_i32_e32 v[21:22], v21
	s_waitcnt vmcnt(1)
	v_cndmask_b32_e32 v26, 0, v29, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[21:22], v[23:24], v[21:22]
	v_mul_lo_u32 v23, v26, v27
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v25, 0, v25, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cvt_f64_i32_e32 v[23:24], v23
	v_movreld_b32_e32 v0, v21
	v_movreld_b32_e32 v1, v22
	s_mov_b32 m0, s13
	v_movrels_b32_e32 v22, v1
	v_movrels_b32_e32 v21, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_f64 v[21:22], v[21:22], v[23:24]
	v_mul_lo_u32 v23, v25, v27
	v_add_co_u32 v25, s1, s22, v18
	v_add_co_ci_u32_e64 v26, null, s24, 0, s1
	s_delay_alu instid0(VALU_DEP_3)
	v_cvt_f64_i32_e32 v[23:24], v23
	v_movreld_b32_e32 v0, v21
	v_movreld_b32_e32 v1, v22
	s_mov_b32 m0, s14
	v_movrels_b32_e32 v22, v1
	v_movrels_b32_e32 v21, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_f64 v[21:22], v[21:22], v[23:24]
	v_add_co_u32 v23, vcc_lo, v25, 2
	v_add_co_ci_u32_e32 v24, vcc_lo, 0, v26, vcc_lo
	s_and_b32 vcc_lo, s2, s23
	v_dual_cndmask_b32 v23, 0, v23 :: v_dual_cndmask_b32 v24, 0, v24
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v23, s1, s16, v23
	v_add_co_ci_u32_e64 v24, s1, s17, v24, s1
	global_load_u8 v23, v[23:24], off
	v_movreld_b32_e32 v0, v21
	v_add_co_u32 v21, s1, v25, 1
	v_movreld_b32_e32 v1, v22
	v_add_co_ci_u32_e64 v22, s1, 0, v26, s1
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v21, 0, v21, vcc_lo
	s_mov_b32 m0, s12
	v_cndmask_b32_e32 v22, 0, v22, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v21, s1, s16, v21
	v_add_co_ci_u32_e64 v22, s1, s17, v22, s1
	global_load_u8 v27, v[21:22], off
	v_dual_cndmask_b32 v21, 0, v25 :: v_dual_cndmask_b32 v22, 0, v26
	v_movrels_b32_e32 v24, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v21, s1, s16, v21
	v_add_co_ci_u32_e64 v22, s1, s17, v22, s1
	global_load_u8 v25, v[21:22], off
	s_waitcnt vmcnt(2)
	v_cndmask_b32_e32 v21, 0, v23, vcc_lo
	v_movrels_b32_e32 v23, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v21, v28, v21
	v_cvt_f64_i32_e32 v[21:22], v21
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_f64 v[21:22], v[23:24], v[21:22]
	s_waitcnt vmcnt(1)
	v_cndmask_b32_e32 v23, 0, v27, vcc_lo
	v_mul_lo_u32 v23, v23, v28
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cvt_f64_i32_e32 v[23:24], v23
	v_movreld_b32_e32 v0, v21
	v_movreld_b32_e32 v1, v22
	s_mov_b32 m0, s13
	v_movrels_b32_e32 v22, v1
	v_movrels_b32_e32 v21, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_f64 v[21:22], v[21:22], v[23:24]
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v23, 0, v25, vcc_lo
	v_add_co_u32 v25, s1, s22, v20
	v_add_co_ci_u32_e64 v26, null, s24, 0, s1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v23, v23, v28
	v_cvt_f64_i32_e32 v[23:24], v23
	v_movreld_b32_e32 v0, v21
	v_movreld_b32_e32 v1, v22
	s_mov_b32 m0, s14
	v_movrels_b32_e32 v22, v1
	v_movrels_b32_e32 v21, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_add_f64 v[21:22], v[21:22], v[23:24]
	v_add_co_u32 v23, vcc_lo, v25, 2
	v_add_co_ci_u32_e32 v24, vcc_lo, 0, v26, vcc_lo
	s_and_b32 vcc_lo, s3, s23
	s_cmp_lg_u32 s21, 20
	v_dual_cndmask_b32 v23, 0, v23 :: v_dual_cndmask_b32 v24, 0, v24
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v23, s1, s16, v23
	v_add_co_ci_u32_e64 v24, s1, s17, v24, s1
	global_load_u8 v23, v[23:24], off
	v_movreld_b32_e32 v0, v21
	v_add_co_u32 v21, s1, v25, 1
	v_movreld_b32_e32 v1, v22
	v_add_co_ci_u32_e64 v22, s1, 0, v26, s1
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v21, 0, v21, vcc_lo
	s_mov_b32 m0, s12
	v_cndmask_b32_e32 v22, 0, v22, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v21, s1, s16, v21
	v_add_co_ci_u32_e64 v22, s1, s17, v22, s1
	global_load_u8 v27, v[21:22], off
	v_dual_cndmask_b32 v21, 0, v25 :: v_dual_cndmask_b32 v22, 0, v26
	ds_load_b32 v26, v30 offset:80
	v_movrels_b32_e32 v24, v1
	v_add_co_u32 v21, s1, s16, v21
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v22, s1, s17, v22, s1
	global_load_u8 v25, v[21:22], off
	s_waitcnt vmcnt(2)
	v_cndmask_b32_e32 v21, 0, v23, vcc_lo
	v_movrels_b32_e32 v23, v0
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v21, v26, v21
	v_cvt_f64_i32_e32 v[21:22], v21
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_f64 v[21:22], v[23:24], v[21:22]
	s_waitcnt vmcnt(1)
	v_cndmask_b32_e32 v23, 0, v27, vcc_lo
	v_mul_lo_u32 v23, v23, v26
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cvt_f64_i32_e32 v[23:24], v23
	v_movreld_b32_e32 v0, v21
	v_movreld_b32_e32 v1, v22
	s_mov_b32 m0, s13
	v_movrels_b32_e32 v22, v1
	v_movrels_b32_e32 v21, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_f64 v[21:22], v[21:22], v[23:24]
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e32 v23, 0, v25, vcc_lo
	v_mul_lo_u32 v23, v23, v26
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cvt_f64_i32_e32 v[23:24], v23
	v_movreld_b32_e32 v0, v21
	v_movreld_b32_e32 v1, v22
	s_mov_b32 m0, s14
	v_movrels_b32_e32 v22, v1
	v_movrels_b32_e32 v21, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f64 v[21:22], v[21:22], v[23:24]
	v_movreld_b32_e32 v0, v21
	s_delay_alu instid0(VALU_DEP_2)
	v_movreld_b32_e32 v1, v22
	s_cbranch_scc1 .LBB0_2
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	s_mov_b32 s12, 1
	s_and_b32 vcc_lo, exec_lo, s6
	s_mov_b32 s13, 0
	s_cbranch_vccz .LBB0_1
; %bb.4:                                ; %.preheader
	v_mul_f64 v[8:9], v[8:9], v[8:9]
	v_mul_f64 v[6:7], v[6:7], v[6:7]
	v_mul_f64 v[10:11], v[10:11], v[10:11]
	s_ashr_i32 s2, s10, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	s_mul_i32 s2, s2, s8
	v_fma_f64 v[2:3], v[2:3], v[2:3], v[8:9]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f64 v[0:1], v[0:1], v[0:1], v[6:7]
	v_fma_f64 v[4:5], v[4:5], v[4:5], v[10:11]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cmp_gt_f64_e32 vcc_lo, 0x10000000, v[2:3]
	v_cmp_gt_f64_e64 s0, 0x10000000, v[0:1]
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_cmp_gt_f64_e64 s1, 0x10000000, v[4:5]
	v_cndmask_b32_e64 v6, 0, 1, vcc_lo
	v_cndmask_b32_e64 v7, 0, 1, s0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v8, 0, 1, s1
	v_lshlrev_b32_e32 v6, 8, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_ldexp_f64 v[2:3], v[2:3], v6
	v_lshlrev_b32_e32 v7, 8, v7
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshlrev_b32_e32 v6, 8, v8
	v_ldexp_f64 v[0:1], v[0:1], v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_ldexp_f64 v[4:5], v[4:5], v6
	v_rsq_f64_e32 v[6:7], v[2:3]
	v_rsq_f64_e32 v[8:9], v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(TRANS32_DEP_3)
	v_rsq_f64_e32 v[10:11], v[4:5]
	v_mul_f64 v[12:13], v[2:3], v[6:7]
	v_mul_f64 v[6:7], v[6:7], 0.5
	s_waitcnt_depctr 0xfff
	v_mul_f64 v[14:15], v[0:1], v[8:9]
	v_mul_f64 v[8:9], v[8:9], 0.5
	v_mul_f64 v[17:18], v[4:5], v[10:11]
	v_mul_f64 v[10:11], v[10:11], 0.5
	v_fma_f64 v[19:20], -v[6:7], v[12:13], 0.5
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f64 v[21:22], -v[8:9], v[14:15], 0.5
	v_fma_f64 v[23:24], -v[10:11], v[17:18], 0.5
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_fma_f64 v[12:13], v[12:13], v[19:20], v[12:13]
	v_fma_f64 v[6:7], v[6:7], v[19:20], v[6:7]
	v_fma_f64 v[14:15], v[14:15], v[21:22], v[14:15]
	v_fma_f64 v[8:9], v[8:9], v[21:22], v[8:9]
	v_fma_f64 v[17:18], v[17:18], v[23:24], v[17:18]
	v_fma_f64 v[10:11], v[10:11], v[23:24], v[10:11]
	v_fma_f64 v[19:20], -v[12:13], v[12:13], v[2:3]
	v_fma_f64 v[21:22], -v[14:15], v[14:15], v[0:1]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f64 v[23:24], -v[17:18], v[17:18], v[4:5]
	v_fma_f64 v[12:13], v[19:20], v[6:7], v[12:13]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f64 v[14:15], v[21:22], v[8:9], v[14:15]
	v_fma_f64 v[17:18], v[23:24], v[10:11], v[17:18]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f64 v[19:20], -v[12:13], v[12:13], v[2:3]
	v_fma_f64 v[21:22], -v[14:15], v[14:15], v[0:1]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f64 v[23:24], -v[17:18], v[17:18], v[4:5]
	v_fma_f64 v[6:7], v[19:20], v[6:7], v[12:13]
	v_cndmask_b32_e64 v12, 0, 0xffffff80, vcc_lo
	v_cndmask_b32_e64 v13, 0, 0xffffff80, s0
	v_cmp_class_f64_e64 vcc_lo, v[2:3], 0x260
	v_cmp_class_f64_e64 s0, v[0:1], 0x260
	v_fma_f64 v[8:9], v[21:22], v[8:9], v[14:15]
	v_fma_f64 v[10:11], v[23:24], v[10:11], v[17:18]
	v_ldexp_f64 v[6:7], v[6:7], v12
	v_cndmask_b32_e64 v12, 0, 0xffffff80, s1
	v_cmp_class_f64_e64 s1, v[4:5], 0x260
	v_ldexp_f64 v[8:9], v[8:9], v13
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_ldexp_f64 v[10:11], v[10:11], v12
	v_dual_cndmask_b32 v2, v6, v2 :: v_dual_cndmask_b32 v3, v7, v3
	v_cndmask_b32_e64 v1, v9, v1, s0
	s_delay_alu instid0(VALU_DEP_2)
	v_ldexp_f64 v[2:3], v[2:3], -3
	v_cndmask_b32_e64 v0, v8, v0, s0
	v_cndmask_b32_e64 v5, v11, v5, s1
	v_cndmask_b32_e64 v4, v10, v4, s1
	s_mul_i32 s0, s10, s9
	s_mul_hi_u32 s1, s10, s8
	v_ldexp_f64 v[0:1], v[0:1], -3
	s_add_i32 s0, s1, s0
	v_ldexp_f64 v[4:5], v[4:5], -3
	s_mul_i32 s10, s10, s8
	s_add_i32 s0, s0, s2
	s_add_u32 s1, s18, s10
	s_addc_u32 s0, s19, s0
	v_min_f64 v[2:3], 0x406fe000, v[2:3]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_min_f64 v[0:1], 0x406fe000, v[0:1]
	v_min_f64 v[4:5], 0x406fe000, v[4:5]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cvt_i32_f64_e32 v2, v[2:3]
	v_cvt_i32_f64_e32 v3, v[0:1]
	v_add_co_u32 v0, s1, s1, v16
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_cvt_i32_f64_e32 v4, v[4:5]
	v_add_co_ci_u32_e64 v1, null, s0, 0, s1
	v_lshlrev_b16 v2, 8, v2
	v_or_b32_e32 v2, v3, v2
	s_clause 0x1
	global_store_b8 v[0:1], v4, off offset:2
	global_store_b16 v[0:1], v2, off
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z5sobelPhS_jjjmi
		.amdhsa_group_segment_fixed_size 200
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 44
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 32
		.amdhsa_next_free_sgpr 27
		.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	_Z5sobelPhS_jjjmi, .Lfunc_end0-_Z5sobelPhS_jjjmi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 3244
; NumSgprs: 29
; NumVgprs: 32
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 200 bytes/workgroup (compile time only)
; SGPRBlocks: 3
; VGPRBlocks: 3
; NumSGPRsForWavesPerEU: 29
; NumVGPRsForWavesPerEU: 32
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.protected	_mask                   ; @_mask
	.type	_mask,@object
	.data
	.globl	_mask
	.p2align	4, 0x0
_mask:
	.long	4294967295                      ; 0xffffffff
	.long	4294967292                      ; 0xfffffffc
	.long	4294967290                      ; 0xfffffffa
	.long	4294967292                      ; 0xfffffffc
	.long	4294967295                      ; 0xffffffff
	.long	4294967294                      ; 0xfffffffe
	.long	4294967288                      ; 0xfffffff8
	.long	4294967284                      ; 0xfffffff4
	.long	4294967288                      ; 0xfffffff8
	.long	4294967294                      ; 0xfffffffe
	.zero	20
	.long	2                               ; 0x2
	.long	8                               ; 0x8
	.long	12                              ; 0xc
	.long	8                               ; 0x8
	.long	2                               ; 0x2
	.long	1                               ; 0x1
	.long	4                               ; 0x4
	.long	6                               ; 0x6
	.long	4                               ; 0x4
	.long	1                               ; 0x1
	.long	4294967295                      ; 0xffffffff
	.long	4294967294                      ; 0xfffffffe
	.long	0                               ; 0x0
	.long	2                               ; 0x2
	.long	1                               ; 0x1
	.long	4294967292                      ; 0xfffffffc
	.long	4294967288                      ; 0xfffffff8
	.long	0                               ; 0x0
	.long	8                               ; 0x8
	.long	4                               ; 0x4
	.long	4294967290                      ; 0xfffffffa
	.long	4294967284                      ; 0xfffffff4
	.long	0                               ; 0x0
	.long	12                              ; 0xc
	.long	6                               ; 0x6
	.long	4294967292                      ; 0xfffffffc
	.long	4294967288                      ; 0xfffffff8
	.long	0                               ; 0x0
	.long	8                               ; 0x8
	.long	4                               ; 0x4
	.long	4294967295                      ; 0xffffffff
	.long	4294967294                      ; 0xfffffffe
	.long	0                               ; 0x0
	.long	2                               ; 0x2
	.long	1                               ; 0x1
	.size	_mask, 200

	.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 _mask
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           8
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 200
    .kernarg_segment_align: 8
    .kernarg_segment_size: 44
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z5sobelPhS_jjjmi
    .private_segment_fixed_size: 0
    .sgpr_count:     29
    .sgpr_spill_count: 0
    .symbol:         _Z5sobelPhS_jjjmi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     32
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
