#include <iostream>

#include <vector>
#include <cstdio>
#include <exception>

/** macro to throw a runtime error */
#define THROW(fmt, ...)                                                    \
  do {                                                                     \
    std::string msg;                                                       \
    char errMsg[2048];                                                     \
    std::sprintf(errMsg, "Exception occured! file=%s line=%d: ", __FILE__, \
                 __LINE__);                                                \
    msg += errMsg;                                                         \
    std::sprintf(errMsg, fmt, ##__VA_ARGS__);                              \
    msg += errMsg;                                                         \
    throw std::runtime_error(msg);                                         \
  } while (0)

/** macro to check for a conditional and assert on failure */
#define ASSERT(check, fmt, ...)              \
  do {                                       \
    if (!(check)) THROW(fmt, ##__VA_ARGS__); \
  } while (0)


/** check for cuda runtime API errors and assert accordingly */
#define CUDA_CHECK(call)                                                \
  do {                                                                  \
    cudaError_t status = call;                                          \
    ASSERT(status == cudaSuccess, "FAIL: call='%s'. Reason:%s\n", #call, \
           cudaGetErrorString(status));                                 \
  } while (0)

__global__ void init_xy(double* x, double* y, double a, double b, int N) {
  const int tid = threadIdx.x;
  const int bid = blockIdx.x;
  const int idx = bid*blockDim.x + tid;
  if(idx < N) {
    x[idx] = a;
    y[idx] = b;
  }
}


__global__ void saxpy(const double* x, const double* y, const double a, const int N, double* z) {
  const int tid = threadIdx.x;
  const int bid = blockIdx.x;
  const int idx = bid*blockDim.x + tid;
  if(idx < N) {
    z[idx] = a*x[idx] + y[idx];
    // printf("z[%d]=%f * %f + %f = %f\n", idx, a, x[idx], y[idx], z[idx]);
  }
}

int checkResults(double* d_z, double a, const int N) {
  std::vector<double> h_z(N);
  CUDA_CHECK(cudaMemcpy(h_z.data(), d_z, sizeof(double)*N, cudaMemcpyDeviceToHost));

  // check
  int i=0;
  for(auto zi : h_z) {
    if(zi != a*1 + 2) {
      std::printf("ERROR: z[%d]=%f != %fn", i, zi, a*1 + 2);
      return -1;
    }
    i++;
  }
  return 0;
}

int main() {
  const int N = 100;
  double* d_x;
  double* d_y;
  double* d_z;
  CUDA_CHECK(cudaMalloc(&d_x, sizeof(double)*N));
  CUDA_CHECK(cudaMalloc(&d_y, sizeof(double)*N));
  CUDA_CHECK(cudaMalloc(&d_z, sizeof(double)*N));
  

  const int threads_per_block = 64;
  const int num_blocks = ceil((double)N/threads_per_block);
  // printf("Num blocks=%d\n", num_blocks);

  init_xy<<<num_blocks, threads_per_block>>>(d_x, d_y, 1.0, 2.0, N);
  CUDA_CHECK(cudaGetLastError());

  double a = 42.0;
  saxpy<<<num_blocks, threads_per_block>>>(d_x, d_y, a, N, d_z);
  CUDA_CHECK(cudaGetLastError());
  
  return checkResults(d_z, a, N);
}

	.file	"tmpxft_0038b80c_00000000-6_main.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4003:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4003:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"basic_string::append"
	.text
	.align 2
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.isra.0, @function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.isra.0:
.LFB4745:
	.cfi_startproc
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%rsi, 8(%rsp)
	call	strlen@PLT
	movq	8(%rsp), %rsi
	movq	%rax, %rdx
	movabsq	$4611686018427387903, %rax
	subq	8(%rbx), %rax
	cmpq	%rdx, %rax
	jnb	.L3
	leaq	.LC0(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L3:
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_appendEPKcm@PLT
	.cfi_endproc
.LFE4745:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.isra.0, .-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.isra.0
	.globl	_Z31__device_stub__Z7init_xyPdS_ddiPdS_ddi
	.type	_Z31__device_stub__Z7init_xyPdS_ddiPdS_ddi, @function
_Z31__device_stub__Z7init_xyPdS_ddiPdS_ddi:
.LFB4025:
	.cfi_startproc
	endbr64
	subq	$168, %rsp
	.cfi_def_cfa_offset 176
	movq	%rdi, 40(%rsp)
	leaq	56(%rsp), %rcx
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	48(%rsp), %rdx
	movsd	%xmm0, 24(%rsp)
	movsd	%xmm1, 16(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 152(%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	16(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 144(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L6
	pushq	56(%rsp)
	.cfi_def_cfa_offset 184
	leaq	_Z7init_xyPdS_ddi(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 192
	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 184
	popq	%rdx
	.cfi_def_cfa_offset 176
.L6:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	addq	$168, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4025:
	.size	_Z31__device_stub__Z7init_xyPdS_ddiPdS_ddi, .-_Z31__device_stub__Z7init_xyPdS_ddiPdS_ddi
	.globl	_Z7init_xyPdS_ddi
	.type	_Z7init_xyPdS_ddi, @function
_Z7init_xyPdS_ddi:
.LFB4026:
	.cfi_startproc
	endbr64
	jmp	_Z31__device_stub__Z7init_xyPdS_ddiPdS_ddi
	.cfi_endproc
.LFE4026:
	.size	_Z7init_xyPdS_ddi, .-_Z7init_xyPdS_ddi
	.globl	_Z32__device_stub__Z5saxpyPKdS0_diPdPKdS0_diPd
	.type	_Z32__device_stub__Z5saxpyPKdS0_diPdPKdS0_diPd, @function
_Z32__device_stub__Z5saxpyPKdS0_diPdPKdS0_diPd:
.LFB4027:
	.cfi_startproc
	endbr64
	subq	$168, %rsp
	.cfi_def_cfa_offset 176
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movl	%edx, 20(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 8(%rsp)
	leaq	56(%rsp), %rcx
	movsd	%xmm0, 24(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 152(%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	8(%rsp), %rax
	movq	%rax, 144(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L11
	pushq	56(%rsp)
	.cfi_def_cfa_offset 184
	leaq	_Z5saxpyPKdS0_diPd(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 192
	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 184
	popq	%rdx
	.cfi_def_cfa_offset 176
.L11:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	addq	$168, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4027:
	.size	_Z32__device_stub__Z5saxpyPKdS0_diPdPKdS0_diPd, .-_Z32__device_stub__Z5saxpyPKdS0_diPdPKdS0_diPd
	.globl	_Z5saxpyPKdS0_diPd
	.type	_Z5saxpyPKdS0_diPd, @function
_Z5saxpyPKdS0_diPd:
.LFB4028:
	.cfi_startproc
	endbr64
	jmp	_Z32__device_stub__Z5saxpyPKdS0_diPdPKdS0_diPd
	.cfi_endproc
.LFE4028:
	.size	_Z5saxpyPKdS0_diPd, .-_Z5saxpyPKdS0_diPd
	.section	.rodata.str1.1
.LC1:
	.string	"_Z5saxpyPKdS0_diPd"
.LC2:
	.string	"_Z7init_xyPdS_ddi"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4030:
	.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	.LC1(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z5saxpyPKdS0_diPd(%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	.LC2(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z7init_xyPdS_ddi(%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
.LFE4030:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata._ZNSt6vectorIdSaIdEEC2EmRKS0_.str1.1,"aMS",@progbits,1
.LC3:
	.string	"cannot create std::vector larger than max_size()"
	.section	.text._ZNSt6vectorIdSaIdEEC2EmRKS0_,"axG",@progbits,_ZNSt6vectorIdSaIdEEC5EmRKS0_,comdat
	.align 2
	.weak	_ZNSt6vectorIdSaIdEEC2EmRKS0_
	.type	_ZNSt6vectorIdSaIdEEC2EmRKS0_, @function
_ZNSt6vectorIdSaIdEEC2EmRKS0_:
.LFB4337:
	.cfi_startproc
	endbr64
	movabsq	$1152921504606846975, %rax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	cmpq	%rsi, %rax
	jnb	.L19
	leaq	.LC3(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L19:
	xorl	%eax, %eax
	movq	%rdi, %rbx
	leaq	0(,%rsi,8), %r12
	movq	%rsi, %rbp
	movq	%rax, (%rdi)
	movq	%rax, 8(%rdi)
	movq	%rax, 16(%rdi)
	xorl	%eax, %eax
	testq	%rsi, %rsi
	je	.L20
	movq	%r12, %rdi
	call	_Znwm@PLT
.L20:
	addq	%rax, %r12
	movq	%rax, (%rbx)
	movq	%rax, 8(%rbx)
	movq	%r12, 16(%rbx)
	testq	%rbp, %rbp
	je	.L21
	movq	$0x000000000, (%rax)
	addq	$8, %rax
	decq	%rbp
	je	.L21
.L22:
	cmpq	%rax, %r12
	je	.L21
	movq	$0x000000000, (%rax)
	addq	$8, %rax
	jmp	.L22
.L21:
	movq	%rax, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4337:
	.size	_ZNSt6vectorIdSaIdEEC2EmRKS0_, .-_ZNSt6vectorIdSaIdEEC2EmRKS0_
	.weak	_ZNSt6vectorIdSaIdEEC1EmRKS0_
	.set	_ZNSt6vectorIdSaIdEEC1EmRKS0_,_ZNSt6vectorIdSaIdEEC2EmRKS0_
	.section	.text._ZNSt6vectorIdSaIdEED2Ev,"axG",@progbits,_ZNSt6vectorIdSaIdEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIdSaIdEED2Ev
	.type	_ZNSt6vectorIdSaIdEED2Ev, @function
_ZNSt6vectorIdSaIdEED2Ev:
.LFB4340:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L33
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L33:
	ret
	.cfi_endproc
.LFE4340:
	.size	_ZNSt6vectorIdSaIdEED2Ev, .-_ZNSt6vectorIdSaIdEED2Ev
	.weak	_ZNSt6vectorIdSaIdEED1Ev
	.set	_ZNSt6vectorIdSaIdEED1Ev,_ZNSt6vectorIdSaIdEED2Ev
	.section	.rodata.str1.1
.LC5:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/rietmann-nv/cuda_demo/master/main.cu"
.LC6:
	.string	"Exception occured! file=%s line=%d: "
.LC7:
	.string	"cudaMemcpy(h_z.data(), d_z, sizeof(double)*N, cudaMemcpyDeviceToHost)"
.LC8:
	.string	"FAIL: call='%s'. Reason:%s\n"
.LC10:
	.string	"ERROR: z[%d]=%f != %fn"
	.text
	.globl	_Z12checkResultsPddi
	.type	_Z12checkResultsPddi, @function
_Z12checkResultsPddi:
.LFB3998:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3998
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movslq	%esi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$2152, %rsp
	.cfi_def_cfa_offset 2192
	leaq	32(%rsp), %rbp
	movsd	%xmm0, 8(%rsp)
	leaq	31(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 2136(%rsp)
	xorl	%eax, %eax
	movq	%rbp, %rdi
.LEHB0:
	call	_ZNSt6vectorIdSaIdEEC1EmRKS0_
.LEHE0:
	movq	32(%rsp), %rbx
	movl	$2, %ecx
	movq	%r13, %rsi
	leaq	0(,%r12,8), %rdx
	movq	%rbx, %rdi
.LEHB1:
	call	cudaMemcpy@PLT
.LEHE1:
	movl	%eax, %r13d
	testl	%eax, %eax
	je	.L36
	leaq	72(%rsp), %rax
	leaq	88(%rsp), %rbx
	movl	$2, %esi
	movl	$58, %r9d
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	movq	%rbx, %rdi
	leaq	56(%rsp), %r12
	movq	%rax, 64(%rsp)
	leaq	.LC5(%rip), %r8
	leaq	.LC6(%rip), %rcx
	xorl	%eax, %eax
	movl	$2048, %edx
	movb	$0, 72(%rsp)
	call	__sprintf_chk@PLT
	movq	%rbx, %rsi
	movq	%r12, %rdi
.LEHB2:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.isra.0
	movl	%r13d, %edi
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$2, %esi
	movq	%rbx, %rdi
	movl	$2048, %edx
	leaq	.LC7(%rip), %r8
	leaq	.LC8(%rip), %rcx
	xorl	%eax, %eax
	call	__sprintf_chk@PLT
	movq	%rbx, %rsi
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.isra.0
.LEHE2:
	movl	$16, %edi
	call	__cxa_allocate_exception@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	movq	%rax, %r13
.LEHB3:
	call	_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@PLT
.LEHE3:
	movq	2136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L54
	movq	_ZNSt13runtime_errorD1Ev@GOTPCREL(%rip), %rdx
	leaq	_ZTISt13runtime_error(%rip), %rsi
	movq	%r13, %rdi
.LEHB4:
	call	__cxa_throw@PLT
.LEHE4:
.L36:
	movq	40(%rsp), %rcx
	movsd	.LC9(%rip), %xmm2
	movq	%rbx, %rax
	xorl	%edx, %edx
.L38:
	cmpq	%rax, %rcx
	je	.L57
	movsd	8(%rsp), %xmm1
	movsd	(%rax), %xmm0
	addq	$8, %rax
	addsd	%xmm2, %xmm1
	ucomisd	%xmm0, %xmm1
	jp	.L52
	je	.L39
.L52:
	leaq	.LC10(%rip), %rsi
	movl	$2, %edi
	movb	$2, %al
.LEHB5:
	call	__printf_chk@PLT
.LEHE5:
	orl	$-1, %ebx
	jmp	.L41
.L39:
	incl	%edx
	jmp	.L38
.L57:
	xorl	%ebx, %ebx
.L41:
	movq	%rbp, %rdi
	call	_ZNSt6vectorIdSaIdEED1Ev
	movq	2136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L47
	jmp	.L54
.L51:
	endbr64
	movq	%rax, %rbx
.L43:
	movq	%r13, %rdi
	call	__cxa_free_exception@PLT
	jmp	.L44
.L50:
	endbr64
	movq	%rax, %rbx
.L44:
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L45
.L49:
	endbr64
	movq	%rax, %rbx
.L45:
	movq	%rbp, %rdi
	call	_ZNSt6vectorIdSaIdEED1Ev
	movq	2136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L54
	movq	%rbx, %rdi
.LEHB6:
	call	_Unwind_Resume@PLT
.LEHE6:
.L54:
	call	__stack_chk_fail@PLT
.L47:
	addq	$2152, %rsp
	.cfi_def_cfa_offset 40
	movl	%ebx, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3998:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3998:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3998-.LLSDACSB3998
.LLSDACSB3998:
	.uleb128 .LEHB0-.LFB3998
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3998
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L49-.LFB3998
	.uleb128 0
	.uleb128 .LEHB2-.LFB3998
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L50-.LFB3998
	.uleb128 0
	.uleb128 .LEHB3-.LFB3998
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L51-.LFB3998
	.uleb128 0
	.uleb128 .LEHB4-.LFB3998
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L50-.LFB3998
	.uleb128 0
	.uleb128 .LEHB5-.LFB3998
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L49-.LFB3998
	.uleb128 0
	.uleb128 .LEHB6-.LFB3998
	.uleb128 .LEHE6-.LEHB6
	.uleb128 0
	.uleb128 0
.LLSDACSE3998:
	.text
	.size	_Z12checkResultsPddi, .-_Z12checkResultsPddi
	.section	.rodata.str1.1
.LC11:
	.string	"cudaMalloc(&d_x, sizeof(double)*N)"
.LC12:
	.string	"cudaMalloc(&d_y, sizeof(double)*N)"
.LC13:
	.string	"cudaMalloc(&d_z, sizeof(double)*N)"
.LC15:
	.string	"cudaGetLastError()"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4000:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4000
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	$800, %esi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$2144, %rsp
	.cfi_def_cfa_offset 2176
	movq	%fs:40, %rax
	movq	%rax, 2136(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
.LEHB7:
	call	cudaMalloc@PLT
.LEHE7:
	testl	%eax, %eax
	je	.L59
	xorl	%edi, %edi
	leaq	88(%rsp), %rbx
	movl	%eax, %ebp
	movl	$2, %esi
	leaq	72(%rsp), %rax
	movq	%rdi, 64(%rsp)
	movq	%rbx, %rdi
	leaq	56(%rsp), %r12
	movq	%rax, 56(%rsp)
	movl	$77, %r9d
	xorl	%eax, %eax
	leaq	.LC5(%rip), %r8
	leaq	.LC6(%rip), %rcx
	movl	$2048, %edx
	movb	$0, 72(%rsp)
	call	__sprintf_chk@PLT
	movq	%rbx, %rsi
	movq	%r12, %rdi
.LEHB8:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.isra.0
	movl	%ebp, %edi
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$2, %esi
	movq	%rbx, %rdi
	movl	$2048, %edx
	leaq	.LC11(%rip), %r8
	leaq	.LC8(%rip), %rcx
	xorl	%eax, %eax
	call	__sprintf_chk@PLT
	movq	%rbx, %rsi
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.isra.0
.LEHE8:
	movl	$16, %edi
	call	__cxa_allocate_exception@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	movq	%rax, %rbp
.LEHB9:
	call	_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@PLT
.LEHE9:
	movq	2136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L97
	movq	_ZNSt13runtime_errorD1Ev@GOTPCREL(%rip), %rdx
	leaq	_ZTISt13runtime_error(%rip), %rsi
	movq	%rbp, %rdi
.LEHB10:
	call	__cxa_throw@PLT
.LEHE10:
.L59:
	leaq	16(%rsp), %rdi
	movl	$800, %esi
.LEHB11:
	call	cudaMalloc@PLT
.LEHE11:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.L61
	leaq	72(%rsp), %rax
	xorl	%esi, %esi
	leaq	88(%rsp), %rbx
	movl	$78, %r9d
	movq	%rax, 56(%rsp)
	movq	%rbx, %rdi
	leaq	56(%rsp), %r12
	xorl	%eax, %eax
	movq	%rsi, 64(%rsp)
	movl	$2048, %edx
	movl	$2, %esi
	leaq	.LC5(%rip), %r8
	leaq	.LC6(%rip), %rcx
	movb	$0, 72(%rsp)
	call	__sprintf_chk@PLT
	movq	%rbx, %rsi
	movq	%r12, %rdi
.LEHB12:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.isra.0
	movl	%ebp, %edi
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$2, %esi
	movq	%rbx, %rdi
	movl	$2048, %edx
	leaq	.LC12(%rip), %r8
	leaq	.LC8(%rip), %rcx
	xorl	%eax, %eax
	call	__sprintf_chk@PLT
	movq	%rbx, %rsi
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.isra.0
.LEHE12:
	movl	$16, %edi
	call	__cxa_allocate_exception@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	movq	%rax, %rbp
.LEHB13:
	call	_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@PLT
.LEHE13:
	movq	2136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L97
	movq	_ZNSt13runtime_errorD1Ev@GOTPCREL(%rip), %rdx
	leaq	_ZTISt13runtime_error(%rip), %rsi
	movq	%rbp, %rdi
.LEHB14:
	call	__cxa_throw@PLT
.LEHE14:
.L61:
	leaq	24(%rsp), %rdi
	movl	$800, %esi
.LEHB15:
	call	cudaMalloc@PLT
.LEHE15:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.L63
	leaq	72(%rsp), %rax
	xorl	%ecx, %ecx
	leaq	88(%rsp), %rbx
	movl	$2, %esi
	movq	%rax, 56(%rsp)
	movq	%rbx, %rdi
	leaq	56(%rsp), %r12
	xorl	%eax, %eax
	movq	%rcx, 64(%rsp)
	movl	$79, %r9d
	leaq	.LC5(%rip), %r8
	leaq	.LC6(%rip), %rcx
	movl	$2048, %edx
	movb	$0, 72(%rsp)
	call	__sprintf_chk@PLT
	movq	%rbx, %rsi
	movq	%r12, %rdi
.LEHB16:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.isra.0
	movl	%ebp, %edi
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$2, %esi
	movq	%rbx, %rdi
	movl	$2048, %edx
	leaq	.LC13(%rip), %r8
	leaq	.LC8(%rip), %rcx
	xorl	%eax, %eax
	call	__sprintf_chk@PLT
	movq	%rbx, %rsi
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.isra.0
.LEHE16:
	movl	$16, %edi
	call	__cxa_allocate_exception@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	movq	%rax, %rbp
.LEHB17:
	call	_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@PLT
.LEHE17:
	movq	2136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L97
	movq	_ZNSt13runtime_errorD1Ev@GOTPCREL(%rip), %rdx
	leaq	_ZTISt13runtime_error(%rip), %rsi
	movq	%rbp, %rdi
.LEHB18:
	call	__cxa_throw@PLT
.LEHE18:
.L63:
	movl	$67108865, %edx
	movl	$2147483649, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$6, %rdx
	addq	%rdi, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movq	%rdx, 44(%rsp)
	movl	$1, 52(%rsp)
	movq	%rdi, 32(%rsp)
	movl	$1, 40(%rsp)
.LEHB19:
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L65
	movq	16(%rsp), %rsi
	movq	8(%rsp), %rdi
	movl	$100, %edx
	movsd	.LC9(%rip), %xmm1
	movsd	.LC14(%rip), %xmm0
	call	_Z31__device_stub__Z7init_xyPdS_ddiPdS_ddi
.L65:
	call	cudaGetLastError@PLT
.LEHE19:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.L66
	leaq	72(%rsp), %rax
	xorl	%edx, %edx
	leaq	88(%rsp), %rbx
	movl	$2, %esi
	movq	%rax, 56(%rsp)
	movq	%rbx, %rdi
	leaq	56(%rsp), %r12
	xorl	%eax, %eax
	movq	%rdx, 64(%rsp)
	movl	$87, %r9d
	leaq	.LC5(%rip), %r8
	leaq	.LC6(%rip), %rcx
	movl	$2048, %edx
	movb	$0, 72(%rsp)
	call	__sprintf_chk@PLT
	movq	%rbx, %rsi
	movq	%r12, %rdi
.LEHB20:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.isra.0
	movl	%ebp, %edi
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$2, %esi
	movq	%rbx, %rdi
	movl	$2048, %edx
	leaq	.LC15(%rip), %r8
	leaq	.LC8(%rip), %rcx
	xorl	%eax, %eax
	call	__sprintf_chk@PLT
	movq	%rbx, %rsi
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.isra.0
.LEHE20:
	movl	$16, %edi
	call	__cxa_allocate_exception@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	movq	%rax, %rbp
.LEHB21:
	call	_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@PLT
.LEHE21:
	movq	2136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L97
	movq	_ZNSt13runtime_errorD1Ev@GOTPCREL(%rip), %rdx
	leaq	_ZTISt13runtime_error(%rip), %rsi
	movq	%rbp, %rdi
.LEHB22:
	call	__cxa_throw@PLT
.LEHE22:
.L66:
	movl	$67108865, %edx
	movl	$2147483649, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$6, %rdx
	addq	%rdi, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movq	%rdx, 44(%rsp)
	movl	$1, 52(%rsp)
	movq	%rdi, 32(%rsp)
	movl	$1, 40(%rsp)
.LEHB23:
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L68
	movq	24(%rsp), %rcx
	movq	16(%rsp), %rsi
	movl	$100, %edx
	movsd	.LC16(%rip), %xmm0
	movq	8(%rsp), %rdi
	call	_Z32__device_stub__Z5saxpyPKdS0_diPdPKdS0_diPd
.L68:
	call	cudaGetLastError@PLT
.LEHE23:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.L69
	leaq	72(%rsp), %rax
	leaq	88(%rsp), %rbx
	movl	$2, %esi
	movl	$91, %r9d
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	movq	%rbx, %rdi
	leaq	56(%rsp), %r12
	movq	%rax, 64(%rsp)
	leaq	.LC5(%rip), %r8
	leaq	.LC6(%rip), %rcx
	xorl	%eax, %eax
	movl	$2048, %edx
	movb	$0, 72(%rsp)
	call	__sprintf_chk@PLT
	movq	%rbx, %rsi
	movq	%r12, %rdi
.LEHB24:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.isra.0
	movl	%ebp, %edi
	call	cudaGetErrorString@PLT
	movq	%rax, %r9
	movl	$2, %esi
	movq	%rbx, %rdi
	movl	$2048, %edx
	leaq	.LC15(%rip), %r8
	leaq	.LC8(%rip), %rcx
	xorl	%eax, %eax
	call	__sprintf_chk@PLT
	movq	%rbx, %rsi
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.isra.0
.LEHE24:
	movl	$16, %edi
	call	__cxa_allocate_exception@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	movq	%rax, %rbp
.LEHB25:
	call	_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@PLT
.LEHE25:
	movq	2136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L97
	movq	_ZNSt13runtime_errorD1Ev@GOTPCREL(%rip), %rdx
	leaq	_ZTISt13runtime_error(%rip), %rsi
	movq	%rbp, %rdi
.LEHB26:
	call	__cxa_throw@PLT
.LEHE26:
.L69:
	movsd	.LC16(%rip), %xmm0
	movq	24(%rsp), %rdi
	movl	$100, %esi
.LEHB27:
	call	_Z12checkResultsPddi
	movq	2136(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L86
	jmp	.L97
.L88:
	endbr64
	jmp	.L101
.L87:
	endbr64
	jmp	.L100
.L90:
	endbr64
	jmp	.L101
.L89:
	endbr64
	jmp	.L100
.L92:
	endbr64
	jmp	.L101
.L91:
	endbr64
	jmp	.L100
.L94:
	endbr64
	jmp	.L101
.L93:
	endbr64
	jmp	.L100
.L96:
	endbr64
.L101:
	movq	%rax, %rbx
.L83:
	movq	%rbp, %rdi
	call	__cxa_free_exception@PLT
	jmp	.L84
.L95:
	endbr64
.L100:
	movq	%rax, %rbx
.L84:
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	2136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L97
	movq	%rbx, %rdi
	call	_Unwind_Resume@PLT
.LEHE27:
.L97:
	call	__stack_chk_fail@PLT
.L86:
	addq	$2144, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4000:
	.section	.gcc_except_table
.LLSDA4000:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4000-.LLSDACSB4000
.LLSDACSB4000:
	.uleb128 .LEHB7-.LFB4000
	.uleb128 .LEHE7-.LEHB7
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB8-.LFB4000
	.uleb128 .LEHE8-.LEHB8
	.uleb128 .L87-.LFB4000
	.uleb128 0
	.uleb128 .LEHB9-.LFB4000
	.uleb128 .LEHE9-.LEHB9
	.uleb128 .L88-.LFB4000
	.uleb128 0
	.uleb128 .LEHB10-.LFB4000
	.uleb128 .LEHE10-.LEHB10
	.uleb128 .L87-.LFB4000
	.uleb128 0
	.uleb128 .LEHB11-.LFB4000
	.uleb128 .LEHE11-.LEHB11
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB12-.LFB4000
	.uleb128 .LEHE12-.LEHB12
	.uleb128 .L89-.LFB4000
	.uleb128 0
	.uleb128 .LEHB13-.LFB4000
	.uleb128 .LEHE13-.LEHB13
	.uleb128 .L90-.LFB4000
	.uleb128 0
	.uleb128 .LEHB14-.LFB4000
	.uleb128 .LEHE14-.LEHB14
	.uleb128 .L89-.LFB4000
	.uleb128 0
	.uleb128 .LEHB15-.LFB4000
	.uleb128 .LEHE15-.LEHB15
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB16-.LFB4000
	.uleb128 .LEHE16-.LEHB16
	.uleb128 .L91-.LFB4000
	.uleb128 0
	.uleb128 .LEHB17-.LFB4000
	.uleb128 .LEHE17-.LEHB17
	.uleb128 .L92-.LFB4000
	.uleb128 0
	.uleb128 .LEHB18-.LFB4000
	.uleb128 .LEHE18-.LEHB18
	.uleb128 .L91-.LFB4000
	.uleb128 0
	.uleb128 .LEHB19-.LFB4000
	.uleb128 .LEHE19-.LEHB19
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB20-.LFB4000
	.uleb128 .LEHE20-.LEHB20
	.uleb128 .L93-.LFB4000
	.uleb128 0
	.uleb128 .LEHB21-.LFB4000
	.uleb128 .LEHE21-.LEHB21
	.uleb128 .L94-.LFB4000
	.uleb128 0
	.uleb128 .LEHB22-.LFB4000
	.uleb128 .LEHE22-.LEHB22
	.uleb128 .L93-.LFB4000
	.uleb128 0
	.uleb128 .LEHB23-.LFB4000
	.uleb128 .LEHE23-.LEHB23
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB24-.LFB4000
	.uleb128 .LEHE24-.LEHB24
	.uleb128 .L95-.LFB4000
	.uleb128 0
	.uleb128 .LEHB25-.LFB4000
	.uleb128 .LEHE25-.LEHB25
	.uleb128 .L96-.LFB4000
	.uleb128 0
	.uleb128 .LEHB26-.LFB4000
	.uleb128 .LEHE26-.LEHB26
	.uleb128 .L95-.LFB4000
	.uleb128 0
	.uleb128 .LEHB27-.LFB4000
	.uleb128 .LEHE27-.LEHB27
	.uleb128 0
	.uleb128 0
.LLSDACSE4000:
	.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.cst8,"aM",@progbits,8
	.align 8
.LC9:
	.long	0
	.long	1073741824
	.align 8
.LC14:
	.long	0
	.long	1072693248
	.align 8
.LC16:
	.long	0
	.long	1078263808
	.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 <iostream>

#include <vector>
#include <cstdio>
#include <exception>

/** macro to throw a runtime error */
#define THROW(fmt, ...)                                                    \
  do {                                                                     \
    std::string msg;                                                       \
    char errMsg[2048];                                                     \
    std::sprintf(errMsg, "Exception occured! file=%s line=%d: ", __FILE__, \
                 __LINE__);                                                \
    msg += errMsg;                                                         \
    std::sprintf(errMsg, fmt, ##__VA_ARGS__);                              \
    msg += errMsg;                                                         \
    throw std::runtime_error(msg);                                         \
  } while (0)

/** macro to check for a conditional and assert on failure */
#define ASSERT(check, fmt, ...)              \
  do {                                       \
    if (!(check)) THROW(fmt, ##__VA_ARGS__); \
  } while (0)


/** check for cuda runtime API errors and assert accordingly */
#define CUDA_CHECK(call)                                                \
  do {                                                                  \
    hipError_t status = call;                                          \
    ASSERT(status == hipSuccess, "FAIL: call='%s'. Reason:%s\n", #call, \
           hipGetErrorString(status));                                 \
  } while (0)

__global__ void init_xy(double* x, double* y, double a, double b, int N) {
  const int tid = threadIdx.x;
  const int bid = blockIdx.x;
  const int idx = bid*blockDim.x + tid;
  if(idx < N) {
    x[idx] = a;
    y[idx] = b;
  }
}


__global__ void saxpy(const double* x, const double* y, const double a, const int N, double* z) {
  const int tid = threadIdx.x;
  const int bid = blockIdx.x;
  const int idx = bid*blockDim.x + tid;
  if(idx < N) {
    z[idx] = a*x[idx] + y[idx];
    // printf("z[%d]=%f * %f + %f = %f\n", idx, a, x[idx], y[idx], z[idx]);
  }
}

int checkResults(double* d_z, double a, const int N) {
  std::vector<double> h_z(N);
  CUDA_CHECK(hipMemcpy(h_z.data(), d_z, sizeof(double)*N, hipMemcpyDeviceToHost));

  // check
  int i=0;
  for(auto zi : h_z) {
    if(zi != a*1 + 2) {
      std::printf("ERROR: z[%d]=%f != %fn", i, zi, a*1 + 2);
      return -1;
    }
    i++;
  }
  return 0;
}

int main() {
  const int N = 100;
  double* d_x;
  double* d_y;
  double* d_z;
  CUDA_CHECK(hipMalloc(&d_x, sizeof(double)*N));
  CUDA_CHECK(hipMalloc(&d_y, sizeof(double)*N));
  CUDA_CHECK(hipMalloc(&d_z, sizeof(double)*N));
  

  const int threads_per_block = 64;
  const int num_blocks = ceil((double)N/threads_per_block);
  // printf("Num blocks=%d\n", num_blocks);

  init_xy<<<num_blocks, threads_per_block>>>(d_x, d_y, 1.0, 2.0, N);
  CUDA_CHECK(hipGetLastError());

  double a = 42.0;
  saxpy<<<num_blocks, threads_per_block>>>(d_x, d_y, a, N, d_z);
  CUDA_CHECK(hipGetLastError());
  
  return checkResults(d_z, a, N);
}

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

                                        # End of file scope inline assembly
	.globl	_Z22__device_stub__init_xyPdS_ddi # -- Begin function _Z22__device_stub__init_xyPdS_ddi
	.type	_Z22__device_stub__init_xyPdS_ddi,@function
_Z22__device_stub__init_xyPdS_ddi:      # @_Z22__device_stub__init_xyPdS_ddi
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	40(%rsp), %rsi
	movsd	%xmm0, (%rsi)
	leaq	32(%rsp), %rdi
	movsd	%xmm1, (%rdi)
	leaq	12(%rsp), %r8
	movl	%edx, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdi, 24(%rbx)
	movq	%r8, 32(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z7init_xyPdS_ddi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z22__device_stub__init_xyPdS_ddi, .Lfunc_end0-_Z22__device_stub__init_xyPdS_ddi
	.cfi_endproc
                                        # -- End function
	.globl	_Z20__device_stub__saxpyPKdS0_diPd # -- Begin function _Z20__device_stub__saxpyPKdS0_diPd
	.type	_Z20__device_stub__saxpyPKdS0_diPd,@function
_Z20__device_stub__saxpyPKdS0_diPd:     # @_Z20__device_stub__saxpyPKdS0_diPd
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movsd	%xmm0, (%rsi)
	leaq	12(%rsp), %r8
	movl	%edx, (%r8)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%r8, 24(%rbx)
	movq	%rdx, 32(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z5saxpyPKdS0_diPd, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z20__device_stub__saxpyPKdS0_diPd, .Lfunc_end1-_Z20__device_stub__saxpyPKdS0_diPd
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z12checkResultsPddi
.LCPI2_0:
	.quad	0x4000000000000000              # double 2
	.text
	.globl	_Z12checkResultsPddi
	.type	_Z12checkResultsPddi,@function
_Z12checkResultsPddi:                   # @_Z12checkResultsPddi
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$2112, %rsp                     # imm = 0x840
	.cfi_def_cfa_offset 2144
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movsd	%xmm0, (%rsp)                   # 8-byte Spill
	movq	%rdi, %rbx
	movslq	%esi, %r14
	leaq	8(%rsp), %r15
	leaq	64(%rsp), %rdx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_ZNSt6vectorIdSaIdEEC2EmRKS0_
	movq	(%r15), %rdi
	shlq	$3, %r14
.Ltmp0:
	movq	%rbx, %rsi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp1:
# %bb.1:
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	.LBB2_2
# %bb.11:
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rax
	cmpq	%rax, %rdi
	movsd	(%rsp), %xmm1                   # 8-byte Reload
                                        # xmm1 = mem[0],zero
	je	.LBB2_20
# %bb.12:                               # %.lr.ph
	addsd	.LCPI2_0(%rip), %xmm1
	xorl	%esi, %esi
	movq	%rdi, %rcx
.LBB2_13:                               # =>This Inner Loop Header: Depth=1
	movsd	(%rcx), %xmm0                   # xmm0 = mem[0],zero
	ucomisd	%xmm1, %xmm0
	jne	.LBB2_14
	jp	.LBB2_14
# %bb.19:                               #   in Loop: Header=BB2_13 Depth=1
	incl	%esi
	addq	$8, %rcx
	cmpq	%rax, %rcx
	jne	.LBB2_13
.LBB2_20:
	xorl	%ebx, %ebx
	jmp	.LBB2_21
.LBB2_14:
	movl	$.L.str.4, %edi
	movb	$2, %al
	callq	printf
	movl	$-1, %ebx
	movq	8(%rsp), %rdi
.LBB2_21:                               # %.loopexit
	testq	%rdi, %rdi
	je	.LBB2_23
# %bb.22:
	callq	_ZdlPv
.LBB2_23:                               # %_ZNSt6vectorIdSaIdEED2Ev.exit36
	movl	%ebx, %eax
	addq	$2112, %rsp                     # imm = 0x840
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB2_2:
	.cfi_def_cfa_offset 2144
	leaq	48(%rsp), %r15
	movq	%r15, -16(%r15)
	movq	$0, -8(%r15)
	movb	$0, (%r15)
	leaq	64(%rsp), %r14
	movl	$.L.str, %esi
	movl	$.L.str.1, %edx
	movq	%r14, %rdi
	movl	$60, %ecx
	xorl	%eax, %eax
	callq	sprintf
.Ltmp3:
	leaq	32(%rsp), %rdi
	movq	%r14, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc
.Ltmp4:
# %bb.3:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit
.Ltmp5:
	movl	%ebx, %edi
	callq	hipGetErrorString
.Ltmp6:
# %bb.4:
	leaq	64(%rsp), %rbx
	movl	$.L.str.2, %esi
	movl	$.L.str.3, %edx
	movq	%rbx, %rdi
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	sprintf
.Ltmp7:
	leaq	32(%rsp), %rdi
	movq	%rbx, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc
.Ltmp8:
# %bb.5:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit34
	movl	$16, %edi
	callq	__cxa_allocate_exception
	movq	%rax, %r14
.Ltmp9:
	leaq	32(%rsp), %rsi
	movq	%rax, %rdi
	callq	_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp10:
# %bb.6:
.Ltmp12:
	movl	$_ZTISt13runtime_error, %esi
	movl	$_ZNSt13runtime_errorD1Ev, %edx
	movq	%r14, %rdi
	callq	__cxa_throw
.Ltmp13:
# %bb.24:
.LBB2_8:
.Ltmp11:
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	__cxa_free_exception
	jmp	.LBB2_9
.LBB2_7:
.Ltmp14:
	movq	%rax, %rbx
.LBB2_9:
	movq	32(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB2_16
# %bb.10:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
	jmp	.LBB2_16
.LBB2_15:
.Ltmp2:
	movq	%rax, %rbx
.LBB2_16:
	movq	8(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB2_18
# %bb.17:
	callq	_ZdlPv
.LBB2_18:                               # %_ZNSt6vectorIdSaIdEED2Ev.exit
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	_Z12checkResultsPddi, .Lfunc_end2-_Z12checkResultsPddi
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.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 .Ltmp8-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp8
	.uleb128 .Ltmp14-.Lfunc_begin0          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp8-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp9-.Ltmp8                  #   Call between .Ltmp8 and .Ltmp9
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp9-.Lfunc_begin0           # >> Call Site 5 <<
	.uleb128 .Ltmp10-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp10
	.uleb128 .Ltmp11-.Lfunc_begin0          #     jumps to .Ltmp11
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp12-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp13-.Ltmp12                #   Call between .Ltmp12 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin0          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp13-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Lfunc_end2-.Ltmp13            #   Call between .Ltmp13 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt6vectorIdSaIdEEC2EmRKS0_,"axG",@progbits,_ZNSt6vectorIdSaIdEEC2EmRKS0_,comdat
	.weak	_ZNSt6vectorIdSaIdEEC2EmRKS0_   # -- Begin function _ZNSt6vectorIdSaIdEEC2EmRKS0_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIdSaIdEEC2EmRKS0_,@function
_ZNSt6vectorIdSaIdEEC2EmRKS0_:          # @_ZNSt6vectorIdSaIdEEC2EmRKS0_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %rax
	shrq	$60, %rax
	jne	.LBB3_7
# %bb.1:                                # %_ZNSt6vectorIdSaIdEE17_S_check_init_lenEmRKS0_.exit
	movq	%rsi, %r14
	movq	%rdi, %rbx
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rdi)
	movq	$0, 16(%rdi)
	testq	%rsi, %rsi
	je	.LBB3_2
# %bb.3:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIdE8allocateEmPKv
	movq	%rax, (%rbx)
	leaq	(%rax,%r14,8), %r15
	movq	%r15, 16(%rbx)
	movq	$0, (%rax)
	addq	$8, %rax
	cmpq	$1, %r14
	jne	.LBB3_5
# %bb.4:
	movq	%rax, %r15
	jmp	.LBB3_6
.LBB3_2:                                # %_ZNSt12_Vector_baseIdSaIdEEC2EmRKS0_.exit.thread
	movups	%xmm0, (%rbx)
	movq	$0, 16(%rbx)
	xorl	%r15d, %r15d
	jmp	.LBB3_6
.LBB3_5:                                # %_ZSt6fill_nIPdmdET_S1_T0_RKT1_.exit.loopexit.i.i.i.i
	leaq	-8(,%r14,8), %rdx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.LBB3_6:
	movq	%r15, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB3_7:
	.cfi_def_cfa_offset 32
	movl	$.L.str.9, %edi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end3:
	.size	_ZNSt6vectorIdSaIdEEC2EmRKS0_, .Lfunc_end3-_ZNSt6vectorIdSaIdEEC2EmRKS0_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI4_0:
	.quad	0x3ff0000000000000              # double 1
.LCPI4_1:
	.quad	0x4000000000000000              # double 2
.LCPI4_2:
	.quad	0x4045000000000000              # double 42
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$2120, %rsp                     # imm = 0x848
	.cfi_def_cfa_offset 2160
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	leaq	56(%rsp), %rdi
	movl	$800, %esi                      # imm = 0x320
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB4_10
# %bb.1:
	leaq	48(%rsp), %rdi
	movl	$800, %esi                      # imm = 0x320
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB4_15
# %bb.2:
	leaq	40(%rsp), %rdi
	movl	$800, %esi                      # imm = 0x320
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB4_20
# %bb.3:
	movabsq	$4294967298, %r14               # imm = 0x100000002
	leaq	62(%r14), %rbx
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_5
# %bb.4:
	movq	56(%rsp), %rdi
	movq	48(%rsp), %rsi
	movsd	.LCPI4_0(%rip), %xmm0           # xmm0 = mem[0],zero
	movsd	.LCPI4_1(%rip), %xmm1           # xmm1 = mem[0],zero
	movl	$100, %edx
	callq	_Z22__device_stub__init_xyPdS_ddi
.LBB4_5:
	callq	hipGetLastError
	testl	%eax, %eax
	jne	.LBB4_25
# %bb.6:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_8
# %bb.7:
	movq	56(%rsp), %rdi
	movq	48(%rsp), %rsi
	movq	40(%rsp), %rcx
	movsd	.LCPI4_2(%rip), %xmm0           # xmm0 = mem[0],zero
	movl	$100, %edx
	callq	_Z20__device_stub__saxpyPKdS0_diPd
.LBB4_8:
	callq	hipGetLastError
	testl	%eax, %eax
	jne	.LBB4_30
# %bb.9:
	movq	40(%rsp), %rdi
	movsd	.LCPI4_2(%rip), %xmm0           # xmm0 = mem[0],zero
	movl	$100, %esi
	callq	_Z12checkResultsPddi
	addq	$2120, %rsp                     # imm = 0x848
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB4_10:
	.cfi_def_cfa_offset 2160
	movl	%eax, %ebx
	leaq	24(%rsp), %r15
	movq	%r15, -16(%r15)
	movq	$0, -8(%r15)
	movb	$0, (%r15)
	leaq	64(%rsp), %r14
	movl	$.L.str, %esi
	movl	$.L.str.1, %edx
	movq	%r14, %rdi
	movl	$79, %ecx
	xorl	%eax, %eax
	callq	sprintf
.Ltmp15:
	leaq	8(%rsp), %rdi
	movq	%r14, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc
.Ltmp16:
# %bb.11:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit
.Ltmp17:
	movl	%ebx, %edi
	callq	hipGetErrorString
.Ltmp18:
# %bb.12:
	leaq	64(%rsp), %rbx
	movl	$.L.str.2, %esi
	movl	$.L.str.5, %edx
	movq	%rbx, %rdi
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	sprintf
.Ltmp19:
	leaq	8(%rsp), %rdi
	movq	%rbx, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc
.Ltmp20:
# %bb.13:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit45
	movl	$16, %edi
	callq	__cxa_allocate_exception
	movq	%rax, %r14
.Ltmp21:
	leaq	8(%rsp), %rsi
	movq	%rax, %rdi
	callq	_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp22:
# %bb.14:
.Ltmp24:
	movl	$_ZTISt13runtime_error, %esi
	movl	$_ZNSt13runtime_errorD1Ev, %edx
	movq	%r14, %rdi
	callq	__cxa_throw
.Ltmp25:
	jmp	.LBB4_35
.LBB4_15:
	movl	%eax, %ebx
	leaq	24(%rsp), %r15
	movq	%r15, -16(%r15)
	movq	$0, -8(%r15)
	movb	$0, (%r15)
	leaq	64(%rsp), %r14
	movl	$.L.str, %esi
	movl	$.L.str.1, %edx
	movq	%r14, %rdi
	movl	$80, %ecx
	xorl	%eax, %eax
	callq	sprintf
.Ltmp27:
	leaq	8(%rsp), %rdi
	movq	%r14, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc
.Ltmp28:
# %bb.16:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit46
.Ltmp29:
	movl	%ebx, %edi
	callq	hipGetErrorString
.Ltmp30:
# %bb.17:
	leaq	64(%rsp), %rbx
	movl	$.L.str.2, %esi
	movl	$.L.str.6, %edx
	movq	%rbx, %rdi
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	sprintf
.Ltmp31:
	leaq	8(%rsp), %rdi
	movq	%rbx, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc
.Ltmp32:
# %bb.18:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit47
	movl	$16, %edi
	callq	__cxa_allocate_exception
	movq	%rax, %r14
.Ltmp33:
	leaq	8(%rsp), %rsi
	movq	%rax, %rdi
	callq	_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp34:
# %bb.19:
.Ltmp36:
	movl	$_ZTISt13runtime_error, %esi
	movl	$_ZNSt13runtime_errorD1Ev, %edx
	movq	%r14, %rdi
	callq	__cxa_throw
.Ltmp37:
	jmp	.LBB4_35
.LBB4_20:
	movl	%eax, %ebx
	leaq	24(%rsp), %r15
	movq	%r15, -16(%r15)
	movq	$0, -8(%r15)
	movb	$0, (%r15)
	leaq	64(%rsp), %r14
	movl	$.L.str, %esi
	movl	$.L.str.1, %edx
	movq	%r14, %rdi
	movl	$81, %ecx
	xorl	%eax, %eax
	callq	sprintf
.Ltmp39:
	leaq	8(%rsp), %rdi
	movq	%r14, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc
.Ltmp40:
# %bb.21:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit51
.Ltmp41:
	movl	%ebx, %edi
	callq	hipGetErrorString
.Ltmp42:
# %bb.22:
	leaq	64(%rsp), %rbx
	movl	$.L.str.2, %esi
	movl	$.L.str.7, %edx
	movq	%rbx, %rdi
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	sprintf
.Ltmp43:
	leaq	8(%rsp), %rdi
	movq	%rbx, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc
.Ltmp44:
# %bb.23:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit52
	movl	$16, %edi
	callq	__cxa_allocate_exception
	movq	%rax, %r14
.Ltmp45:
	leaq	8(%rsp), %rsi
	movq	%rax, %rdi
	callq	_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp46:
# %bb.24:
.Ltmp48:
	movl	$_ZTISt13runtime_error, %esi
	movl	$_ZNSt13runtime_errorD1Ev, %edx
	movq	%r14, %rdi
	callq	__cxa_throw
.Ltmp49:
	jmp	.LBB4_35
.LBB4_25:
	movl	%eax, %ebp
	leaq	24(%rsp), %r15
	movq	%r15, -16(%r15)
	movq	$0, -8(%r15)
	movb	$0, (%r15)
	leaq	64(%rsp), %rbx
	movl	$.L.str, %esi
	movl	$.L.str.1, %edx
	movq	%rbx, %rdi
	movl	$89, %ecx
	xorl	%eax, %eax
	callq	sprintf
.Ltmp51:
	leaq	8(%rsp), %rdi
	movq	%rbx, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc
.Ltmp52:
# %bb.26:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit56
.Ltmp53:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp54:
# %bb.27:
	leaq	64(%rsp), %rbx
	movl	$.L.str.2, %esi
	movl	$.L.str.8, %edx
	movq	%rbx, %rdi
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	sprintf
.Ltmp55:
	leaq	8(%rsp), %rdi
	movq	%rbx, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc
.Ltmp56:
# %bb.28:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit57
	movl	$16, %edi
	callq	__cxa_allocate_exception
	movq	%rax, %r14
.Ltmp57:
	leaq	8(%rsp), %rsi
	movq	%rax, %rdi
	callq	_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp58:
# %bb.29:
.Ltmp60:
	movl	$_ZTISt13runtime_error, %esi
	movl	$_ZNSt13runtime_errorD1Ev, %edx
	movq	%r14, %rdi
	callq	__cxa_throw
.Ltmp61:
	jmp	.LBB4_35
.LBB4_30:
	movl	%eax, %ebx
	leaq	24(%rsp), %r15
	movq	%r15, -16(%r15)
	movq	$0, -8(%r15)
	movb	$0, (%r15)
	leaq	64(%rsp), %r14
	movl	$.L.str, %esi
	movl	$.L.str.1, %edx
	movq	%r14, %rdi
	movl	$93, %ecx
	xorl	%eax, %eax
	callq	sprintf
.Ltmp63:
	leaq	8(%rsp), %rdi
	movq	%r14, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc
.Ltmp64:
# %bb.31:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit61
.Ltmp65:
	movl	%ebx, %edi
	callq	hipGetErrorString
.Ltmp66:
# %bb.32:
	leaq	64(%rsp), %rbx
	movl	$.L.str.2, %esi
	movl	$.L.str.8, %edx
	movq	%rbx, %rdi
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	sprintf
.Ltmp67:
	leaq	8(%rsp), %rdi
	movq	%rbx, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc
.Ltmp68:
# %bb.33:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit62
	movl	$16, %edi
	callq	__cxa_allocate_exception
	movq	%rax, %r14
.Ltmp69:
	leaq	8(%rsp), %rsi
	movq	%rax, %rdi
	callq	_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp70:
# %bb.34:
.Ltmp72:
	movl	$_ZTISt13runtime_error, %esi
	movl	$_ZNSt13runtime_errorD1Ev, %edx
	movq	%r14, %rdi
	callq	__cxa_throw
.Ltmp73:
.LBB4_35:
.LBB4_36:
.Ltmp71:
	jmp	.LBB4_41
.LBB4_37:
.Ltmp59:
	jmp	.LBB4_41
.LBB4_38:
.Ltmp47:
	jmp	.LBB4_41
.LBB4_39:
.Ltmp35:
	jmp	.LBB4_41
.LBB4_40:
.Ltmp23:
.LBB4_41:
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	__cxa_free_exception
	jmp	.LBB4_48
.LBB4_42:
.Ltmp74:
	jmp	.LBB4_47
.LBB4_43:
.Ltmp62:
	jmp	.LBB4_47
.LBB4_44:
.Ltmp50:
	jmp	.LBB4_47
.LBB4_45:
.Ltmp38:
	jmp	.LBB4_47
.LBB4_46:
.Ltmp26:
.LBB4_47:
	movq	%rax, %rbx
.LBB4_48:
	movq	8(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB4_50
# %bb.49:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i63
	callq	_ZdlPv
.LBB4_50:
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end4:
	.size	main, .Lfunc_end4-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table4:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Lfunc_begin1-.Lfunc_begin1    # >> Call Site 1 <<
	.uleb128 .Ltmp15-.Lfunc_begin1          #   Call between .Lfunc_begin1 and .Ltmp15
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp15-.Lfunc_begin1          # >> Call Site 2 <<
	.uleb128 .Ltmp20-.Ltmp15                #   Call between .Ltmp15 and .Ltmp20
	.uleb128 .Ltmp26-.Lfunc_begin1          #     jumps to .Ltmp26
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp20-.Lfunc_begin1          # >> Call Site 3 <<
	.uleb128 .Ltmp21-.Ltmp20                #   Call between .Ltmp20 and .Ltmp21
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp21-.Lfunc_begin1          # >> Call Site 4 <<
	.uleb128 .Ltmp22-.Ltmp21                #   Call between .Ltmp21 and .Ltmp22
	.uleb128 .Ltmp23-.Lfunc_begin1          #     jumps to .Ltmp23
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp24-.Lfunc_begin1          # >> Call Site 5 <<
	.uleb128 .Ltmp25-.Ltmp24                #   Call between .Ltmp24 and .Ltmp25
	.uleb128 .Ltmp26-.Lfunc_begin1          #     jumps to .Ltmp26
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp27-.Lfunc_begin1          # >> Call Site 6 <<
	.uleb128 .Ltmp32-.Ltmp27                #   Call between .Ltmp27 and .Ltmp32
	.uleb128 .Ltmp38-.Lfunc_begin1          #     jumps to .Ltmp38
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp32-.Lfunc_begin1          # >> Call Site 7 <<
	.uleb128 .Ltmp33-.Ltmp32                #   Call between .Ltmp32 and .Ltmp33
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp33-.Lfunc_begin1          # >> Call Site 8 <<
	.uleb128 .Ltmp34-.Ltmp33                #   Call between .Ltmp33 and .Ltmp34
	.uleb128 .Ltmp35-.Lfunc_begin1          #     jumps to .Ltmp35
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp36-.Lfunc_begin1          # >> Call Site 9 <<
	.uleb128 .Ltmp37-.Ltmp36                #   Call between .Ltmp36 and .Ltmp37
	.uleb128 .Ltmp38-.Lfunc_begin1          #     jumps to .Ltmp38
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp39-.Lfunc_begin1          # >> Call Site 10 <<
	.uleb128 .Ltmp44-.Ltmp39                #   Call between .Ltmp39 and .Ltmp44
	.uleb128 .Ltmp50-.Lfunc_begin1          #     jumps to .Ltmp50
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp44-.Lfunc_begin1          # >> Call Site 11 <<
	.uleb128 .Ltmp45-.Ltmp44                #   Call between .Ltmp44 and .Ltmp45
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp45-.Lfunc_begin1          # >> Call Site 12 <<
	.uleb128 .Ltmp46-.Ltmp45                #   Call between .Ltmp45 and .Ltmp46
	.uleb128 .Ltmp47-.Lfunc_begin1          #     jumps to .Ltmp47
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp48-.Lfunc_begin1          # >> Call Site 13 <<
	.uleb128 .Ltmp49-.Ltmp48                #   Call between .Ltmp48 and .Ltmp49
	.uleb128 .Ltmp50-.Lfunc_begin1          #     jumps to .Ltmp50
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp51-.Lfunc_begin1          # >> Call Site 14 <<
	.uleb128 .Ltmp56-.Ltmp51                #   Call between .Ltmp51 and .Ltmp56
	.uleb128 .Ltmp62-.Lfunc_begin1          #     jumps to .Ltmp62
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp56-.Lfunc_begin1          # >> Call Site 15 <<
	.uleb128 .Ltmp57-.Ltmp56                #   Call between .Ltmp56 and .Ltmp57
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp57-.Lfunc_begin1          # >> Call Site 16 <<
	.uleb128 .Ltmp58-.Ltmp57                #   Call between .Ltmp57 and .Ltmp58
	.uleb128 .Ltmp59-.Lfunc_begin1          #     jumps to .Ltmp59
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp60-.Lfunc_begin1          # >> Call Site 17 <<
	.uleb128 .Ltmp61-.Ltmp60                #   Call between .Ltmp60 and .Ltmp61
	.uleb128 .Ltmp62-.Lfunc_begin1          #     jumps to .Ltmp62
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp63-.Lfunc_begin1          # >> Call Site 18 <<
	.uleb128 .Ltmp68-.Ltmp63                #   Call between .Ltmp63 and .Ltmp68
	.uleb128 .Ltmp74-.Lfunc_begin1          #     jumps to .Ltmp74
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp68-.Lfunc_begin1          # >> Call Site 19 <<
	.uleb128 .Ltmp69-.Ltmp68                #   Call between .Ltmp68 and .Ltmp69
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp69-.Lfunc_begin1          # >> Call Site 20 <<
	.uleb128 .Ltmp70-.Ltmp69                #   Call between .Ltmp69 and .Ltmp70
	.uleb128 .Ltmp71-.Lfunc_begin1          #     jumps to .Ltmp71
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp72-.Lfunc_begin1          # >> Call Site 21 <<
	.uleb128 .Ltmp73-.Ltmp72                #   Call between .Ltmp72 and .Ltmp73
	.uleb128 .Ltmp74-.Lfunc_begin1          #     jumps to .Ltmp74
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp73-.Lfunc_begin1          # >> Call Site 22 <<
	.uleb128 .Lfunc_end4-.Ltmp73            #   Call between .Ltmp73 and .Lfunc_end4
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIdE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIdE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIdE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIdE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIdE8allocateEmPKv,@function
_ZNSt15__new_allocatorIdE8allocateEmPKv: # @_ZNSt15__new_allocatorIdE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$60, %rax
	jne	.LBB5_1
# %bb.3:
	shlq	$3, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB5_1:
	.cfi_def_cfa_offset 16
	shrq	$61, %rsi
	je	.LBB5_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB5_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end5:
	.size	_ZNSt15__new_allocatorIdE8allocateEmPKv, .Lfunc_end5-_ZNSt15__new_allocatorIdE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB6_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB6_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z7init_xyPdS_ddi, %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	$_Z5saxpyPKdS0_diPd, %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_end6:
	.size	__hip_module_ctor, .Lfunc_end6-__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	.LBB7_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
.LBB7_2:
	retq
.Lfunc_end7:
	.size	__hip_module_dtor, .Lfunc_end7-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z7init_xyPdS_ddi,@object       # @_Z7init_xyPdS_ddi
	.section	.rodata,"a",@progbits
	.globl	_Z7init_xyPdS_ddi
	.p2align	3, 0x0
_Z7init_xyPdS_ddi:
	.quad	_Z22__device_stub__init_xyPdS_ddi
	.size	_Z7init_xyPdS_ddi, 8

	.type	_Z5saxpyPKdS0_diPd,@object      # @_Z5saxpyPKdS0_diPd
	.globl	_Z5saxpyPKdS0_diPd
	.p2align	3, 0x0
_Z5saxpyPKdS0_diPd:
	.quad	_Z20__device_stub__saxpyPKdS0_diPd
	.size	_Z5saxpyPKdS0_diPd, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Exception occured! file=%s line=%d: "
	.size	.L.str, 37

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/rietmann-nv/cuda_demo/master/main.hip"
	.size	.L.str.1, 100

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"FAIL: call='%s'. Reason:%s\n"
	.size	.L.str.2, 28

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"hipMemcpy(h_z.data(), d_z, sizeof(double)*N, hipMemcpyDeviceToHost)"
	.size	.L.str.3, 68

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"ERROR: z[%d]=%f != %fn"
	.size	.L.str.4, 23

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"hipMalloc(&d_x, sizeof(double)*N)"
	.size	.L.str.5, 34

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"hipMalloc(&d_y, sizeof(double)*N)"
	.size	.L.str.6, 34

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"hipMalloc(&d_z, sizeof(double)*N)"
	.size	.L.str.7, 34

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"hipGetLastError()"
	.size	.L.str.8, 18

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"cannot create std::vector larger than max_size()"
	.size	.L.str.9, 49

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

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z5saxpyPKdS0_diPd"
	.size	.L__unnamed_2, 19

	.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 _Z22__device_stub__init_xyPdS_ddi
	.addrsig_sym _Z20__device_stub__saxpyPKdS0_diPd
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z7init_xyPdS_ddi
	.addrsig_sym _Z5saxpyPKdS0_diPd
	.addrsig_sym _ZTISt13runtime_error
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z7init_xyPdS_ddi       ; -- Begin function _Z7init_xyPdS_ddi
	.globl	_Z7init_xyPdS_ddi
	.p2align	8
	.type	_Z7init_xyPdS_ddi,@function
_Z7init_xyPdS_ddi:                      ; @_Z7init_xyPdS_ddi
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x34
	s_load_b32 s3, s[0:1], 0x20
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s3, v1
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b256 s[0:7], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 3, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v6, vcc_lo, s0, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v7, vcc_lo, s1, v1, vcc_lo
	v_add_co_u32 v0, vcc_lo, s2, v0
	v_dual_mov_b32 v2, s4 :: v_dual_mov_b32 v3, s5
	v_dual_mov_b32 v4, s6 :: v_dual_mov_b32 v5, s7
	v_add_co_ci_u32_e32 v1, vcc_lo, s3, v1, vcc_lo
	global_store_b64 v[6:7], v[2:3], off
	global_store_b64 v[0:1], v[4:5], off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7init_xyPdS_ddi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 8
		.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	_Z7init_xyPdS_ddi, .Lfunc_end0-_Z7init_xyPdS_ddi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 160
; NumSgprs: 18
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 8
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z5saxpyPKdS0_diPd      ; -- Begin function _Z5saxpyPKdS0_diPd
	.globl	_Z5saxpyPKdS0_diPd
	.p2align	8
	.type	_Z5saxpyPKdS0_diPd,@function
_Z5saxpyPKdS0_diPd:                     ; @_Z5saxpyPKdS0_diPd
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x34
	s_load_b32 s3, s[0:1], 0x18
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s3, v1
	s_cbranch_execz .LBB1_2
; %bb.1:
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[2:3], s[0:1], 0x10
	v_ashrrev_i32_e32 v2, 31, v1
	s_load_b64 s[0:1], s[0:1], 0x20
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 3, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s4, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v1, vcc_lo
	v_add_co_u32 v4, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v1, vcc_lo
	v_add_co_u32 v0, vcc_lo, s0, v0
	global_load_b64 v[2:3], v[2:3], off
	global_load_b64 v[4:5], v[4:5], off
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	s_waitcnt vmcnt(0)
	v_fma_f64 v[2:3], v[2:3], s[2:3], v[4:5]
	global_store_b64 v[0:1], v[2:3], off
.LBB1_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z5saxpyPKdS0_diPd
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 6
		.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	_Z5saxpyPKdS0_diPd, .Lfunc_end1-_Z5saxpyPKdS0_diPd
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 196
; NumSgprs: 18
; NumVgprs: 6
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 6
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.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
      - .offset:         16
        .size:           8
        .value_kind:     by_value
      - .offset:         24
        .size:           8
        .value_kind:     by_value
      - .offset:         32
        .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:           _Z7init_xyPdS_ddi
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z7init_xyPdS_ddi.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .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
      - .offset:         16
        .size:           8
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .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:           _Z5saxpyPKdS0_diPd
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z5saxpyPKdS0_diPd.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     6
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
