#include <iomanip>
#include <getopt.h>
#include <stdio.h>
#include <string.h>



void testPooling(
        int tdims, int xDims[],
        int pdims, int poolDims[], int poolPad[], int poolStride[],
        int verbose, int compare
    );

void testXcorr(
        int tdims, int xDims[], int wDims[],
        int cdims, int convPad[], int convStride[], int convUpscale[], int verbose, int compare
        );

void cmdLine(int argc, char *argv[], int& mode, int& dims, int& verbose, int& compare){
    /// Command line arguments
    // Default value of the domain sizes
    static struct option long_options[] = {
        {"d", required_argument, 0, 'd'},
        {"m", required_argument, 0, 'm'},
        {"v", no_argument, 0, 'v'},
        {"c", no_argument, 0, 'c'},
    };
    // Process command line arguments
    int ac;
    for(ac=1;ac<argc;ac++) {
        int cmd;
        while ((cmd=getopt_long(argc,argv,"m:d:v:c",long_options,NULL)) != -1){
            switch (cmd) {
                case 'm':
                    mode = atoi(optarg);
                    break;

                case 'd':
                    dims = atoi(optarg);
                    break;

                case 'v':
                    verbose = 1;
                    break;

                case 'c':
                    compare = 1;
                    break;

                default:
                    printf("Usage: a.out [-m <mode>] [-d <dims>] [-v for verbose] [-c for comparison]\n");
                    exit(-1);
            }
        }
    }
}

int main(int argc, char *argv[]){
    int mode=0, dims=5, verbose=0, compare=0;
    cmdLine(argc, argv, mode, dims, verbose, compare);
    printf("%d %d %d\n", dims, verbose, compare);

    if(mode==0){ // xcorr
        printf("mode: xcorr\n");
        if(dims==5){
            int xDims[5] = {10,3,28,28,28};
            int wDims[5] = {2,3,5,5,5};
            int convPad[3] = {2,2,2};
            int convStride[3] = {1,1,1};
            int convUpscale[3] = {1,1,1};
            testXcorr(
                5, xDims, wDims,
                3, convPad, convStride, convUpscale, verbose, compare
                );
        }else if(dims == 4){
            int xDims[4] = {11,3,25,25};
            int wDims[4] = {5,3,5,6};
            int convPad[2] = {3,3};
            int convStride[2] = {1,1};
            int convUpscale[2] = {1,1};
            testXcorr(
                4, xDims, wDims,
                2, convPad, convStride, convUpscale, verbose, compare
                );
        }
    }else if(mode==1){ // max pool
        printf("mode: max pool\n");
        if(dims==4){
            int xDims[4] = {100,3,28,28}; // N C H W D

            int poolDims[2] = {5,5};
            int poolStride[2] = {5,5};
            int poolPad[2] = {0,0};
            testPooling( 4, xDims, 2, poolDims, poolPad, poolStride, verbose, compare);
        }else if(dims == 5){
            int xDims[5] = {100,3,28,28,28}; // N C H W D

            int poolDims[3] = {5,5,5};
            int poolStride[3] = {5,5,5};
            int poolPad[3] = {0,0,0};
            testPooling(5, xDims, 3, poolDims, poolPad, poolStride, verbose, compare);
        }else
            exit(-1);
    }

    return 0;
}


	.file	"tmpxft_002a0bc9_00000000-6_runtests.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3919:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3919:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Usage: a.out [-m <mode>] [-d <dims>] [-v for verbose] [-c for comparison]\n"
.LC1:
	.string	"m:d:v:c"
	.text
	.globl	_Z7cmdLineiPPcRiS1_S1_S1_
	.type	_Z7cmdLineiPPcRiS1_S1_S1_, @function
_Z7cmdLineiPPcRiS1_S1_S1_:
.LFB3915:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%r9, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r8, %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	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	$1, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edi, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%rsi, 8(%rsp)
.L3:
	cmpl	%ebx, %ebp
	jge	.L16
.L12:
	movq	8(%rsp), %rsi
	xorl	%r8d, %r8d
	leaq	_ZZ7cmdLineiPPcRiS1_S1_S1_E12long_options(%rip), %rcx
	movl	%ebx, %edi
	leaq	.LC1(%rip), %rdx
	call	getopt_long@PLT
	cmpl	$-1, %eax
	je	.L17
	cmpl	$109, %eax
	je	.L4
	jg	.L5
	cmpl	$99, %eax
	je	.L6
	cmpl	$100, %eax
	jne	.L8
	movq	optarg(%rip), %rdi
	call	atoi@PLT
	movl	%eax, 0(%r13)
	jmp	.L12
