#include <cuda.h>
#include <bits/stdc++.h>

#define BLOCK_SIZE 32

using namespace std;



void fill_matrix_random(int *mat, int rows, int cols){
  for (int i = 0; i < rows; i++){
    for (int j = 0; j < cols; j++){
      mat[i * cols + j] = rand() % 5;
    }
  }
}

bool check_matrix(int *A, int *B, int rows, int cols){
  for (int i = 0; i < rows; i++){
    for (int j = 0; j < cols; j++){
      if (A[i * cols + j] != B[i * cols +j])
        return false;
    }
  }
  return true;
}

void print_matrix(int *mat, int rows, int cols){
  cout << "------------" << endl;
  for (int i = 0; i < rows; i++){
    for (int j = 0; j < cols; j++){
      cout << mat[i * cols + j] << " ";
    }
    cout << endl;
  }
  cout << "------------" << endl;
}

void mat_mul_seq(int *m_A, int *m_B, int *m_C, int A_rows, int A_cols, int B_rows, int B_cols){
  int sum;
  for(int i = 0; i < A_rows; i++){
    for (int j = 0; j < B_cols; j++){
      sum = 0;
      for (int k = 0; k < A_cols; k++){
        sum += m_A[i * A_cols + k] * m_B[k * B_cols + j];
      }
      m_C[i * B_cols + j] = sum;
    }
  }
}
__global__ void mat_mul_kernel(int *m_A, int *m_B, int *m_C, int A_rows, int A_cols, int B_rows, int B_cols){
  int sum = 0;
  int row = threadIdx.y + blockIdx.y * blockDim.y;
  int col = threadIdx.x + blockIdx.x * blockDim.x;
  if(row < A_rows && col < B_cols){
    for(int i = 0; i < A_cols; i ++){
      sum += m_A[row * A_cols + i] * m_B[i * B_cols + col];
    }
    m_C[row * B_cols + col] = sum;
  }
}

__global__ void mat_mul_kernel_tiled(int *m_A, int *m_B, int *m_C, int A_rows, int A_cols, int B_rows, int B_cols){
  __shared__ int s_A[BLOCK_SIZE][BLOCK_SIZE], s_B[BLOCK_SIZE][BLOCK_SIZE];

  int blockRow = blockIdx.y;
  int blockCol = blockIdx.x;

  int threadRow = threadIdx.y;
  int threadCol = threadIdx.x;

  int row = blockRow * BLOCK_SIZE + threadRow;
  int col = blockCol * BLOCK_SIZE + threadCol;

  int sum = 0;
  for (int sm = 0; sm < ceil(A_cols / float (BLOCK_SIZE)); sm++){
    if (row < A_rows && (sm * BLOCK_SIZE + threadCol) < A_cols){
      s_A[threadRow][threadCol] = m_A[(row) * A_cols + (sm * BLOCK_SIZE + threadCol)];
    } else{
      s_A[threadRow][threadCol] = 0;
    }
    if (col < B_cols && (threadRow + sm * BLOCK_SIZE) < B_rows){
      s_B[threadRow][threadCol] = m_B[(threadRow + sm * BLOCK_SIZE) * B_cols + (col)];
    } else{
      s_B[threadRow][threadCol] = 0;
    }
    __syncthreads();
    for (int i = 0; i < BLOCK_SIZE; i++){
      sum += s_A[threadRow][i] * s_B[i][threadCol];
    }
    __syncthreads();
    if (row < A_rows && col < B_cols)
      m_C[row * B_cols + col] = sum;
  }

}

void mat_mul_con(int *m_A, int *m_B, int *m_C, int A_rows, int A_cols, int B_rows, int B_cols){
    int A_size = A_rows * A_cols * sizeof(int);
    int B_size = B_rows * B_cols * sizeof(int);
    int C_size = A_rows * B_cols * sizeof(int);

    int *d_A, *d_B, *d_C;
    //1. Allocate memory for d_A, etc. on the device (cudaMalloc)
    cudaMalloc(&d_A, A_size);
    cudaMalloc(&d_B, B_size);
    cudaMalloc(&d_C, C_size);
    //2. Copy Data from host to d_A, etc. (cudaMemcpy)
    cudaMemcpy(d_A, m_A, A_size, cudaMemcpyHostToDevice);
    cudaMemcpy(d_B, m_B, B_size, cudaMemcpyHostToDevice);
    //3. Kernel Launch Code
    dim3 dimGrid(ceil(max(A_cols, B_cols) / float(BLOCK_SIZE)), ceil(max(A_rows, B_rows) / float(BLOCK_SIZE)), 1);
    dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE, 1);
    mat_mul_kernel<<<dimGrid, dimBlock>>> (d_A, d_B, d_C, A_rows, A_cols, B_rows, B_cols);
    cudaDeviceSynchronize();
    //4. Copy d_C to C from device, free device memory (cusdaFree), sync if neccessary
    cudaMemcpy (m_C, d_C, C_size, cudaMemcpyDeviceToHost);
    cudaFree(d_A);
    cudaFree(d_B);
    cudaFree(d_C);
}

void mat_mul_con_tiled(int *m_A, int *m_B, int *m_C, int A_rows, int A_cols, int B_rows, int B_cols){
    int A_size = A_rows * A_cols * sizeof(int);
    int B_size = B_rows * B_cols * sizeof(int);
    int C_size = A_rows * B_cols * sizeof(int);

    int *d_A, *d_B, *d_C;
    //1. Allocate memory for d_A, etc. on the device (cudaMalloc)
    cudaMalloc(&d_A, A_size);
    cudaMalloc(&d_B, B_size);
    cudaMalloc(&d_C, C_size);
    //2. Copy Data from host to d_A, etc. (cudaMemcpy)
    cudaMemcpy(d_A, m_A, A_size, cudaMemcpyHostToDevice);
    cudaMemcpy(d_B, m_B, B_size, cudaMemcpyHostToDevice);
    //3. Kernel Launch Code
    dim3 dimGrid(ceil(max(A_cols, B_cols) / float(BLOCK_SIZE)), ceil(max(A_rows, B_rows) / float(BLOCK_SIZE)), 1);
    dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE, 1);
    mat_mul_kernel_tiled<<<dimGrid, dimBlock>>> (d_A, d_B, d_C, A_rows, A_cols, B_rows, B_cols);
    cudaDeviceSynchronize();
    //4. Copy d_C to C from device, free device memory (cusdaFree), sync if neccessary
    cudaMemcpy (m_C, d_C, C_size, cudaMemcpyDeviceToHost);
    cudaFree(d_A);
    cudaFree(d_B);
    cudaFree(d_C);
}

int main(int argc, char **argv){
  if (argc < 5){
    cout << "Usage: ./mul max_number step offset_A, offset_B" << endl;
    return 0;
  }
  const int max_number = atoi(argv[1]),
  step = atoi(argv[2]),
  offset_A = atoi(argv[3]),
  offset_B = atoi(argv[4]);
  srand (time(NULL));

  ofstream x("x.mio"),
  y_seq("y_seq.mio"),
  y_con("y_con.mio"),
  y_con_tiled("y_con_tiled.mio");

  clock_t begin, end;
  double elapsed_secs;

  for (int i = step; i <= max_number; i += step){
    int *A, *B, *C, *D;
    A = (int*) malloc((i + offset_A) * i * sizeof(int));
    B = (int*) malloc((i + offset_B) * i * sizeof(int));
    C = (int*) malloc((i + offset_A) * (i + offset_B) * sizeof(int));
    D = (int*) malloc((i + offset_A) * (i + offset_B) * sizeof(int));

    x << i << endl;

    fill_matrix_random(A, i + offset_A, i);
    fill_matrix_random(B, i, i + offset_B);

    begin = clock();
    mat_mul_seq(A, B, C, i + offset_A, i, i, i + offset_B);
    end = clock();
    elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
    y_seq << elapsed_secs << endl;

    begin = clock();
    mat_mul_con(A, B, D, i + offset_A, i, i, i + offset_B);
    end = clock();
    elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
    y_con << elapsed_secs << endl;

    cout << "-----------" << endl << "Not Tiled: ";
    if (check_matrix(C, D, i + offset_A, i + offset_B))
      cout << "All good" << endl;
    else
      cout << "Something Went Wrong" << endl;
    cout << "-----------" << endl;

    begin = clock();
    mat_mul_con_tiled(A, B, D, i + offset_A, i, i, i + offset_B);
    end = clock();
    elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
    y_con_tiled << elapsed_secs << endl;
    
    cout << "Tiled: ";
    if (check_matrix(C, D, i + offset_A, i + offset_B))
      cout << "All good" << endl;
    else
      cout << "Something Went Wrong ARow " << i + offset_A << " ACol " << i << " BCol " << i + offset_B  << endl;
    cout << "-----------" << endl;

    free(A);
    free(B);
    free(C);
    free(D);
  }

  return 0;
}

	.file	"tmpxft_002ef17d_00000000-6_matrix_mul.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB10834:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE10834:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z18fill_matrix_randomPiii
	.type	_Z18fill_matrix_randomPiii, @function
_Z18fill_matrix_randomPiii:
.LFB10825:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	xorl	%r14d, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L3:
	cmpl	%esi, %r14d
	jge	.L2
	movslq	%r13d, %rax
	xorl	%ebx, %ebx
	leaq	(%r12,%rax,4), %r15
.L6:
	cmpl	%ebx, %ebp
	jle	.L9
	movl	%esi, 12(%rsp)
	call	rand@PLT
	movl	$5, %ecx
	movl	12(%rsp), %esi
	cltd
	idivl	%ecx
	movl	%edx, (%r15,%rbx,4)
	incq	%rbx
	jmp	.L6
.L9:
	incl	%r14d
	addl	%ebp, %r13d
	jmp	.L3
.L2:
	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
.LFE10825:
	.size	_Z18fill_matrix_randomPiii, .-_Z18fill_matrix_randomPiii
	.globl	_Z12check_matrixPiS_ii
	.type	_Z12check_matrixPiS_ii, @function
_Z12check_matrixPiS_ii:
.LFB10826:
	.cfi_startproc
	endbr64
	movq	%rdi, %r10
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
.L11:
	cmpl	%edx, %r9d
	jge	.L16
	movslq	%r8d, %rax
	xorl	%edi, %edi
	salq	$2, %rax
.L14:
	cmpl	%ecx, %edi
	jge	.L17
	movl	(%r10,%rax), %r11d
	addq	$4, %rax
	cmpl	-4(%rsi,%rax), %r11d
	jne	.L15
	incl	%edi
	jmp	.L14
.L17:
	incl	%r9d
	addl	%ecx, %r8d
	jmp	.L11
.L15:
	xorl	%eax, %eax
	ret
.L16:
	movb	$1, %al
	ret
	.cfi_endproc
.LFE10826:
	.size	_Z12check_matrixPiS_ii, .-_Z12check_matrixPiS_ii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"------------"
.LC1:
	.string	" "
	.text
	.globl	_Z12print_matrixPiii
	.type	_Z12print_matrixPiii, @function