.L5:
	cmpl	$118, %eax
	jne	.L8
	movl	$1, (%r14)
	jmp	.L12
.L4:
	movq	optarg(%rip), %rdi
	call	atoi@PLT
	movl	%eax, (%r12)
	jmp	.L12
.L6:
	movl	$1, (%r15)
	jmp	.L12
.L8:
	movl	$2, %edi
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	orl	$-1, %edi
	call	exit@PLT
.L17:
	incl	%ebp
	jmp	.L3
.L16:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3915:
	.size	_Z7cmdLineiPPcRiS1_S1_S1_, .-_Z7cmdLineiPPcRiS1_S1_S1_
	.section	.rodata.str1.1
.LC2:
	.string	"%d %d %d\n"
.LC3:
	.string	"mode: xcorr\n"
.LC4:
	.string	"mode: max pool\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB3916:
	.cfi_startproc
	endbr64
	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
	subq	$112, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	12(%rsp), %rdx
	movl	%eax, 12(%rsp)
	leaq	24(%rsp), %r9
	xorl	%eax, %eax
	leaq	20(%rsp), %r8
	movl	%eax, 20(%rsp)
	movl	%eax, 24(%rsp)
	movl	$5, 16(%rsp)
	call	_Z7cmdLineiPPcRiS1_S1_S1_
	movl	24(%rsp), %ebp
	movl	20(%rsp), %ebx
	xorl	%eax, %eax
	movl	16(%rsp), %r12d
	leaq	.LC2(%rip), %rsi
	movl	$2, %edi
	movl	%ebp, %r8d
	movl	%ebx, %ecx
	movl	%r12d, %edx
	call	__printf_chk@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jne	.L19
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	cmpl	$5, %r12d
	jne	.L20
	movabsq	$12884901898, %rax
	movl	$28, 80(%rsp)
	leaq	84(%rsp), %rdx
	leaq	64(%rsp), %rsi
	movq	%rax, 64(%rsp)
	movl	$3, %ecx
	movabsq	$120259084316, %rax
	movl	$5, %edi
	movq	%rax, 72(%rsp)
	movabsq	$12884901890, %rax
	movq	%rax, 84(%rsp)
	movabsq	$21474836485, %rax
	movq	%rax, 92(%rsp)
	movabsq	$8589934594, %rax
	movq	%rax, 28(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$5, 100(%rsp)
	movl	$2, 36(%rsp)
	movl	$1, 48(%rsp)
	movl	$1, 60(%rsp)
	pushq	%rax
	.cfi_remember_state
	.cfi_def_cfa_offset 152
	pushq	%rbp
	.cfi_def_cfa_offset 160
	pushq	%rbx
	.cfi_def_cfa_offset 168
	leaq	76(%rsp), %rax
	pushq	%rax
	.cfi_def_cfa_offset 176
	leaq	72(%rsp), %r9
	leaq	60(%rsp), %r8
	jmp	.L28
.L20:
	.cfi_restore_state
	cmpl	$4, %r12d
	jne	.L21
	leaq	84(%rsp), %rdx
	leaq	64(%rsp), %rsi
	movl	$2, %ecx
	movabsq	$12884901899, %rax
	movq	%rax, 64(%rsp)
	movl	$4, %edi
	movabsq	$107374182425, %rax
	movq	%rax, 72(%rsp)
	movabsq	$12884901893, %rax
	movq	%rax, 84(%rsp)
	movabsq	$25769803781, %rax
	movq	%rax, 92(%rsp)
	movabsq	$12884901891, %rax
	movq	%rax, 28(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	pushq	%r12
	.cfi_def_cfa_offset 152
	pushq	%rbp
	.cfi_def_cfa_offset 160
	pushq	%rbx
	.cfi_def_cfa_offset 168
	leaq	76(%rsp), %rax
	pushq	%rax
	.cfi_def_cfa_offset 176
	leaq	72(%rsp), %r9
	leaq	60(%rsp), %r8
.L28:
	call	_Z9testXcorriPiS_iS_S_S_ii@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 144
	jmp	.L21
.L19:
	decl	%eax
	jne	.L21
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	cmpl	$4, %r12d
	leaq	40(%rsp), %rcx
	leaq	84(%rsp), %rsi
	leaq	64(%rsp), %r8
	leaq	52(%rsp), %r9
	jne	.L23
	movl	$3221225497, %eax
	xorl	%r11d, %r11d
	movl	$2, %edx
	movl	$4, %edi
	salq	$2, %rax
	movq	%r11, 64(%rsp)
	movq	%rax, 84(%rsp)
	movabsq	$120259084316, %rax
	movq	%rax, 92(%rsp)
	movabsq	$21474836485, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	pushq	%rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 152
	pushq	%rbx
	.cfi_def_cfa_offset 160
	jmp	.L27
.L23:
	.cfi_restore_state
	cmpl	$5, %r12d
	jne	.L24
	movl	$3221225497, %eax
	xorl	%edi, %edi
	xorl	%r10d, %r10d
	movl	$3, %edx
	salq	$2, %rax
	movq	%rdi, 64(%rsp)
	movl	$5, %edi
	movq	%rax, 84(%rsp)
	movabsq	$120259084316, %rax
	movq	%rax, 92(%rsp)
	movabsq	$21474836485, %rax
	movl	$28, 100(%rsp)
	movq	%rax, 40(%rsp)
	movl	$5, 48(%rsp)
	movq	%rax, 52(%rsp)
	movl	$5, 60(%rsp)
	movl	%r10d, 72(%rsp)
	pushq	%rbp
	.cfi_def_cfa_offset 152
	pushq	%rbx
	.cfi_def_cfa_offset 160
.L27:
	call	_Z11testPoolingiPiiS_S_S_ii@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
	jmp	.L21
.L24:
	orl	$-1, %edi
	call	exit@PLT
.L21:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	addq	$112, %rsp
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3916:
	.size	main, .-main
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3942:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE3942:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.str1.1
.LC5:
	.string	"d"
.LC6:
	.string	"m"
.LC7:
	.string	"v"
.LC8:
	.string	"c"
	.section	.data.rel.local,"aw"
	.align 32
	.type	_ZZ7cmdLineiPPcRiS1_S1_S1_E12long_options, @object
	.size	_ZZ7cmdLineiPPcRiS1_S1_S1_E12long_options, 128
_ZZ7cmdLineiPPcRiS1_S1_S1_E12long_options:
	.quad	.LC5
	.long	1
	.zero	4
	.quad	0
	.long	100
	.zero	4
	.quad	.LC6
	.long	1
	.zero	4
	.quad	0
	.long	109
	.zero	4
	.quad	.LC7
	.long	0
	.zero	4
	.quad	0
	.long	118
	.zero	4
	.quad	.LC8
	.long	0
	.zero	4
	.quad	0
	.long	99
	.zero	4
	.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 <iomanip>
#include <getopt.h>
#include <stdio.h>
#include <string.h>



void testPooling(
        int tdims, int xDims[],
        int pdims, int poolDims[], int poolPad[], int poolStride[],
        int verbose, int compare
    );

void testXcorr(
        int tdims, int xDims[], int wDims[],
        int cdims, int convPad[], int convStride[], int convUpscale[], int verbose, int compare
        );

void cmdLine(int argc, char *argv[], int& mode, int& dims, int& verbose, int& compare){
    /// Command line arguments
    // Default value of the domain sizes
    static struct option long_options[] = {
        {"d", required_argument, 0, 'd'},
        {"m", required_argument, 0, 'm'},
        {"v", no_argument, 0, 'v'},
        {"c", no_argument, 0, 'c'},
    };
    // Process command line arguments
    int ac;
    for(ac=1;ac<argc;ac++) {
        int cmd;
        while ((cmd=getopt_long(argc,argv,"m:d:v:c",long_options,NULL)) != -1){
            switch (cmd) {
                case 'm':
                    mode = atoi(optarg);
                    break;

                case 'd':
                    dims = atoi(optarg);
                    break;

                case 'v':
                    verbose = 1;
                    break;

                case 'c':
                    compare = 1;
                    break;

                default:
                    printf("Usage: a.out [-m <mode>] [-d <dims>] [-v for verbose] [-c for comparison]\n");
                    exit(-1);
            }
        }
    }
}

int main(int argc, char *argv[]){
    int mode=0, dims=5, verbose=0, compare=0;
    cmdLine(argc, argv, mode, dims, verbose, compare);
    printf("%d %d %d\n", dims, verbose, compare);

    if(mode==0){ // xcorr
        printf("mode: xcorr\n");
        if(dims==5){
            int xDims[5] = {10,3,28,28,28};
            int wDims[5] = {2,3,5,5,5};
            int convPad[3] = {2,2,2};
            int convStride[3] = {1,1,1};
            int convUpscale[3] = {1,1,1};
            testXcorr(
                5, xDims, wDims,
                3, convPad, convStride, convUpscale, verbose, compare
                );
        }else if(dims == 4){
            int xDims[4] = {11,3,25,25};
            int wDims[4] = {5,3,5,6};
            int convPad[2] = {3,3};
            int convStride[2] = {1,1};
            int convUpscale[2] = {1,1};
            testXcorr(
                4, xDims, wDims,
                2, convPad, convStride, convUpscale, verbose, compare
                );
        }
    }else if(mode==1){ // max pool
        printf("mode: max pool\n");
        if(dims==4){
            int xDims[4] = {100,3,28,28}; // N C H W D

            int poolDims[2] = {5,5};
            int poolStride[2] = {5,5};
            int poolPad[2] = {0,0};
            testPooling( 4, xDims, 2, poolDims, poolPad, poolStride, verbose, compare);
        }else if(dims == 5){
            int xDims[5] = {100,3,28,28,28}; // N C H W D

            int poolDims[3] = {5,5,5};
            int poolStride[3] = {5,5,5};
            int poolPad[3] = {0,0,0};
            testPooling(5, xDims, 3, poolDims, poolPad, poolStride, verbose, compare);
        }else
            exit(-1);
    }

    return 0;
}


	.text
	.file	"runtests.hip"
	.globl	_Z7cmdLineiPPcRiS1_S1_S1_       # -- Begin function _Z7cmdLineiPPcRiS1_S1_S1_
	.type	_Z7cmdLineiPPcRiS1_S1_S1_,@function
_Z7cmdLineiPPcRiS1_S1_S1_:              # @_Z7cmdLineiPPcRiS1_S1_S1_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	cmpl	$2, %edi
	jl	.LBB0_15
# %bb.1:                                # %.preheader.preheader
	movq	%r9, %rbx
	movq	%r8, %r14
	movq	%rcx, %r15
	movq	%rdx, %r12
	movq	%rsi, %r13
	movl	%edi, %ebp
	movl	$1, %eax
.LBB0_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_3 Depth 2
	movl	%eax, 4(%rsp)                   # 4-byte Spill
.LBB0_3:                                #   Parent Loop BB0_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$.L.str.4, %edx
	movl	$_ZZ7cmdLineiPPcRiS1_S1_S1_E12long_options, %ecx
	movl	%ebp, %edi
	movq	%r13, %rsi
	xorl	%r8d, %r8d
	callq	getopt_long
	cmpl	$108, %eax
	jg	.LBB0_8
# %bb.4:                                #   in Loop: Header=BB0_3 Depth=2
	cmpl	$99, %eax
	je	.LBB0_13
# %bb.5:                                #   in Loop: Header=BB0_3 Depth=2
	cmpl	$100, %eax
	jne	.LBB0_6
# %bb.11:                               #   in Loop: Header=BB0_3 Depth=2
	movq	optarg(%rip), %rdi
	callq	atoi
	movl	%eax, (%r15)
	jmp	.LBB0_3
.LBB0_8:                                #   in Loop: Header=BB0_3 Depth=2
	cmpl	$118, %eax
	je	.LBB0_12
# %bb.9:                                #   in Loop: Header=BB0_3 Depth=2
	cmpl	$109, %eax
	jne	.LBB0_7
# %bb.10:                               #   in Loop: Header=BB0_3 Depth=2
	movq	optarg(%rip), %rdi
	callq	atoi
	movl	%eax, (%r12)
	jmp	.LBB0_3
.LBB0_12:                               #   in Loop: Header=BB0_3 Depth=2
	movl	$1, (%r14)
	jmp	.LBB0_3
.LBB0_13:                               #   in Loop: Header=BB0_3 Depth=2
	movl	$1, (%rbx)
	jmp	.LBB0_3
.LBB0_6:                                #   in Loop: Header=BB0_2 Depth=1
	cmpl	$-1, %eax
	jne	.LBB0_7
# %bb.14:                               #   in Loop: Header=BB0_2 Depth=1
	movl	4(%rsp), %eax                   # 4-byte Reload
	incl	%eax
	cmpl	%ebp, %eax
	jne	.LBB0_2
.LBB0_15:                               # %._crit_edge
	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
.LBB0_7:
	.cfi_def_cfa_offset 64
	movl	$.Lstr, %edi
	callq	puts@PLT
	movl	$-1, %edi
	callq	exit
.Lfunc_end0:
	.size	_Z7cmdLineiPPcRiS1_S1_S1_, .Lfunc_end0-_Z7cmdLineiPPcRiS1_S1_S1_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function main
.LCPI1_0:
	.long	100                             # 0x64
	.long	3                               # 0x3
	.long	28                              # 0x1c
	.long	28                              # 0x1c
.LCPI1_1:
	.long	11                              # 0xb
	.long	3                               # 0x3
	.long	25                              # 0x19
	.long	25                              # 0x19
.LCPI1_2:
	.long	5                               # 0x5
	.long	3                               # 0x3
	.long	5                               # 0x5
	.long	6                               # 0x6
.LCPI1_3:
	.long	10                              # 0xa
	.long	3                               # 0x3
	.long	28                              # 0x1c
	.long	28                              # 0x1c
.LCPI1_4:
	.long	2                               # 0x2
	.long	3                               # 0x3
	.long	5                               # 0x5
	.long	5                               # 0x5
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	xorl	%eax, %eax
	leaq	44(%rsp), %r15
	movl	%eax, (%r15)
	leaq	40(%rsp), %rbx
	movl	$5, (%rbx)
	leaq	36(%rsp), %r14
	movl	%eax, (%r14)
	leaq	32(%rsp), %r12
	movl	%eax, (%r12)
	movq	%r15, %rdx
	movq	%rbx, %rcx
	movq	%r14, %r8
	movq	%r12, %r9
	callq	_Z7cmdLineiPPcRiS1_S1_S1_
	movl	(%rbx), %ebp
	movl	(%r14), %ebx
	movl	(%r12), %r14d
	movl	$.L.str.6, %edi
	movl	%ebp, %esi
	movl	%ebx, %edx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	printf
	movl	(%r15), %eax
	cmpl	$1, %eax
	je	.LBB1_8
# %bb.1:
	testl	%eax, %eax
	jne	.LBB1_7
# %bb.2:
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	cmpl	$4, %ebp
	je	.LBB1_5
# %bb.3:
	cmpl	$5, %ebp
	jne	.LBB1_7
# %bb.4:
	movaps	.LCPI1_3(%rip), %xmm0           # xmm0 = [10,3,28,28]
	leaq	80(%rsp), %rsi
	movaps	%xmm0, (%rsi)
	movl	$28, 16(%rsi)
	movaps	.LCPI1_4(%rip), %xmm0           # xmm0 = [2,3,5,5]
	leaq	48(%rsp), %rdx
	movaps	%xmm0, (%rdx)
	movl	$5, 16(%rdx)
	movabsq	$8589934594, %rax               # imm = 0x200000002
	leaq	20(%rsp), %r8
	movq	%rax, (%r8)
	movl	$2, 8(%r8)
	movabsq	$4294967297, %rax               # imm = 0x100000001
	leaq	8(%rsp), %r9
	movq	%rax, (%r9)
	movl	$1, %ecx
	movl	%ecx, 8(%r9)
	leaq	100(%rsp), %r10
	movq	%rax, (%r10)
	movl	%ecx, 8(%r10)
	subq	$8, %rsp
	.cfi_adjust_cfa_offset 8
	movl	$5, %edi
	movl	$3, %ecx
	jmp	.LBB1_6
.LBB1_8:
	.cfi_def_cfa_offset 160
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	cmpl	$5, %ebp
	je	.LBB1_12
# %bb.9:
	cmpl	$4, %ebp
	jne	.LBB1_13
# %bb.10:
	movaps	.LCPI1_0(%rip), %xmm0           # xmm0 = [100,3,28,28]
	leaq	80(%rsp), %rsi
	movaps	%xmm0, (%rsi)
	movabsq	$21474836485, %rax              # imm = 0x500000005
	leaq	48(%rsp), %rcx
	movq	%rax, (%rcx)
	leaq	20(%rsp), %r9
	movq	%rax, (%r9)
	leaq	8(%rsp), %r8
	movq	$0, (%r8)
	movl	$4, %edi
	movl	$2, %edx
	jmp	.LBB1_11
.LBB1_12:
	movaps	.LCPI1_0(%rip), %xmm0           # xmm0 = [100,3,28,28]
	leaq	80(%rsp), %rsi
	movaps	%xmm0, (%rsi)
	movl	$28, 16(%rsi)
	movabsq	$21474836485, %rax              # imm = 0x500000005
	leaq	48(%rsp), %rcx
	movq	%rax, (%rcx)
	movl	$5, %edx
	movl	%edx, 8(%rcx)
	leaq	20(%rsp), %r9
	movq	%rax, (%r9)
	movl	%edx, 8(%r9)
	leaq	8(%rsp), %r8
	movl	$0, 8(%r8)
	movq	$0, (%r8)
	movl	$5, %edi
	movl	$3, %edx
.LBB1_11:
	pushq	%r14
	.cfi_adjust_cfa_offset 8
	pushq	%rbx
	.cfi_adjust_cfa_offset 8
	callq	_Z11testPoolingiPiiS_S_S_ii
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	jmp	.LBB1_7
.LBB1_5:
	movaps	.LCPI1_1(%rip), %xmm0           # xmm0 = [11,3,25,25]
	leaq	80(%rsp), %rsi
	movaps	%xmm0, (%rsi)
	movaps	.LCPI1_2(%rip), %xmm0           # xmm0 = [5,3,5,6]
	leaq	48(%rsp), %rdx
	movaps	%xmm0, (%rdx)
	movabsq	$12884901891, %rax              # imm = 0x300000003
	leaq	20(%rsp), %r8
	movq	%rax, (%r8)
	movabsq	$4294967297, %rax               # imm = 0x100000001
	leaq	8(%rsp), %r9
	movq	%rax, (%r9)
	leaq	100(%rsp), %r10
	movq	%rax, (%r10)
	subq	$8, %rsp
	.cfi_adjust_cfa_offset 8
	movl	$4, %edi
	movl	$2, %ecx
.LBB1_6:
	pushq	%r14
	.cfi_adjust_cfa_offset 8
	pushq	%rbx
	.cfi_adjust_cfa_offset 8
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	callq	_Z9testXcorriPiS_iS_S_S_ii
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
.LBB1_7:
	xorl	%eax, %eax
	addq	$112, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB1_13:
	.cfi_def_cfa_offset 160
	movl	$-1, %edi
	callq	exit
.Lfunc_end1:
	.size	main, .Lfunc_end1-main
	.cfi_endproc
                                        # -- End function
	.type	_ZZ7cmdLineiPPcRiS1_S1_S1_E12long_options,@object # @_ZZ7cmdLineiPPcRiS1_S1_S1_E12long_options
	.data
	.p2align	4, 0x0
_ZZ7cmdLineiPPcRiS1_S1_S1_E12long_options:
	.quad	.L.str
	.long	1                               # 0x1
	.zero	4
	.quad	0
	.long	100                             # 0x64
	.zero	4
	.quad	.L.str.1
	.long	1                               # 0x1
	.zero	4
	.quad	0
	.long	109                             # 0x6d
	.zero	4
	.quad	.L.str.2
	.long	0                               # 0x0
	.zero	4
	.quad	0
	.long	118                             # 0x76
	.zero	4
	.quad	.L.str.3
	.long	0                               # 0x0
	.zero	4
	.quad	0
	.long	99                              # 0x63
	.zero	4
	.size	_ZZ7cmdLineiPPcRiS1_S1_S1_E12long_options, 128

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"d"
	.size	.L.str, 2

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"m"
	.size	.L.str.1, 2

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

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

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"m:d:v:c"
	.size	.L.str.4, 8

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"%d %d %d\n"
	.size	.L.str.6, 10

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

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"Usage: a.out [-m <mode>] [-d <dims>] [-v for verbose] [-c for comparison]"
	.size	.Lstr, 74

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"mode: max pool"
	.size	.Lstr.1, 15

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"mode: xcorr"
	.size	.Lstr.2, 12

	.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 _ZZ7cmdLineiPPcRiS1_S1_S1_E12long_options
	.addrsig_sym __hip_cuid_

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

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

	.end_amdgpu_metadata