_Z12print_matrixPiii:
.LFB10827:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%esi, %r14d
	leaq	.LC0(%rip), %rsi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	leaq	_ZSt4cout(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
.L19:
	cmpl	%r14d, %r13d
	jge	.L21
	movslq	%r12d, %rax
	xorl	%r15d, %r15d
	leaq	0(%rbp,%rax,4), %rcx
.L22:
	cmpl	%r15d, %ebx
	jle	.L24
	movl	(%rcx,%r15,4), %esi
	leaq	_ZSt4cout(%rip), %rdi
	movq	%rcx, 8(%rsp)
	incq	%r15
	call	_ZNSolsEi@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	8(%rsp), %rcx
	jmp	.L22
.L24:
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	incl	%r13d
	addl	%ebx, %r12d
	call	_ZNSolsEPFRSoS_E@PLT
	jmp	.L19
.L21:
	leaq	.LC0(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	movq	%rax, %rdi
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	_ZNSolsEPFRSoS_E@PLT
	.cfi_endproc
.LFE10827:
	.size	_Z12print_matrixPiii, .-_Z12print_matrixPiii
	.globl	_Z11mat_mul_seqPiS_S_iiii
	.type	_Z11mat_mul_seqPiS_S_iiii, @function
_Z11mat_mul_seqPiS_S_iiii:
.LFB10828:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rsi, %r11
	xorl	%r9d, %r9d
	movq	%rdx, %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	xorl	%r10d, %r10d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movslq	56(%rsp), %rax
	movl	%ecx, %ebx
	xorl	%ecx, %ecx
	salq	$2, %rax
	movq	%rax, -8(%rsp)
.L26:
	cmpl	%ebx, %r10d
	jge	.L25
	movslq	%r9d, %rax
	leaq	(%rsi,%rax,4), %r15
	movslq	%ecx, %rax
	leaq	(%rdi,%rax,4), %r14
	xorl	%eax, %eax
.L31:
	cmpl	%eax, 56(%rsp)
	jle	.L28
	leaq	(%r11,%rax,4), %r12
	xorl	%edx, %edx
	xorl	%ebp, %ebp
.L29:
	cmpl	%edx, %r8d
	jle	.L33
	movl	(%r14,%rdx,4), %r13d
	imull	(%r12), %r13d
	incq	%rdx
	addl	%r13d, %ebp
	movq	-8(%rsp), %r13
	addq	%r13, %r12
	jmp	.L29
.L33:
	movl	%ebp, (%r15,%rax,4)
	incq	%rax
	jmp	.L31
.L28:
	incl	%r10d
	addl	56(%rsp), %r9d
	addl	%r8d, %ecx
	jmp	.L26
.L25:
	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
.LFE10828:
	.size	_Z11mat_mul_seqPiS_S_iiii, .-_Z11mat_mul_seqPiS_S_iiii
	.globl	_Z42__device_stub__Z14mat_mul_kernelPiS_S_iiiiPiS_S_iiii
	.type	_Z42__device_stub__Z14mat_mul_kernelPiS_S_iiiiPiS_S_iiii, @function
_Z42__device_stub__Z14mat_mul_kernelPiS_S_iiiiPiS_S_iiii:
.LFB10856:
	.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
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movl	%ecx, 20(%rsp)
	leaq	56(%rsp), %rcx
	movl	%r8d, 16(%rsp)
	movl	%r9d, 12(%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	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	12(%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	.L34
	pushq	56(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z14mat_mul_kernelPiS_S_iiii(%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
.L34:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L36
	call	__stack_chk_fail@PLT
.L36:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE10856:
	.size	_Z42__device_stub__Z14mat_mul_kernelPiS_S_iiiiPiS_S_iiii, .-_Z42__device_stub__Z14mat_mul_kernelPiS_S_iiiiPiS_S_iiii
	.globl	_Z14mat_mul_kernelPiS_S_iiii
	.type	_Z14mat_mul_kernelPiS_S_iiii, @function
_Z14mat_mul_kernelPiS_S_iiii:
.LFB10857:
	.cfi_startproc
	endbr64
	jmp	_Z42__device_stub__Z14mat_mul_kernelPiS_S_iiiiPiS_S_iiii
	.cfi_endproc
.LFE10857:
	.size	_Z14mat_mul_kernelPiS_S_iiii, .-_Z14mat_mul_kernelPiS_S_iiii
	.globl	_Z11mat_mul_conPiS_S_iiii
	.type	_Z11mat_mul_conPiS_S_iiii, @function
_Z11mat_mul_conPiS_S_iiii:
.LFB10829:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%r9d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%r12d, %r13d
	movl	%r8d, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%ecx, %ebx
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movl	160(%rsp), %r14d
	movq	%rdx, 16(%rsp)
	movl	%ecx, %edx
	leaq	40(%rsp), %rdi
	imull	%r8d, %edx
	movq	%rsi, 8(%rsp)
	imull	%r14d, %r13d
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	sall	$2, %edx
	movslq	%edx, %rdx
	sall	$2, %r13d
	movq	%rdx, %rsi
	movslq	%r13d, %r13
	movq	%rdx, 24(%rsp)
	call	cudaMalloc@PLT
	movq	%r13, %rsi
	leaq	48(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	%ebx, %eax
	leaq	56(%rsp), %rdi
	imull	%r14d, %eax
	sall	$2, %eax
	cltq
	movq	%rax, %rsi
	movq	%rax, (%rsp)
	call	cudaMalloc@PLT
	movq	24(%rsp), %rdx
	movq	40(%rsp), %rdi
	movq	%r15, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rsi
	movq	48(%rsp), %rdi
	movq	%r13, %rdx
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	cmpl	%r12d, %ebx
	movl	%r12d, %eax
	cmovge	%ebx, %eax
	cvtsi2ssl	%eax, %xmm0
	mulss	.LC2(%rip), %xmm0
	call	ceilf@PLT
	cmpl	%r14d, %ebp
	movl	%r14d, %eax
	cmovge	%ebp, %eax
	movd	%xmm0, %r13d
	cvtsi2ssl	%eax, %xmm0
	mulss	.LC2(%rip), %xmm0
	call	ceilf@PLT
	movd	%r13d, %xmm1
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttss2siq	%xmm0, %rax
	movl	$1, %ecx
	movl	$1, %esi
	movabsq	$137438953504, %rdx
	movl	%eax, 64(%rsp)
	cvttss2siq	%xmm1, %rax
	movl	%eax, 68(%rsp)
	movq	64(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L40
	pushq	%rax
	.cfi_def_cfa_offset 168
	movl	%ebx, %ecx
	movl	%r12d, %r9d
	movl	%ebp, %r8d
	pushq	%r14
	.cfi_def_cfa_offset 176
	movq	72(%rsp), %rdx
	movq	64(%rsp), %rsi
	movq	56(%rsp), %rdi
	call	_Z42__device_stub__Z14mat_mul_kernelPiS_S_iiiiPiS_S_iiii
	popq	%rdx
	.cfi_def_cfa_offset 168
	popq	%rcx
	.cfi_def_cfa_offset 160
.L40:
	call	cudaDeviceSynchronize@PLT
	movq	(%rsp), %rdx
	movq	56(%rsp), %rsi
	movl	$2, %ecx
	movq	16(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	addq	$104, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE10829:
	.size	_Z11mat_mul_conPiS_S_iiii, .-_Z11mat_mul_conPiS_S_iiii
	.globl	_Z48__device_stub__Z20mat_mul_kernel_tiledPiS_S_iiiiPiS_S_iiii
	.type	_Z48__device_stub__Z20mat_mul_kernel_tiledPiS_S_iiiiPiS_S_iiii, @function
_Z48__device_stub__Z20mat_mul_kernel_tiledPiS_S_iiiiPiS_S_iiii:
.LFB10858:
	.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
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movl	%ecx, 20(%rsp)
	leaq	56(%rsp), %rcx
	movl	%r8d, 16(%rsp)
	movl	%r9d, 12(%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	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	12(%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	.L43
	pushq	56(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z20mat_mul_kernel_tiledPiS_S_iiii(%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
.L43:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L45
	call	__stack_chk_fail@PLT
.L45:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE10858:
	.size	_Z48__device_stub__Z20mat_mul_kernel_tiledPiS_S_iiiiPiS_S_iiii, .-_Z48__device_stub__Z20mat_mul_kernel_tiledPiS_S_iiiiPiS_S_iiii
	.globl	_Z20mat_mul_kernel_tiledPiS_S_iiii
	.type	_Z20mat_mul_kernel_tiledPiS_S_iiii, @function
_Z20mat_mul_kernel_tiledPiS_S_iiii:
.LFB10859:
	.cfi_startproc
	endbr64
	jmp	_Z48__device_stub__Z20mat_mul_kernel_tiledPiS_S_iiiiPiS_S_iiii
	.cfi_endproc
.LFE10859:
	.size	_Z20mat_mul_kernel_tiledPiS_S_iiii, .-_Z20mat_mul_kernel_tiledPiS_S_iiii
	.globl	_Z17mat_mul_con_tiledPiS_S_iiii
	.type	_Z17mat_mul_con_tiledPiS_S_iiii, @function
_Z17mat_mul_con_tiledPiS_S_iiii:
.LFB10830:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%r9d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%r12d, %r13d
	movl	%r8d, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%ecx, %ebx
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movl	160(%rsp), %r14d
	movq	%rdx, 16(%rsp)
	movl	%ecx, %edx
	leaq	40(%rsp), %rdi
	imull	%r8d, %edx
	movq	%rsi, 8(%rsp)
	imull	%r14d, %r13d
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	sall	$2, %edx
	movslq	%edx, %rdx
	sall	$2, %r13d
	movq	%rdx, %rsi
	movslq	%r13d, %r13
	movq	%rdx, 24(%rsp)
	call	cudaMalloc@PLT
	movq	%r13, %rsi
	leaq	48(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	%ebx, %eax
	leaq	56(%rsp), %rdi
	imull	%r14d, %eax
	sall	$2, %eax
	cltq
	movq	%rax, %rsi
	movq	%rax, (%rsp)
	call	cudaMalloc@PLT
	movq	24(%rsp), %rdx
	movq	40(%rsp), %rdi
	movq	%r15, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rsi
	movq	48(%rsp), %rdi
	movq	%r13, %rdx
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	cmpl	%r12d, %ebx
	movl	%r12d, %eax
	cmovge	%ebx, %eax
	cvtsi2ssl	%eax, %xmm0
	mulss	.LC2(%rip), %xmm0
	call	ceilf@PLT
	cmpl	%r14d, %ebp
	movl	%r14d, %eax
	cmovge	%ebp, %eax
	movd	%xmm0, %r13d
	cvtsi2ssl	%eax, %xmm0
	mulss	.LC2(%rip), %xmm0
	call	ceilf@PLT
	movd	%r13d, %xmm1
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttss2siq	%xmm0, %rax
	movl	$1, %ecx
	movl	$1, %esi
	movabsq	$137438953504, %rdx
	movl	%eax, 64(%rsp)
	cvttss2siq	%xmm1, %rax
	movl	%eax, 68(%rsp)
	movq	64(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L49
	pushq	%rax
	.cfi_def_cfa_offset 168
	movl	%ebx, %ecx
	movl	%r12d, %r9d
	movl	%ebp, %r8d
	pushq	%r14
	.cfi_def_cfa_offset 176
	movq	72(%rsp), %rdx
	movq	64(%rsp), %rsi
	movq	56(%rsp), %rdi
	call	_Z48__device_stub__Z20mat_mul_kernel_tiledPiS_S_iiiiPiS_S_iiii
	popq	%rdx
	.cfi_def_cfa_offset 168
	popq	%rcx
	.cfi_def_cfa_offset 160
.L49:
	call	cudaDeviceSynchronize@PLT
	movq	(%rsp), %rdx
	movq	56(%rsp), %rsi
	movl	$2, %ecx
	movq	16(%rsp), %rdi
	call	cudaMemcpy@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L50
	call	__stack_chk_fail@PLT
.L50:
	addq	$104, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE10830:
	.size	_Z17mat_mul_con_tiledPiS_S_iiii, .-_Z17mat_mul_con_tiledPiS_S_iiii
	.section	.rodata.str1.1
.LC3:
	.string	"_Z20mat_mul_kernel_tiledPiS_S_iiii"
.LC4:
	.string	"_Z14mat_mul_kernelPiS_S_iiii"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB10861:
	.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	_Z20mat_mul_kernel_tiledPiS_S_iiii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC4(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z14mat_mul_kernelPiS_S_iiii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE10861:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata.str1.1
.LC5:
	.string	"Usage: ./mul max_number step offset_A, offset_B"
.LC6:
	.string	"x.mio"
.LC7:
	.string	"y_seq.mio"
.LC8:
	.string	"y_con.mio"
.LC9:
	.string	"y_con_tiled.mio"
.LC11:
	.string	"-----------"
.LC12:
	.string	"Not Tiled: "
.LC13:
	.string	"All good"
.LC14:
	.string	"Something Went Wrong"
.LC15:
	.string	"Tiled: "
.LC16:
	.string	"Something Went Wrong ARow "
.LC17:
	.string	" ACol "
.LC18:
	.string	" BCol "
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB10831:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA10831
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$2120, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	cmpl	$4, %edi
	jg	.L55
	leaq	.LC5(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
.LEHB0:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	jmp	.L56
.L55:
	movq	8(%rsi), %rdi
	movq	%rsi, %rbx
	call	atoi@PLT
	movq	16(%rbx), %rdi
	movl	%eax, -2120(%rbp)
	call	atoi@PLT
	movq	24(%rbx), %rdi
	movl	%eax, %r13d
	call	atoi@PLT
	movq	32(%rbx), %rdi
	movl	%eax, -2156(%rbp)
	call	atoi@PLT
	xorl	%edi, %edi
	movl	%eax, %r14d
	call	time@PLT
	movl	%eax, %edi
	call	srand@PLT
	leaq	-2104(%rbp), %rdi
	movl	$16, %edx
	leaq	.LC6(%rip), %rsi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE0:
	leaq	-1592(%rbp), %rdi
	movl	$16, %edx
	leaq	.LC7(%rip), %rsi
.LEHB1:
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE1:
	leaq	-1080(%rbp), %rdi
	movl	$16, %edx
	leaq	.LC8(%rip), %rsi
.LEHB2:
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE2:
	leaq	-568(%rbp), %rdi
	movl	$16, %edx
	leaq	.LC9(%rip), %rsi
.LEHB3:
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE3:
	movl	%r13d, %ebx
.L57:
	movl	-2120(%rbp), %eax
	leaq	-2104(%rbp), %r15
	cmpl	%eax, %ebx
	jg	.L87
	movl	-2156(%rbp), %eax
	leal	(%rax,%rbx), %r12d
	movl	%r12d, %edi
	imull	%ebx, %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, -2128(%rbp)
	leal	(%r14,%rbx), %eax
	movl	%eax, %edi
	movl	%eax, -2116(%rbp)
	imull	%ebx, %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movl	-2116(%rbp), %edi
	movq	%rax, -2136(%rbp)
	imull	%r12d, %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	movq	%rdi, -2144(%rbp)
	call	malloc@PLT
	movq	-2144(%rbp), %rdi
	movq	%rax, -2152(%rbp)
	call	malloc@PLT
	movl	%ebx, %esi
	movq	%r15, %rdi
	movq	%rax, -2144(%rbp)
.LEHB4:
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	movq	-2128(%rbp), %rdi
	movl	%ebx, %edx
	movl	%r12d, %esi
	call	_Z18fill_matrix_randomPiii
	movl	-2116(%rbp), %edx
	movq	-2136(%rbp), %rdi
	movl	%ebx, %esi
	call	_Z18fill_matrix_randomPiii
	call	clock@PLT
	movl	%ebx, %r8d
	movl	%r12d, %ecx
	pushq	%r9
	movq	%rax, %r15
	movl	-2116(%rbp), %eax
	movl	%ebx, %r9d
	movq	-2128(%rbp), %rdi
	movq	-2152(%rbp), %rdx
	pushq	%rax
	movq	-2136(%rbp), %rsi
	call	_Z11mat_mul_seqPiS_S_iiii
	call	clock@PLT
	popq	%r10
	leaq	-1592(%rbp), %rdi
	popq	%r11
	subq	%r15, %rax
	cvtsi2sdq	%rax, %xmm0
	divsd	.LC10(%rip), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	call	clock@PLT
	movl	%ebx, %r9d
	movl	%r12d, %ecx
	pushq	%r8
	movq	%rax, %r15
	movl	-2116(%rbp), %eax
	movl	%ebx, %r8d
	movq	-2144(%rbp), %rdx
	movq	-2136(%rbp), %rsi
	pushq	%rax
	movq	-2128(%rbp), %rdi
	.cfi_escape 0x2e,0x10
	call	_Z11mat_mul_conPiS_S_iiii
	popq	%rsi
	popq	%rdi
	call	clock@PLT
	leaq	-1080(%rbp), %rdi
	subq	%r15, %rax
	cvtsi2sdq	%rax, %xmm0
	divsd	.LC10(%rip), %xmm0
	.cfi_escape 0x2e,0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	leaq	.LC11(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	movq	%rax, %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	-2144(%rbp), %rsi
	movl	-2116(%rbp), %ecx
	movl	%r12d, %edx
	leaq	_ZSt4cout(%rip), %r15
	movq	-2152(%rbp), %rdi
	call	_Z12check_matrixPiS_ii
	leaq	.LC14(%rip), %rsi
	testb	%al, %al
	je	.L86
	leaq	.LC13(%rip), %rsi
.L86:
	movq	%r15, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	leaq	.LC11(%rip), %rsi
	movq	%r15, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	call	clock@PLT
	movl	%ebx, %r9d
	movl	%ebx, %r8d
	pushq	%rcx
	movq	%rax, %r15
	movl	-2116(%rbp), %eax
	movl	%r12d, %ecx
	movq	-2144(%rbp), %rdx
	movq	-2136(%rbp), %rsi
	pushq	%rax
	movq	-2128(%rbp), %rdi
	.cfi_escape 0x2e,0x10
	call	_Z17mat_mul_con_tiledPiS_S_iiii
	popq	%rax
	popq	%rdx
	call	clock@PLT
	leaq	-568(%rbp), %rdi
	subq	%r15, %rax
	cvtsi2sdq	%rax, %xmm0
	divsd	.LC10(%rip), %xmm0
	.cfi_escape 0x2e,0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	leaq	.LC15(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	-2116(%rbp), %ecx
	movq	-2144(%rbp), %rsi
	movl	%r12d, %edx
	leaq	_ZSt4cout(%rip), %r15
	movq	-2152(%rbp), %rdi
	call	_Z12check_matrixPiS_ii
	testb	%al, %al
	je	.L61
	leaq	.LC13(%rip), %rsi
	movq	%r15, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L84:
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	leaq	.LC11(%rip), %rsi
	movq	%r15, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	movq	-2128(%rbp), %rdi
	addl	%r13d, %ebx
	call	free@PLT
	movq	-2136(%rbp), %rdi
	call	free@PLT
	movq	-2152(%rbp), %rdi
	call	free@PLT
	movq	-2144(%rbp), %rdi
	call	free@PLT
	jmp	.L57
.L61:
	leaq	.LC16(%rip), %rsi
	movq	%r15, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%r12d, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC17(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%ebx, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC18(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	-2116(%rbp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
.LEHE4:
	jmp	.L84
.L87:
	leaq	-568(%rbp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	leaq	-1080(%rbp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	leaq	-1592(%rbp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	%r15, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
.L56:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L70
	jmp	.L79
.L75:
	endbr64
	movq	%rax, %rbx
.L65:
	leaq	-568(%rbp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	jmp	.L66
.L74:
	endbr64
	movq	%rax, %rbx
.L66:
	leaq	-1080(%rbp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	jmp	.L67
.L73:
	endbr64
	movq	%rax, %rbx
.L67:
	leaq	-1592(%rbp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	jmp	.L68
.L72:
	endbr64
	movq	%rax, %rbx
.L68:
	leaq	-2104(%rbp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L79
	movq	%rbx, %rdi
.LEHB5:
	call	_Unwind_Resume@PLT
.LEHE5:
.L79:
	call	__stack_chk_fail@PLT
.L70:
	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
.LFE10831:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA10831:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE10831-.LLSDACSB10831
.LLSDACSB10831:
	.uleb128 .LEHB0-.LFB10831
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB10831
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L72-.LFB10831
	.uleb128 0
	.uleb128 .LEHB2-.LFB10831
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L73-.LFB10831
	.uleb128 0
	.uleb128 .LEHB3-.LFB10831
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L74-.LFB10831
	.uleb128 0
	.uleb128 .LEHB4-.LFB10831
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L75-.LFB10831
	.uleb128 0
	.uleb128 .LEHB5-.LFB10831
	.uleb128 .LEHE5-.LEHB5
	.uleb128 0
	.uleb128 0
.LLSDACSE10831:
	.section	.text.startup
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC2:
	.long	1023410176
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC10:
	.long	0
	.long	1093567616
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <hip/hip_runtime.h>
#include <bits/stdc++.h>

#define BLOCK_SIZE 32

using namespace std;



void fill_matrix_random(int *mat, int rows, int cols){
  for (int i = 0; i < rows; i++){
    for (int j = 0; j < cols; j++){
      mat[i * cols + j] = rand() % 5;
    }
  }
}

bool check_matrix(int *A, int *B, int rows, int cols){
  for (int i = 0; i < rows; i++){
    for (int j = 0; j < cols; j++){
      if (A[i * cols + j] != B[i * cols +j])
        return false;
    }
  }
  return true;
}

void print_matrix(int *mat, int rows, int cols){
  cout << "------------" << endl;
  for (int i = 0; i < rows; i++){
    for (int j = 0; j < cols; j++){
      cout << mat[i * cols + j] << " ";
    }
    cout << endl;
  }
  cout << "------------" << endl;
}

void mat_mul_seq(int *m_A, int *m_B, int *m_C, int A_rows, int A_cols, int B_rows, int B_cols){
  int sum;
  for(int i = 0; i < A_rows; i++){
    for (int j = 0; j < B_cols; j++){
      sum = 0;
      for (int k = 0; k < A_cols; k++){
        sum += m_A[i * A_cols + k] * m_B[k * B_cols + j];
      }
      m_C[i * B_cols + j] = sum;
    }
  }
}
__global__ void mat_mul_kernel(int *m_A, int *m_B, int *m_C, int A_rows, int A_cols, int B_rows, int B_cols){
  int sum = 0;
  int row = threadIdx.y + blockIdx.y * blockDim.y;
  int col = threadIdx.x + blockIdx.x * blockDim.x;
  if(row < A_rows && col < B_cols){
    for(int i = 0; i < A_cols; i ++){
      sum += m_A[row * A_cols + i] * m_B[i * B_cols + col];
    }
    m_C[row * B_cols + col] = sum;
  }
}

__global__ void mat_mul_kernel_tiled(int *m_A, int *m_B, int *m_C, int A_rows, int A_cols, int B_rows, int B_cols){
  __shared__ int s_A[BLOCK_SIZE][BLOCK_SIZE], s_B[BLOCK_SIZE][BLOCK_SIZE];

  int blockRow = blockIdx.y;
  int blockCol = blockIdx.x;

  int threadRow = threadIdx.y;
  int threadCol = threadIdx.x;

  int row = blockRow * BLOCK_SIZE + threadRow;
  int col = blockCol * BLOCK_SIZE + threadCol;

  int sum = 0;
  for (int sm = 0; sm < ceil(A_cols / float (BLOCK_SIZE)); sm++){
    if (row < A_rows && (sm * BLOCK_SIZE + threadCol) < A_cols){
      s_A[threadRow][threadCol] = m_A[(row) * A_cols + (sm * BLOCK_SIZE + threadCol)];
    } else{
      s_A[threadRow][threadCol] = 0;
    }
    if (col < B_cols && (threadRow + sm * BLOCK_SIZE) < B_rows){
      s_B[threadRow][threadCol] = m_B[(threadRow + sm * BLOCK_SIZE) * B_cols + (col)];
    } else{
      s_B[threadRow][threadCol] = 0;
    }
    __syncthreads();
    for (int i = 0; i < BLOCK_SIZE; i++){
      sum += s_A[threadRow][i] * s_B[i][threadCol];
    }
    __syncthreads();
    if (row < A_rows && col < B_cols)
      m_C[row * B_cols + col] = sum;
  }

}

void mat_mul_con(int *m_A, int *m_B, int *m_C, int A_rows, int A_cols, int B_rows, int B_cols){
    int A_size = A_rows * A_cols * sizeof(int);
    int B_size = B_rows * B_cols * sizeof(int);
    int C_size = A_rows * B_cols * sizeof(int);

    int *d_A, *d_B, *d_C;
    //1. Allocate memory for d_A, etc. on the device (cudaMalloc)
    hipMalloc(&d_A, A_size);
    hipMalloc(&d_B, B_size);
    hipMalloc(&d_C, C_size);
    //2. Copy Data from host to d_A, etc. (cudaMemcpy)
    hipMemcpy(d_A, m_A, A_size, hipMemcpyHostToDevice);
    hipMemcpy(d_B, m_B, B_size, hipMemcpyHostToDevice);
    //3. Kernel Launch Code
    dim3 dimGrid(ceil(max(A_cols, B_cols) / float(BLOCK_SIZE)), ceil(max(A_rows, B_rows) / float(BLOCK_SIZE)), 1);
    dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE, 1);
    mat_mul_kernel<<<dimGrid, dimBlock>>> (d_A, d_B, d_C, A_rows, A_cols, B_rows, B_cols);
    hipDeviceSynchronize();
    //4. Copy d_C to C from device, free device memory (cusdaFree), sync if neccessary
    hipMemcpy (m_C, d_C, C_size, hipMemcpyDeviceToHost);
    hipFree(d_A);
    hipFree(d_B);
    hipFree(d_C);
}

void mat_mul_con_tiled(int *m_A, int *m_B, int *m_C, int A_rows, int A_cols, int B_rows, int B_cols){
    int A_size = A_rows * A_cols * sizeof(int);
    int B_size = B_rows * B_cols * sizeof(int);
    int C_size = A_rows * B_cols * sizeof(int);

    int *d_A, *d_B, *d_C;
    //1. Allocate memory for d_A, etc. on the device (cudaMalloc)
    hipMalloc(&d_A, A_size);
    hipMalloc(&d_B, B_size);
    hipMalloc(&d_C, C_size);
    //2. Copy Data from host to d_A, etc. (cudaMemcpy)
    hipMemcpy(d_A, m_A, A_size, hipMemcpyHostToDevice);
    hipMemcpy(d_B, m_B, B_size, hipMemcpyHostToDevice);
    //3. Kernel Launch Code
    dim3 dimGrid(ceil(max(A_cols, B_cols) / float(BLOCK_SIZE)), ceil(max(A_rows, B_rows) / float(BLOCK_SIZE)), 1);
    dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE, 1);
    mat_mul_kernel_tiled<<<dimGrid, dimBlock>>> (d_A, d_B, d_C, A_rows, A_cols, B_rows, B_cols);
    hipDeviceSynchronize();
    //4. Copy d_C to C from device, free device memory (cusdaFree), sync if neccessary
    hipMemcpy (m_C, d_C, C_size, hipMemcpyDeviceToHost);
    hipFree(d_A);
    hipFree(d_B);
    hipFree(d_C);
}

int main(int argc, char **argv){
  if (argc < 5){
    cout << "Usage: ./mul max_number step offset_A, offset_B" << endl;
    return 0;
  }
  const int max_number = atoi(argv[1]),
  step = atoi(argv[2]),
  offset_A = atoi(argv[3]),
  offset_B = atoi(argv[4]);
  srand (time(NULL));

  ofstream x("x.mio"),
  y_seq("y_seq.mio"),
  y_con("y_con.mio"),
  y_con_tiled("y_con_tiled.mio");

  clock_t begin, end;
  double elapsed_secs;

  for (int i = step; i <= max_number; i += step){
    int *A, *B, *C, *D;
    A = (int*) malloc((i + offset_A) * i * sizeof(int));
    B = (int*) malloc((i + offset_B) * i * sizeof(int));
    C = (int*) malloc((i + offset_A) * (i + offset_B) * sizeof(int));
    D = (int*) malloc((i + offset_A) * (i + offset_B) * sizeof(int));

    x << i << endl;

    fill_matrix_random(A, i + offset_A, i);
    fill_matrix_random(B, i, i + offset_B);

    begin = clock();
    mat_mul_seq(A, B, C, i + offset_A, i, i, i + offset_B);
    end = clock();
    elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
    y_seq << elapsed_secs << endl;

    begin = clock();
    mat_mul_con(A, B, D, i + offset_A, i, i, i + offset_B);
    end = clock();
    elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
    y_con << elapsed_secs << endl;

    cout << "-----------" << endl << "Not Tiled: ";
    if (check_matrix(C, D, i + offset_A, i + offset_B))
      cout << "All good" << endl;
    else
      cout << "Something Went Wrong" << endl;
    cout << "-----------" << endl;

    begin = clock();
    mat_mul_con_tiled(A, B, D, i + offset_A, i, i, i + offset_B);
    end = clock();
    elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
    y_con_tiled << elapsed_secs << endl;
    
    cout << "Tiled: ";
    if (check_matrix(C, D, i + offset_A, i + offset_B))
      cout << "All good" << endl;
    else
      cout << "Something Went Wrong ARow " << i + offset_A << " ACol " << i << " BCol " << i + offset_B  << endl;
    cout << "-----------" << endl;

    free(A);
    free(B);
    free(C);
    free(D);
  }

  return 0;
}

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

                                        # End of file scope inline assembly
	.globl	_Z18fill_matrix_randomPiii      # -- Begin function _Z18fill_matrix_randomPiii
	.type	_Z18fill_matrix_randomPiii,@function
_Z18fill_matrix_randomPiii:             # @_Z18fill_matrix_randomPiii
	.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
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	testl	%esi, %esi
	jle	.LBB0_6
# %bb.1:                                # %.preheader.lr.ph
	movl	%edx, %ebx
	movl	%esi, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movl	%edx, %r12d
	xorl	%r13d, %r13d
	xorl	%ebp, %ebp
.LBB0_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_4 Depth 2
	testl	%ebx, %ebx
	jle	.LBB0_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB0_2 Depth=1
	movl	%r13d, %eax
	movq	8(%rsp), %rcx                   # 8-byte Reload
	leaq	(%rcx,%rax,4), %r14
	xorl	%r15d, %r15d
.LBB0_4:                                #   Parent Loop BB0_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	rand
	cltq
	imulq	$1717986919, %rax, %rcx         # imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$33, %rcx
	addl	%edx, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subl	%ecx, %eax
	movl	%eax, (%r14,%r15,4)
	incq	%r15
	cmpq	%r15, %r12
	jne	.LBB0_4
.LBB0_5:                                # %._crit_edge
                                        #   in Loop: Header=BB0_2 Depth=1
	incq	%rbp
	addl	%ebx, %r13d
	cmpq	16(%rsp), %rbp                  # 8-byte Folded Reload
	jne	.LBB0_2
.LBB0_6:                                # %._crit_edge13
	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
.Lfunc_end0:
	.size	_Z18fill_matrix_randomPiii, .Lfunc_end0-_Z18fill_matrix_randomPiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z12check_matrixPiS_ii          # -- Begin function _Z12check_matrixPiS_ii
	.type	_Z12check_matrixPiS_ii,@function
_Z12check_matrixPiS_ii:                 # @_Z12check_matrixPiS_ii
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jle	.LBB1_1
# %bb.3:                                # %.preheader.lr.ph
	pushq	%rbp
	.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 %rbp, -16
	movl	%edx, %edx
	movl	%ecx, %r8d
	xorl	%r9d, %r9d
	xorl	%r10d, %r10d
	xorl	%eax, %eax
.LBB1_4:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_7 Depth 2
	testl	%ecx, %ecx
	jle	.LBB1_8
# %bb.5:                                # %.lr.ph
                                        #   in Loop: Header=BB1_4 Depth=1
	movl	%r9d, %ebx
	leaq	(%rsi,%rbx,4), %r11
	leaq	(%rdi,%rbx,4), %rbx
	xorl	%r14d, %r14d
.LBB1_7:                                #   Parent Loop BB1_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%rbx,%r14,4), %ebp
	cmpl	(%r11,%r14,4), %ebp
	jne	.LBB1_9
# %bb.6:                                #   in Loop: Header=BB1_7 Depth=2
	incq	%r14
	cmpq	%r14, %r8
	jne	.LBB1_7
.LBB1_8:                                # %._crit_edge
                                        #   in Loop: Header=BB1_4 Depth=1
	incq	%r10
	cmpq	%rdx, %r10
	setae	%al
	addl	%ecx, %r9d
	cmpq	%rdx, %r10
	jne	.LBB1_4
.LBB1_9:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %rbp
	jmp	.LBB1_2
.LBB1_1:
	movb	$1, %al
.LBB1_2:                                # %.thread
	andb	$1, %al
                                        # kill: def $al killed $al killed $rax
	retq
.Lfunc_end1:
	.size	_Z12check_matrixPiS_ii, .Lfunc_end1-_Z12check_matrixPiS_ii
	.cfi_endproc
                                        # -- End function
	.globl	_Z12print_matrixPiii            # -- Begin function _Z12print_matrixPiii
	.type	_Z12print_matrixPiii,@function
_Z12print_matrixPiii:                   # @_Z12print_matrixPiii
	.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, %ebx
	movl	%esi, %ebp
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	movl	$_ZSt4cout, %r14d
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$12, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	testl	%ebp, %ebp
	jle	.LBB2_6
# %bb.1:                                # %.preheader.lr.ph
	movl	%ebp, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movl	%ebx, %r13d
	xorl	%ebp, %ebp
	xorl	%r15d, %r15d
.LBB2_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_4 Depth 2
	testl	%ebx, %ebx
	jle	.LBB2_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB2_2 Depth=1
	movl	%ebp, %eax
	movq	8(%rsp), %rcx                   # 8-byte Reload
	leaq	(%rcx,%rax,4), %r14
	xorl	%r12d, %r12d
.LBB2_4:                                #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%r14,%r12,4), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r12
	cmpq	%r12, %r13
	jne	.LBB2_4
.LBB2_5:                                # %._crit_edge
                                        #   in Loop: Header=BB2_2 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	movl	$_ZSt4cout, %eax
	addq	%rax, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	incq	%r15
	addl	%ebx, %ebp
	cmpq	16(%rsp), %r15                  # 8-byte Folded Reload
	jne	.LBB2_2
.LBB2_6:                                # %._crit_edge13
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$12, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	movl	$_ZSt4cout, %eax
	addq	%rax, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	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
	jmp	_ZNSo5flushEv                   # TAILCALL
.Lfunc_end2:
	.size	_Z12print_matrixPiii, .Lfunc_end2-_Z12print_matrixPiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z11mat_mul_seqPiS_S_iiii       # -- Begin function _Z11mat_mul_seqPiS_S_iiii
	.type	_Z11mat_mul_seqPiS_S_iiii,@function
_Z11mat_mul_seqPiS_S_iiii:              # @_Z11mat_mul_seqPiS_S_iiii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdx, -8(%rsp)                  # 8-byte Spill
	movq	%rsi, -16(%rsp)                 # 8-byte Spill
	movq	%rdi, -24(%rsp)                 # 8-byte Spill
	testl	%ecx, %ecx
	jle	.LBB3_7
# %bb.1:                                # %.preheader27.lr.ph
	movslq	56(%rsp), %rax
	movl	%ecx, %ecx
	movl	%eax, %r10d
	movl	%r8d, %r11d
	movq	%rax, -32(%rsp)                 # 8-byte Spill
	leaq	(,%rax,4), %rbx
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
.LBB3_2:                                # %.preheader27
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_4 Depth 2
                                        #       Child Loop BB3_9 Depth 3
	cmpl	$0, 56(%rsp)
	jle	.LBB3_6
# %bb.3:                                # %.preheader.lr.ph
                                        #   in Loop: Header=BB3_2 Depth=1
	movl	%r14d, %eax
	movq	-24(%rsp), %rdx                 # 8-byte Reload
	leaq	(%rdx,%rax,4), %r12
	movq	%r15, %rax
	imulq	-32(%rsp), %rax                 # 8-byte Folded Reload
	movq	-8(%rsp), %rdx                  # 8-byte Reload
	leaq	(%rdx,%rax,4), %r13
	movq	-16(%rsp), %rsi                 # 8-byte Reload
	xorl	%eax, %eax
.LBB3_4:                                # %.preheader
                                        #   Parent Loop BB3_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB3_9 Depth 3
	testl	%r8d, %r8d
	jle	.LBB3_5
# %bb.8:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB3_4 Depth=2
	xorl	%edx, %edx
	movq	%rsi, %rbp
	xorl	%r9d, %r9d
.LBB3_9:                                # %.lr.ph
                                        #   Parent Loop BB3_2 Depth=1
                                        #     Parent Loop BB3_4 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	(%rbp), %edi
	imull	(%r12,%rdx,4), %edi
	addl	%edi, %r9d
	incq	%rdx
	addq	%rbx, %rbp
	cmpq	%rdx, %r11
	jne	.LBB3_9
	jmp	.LBB3_10
.LBB3_5:                                #   in Loop: Header=BB3_4 Depth=2
	xorl	%r9d, %r9d
.LBB3_10:                               # %._crit_edge
                                        #   in Loop: Header=BB3_4 Depth=2
	movl	%r9d, (%r13,%rax,4)
	incq	%rax
	addq	$4, %rsi
	cmpq	%r10, %rax
	jne	.LBB3_4
.LBB3_6:                                # %._crit_edge31
                                        #   in Loop: Header=BB3_2 Depth=1
	incq	%r15
	addl	%r8d, %r14d
	cmpq	%rcx, %r15
	jne	.LBB3_2
.LBB3_7:                                # %._crit_edge33
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z11mat_mul_seqPiS_S_iiii, .Lfunc_end3-_Z11mat_mul_seqPiS_S_iiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z29__device_stub__mat_mul_kernelPiS_S_iiii # -- Begin function _Z29__device_stub__mat_mul_kernelPiS_S_iiii
	.type	_Z29__device_stub__mat_mul_kernelPiS_S_iiii,@function
_Z29__device_stub__mat_mul_kernelPiS_S_iiii: # @_Z29__device_stub__mat_mul_kernelPiS_S_iiii
	.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	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	20(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	16(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	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	$_Z14mat_mul_kernelPiS_S_iiii, %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_end4:
	.size	_Z29__device_stub__mat_mul_kernelPiS_S_iiii, .Lfunc_end4-_Z29__device_stub__mat_mul_kernelPiS_S_iiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z35__device_stub__mat_mul_kernel_tiledPiS_S_iiii # -- Begin function _Z35__device_stub__mat_mul_kernel_tiledPiS_S_iiii
	.type	_Z35__device_stub__mat_mul_kernel_tiledPiS_S_iiii,@function
_Z35__device_stub__mat_mul_kernel_tiledPiS_S_iiii: # @_Z35__device_stub__mat_mul_kernel_tiledPiS_S_iiii
	.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	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	20(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	16(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	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	$_Z20mat_mul_kernel_tiledPiS_S_iiii, %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_end5:
	.size	_Z35__device_stub__mat_mul_kernel_tiledPiS_S_iiii, .Lfunc_end5-_Z35__device_stub__mat_mul_kernel_tiledPiS_S_iiii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z11mat_mul_conPiS_S_iiii
.LCPI6_0:
	.long	0x3d000000                      # float 0.03125
	.text
	.globl	_Z11mat_mul_conPiS_S_iiii
	.type	_Z11mat_mul_conPiS_S_iiii,@function
_Z11mat_mul_conPiS_S_iiii:              # @_Z11mat_mul_conPiS_S_iiii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%r9d, %ebx
	movl	%r8d, %r14d
	movl	%ecx, %r13d
	movq	%rdx, 48(%rsp)                  # 8-byte Spill
	movq	%rsi, 40(%rsp)                  # 8-byte Spill
	movq	%rdi, 32(%rsp)                  # 8-byte Spill
	movl	112(%rsp), %ecx
	leal	(,%r13,4), %r15d
	movl	%r15d, %eax
	imull	%r8d, %eax
	movl	%r9d, %ebp
	imull	%ecx, %ebp
	shll	$2, %ebp
	imull	%ecx, %r15d
	movslq	%eax, %r12
	leaq	24(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	movslq	%ebp, %rbp
	leaq	16(%rsp), %rdi
	movq	%rbp, %rsi
	callq	hipMalloc
	movslq	%r15d, %rax
	movq	%r13, %r15
	movq	%rax, %r13
	leaq	8(%rsp), %rdi
	movq	%rax, %rsi
	callq	hipMalloc
	leaq	24(%rsp), %rax
	movq	(%rax), %rdi
	movq	32(%rsp), %rsi                  # 8-byte Reload
	movq	%r12, %rdx
	movl	112(%rsp), %r12d
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	16(%rsp), %rax
	movq	(%rax), %rdi
	movq	40(%rsp), %rsi                  # 8-byte Reload
	movq	%rbp, %rdx
	movl	%ebx, %ebp
	movl	$1, %ecx
	callq	hipMemcpy
	cmpl	%r12d, %r14d
	movl	%r12d, %eax
	cmovgl	%r14d, %eax
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI6_0(%rip), %xmm0
	callq	ceilf@PLT
	cvttss2si	%xmm0, %rbx
	cmpl	%ebp, %r15d
	movl	%ebp, %eax
	cmovgl	%r15d, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI6_0(%rip), %xmm0
	callq	ceilf@PLT
	cvttss2si	%xmm0, %rdi
	movl	%ebx, %eax
	shlq	$32, %rdi
	orq	%rax, %rdi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB6_2
# %bb.1:
	movq	24(%rsp), %rdi
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdx
	movl	%r12d, (%rsp)
	movl	%r15d, %ecx
	movl	%r14d, %r8d
	movl	%ebp, %r9d
	callq	_Z29__device_stub__mat_mul_kernelPiS_S_iiii
.LBB6_2:
	callq	hipDeviceSynchronize
	movq	8(%rsp), %rsi
	movq	48(%rsp), %rdi                  # 8-byte Reload
	movq	%r13, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	callq	hipFree
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	_Z11mat_mul_conPiS_S_iiii, .Lfunc_end6-_Z11mat_mul_conPiS_S_iiii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z17mat_mul_con_tiledPiS_S_iiii
.LCPI7_0:
	.long	0x3d000000                      # float 0.03125
	.text
	.globl	_Z17mat_mul_con_tiledPiS_S_iiii
	.type	_Z17mat_mul_con_tiledPiS_S_iiii,@function
_Z17mat_mul_con_tiledPiS_S_iiii:        # @_Z17mat_mul_con_tiledPiS_S_iiii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%r9d, %ebx
	movl	%r8d, %r14d
	movl	%ecx, %r13d
	movq	%rdx, 48(%rsp)                  # 8-byte Spill
	movq	%rsi, 40(%rsp)                  # 8-byte Spill
	movq	%rdi, 32(%rsp)                  # 8-byte Spill
	movl	112(%rsp), %ecx
	leal	(,%r13,4), %r15d
	movl	%r15d, %eax
	imull	%r8d, %eax
	movl	%r9d, %ebp
	imull	%ecx, %ebp
	shll	$2, %ebp
	imull	%ecx, %r15d
	movslq	%eax, %r12
	leaq	24(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	movslq	%ebp, %rbp
	leaq	16(%rsp), %rdi
	movq	%rbp, %rsi
	callq	hipMalloc
	movslq	%r15d, %rax
	movq	%r13, %r15
	movq	%rax, %r13
	leaq	8(%rsp), %rdi
	movq	%rax, %rsi
	callq	hipMalloc
	leaq	24(%rsp), %rax
	movq	(%rax), %rdi
	movq	32(%rsp), %rsi                  # 8-byte Reload
	movq	%r12, %rdx
	movl	112(%rsp), %r12d
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	16(%rsp), %rax
	movq	(%rax), %rdi
	movq	40(%rsp), %rsi                  # 8-byte Reload
	movq	%rbp, %rdx
	movl	%ebx, %ebp
	movl	$1, %ecx
	callq	hipMemcpy
	cmpl	%r12d, %r14d
	movl	%r12d, %eax
	cmovgl	%r14d, %eax
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI7_0(%rip), %xmm0
	callq	ceilf@PLT
	cvttss2si	%xmm0, %rbx
	cmpl	%ebp, %r15d
	movl	%ebp, %eax
	cmovgl	%r15d, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	.LCPI7_0(%rip), %xmm0
	callq	ceilf@PLT
	cvttss2si	%xmm0, %rdi
	movl	%ebx, %eax
	shlq	$32, %rdi
	orq	%rax, %rdi
	movabsq	$137438953504, %rdx             # imm = 0x2000000020
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB7_2
# %bb.1:
	movq	24(%rsp), %rdi
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdx
	movl	%r12d, (%rsp)
	movl	%r15d, %ecx
	movl	%r14d, %r8d
	movl	%ebp, %r9d
	callq	_Z35__device_stub__mat_mul_kernel_tiledPiS_S_iiii
.LBB7_2:
	callq	hipDeviceSynchronize
	movq	8(%rsp), %rsi
	movq	48(%rsp), %rdi                  # 8-byte Reload
	movq	%r13, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	callq	hipFree
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_Z17mat_mul_con_tiledPiS_S_iiii, .Lfunc_end7-_Z17mat_mul_con_tiledPiS_S_iiii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI8_0:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.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	$2168, %rsp                     # imm = 0x878
	.cfi_def_cfa_offset 2224
	.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	$4, %edi
	jg	.LBB8_2
# %bb.1:
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$47, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	jmp	.LBB8_77
.LBB8_2:
	movq	%rsi, %r14
	movq	8(%rsi), %rdi
	callq	atoi
	movl	%eax, %ebx
	movq	16(%r14), %rdi
	callq	atoi
                                        # kill: def $eax killed $eax def $rax
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	movq	24(%r14), %rdi
	callq	atoi
	movl	%eax, %ebp
	movq	32(%r14), %rdi
	callq	atoi
	movl	%eax, %r14d
	xorl	%edi, %edi
	callq	time
	movl	%eax, %edi
	callq	srand
	leaq	1656(%rsp), %rdi
	movl	$.L.str.3, %esi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
.Ltmp0:
	leaq	1144(%rsp), %rdi
	movl	$.L.str.4, %esi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
.Ltmp1:
# %bb.3:
.Ltmp3:
	leaq	632(%rsp), %rdi
	movl	$.L.str.5, %esi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
.Ltmp4:
# %bb.4:
.Ltmp6:
	leaq	120(%rsp), %rdi
	movl	$.L.str.6, %esi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
.Ltmp7:
# %bb.5:                                # %.preheader
	cmpl	%ebx, 48(%rsp)                  # 4-byte Folded Reload
	jg	.LBB8_76
# %bb.6:                                # %.lr.ph.preheader
	movq	48(%rsp), %rax                  # 8-byte Reload
	movslq	%eax, %r13
	movslq	%ebp, %rcx
	movq	%rcx, 96(%rsp)                  # 8-byte Spill
	movslq	%r14d, %rcx
	movslq	%ebx, %rdx
	movq	%rdx, 72(%rsp)                  # 8-byte Spill
	leaq	(%rcx,%r13), %r15
	movq	%rcx, 88(%rsp)                  # 8-byte Spill
	addl	%ecx, %eax
	movl	%eax, 20(%rsp)                  # 4-byte Spill
	movq	%r13, 80(%rsp)                  # 8-byte Spill
.LBB8_7:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB8_27 Depth 2
                                        #       Child Loop BB8_32 Depth 3
                                        #     Child Loop BB8_54 Depth 2
                                        #       Child Loop BB8_57 Depth 3
	movq	96(%rsp), %rax                  # 8-byte Reload
	leaq	(%rax,%r13), %r12
	addl	%r13d, %eax
	movl	%eax, 28(%rsp)                  # 4-byte Spill
	movslq	%eax, %rdi
	imulq	%r13, %rdi
	shlq	$2, %rdi
	callq	malloc
	movq	%rax, 40(%rsp)                  # 8-byte Spill
	movq	88(%rsp), %rax                  # 8-byte Reload
	leaq	(%rax,%r13), %rbx
	addl	%r13d, %eax
	movl	%eax, 24(%rsp)                  # 4-byte Spill
	movslq	%eax, %rdi
	imulq	%r13, %rdi
	shlq	$2, %rdi
	callq	malloc
	movq	%rax, %r14
	movq	%r12, 64(%rsp)                  # 8-byte Spill
	movq	%rbx, 56(%rsp)                  # 8-byte Spill
	imulq	%rbx, %r12
	shlq	$2, %r12
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, %rbp
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, 32(%rsp)                  # 8-byte Spill
.Ltmp9:
	leaq	1656(%rsp), %rdi
	movl	%r13d, %esi
	callq	_ZNSolsEi
.Ltmp10:
# %bb.8:                                #   in Loop: Header=BB8_7 Depth=1
	movq	%rax, %r12
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
.Ltmp11:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp12:
# %bb.9:                                # %.noexc
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp13:
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
.Ltmp14:
# %bb.10:                               # %.noexc137
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp15:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp16:
# %bb.11:                               # %_ZNSolsEPFRSoS_E.exit
                                        #   in Loop: Header=BB8_7 Depth=1
	movq	%rbp, 112(%rsp)                 # 8-byte Spill
	movq	%r14, %rbp
	movq	40(%rsp), %r14                  # 8-byte Reload
	movq	%r14, %rdi
	movl	28(%rsp), %ebx                  # 4-byte Reload
	movl	%ebx, %esi
	movl	%r13d, %edx
	callq	_Z18fill_matrix_randomPiii
	movq	%rbp, %rdi
	movl	%r13d, %esi
	movq	%r15, %r12
	movl	24(%rsp), %r15d                 # 4-byte Reload
	movl	%r15d, %edx
	callq	_Z18fill_matrix_randomPiii
	callq	clock
	movq	%rax, 104(%rsp)                 # 8-byte Spill
	movl	%r15d, (%rsp)
	movq	%r12, %r15
	movq	%r14, %rdi
	movq	%rbp, %r14
	movq	112(%rsp), %rbp                 # 8-byte Reload
	movq	%r14, %rsi
	movq	%rbp, %rdx
	movl	%ebx, %ecx
	movl	%r13d, %r8d
	callq	_Z11mat_mul_seqPiS_S_iiii
	callq	clock
	subq	104(%rsp), %rax                 # 8-byte Folded Reload
	cvtsi2sd	%rax, %xmm0
	divsd	.LCPI8_0(%rip), %xmm0
.Ltmp17:
	leaq	1144(%rsp), %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp18:
# %bb.12:                               # %_ZNSolsEd.exit
                                        #   in Loop: Header=BB8_7 Depth=1
	movq	%rax, %r12
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
.Ltmp19:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp20:
# %bb.13:                               # %.noexc139
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp21:
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
.Ltmp22:
# %bb.14:                               # %.noexc140
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp23:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp24:
# %bb.15:                               # %_ZNSolsEPFRSoS_E.exit100
                                        #   in Loop: Header=BB8_7 Depth=1
	callq	clock
	movq	%rax, %r12
.Ltmp25:
	movl	24(%rsp), %eax                  # 4-byte Reload
	movl	%eax, (%rsp)
	movq	40(%rsp), %rdi                  # 8-byte Reload
	movq	%r14, %rsi
	movq	32(%rsp), %rdx                  # 8-byte Reload
	movl	28(%rsp), %ecx                  # 4-byte Reload
	movl	%r13d, %r8d
	movl	%r13d, %r9d
	callq	_Z11mat_mul_conPiS_S_iiii
.Ltmp26:
# %bb.16:                               #   in Loop: Header=BB8_7 Depth=1
	callq	clock
	subq	%r12, %rax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	divsd	.LCPI8_0(%rip), %xmm0
.Ltmp27:
	leaq	632(%rsp), %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp28:
# %bb.17:                               # %_ZNSolsEd.exit101
                                        #   in Loop: Header=BB8_7 Depth=1
	movq	%rax, %r12
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
.Ltmp29:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp30:
# %bb.18:                               # %.noexc143
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp31:
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
.Ltmp32:
# %bb.19:                               # %.noexc144
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp33:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp34:
# %bb.20:                               # %_ZNSolsEPFRSoS_E.exit102
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp35:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.7, %esi
	movl	$11, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp36:
# %bb.21:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
                                        #   in Loop: Header=BB8_7 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	movl	$_ZSt4cout, %eax
	addq	%rax, %rdi
.Ltmp37:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp38:
# %bb.22:                               # %.noexc147
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp39:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp40:
# %bb.23:                               # %.noexc148
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp41:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp42:
# %bb.24:                               # %_ZNSolsEPFRSoS_E.exit103
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp43:
	movl	$.L.str.8, %esi
	movl	$11, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp44:
# %bb.25:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit104
                                        #   in Loop: Header=BB8_7 Depth=1
	movq	64(%rsp), %r11                  # 8-byte Reload
	testq	%r11, %r11
	movq	56(%rsp), %r10                  # 8-byte Reload
	jle	.LBB8_37
# %bb.26:                               # %.preheader.lr.ph.i
                                        #   in Loop: Header=BB8_7 Depth=1
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	xorl	%edx, %edx
.LBB8_27:                               # %.preheader.i
                                        #   Parent Loop BB8_7 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB8_32 Depth 3
	testq	%r10, %r10
	jle	.LBB8_33
# %bb.28:                               # %.lr.ph.i
                                        #   in Loop: Header=BB8_27 Depth=2
	movl	%eax, %edi
	movq	32(%rsp), %rsi                  # 8-byte Reload
	leaq	(%rsi,%rdi,4), %rsi
	leaq	(,%rdi,4), %rdi
	addq	%rbp, %rdi
	xorl	%r8d, %r8d
.LBB8_32:                               #   Parent Loop BB8_7 Depth=1
                                        #     Parent Loop BB8_27 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	(%rdi,%r8,4), %r9d
	cmpl	(%rsi,%r8,4), %r9d
	jne	.LBB8_34
# %bb.31:                               #   in Loop: Header=BB8_32 Depth=3
	incq	%r8
	cmpq	%r8, %r15
	jne	.LBB8_32
.LBB8_33:                               # %._crit_edge.i
                                        #   in Loop: Header=BB8_27 Depth=2
	incq	%rcx
	addl	20(%rsp), %eax                  # 4-byte Folded Reload
	cmpq	%r11, %rcx
	setae	%dl
	jne	.LBB8_27
.LBB8_34:                               # %_Z12check_matrixPiS_ii.exit
                                        #   in Loop: Header=BB8_7 Depth=1
	testb	$1, %dl
	je	.LBB8_35
.LBB8_37:                               # %_Z12check_matrixPiS_ii.exit.thread
                                        #   in Loop: Header=BB8_7 Depth=1
	movl	$8, %edx
	movl	$.L.str.9, %esi
	jmp	.LBB8_38
.LBB8_35:                               #   in Loop: Header=BB8_7 Depth=1
	movl	$20, %edx
	movl	$.L.str.10, %esi
.LBB8_38:                               # %.invoke
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp45:
	movl	$_ZSt4cout, %edi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp46:
# %bb.39:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit107.invoke
                                        #   in Loop: Header=BB8_7 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	movl	$_ZSt4cout, %eax
	addq	%rax, %rdi
.Ltmp47:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp48:
# %bb.40:                               # %.noexc155.invoke
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp49:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp50:
# %bb.41:                               # %.noexc156.invoke
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp51:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp52:
# %bb.42:                               # %_ZNSolsEPFRSoS_E.exit106
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp53:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.7, %esi
	movl	$11, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp54:
# %bb.43:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit109
                                        #   in Loop: Header=BB8_7 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	movl	$_ZSt4cout, %eax
	addq	%rax, %rdi
.Ltmp55:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp56:
# %bb.44:                               # %.noexc159
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp57:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp58:
# %bb.45:                               # %.noexc160
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp59:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp60:
# %bb.46:                               # %_ZNSolsEPFRSoS_E.exit110
                                        #   in Loop: Header=BB8_7 Depth=1
	callq	clock
	movq	%rax, %r12
.Ltmp61:
	movl	24(%rsp), %eax                  # 4-byte Reload
	movl	%eax, (%rsp)
	movq	40(%rsp), %rdi                  # 8-byte Reload
	movq	%r14, %rsi
	movq	32(%rsp), %rdx                  # 8-byte Reload
	movl	28(%rsp), %ecx                  # 4-byte Reload
	movl	%r13d, %r8d
	movl	%r13d, %r9d
	callq	_Z17mat_mul_con_tiledPiS_S_iiii
.Ltmp62:
# %bb.47:                               #   in Loop: Header=BB8_7 Depth=1
	callq	clock
	subq	%r12, %rax
	cvtsi2sd	%rax, %xmm0
	divsd	.LCPI8_0(%rip), %xmm0
.Ltmp63:
	leaq	120(%rsp), %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp64:
# %bb.48:                               # %_ZNSolsEd.exit111
                                        #   in Loop: Header=BB8_7 Depth=1
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp65:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp66:
# %bb.49:                               # %.noexc163
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp67:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp68:
# %bb.50:                               # %.noexc164
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp69:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp70:
# %bb.51:                               # %_ZNSolsEPFRSoS_E.exit112
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp71:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.11, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp72:
# %bb.52:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit113
                                        #   in Loop: Header=BB8_7 Depth=1
	movq	64(%rsp), %r11                  # 8-byte Reload
	testq	%r11, %r11
	jle	.LBB8_60
# %bb.53:                               # %.preheader.lr.ph.i114
                                        #   in Loop: Header=BB8_7 Depth=1
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	movq	56(%rsp), %r10                  # 8-byte Reload
.LBB8_54:                               # %.preheader.i118
                                        #   Parent Loop BB8_7 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB8_57 Depth 3
	testq	%r10, %r10
	jle	.LBB8_58
# %bb.55:                               # %.lr.ph.i123
                                        #   in Loop: Header=BB8_54 Depth=2
	movl	%eax, %edi
	movq	32(%rsp), %rsi                  # 8-byte Reload
	leaq	(%rsi,%rdi,4), %rsi
	leaq	(,%rdi,4), %rdi
	addq	%rbp, %rdi
	xorl	%r8d, %r8d
.LBB8_57:                               #   Parent Loop BB8_7 Depth=1
                                        #     Parent Loop BB8_54 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	(%rdi,%r8,4), %r9d
	cmpl	(%rsi,%r8,4), %r9d
	jne	.LBB8_59
# %bb.56:                               #   in Loop: Header=BB8_57 Depth=3
	incq	%r8
	cmpq	%r8, %r15
	jne	.LBB8_57
.LBB8_58:                               # %._crit_edge.i120
                                        #   in Loop: Header=BB8_54 Depth=2
	incq	%rcx
	addl	20(%rsp), %eax                  # 4-byte Folded Reload
	cmpq	%r11, %rcx
	setae	%dl
	jne	.LBB8_54
.LBB8_59:                               # %_Z12check_matrixPiS_ii.exit128
                                        #   in Loop: Header=BB8_7 Depth=1
	testb	$1, %dl
	je	.LBB8_62
.LBB8_60:                               # %_Z12check_matrixPiS_ii.exit128.thread
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp87:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.9, %esi
	movl	$8, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp88:
# %bb.61:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit129
                                        #   in Loop: Header=BB8_7 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %ebx
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp89:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp90:
	jmp	.LBB8_69
.LBB8_62:                               #   in Loop: Header=BB8_7 Depth=1
.Ltmp73:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.12, %esi
	movl	$26, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp74:
# %bb.63:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit131
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp75:
	movl	$_ZSt4cout, %edi
	movq	64(%rsp), %rsi                  # 8-byte Reload
                                        # kill: def $esi killed $esi killed $rsi
	callq	_ZNSolsEi
.Ltmp76:
# %bb.64:                               #   in Loop: Header=BB8_7 Depth=1
.Ltmp77:
	movq	%rax, %rbx
	movl	$.L.str.13, %esi
	movl	$6, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp78:
# %bb.65:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit132
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp79:
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_ZNSolsEi
.Ltmp80:
# %bb.66:                               #   in Loop: Header=BB8_7 Depth=1
.Ltmp81:
	movq	%rax, %rbx
	movl	$.L.str.14, %esi
	movl	$6, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp82:
# %bb.67:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit133
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp83:
	movq	%rbx, %rdi
	movq	56(%rsp), %rsi                  # 8-byte Reload
                                        # kill: def $esi killed $esi killed $rsi
	callq	_ZNSolsEi
.Ltmp84:
# %bb.68:                               #   in Loop: Header=BB8_7 Depth=1
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp85:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp86:
.LBB8_69:                               # %.noexc171.invoke
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp91:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp92:
# %bb.70:                               # %.noexc172.invoke
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp93:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp94:
# %bb.71:                               # %_ZNSolsEPFRSoS_E.exit130
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp95:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.7, %esi
	movl	$11, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp96:
# %bb.72:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit135
                                        #   in Loop: Header=BB8_7 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	movl	$_ZSt4cout, %eax
	addq	%rax, %rdi
.Ltmp97:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp98:
# %bb.73:                               # %.noexc175
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp99:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp100:
# %bb.74:                               # %.noexc176
                                        #   in Loop: Header=BB8_7 Depth=1
.Ltmp101:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp102:
# %bb.75:                               # %_ZNSolsEPFRSoS_E.exit136
                                        #   in Loop: Header=BB8_7 Depth=1
	movq	40(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	%r14, %rdi
	callq	free
	movq	%rbp, %rdi
	callq	free
	movq	32(%rsp), %rdi                  # 8-byte Reload
	callq	free
	movq	80(%rsp), %rax                  # 8-byte Reload
	addq	%rax, %r13
	addq	%rax, %r15
	movl	20(%rsp), %eax                  # 4-byte Reload
	addl	48(%rsp), %eax                  # 4-byte Folded Reload
	movl	%eax, 20(%rsp)                  # 4-byte Spill
	cmpq	72(%rsp), %r13                  # 8-byte Folded Reload
	jle	.LBB8_7
.LBB8_76:                               # %._crit_edge
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE(%rip), %rbx
	leaq	128(%rsp), %rdi
	movq	%rbx, -8(%rdi)
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE+24(%rip), %r14
	movq	-24(%rbx), %rax
	movq	%r14, 120(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	movl	$248, %r15d
	leaq	120(%rsp), %rdi
	addq	%r15, %rdi
	callq	_ZNSt8ios_baseD2Ev
	leaq	640(%rsp), %rdi
	movq	%rbx, -8(%rdi)
	movq	-24(%rbx), %rax
	movq	%r14, 632(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	leaq	632(%rsp), %rdi
	addq	%r15, %rdi
	callq	_ZNSt8ios_baseD2Ev
	leaq	1152(%rsp), %rdi
	movq	%rbx, -8(%rdi)
	movq	-24(%rbx), %rax
	movq	%r14, 1144(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	leaq	1144(%rsp), %rdi
	addq	%r15, %rdi
	callq	_ZNSt8ios_baseD2Ev
	leaq	1664(%rsp), %rdi
	movq	%rbx, -8(%rdi)
	movq	-24(%rbx), %rax
	movq	%r14, 1656(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	leaq	1656(%rsp), %rdi
	addq	%r15, %rdi
	callq	_ZNSt8ios_baseD2Ev
.LBB8_77:
	xorl	%eax, %eax
	addq	$2168, %rsp                     # imm = 0x878
	.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
.LBB8_78:
	.cfi_def_cfa_offset 2224
.Ltmp8:
	movq	%rax, %rbx
	jmp	.LBB8_79
.LBB8_30:
.Ltmp5:
	movq	%rax, %rbx
	jmp	.LBB8_80
.LBB8_29:
.Ltmp2:
	movq	%rax, %rbx
	jmp	.LBB8_81
.LBB8_36:
.Ltmp103:
	movq	%rax, %rbx
	leaq	120(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
.LBB8_79:
	leaq	632(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
.LBB8_80:
	leaq	1144(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
.LBB8_81:
	leaq	1656(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end8:
	.size	main, .Lfunc_end8-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table8:
.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 .Ltmp3-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp7-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp7
	.uleb128 .Ltmp8-.Lfunc_begin0           #     jumps to .Ltmp8
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp9-.Lfunc_begin0           # >> Call Site 5 <<
	.uleb128 .Ltmp102-.Ltmp9                #   Call between .Ltmp9 and .Ltmp102
	.uleb128 .Ltmp103-.Lfunc_begin0         #     jumps to .Ltmp103
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp102-.Lfunc_begin0         # >> Call Site 6 <<
	.uleb128 .Lfunc_end8-.Ltmp102           #   Call between .Ltmp102 and .Lfunc_end8
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- 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	.LBB9_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB9_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z14mat_mul_kernelPiS_S_iiii, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z20mat_mul_kernel_tiledPiS_S_iiii, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end9:
	.size	__hip_module_ctor, .Lfunc_end9-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB10_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB10_2:
	retq
.Lfunc_end10:
	.size	__hip_module_dtor, .Lfunc_end10-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"------------"
	.size	.L.str, 13

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

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

	.type	_Z20mat_mul_kernel_tiledPiS_S_iiii,@object # @_Z20mat_mul_kernel_tiledPiS_S_iiii
	.globl	_Z20mat_mul_kernel_tiledPiS_S_iiii
	.p2align	3, 0x0
_Z20mat_mul_kernel_tiledPiS_S_iiii:
	.quad	_Z35__device_stub__mat_mul_kernel_tiledPiS_S_iiii
	.size	_Z20mat_mul_kernel_tiledPiS_S_iiii, 8

	.type	.L.str.2,@object                # @.str.2
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.2:
	.asciz	"Usage: ./mul max_number step offset_A, offset_B"
	.size	.L.str.2, 48

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"x.mio"
	.size	.L.str.3, 6

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"y_seq.mio"
	.size	.L.str.4, 10

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"y_con.mio"
	.size	.L.str.5, 10

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"y_con_tiled.mio"
	.size	.L.str.6, 16

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"-----------"
	.size	.L.str.7, 12

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"Not Tiled: "
	.size	.L.str.8, 12

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"All good"
	.size	.L.str.9, 9

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"Something Went Wrong"
	.size	.L.str.10, 21

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"Tiled: "
	.size	.L.str.11, 8

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"Something Went Wrong ARow "
	.size	.L.str.12, 27

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	" ACol "
	.size	.L.str.13, 7

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	" BCol "
	.size	.L.str.14, 7

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z14mat_mul_kernelPiS_S_iiii"
	.size	.L__unnamed_1, 29

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z20mat_mul_kernel_tiledPiS_S_iiii"
	.size	.L__unnamed_2, 35

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

	.type	__hip_gpubin_handle,@object     # @__hip_gpubin_handle
	.local	__hip_gpubin_handle
	.comm	__hip_gpubin_handle,8,8
	.section	.init_array,"aw",@init_array
	.p2align	3, 0x0
	.quad	__hip_module_ctor
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _Z29__device_stub__mat_mul_kernelPiS_S_iiii
	.addrsig_sym _Z35__device_stub__mat_mul_kernel_tiledPiS_S_iiii
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _ZSt4cout
	.addrsig_sym _Z14mat_mul_kernelPiS_S_iiii
	.addrsig_sym _Z20mat_mul_kernel_tiledPiS_S_iiii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z14mat_mul_kernelPiS_S_iiii ; -- Begin function _Z14mat_mul_kernelPiS_S_iiii
	.globl	_Z14mat_mul_kernelPiS_S_iiii
	.p2align	8
	.type	_Z14mat_mul_kernelPiS_S_iiii,@function
_Z14mat_mul_kernelPiS_S_iiii:           ; @_Z14mat_mul_kernelPiS_S_iiii
; %bb.0:
	s_clause 0x2
	s_load_b32 s4, s[0:1], 0x34
	s_load_b64 s[2:3], s[0:1], 0x18
	s_load_b32 s8, s[0:1], 0x24
	v_bfe_u32 v2, v0, 10, 10
	v_and_b32_e32 v3, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s5, s4, 16
	s_and_b32 s4, s4, 0xffff
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[0:1], null, s15, s5, v[2:3]
	v_mad_u64_u32 v[1:2], null, s14, s4, v[3:4]
	v_cmp_gt_i32_e32 vcc_lo, s2, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_gt_i32_e64 s2, s8, v1
	s_and_b32 s2, vcc_lo, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s4, s2
	s_cbranch_execz .LBB0_6
; %bb.1:                                ; %.preheader
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[0:1], s[0:1], 0x10
	s_cmp_lt_i32 s3, 1
	s_cbranch_scc1 .LBB0_4
; %bb.2:                                ; %.lr.ph
	v_mul_lo_u32 v2, v0, s3
	v_mov_b32_e32 v5, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v3, 31, v2
	v_lshlrev_b64 v[3:4], 2, v[2:3]
	v_mov_b32_e32 v2, 0
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v3, vcc_lo, s4, v3
	v_add_co_ci_u32_e32 v4, vcc_lo, s5, v4, vcc_lo
.LBB0_3:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_ashrrev_i32_e32 v6, 31, v5
	s_add_i32 s3, s3, -1
	s_cmp_eq_u32 s3, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[6:7], 2, v[5:6]
	v_add_co_u32 v6, vcc_lo, s6, v6
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v7, vcc_lo, s7, v7, vcc_lo
	global_load_b32 v8, v[3:4], off
	global_load_b32 v9, v[6:7], off
	s_waitcnt vmcnt(0)
	v_mad_u64_u32 v[6:7], null, v9, v8, v[2:3]
	v_add_co_u32 v3, vcc_lo, v3, 4
	v_add_co_ci_u32_e32 v4, vcc_lo, 0, v4, vcc_lo
	s_delay_alu instid0(VALU_DEP_3)
	v_dual_mov_b32 v2, v6 :: v_dual_add_nc_u32 v5, s8, v5
	s_cbranch_scc0 .LBB0_3
	s_branch .LBB0_5
.LBB0_4:
	v_mov_b32_e32 v2, 0
.LBB0_5:                                ; %Flow53
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[3:4], null, v0, s8, v[1:2]
	v_ashrrev_i32_e32 v4, 31, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[3:4]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s0, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b32 v[0:1], v2, off
.LBB0_6:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z14mat_mul_kernelPiS_S_iiii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 10
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z14mat_mul_kernelPiS_S_iiii, .Lfunc_end0-_Z14mat_mul_kernelPiS_S_iiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 368
; NumSgprs: 18
; NumVgprs: 10
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 10
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.protected	_Z20mat_mul_kernel_tiledPiS_S_iiii ; -- Begin function _Z20mat_mul_kernel_tiledPiS_S_iiii
	.globl	_Z20mat_mul_kernel_tiledPiS_S_iiii
	.p2align	8
	.type	_Z20mat_mul_kernel_tiledPiS_S_iiii,@function
_Z20mat_mul_kernel_tiledPiS_S_iiii:     ; @_Z20mat_mul_kernel_tiledPiS_S_iiii
; %bb.0:
	s_load_b128 s[4:7], s[0:1], 0x18
	s_mov_b32 s2, 0
	s_waitcnt lgkmcnt(0)
	v_cvt_f32_i32_e32 v1, s5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v1, 0x3d000000, v1
	v_ceil_f32_e32 v5, v1
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_nlt_f32_e32 vcc_lo, 0, v5
	s_cbranch_vccnz .LBB1_15
; %bb.1:                                ; %.lr.ph
	v_and_b32_e32 v6, 0x3ff, v0
	v_bfe_u32 v7, v0, 10, 10
	s_clause 0x1
	s_load_b64 s[12:13], s[0:1], 0x10
	s_load_b128 s[8:11], s[0:1], 0x0
	v_lshl_add_u32 v0, s14, 5, v6
	v_lshl_add_u32 v3, s15, 5, v7
	v_lshlrev_b32_e32 v8, 7, v7
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cmp_gt_i32_e64 s1, s7, v0
	v_mad_u64_u32 v[1:2], null, v3, s7, v[0:1]
	v_cmp_gt_i32_e64 s0, s4, v3
	v_mul_lo_u32 v10, v3, s5
	v_dual_mov_b32 v3, 0 :: v_dual_lshlrev_b32 v4, 2, v6
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	s_and_b32 s3, s0, s1
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_or_b32_e32 v9, 0x1000, v4
	v_add_nc_u32_e32 v11, v8, v4
	v_lshlrev_b64 v[1:2], 2, v[1:2]
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v12, v9, v8
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v1, vcc_lo, s12, v1
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v2, vcc_lo, s13, v2, vcc_lo
.LBB1_2:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_11 Depth 2
	v_mov_b32_e32 v4, 0
	s_and_saveexec_b32 s4, s0
	s_cbranch_execz .LBB1_6
; %bb.3:                                ;   in Loop: Header=BB1_2 Depth=1
	v_lshl_add_u32 v13, s2, 5, v6
	v_mov_b32_e32 v4, 0
	s_mov_b32 s12, exec_lo
	s_delay_alu instid0(VALU_DEP_2)
	v_cmpx_gt_i32_e64 s5, v13
	s_cbranch_execz .LBB1_5
; %bb.4:                                ;   in Loop: Header=BB1_2 Depth=1
	v_add_nc_u32_e32 v13, v13, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v14, 31, v13
	v_lshlrev_b64 v[13:14], 2, v[13:14]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v13, vcc_lo, s8, v13
	v_add_co_ci_u32_e32 v14, vcc_lo, s9, v14, vcc_lo
	global_load_b32 v4, v[13:14], off
.LBB1_5:                                ; %Flow95
                                        ;   in Loop: Header=BB1_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s12
.LBB1_6:                                ;   in Loop: Header=BB1_2 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s4
	v_mov_b32_e32 v13, 0
	s_waitcnt vmcnt(0)
	ds_store_b32 v11, v4
	s_and_saveexec_b32 s4, s1
	s_cbranch_execz .LBB1_10
; %bb.7:                                ;   in Loop: Header=BB1_2 Depth=1
	v_lshl_add_u32 v4, s2, 5, v7
	v_mov_b32_e32 v13, 0
	s_mov_b32 s12, exec_lo
	s_delay_alu instid0(VALU_DEP_2)
	v_cmpx_gt_i32_e64 s6, v4
	s_cbranch_execz .LBB1_9
; %bb.8:                                ;   in Loop: Header=BB1_2 Depth=1
	v_mad_u64_u32 v[13:14], null, v4, s7, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v14, 31, v13
	v_lshlrev_b64 v[13:14], 2, v[13:14]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v13, vcc_lo, s10, v13
	v_add_co_ci_u32_e32 v14, vcc_lo, s11, v14, vcc_lo
	global_load_b32 v13, v[13:14], off
.LBB1_9:                                ; %Flow
                                        ;   in Loop: Header=BB1_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s12
.LBB1_10:                               ;   in Loop: Header=BB1_2 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s4
	s_waitcnt vmcnt(0)
	ds_store_b32 v12, v13
	v_mov_b32_e32 v13, v9
	s_mov_b32 s4, 0
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
.LBB1_11:                               ;   Parent Loop BB1_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	v_add_nc_u32_e32 v4, s4, v8
	s_delay_alu instid0(VALU_DEP_2)
	v_mov_b32_e32 v14, v3
	s_add_i32 s4, s4, 4
	ds_load_b32 v15, v13
	ds_load_b32 v16, v4
	v_add_nc_u32_e32 v13, 0x80, v13
	s_cmpk_eq_i32 s4, 0x80
	s_waitcnt lgkmcnt(0)
	v_mad_u64_u32 v[3:4], null, v15, v16, v[14:15]
	s_cbranch_scc0 .LBB1_11
; %bb.12:                               ;   in Loop: Header=BB1_2 Depth=1
	s_barrier
	buffer_gl0_inv
	s_and_saveexec_b32 s4, s3
	s_cbranch_execz .LBB1_14
; %bb.13:                               ;   in Loop: Header=BB1_2 Depth=1
	global_store_b32 v[1:2], v3, off
.LBB1_14:                               ;   in Loop: Header=BB1_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s4
	s_add_i32 s2, s2, 1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cvt_f32_i32_e32 v4, s2
	v_cmp_ngt_f32_e32 vcc_lo, v5, v4
	s_cbranch_vccz .LBB1_2
.LBB1_15:                               ; %._crit_edge
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z20mat_mul_kernel_tiledPiS_S_iiii
		.amdhsa_group_segment_fixed_size 8192
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 40
		.amdhsa_user_sgpr_count 14
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 17
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z20mat_mul_kernel_tiledPiS_S_iiii, .Lfunc_end1-_Z20mat_mul_kernel_tiledPiS_S_iiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 592
; NumSgprs: 18
; NumVgprs: 17
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 8192 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 17
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         36
        .size:           4
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         44
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         52
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         54
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         56
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         58
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         60
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         62
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         104
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 296
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z14mat_mul_kernelPiS_S_iiii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z14mat_mul_kernelPiS_S_iiii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     10
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         28
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         36
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 8192
    .kernarg_segment_align: 8
    .kernarg_segment_size: 40
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z20mat_mul_kernel_tiledPiS_S_iiii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z20mat_mul_kernel_tiledPiS_S_iiii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     17
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
