/*
 * Parakeet
 *
 * (c) 2009-2011 Eric Hielscher, Alex Rubinsteyn
 *
 * 
 */

#include <cuda_runtime_api.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void chkError(cudaError_t rslt, char *msg) {
  if (rslt) {
    printf("Error: %s\n", msg);
    exit(1);
  }
}

int main(int argc, char **argv) {
  cudaError_t rslt;

  int numDevices;
  rslt = cudaGetDeviceCount(&numDevices);
  chkError(rslt, "couldn't get number of devices");

  cudaDeviceProp *deviceProps =
    (cudaDeviceProp*)malloc(numDevices * sizeof(cudaDeviceProp));

  int i;
  for (i = 0; i < numDevices; ++i) {
    rslt = cudaGetDeviceProperties(&deviceProps[i], i);
    chkError(rslt, "couldn't get properties for device");

    int canAccessPeer;
    rslt = cudaDeviceCanAccessPeer(&canAccessPeer, i, (i+1)%numDevices);
    chkError(rslt, "couldn't get peer access info");

    printf(
        "PROPERTIES FOR DEVICE %d\n"
        "------------------------\n"
        "\n"
        "Device name: %s\n"
        "Total Global mem: %d\n"
        "Shared mem per block: %d\n"
        "Regs per block: %d\n"
        "Warp size: %d\n"
        "Mem pitch: %d\n"
        "Max threads per block: %d\n"
        "Max threads per dim: [%d,%d,%d]\n"
        "Max Grid size: [%d,%d,%d]\n"
        "Clock rate: %d\n"
        "Total const mem: %d\n"
        "Compute capability: %d.%d\n"
        "Texture alignment: %d\n"
        "Device Overlap: %d\n"
        "Multi Processor Count: %d\n"
        "Kernel Exec Timeout Enabled: %d\n"
        "Integrated: %d\n"
        "Can Map Host Mem: %d\n"
        "Compute mode: %d\n"
        "Max texture 1D: %d\n"
        "Max texture 2D: [%d,%d]\n"
        "Max texture 3D: [%d,%d,%d]\n"
        "Max texture 1D layered: [%d,%d]\n"
        "Max texture 2D layered: [%d,%d,%d]\n"
        "Surface alignment: %d\n"
        "Concurrent kernels: %d\n"
        "ECC Enabled: %d\n"
        "PCI Bus ID: %d\n"
        "PCI Device ID: %d\n"
        "PCI Domain ID: %d\n"
        "TCC Driver: %d\n"
        "Async Engine Count: %d\n"
        "Unified Addressing: %d\n"
        "Memory Clock rate: %d\n"
        "Memory Bus Width: %d\n"
        "L2 Cache Size: %d\n"
        "Max Threads per SM: %d\n"
        "Can access peer: %d\n"
        "\n",
        i,
        deviceProps[i].name,
        deviceProps[i].totalGlobalMem,
        deviceProps[i].sharedMemPerBlock,
        deviceProps[i].regsPerBlock,
        deviceProps[i].warpSize,
        deviceProps[i].memPitch,
        deviceProps[i].maxThreadsPerBlock,
        deviceProps[i].maxThreadsDim[0],
        deviceProps[i].maxThreadsDim[1],
        deviceProps[i].maxThreadsDim[2],
        deviceProps[i].maxGridSize[0],
        deviceProps[i].maxGridSize[1],
        deviceProps[i].maxGridSize[2],
        deviceProps[i].clockRate,
        deviceProps[i].totalConstMem,
        deviceProps[i].major,
        deviceProps[i].minor,
        deviceProps[i].textureAlignment,
        deviceProps[i].deviceOverlap,
        deviceProps[i].multiProcessorCount,
        deviceProps[i].kernelExecTimeoutEnabled,
        deviceProps[i].integrated,
        deviceProps[i].canMapHostMemory,
        deviceProps[i].computeMode,
        deviceProps[i].maxTexture1D,
        deviceProps[i].maxTexture2D[0],
        deviceProps[i].maxTexture2D[1],
        deviceProps[i].maxTexture3D[0],
        deviceProps[i].maxTexture3D[1],
        deviceProps[i].maxTexture3D[2],
        deviceProps[i].maxTexture1DLayered[0],
        deviceProps[i].maxTexture1DLayered[1],
        deviceProps[i].maxTexture2DLayered[0],
        deviceProps[i].maxTexture2DLayered[1],
        deviceProps[i].maxTexture2DLayered[2],
        deviceProps[i].surfaceAlignment,
        deviceProps[i].concurrentKernels,
        deviceProps[i].ECCEnabled,
        deviceProps[i].pciBusID,
        deviceProps[i].pciDeviceID,
        deviceProps[i].pciDomainID,
        deviceProps[i].tccDriver,
        deviceProps[i].asyncEngineCount,
        deviceProps[i].unifiedAddressing,
        deviceProps[i].memoryClockRate,
        deviceProps[i].memoryBusWidth,
        deviceProps[i].l2CacheSize,
        deviceProps[i].maxThreadsPerMultiProcessor,
        canAccessPeer);
  }

  free(deviceProps);

  return 0;
}

	.file	"tmpxft_0035b0f4_00000000-6_gpu_detector.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2031:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2031:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Error: %s\n"
	.text
	.globl	_Z8chkError9cudaErrorPc
	.type	_Z8chkError9cudaErrorPc, @function
_Z8chkError9cudaErrorPc:
.LFB2027:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	je	.L2
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rdx
	movl	$2, %edi
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L2:
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z8chkError9cudaErrorPc, .-_Z8chkError9cudaErrorPc
	.section	.rodata.str1.1
.LC1:
	.string	"couldn't get number of devices"
.LC2:
	.string	"couldn't get properties for device"
.LC3:
	.string	"couldn't get peer access info"
.LC4:
	.ascii	"PROPERTIES FOR DEVICE %d\n------------------------\n\nDevice"
	.ascii	" name: %s\nTotal Global mem: %d\nShared mem per block: %d\nR"
	.ascii	"egs per block: %d\nWarp size: %d\nMem pitch: %d\nMax threads"
	.ascii	" per block: %d\nMax threads per dim: [%d,%d,%d]\nMax Grid si"
	.ascii	"ze: [%d,%d,%d]\nClock rate: %d\nTotal const mem: %d\nCompute"
	.ascii	" capability: %d.%d\nTexture alignment: %d\nDevice Overlap: %"
	.ascii	"d\nMulti Processor Count: %d\nKernel Exec Timeout Enabled: %"
	.ascii	"d\nIntegrated: %d\nCan Map Host Mem: %d\nCompute mode: %d\nM"
	.ascii	"ax texture 1D: %d\nMax texture 2D: [%d,%d]\nMax texture 3D: "
	.ascii	"[%d,%d,%d]\nMax texture 1D layered: [%d,%d]\nMax texture 2D "
	.ascii	"layered: [%d,%d,%d]\nSurface alignment: %d\n"
	.string	"Concurrent kernels: %d\nECC Enabled: %d\nPCI Bus ID: %d\nPCI Device ID: %d\nPCI Domain ID: %d\nTCC Driver: %d\nAsync Engine Count: %d\nUnified Addressing: %d\nMemory Clock rate: %d\nMemory Bus Width: %d\nL2 Cache Size: %d\nMax Threads per SM: %d\nCan access peer: %d\n\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC2(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rdi
	call	cudaGetDeviceCount@PLT
	leaq	.LC1(%rip), %rsi
	movl	%eax, %edi
	call	_Z8chkError9cudaErrorPc
	movslq	(%rsp), %rdi
	imulq	$1032, %rdi, %rdi
	call	malloc@PLT
	movq	%rax, %r12
	movq	%rax, %rbx
.L9:
	cmpl	%ebp, (%rsp)
	jle	.L13
	movl	%ebp, %esi
	movq	%rbx, %rdi
	leal	1(%rbp), %r13d
	call	cudaGetDeviceProperties_v2@PLT
	movq	%r14, %rsi
	movl	%eax, %edi
	call	_Z8chkError9cudaErrorPc
	movl	%r13d, %eax
	leaq	4(%rsp), %rdi
	movl	%ebp, %esi
	cltd
	idivl	(%rsp)
	call	cudaDeviceCanAccessPeer@PLT
	leaq	.LC3(%rip), %rsi
	movl	%eax, %edi
	call	_Z8chkError9cudaErrorPc
	movl	4(%rsp), %eax
	movq	%rbx, %rcx
	movl	%ebp, %edx
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	addq	$1032, %rbx
	movl	%r13d, %ebp
	pushq	%rax
	.cfi_def_cfa_offset 72
	movl	-408(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 80
	movl	-416(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 88
	movl	-420(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 96
	movl	-424(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 104
	movl	-428(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 112
	movl	-432(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 120
	movl	-436(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 128
	movl	-440(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 136
	movl	-444(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 144
	movl	-448(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 152
	movl	-452(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 160
	movl	-456(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 168
	movl	-532(%rbx), %eax
	pushq	-464(%rbx)
	.cfi_def_cfa_offset 176
	pushq	%rax
	.cfi_def_cfa_offset 184
	movl	-536(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 192
	movl	-540(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 200
	movl	-544(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 208
	movl	-548(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 216
	movl	-568(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 224
	movl	-572(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 232
	movl	-576(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 240
	movl	-608(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 248
	movl	-612(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 256
	movl	-624(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 264
	movl	-628(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 272
	movl	-632(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 280
	movl	-636(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 288
	movl	-640(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 296
	movl	-644(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 304
	movl	-648(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 312
	movl	-668(%rbx), %eax
	pushq	-664(%rbx)
	.cfi_def_cfa_offset 320
	pushq	%rax
	.cfi_def_cfa_offset 328
	movl	-672(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 336
	movl	-684(%rbx), %eax
	pushq	-680(%rbx)
	.cfi_def_cfa_offset 344
	pushq	%rax
	.cfi_def_cfa_offset 352
	movl	-688(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 360
	movl	-692(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 368
	movl	-696(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 376
	movl	-700(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 384
	movl	-704(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 392
	movl	-708(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 400
	movl	-712(%rbx), %eax
	pushq	%rax
	.cfi_def_cfa_offset 408
	pushq	-720(%rbx)
	.cfi_def_cfa_offset 416
	movl	-724(%rbx), %eax
	movq	-736(%rbx), %r9
	pushq	%rax
	.cfi_def_cfa_offset 424
	movl	-728(%rbx), %eax
	movq	-744(%rbx), %r8
	pushq	%rax
	.cfi_def_cfa_offset 432
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$368, %rsp
	.cfi_def_cfa_offset 64
	jmp	.L9
.L13:
	movq	%r12, %rdi
	call	free@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2028:
	.size	main, .-main
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2054:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2054:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.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:

/*
 * Parakeet
 *
 * (c) 2009-2011 Eric Hielscher, Alex Rubinsteyn
 *
 * 
 */


#include <hip/hip_runtime.h>
#include <hip/hip_runtime_api.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void chkError(hipError_t rslt, char *msg) {
  if (rslt) {
    printf("Error: %s\n", msg);
    exit(1);
  }
}

int main(int argc, char **argv) {
  hipError_t rslt;

  int numDevices;
  rslt = hipGetDeviceCount(&numDevices);
  chkError(rslt, "couldn't get number of devices");

  hipDeviceProp_t *deviceProps =
    (hipDeviceProp_t*)malloc(numDevices * sizeof(hipDeviceProp_t));

  int i;
  for (i = 0; i < numDevices; ++i) {
    rslt = hipGetDeviceProperties(&deviceProps[i], i);
    chkError(rslt, "couldn't get properties for device");

    int canAccessPeer;
    rslt = hipDeviceCanAccessPeer(&canAccessPeer, i, (i+1)%numDevices);
    chkError(rslt, "couldn't get peer access info");

    printf(
        "PROPERTIES FOR DEVICE %d\n"
        "------------------------\n"
        "\n"
        "Device name: %s\n"
        "Total Global mem: %d\n"
        "Shared mem per block: %d\n"
        "Regs per block: %d\n"
        "Warp size: %d\n"
        "Mem pitch: %d\n"
        "Max threads per block: %d\n"
        "Max threads per dim: [%d,%d,%d]\n"
        "Max Grid size: [%d,%d,%d]\n"
        "Clock rate: %d\n"
        "Total const mem: %d\n"
        "Compute capability: %d.%d\n"
        "Texture alignment: %d\n"
        "Device Overlap: %d\n"
        "Multi Processor Count: %d\n"
        "Kernel Exec Timeout Enabled: %d\n"
        "Integrated: %d\n"
        "Can Map Host Mem: %d\n"
        "Compute mode: %d\n"
        "Max texture 1D: %d\n"
        "Max texture 2D: [%d,%d]\n"
        "Max texture 3D: [%d,%d,%d]\n"
        "Max texture 1D layered: [%d,%d]\n"
        "Max texture 2D layered: [%d,%d,%d]\n"
        "Surface alignment: %d\n"
        "Concurrent kernels: %d\n"
        "ECC Enabled: %d\n"
        "PCI Bus ID: %d\n"
        "PCI Device ID: %d\n"
        "PCI Domain ID: %d\n"
        "TCC Driver: %d\n"
        "Async Engine Count: %d\n"
        "Unified Addressing: %d\n"
        "Memory Clock rate: %d\n"
        "Memory Bus Width: %d\n"
        "L2 Cache Size: %d\n"
        "Max Threads per SM: %d\n"
        "Can access peer: %d\n"
        "\n",
        i,
        deviceProps[i].name,
        deviceProps[i].totalGlobalMem,
        deviceProps[i].sharedMemPerBlock,
        deviceProps[i].regsPerBlock,
        deviceProps[i].warpSize,
        deviceProps[i].memPitch,
        deviceProps[i].maxThreadsPerBlock,
        deviceProps[i].maxThreadsDim[0],
        deviceProps[i].maxThreadsDim[1],
        deviceProps[i].maxThreadsDim[2],
        deviceProps[i].maxGridSize[0],
        deviceProps[i].maxGridSize[1],
        deviceProps[i].maxGridSize[2],
        deviceProps[i].clockRate,
        deviceProps[i].totalConstMem,
        deviceProps[i].major,
        deviceProps[i].minor,
        deviceProps[i].textureAlignment,
        deviceProps[i].deviceOverlap,
        deviceProps[i].multiProcessorCount,
        deviceProps[i].kernelExecTimeoutEnabled,
        deviceProps[i].integrated,
        deviceProps[i].canMapHostMemory,
        deviceProps[i].computeMode,
        deviceProps[i].maxTexture1D,
        deviceProps[i].maxTexture2D[0],
        deviceProps[i].maxTexture2D[1],
        deviceProps[i].maxTexture3D[0],
        deviceProps[i].maxTexture3D[1],
        deviceProps[i].maxTexture3D[2],
        deviceProps[i].maxTexture1DLayered[0],
        deviceProps[i].maxTexture1DLayered[1],
        deviceProps[i].maxTexture2DLayered[0],
        deviceProps[i].maxTexture2DLayered[1],
        deviceProps[i].maxTexture2DLayered[2],
        deviceProps[i].surfaceAlignment,
        deviceProps[i].concurrentKernels,
        deviceProps[i].ECCEnabled,
        deviceProps[i].pciBusID,
        deviceProps[i].pciDeviceID,
        deviceProps[i].pciDomainID,
        deviceProps[i].tccDriver,
        deviceProps[i].asyncEngineCount,
        deviceProps[i].unifiedAddressing,
        deviceProps[i].memoryClockRate,
        deviceProps[i].memoryBusWidth,
        deviceProps[i].l2CacheSize,
        deviceProps[i].maxThreadsPerMultiProcessor,
        canAccessPeer);
  }

  free(deviceProps);

  return 0;
}

	.text
	.file	"gpu_detector.hip"
	.globl	_Z8chkError10hipError_tPc       # -- Begin function _Z8chkError10hipError_tPc
	.type	_Z8chkError10hipError_tPc,@function
_Z8chkError10hipError_tPc:              # @_Z8chkError10hipError_tPc
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	jne	.LBB0_2
# %bb.1:
	retq
.LBB0_2:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movl	$.L.str, %edi
	xorl	%eax, %eax
	callq	printf
	movl	$1, %edi
	callq	exit
.Lfunc_end0:
	.size	_Z8chkError10hipError_tPc, .Lfunc_end0-_Z8chkError10hipError_tPc
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$312, %rsp                      # imm = 0x138
	.cfi_def_cfa_offset 368
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	leaq	8(%rsp), %rdi
	callq	hipGetDeviceCount
	testl	%eax, %eax
	jne	.LBB1_1
# %bb.3:                                # %_Z8chkError10hipError_tPc.exit
	movslq	8(%rsp), %rbx
	imulq	$1472, %rbx, %rdi               # imm = 0x5C0
	callq	malloc
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	testq	%rbx, %rbx
	jle	.LBB1_10
# %bb.4:                                # %.lr.ph.preheader
	movq	16(%rsp), %r15                  # 8-byte Reload
	xorl	%r13d, %r13d
.LBB1_5:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	hipGetDevicePropertiesR0600
	testl	%eax, %eax
	jne	.LBB1_6
# %bb.7:                                # %_Z8chkError10hipError_tPc.exit108
                                        #   in Loop: Header=BB1_5 Depth=1
	movq	%r13, %r12
	incq	%r12
	movl	%r12d, %eax
	cltd
	idivl	8(%rsp)
	leaq	12(%rsp), %rdi
	movl	%r13d, %esi
	callq	hipDeviceCanAccessPeer
	testl	%eax, %eax
	jne	.LBB1_8
# %bb.9:                                # %_Z8chkError10hipError_tPc.exit110
                                        #   in Loop: Header=BB1_5 Depth=1
	movq	288(%r15), %rcx
	movq	296(%r15), %r8
	movl	304(%r15), %r9d
	movl	308(%r15), %eax
	movq	%rax, 304(%rsp)                 # 8-byte Spill
	movl	320(%r15), %eax
	movq	%rax, 296(%rsp)                 # 8-byte Spill
	movl	324(%r15), %eax
	movq	%rax, 288(%rsp)                 # 8-byte Spill
	movl	328(%r15), %eax
	movq	%rax, 280(%rsp)                 # 8-byte Spill
	movl	332(%r15), %eax
	movq	%rax, 272(%rsp)                 # 8-byte Spill
	movl	336(%r15), %eax
	movq	%rax, 264(%rsp)                 # 8-byte Spill
	movl	340(%r15), %eax
	movq	%rax, 256(%rsp)                 # 8-byte Spill
	movl	344(%r15), %eax
	movq	%rax, 248(%rsp)                 # 8-byte Spill
	movl	348(%r15), %eax
	movq	%rax, 240(%rsp)                 # 8-byte Spill
	movl	360(%r15), %eax
	movq	%rax, 232(%rsp)                 # 8-byte Spill
	movl	364(%r15), %eax
	movq	%rax, 224(%rsp)                 # 8-byte Spill
	movl	384(%r15), %eax
	movq	%rax, 216(%rsp)                 # 8-byte Spill
	movl	388(%r15), %eax
	movq	%rax, 208(%rsp)                 # 8-byte Spill
	movl	392(%r15), %eax
	movq	%rax, 200(%rsp)                 # 8-byte Spill
	movl	396(%r15), %eax
	movq	%rax, 192(%rsp)                 # 8-byte Spill
	movl	400(%r15), %eax
	movq	%rax, 184(%rsp)                 # 8-byte Spill
	movl	404(%r15), %eax
	movq	%rax, 176(%rsp)                 # 8-byte Spill
	movl	408(%r15), %eax
	movq	%rax, 168(%rsp)                 # 8-byte Spill
	movl	420(%r15), %eax
	movq	%rax, 160(%rsp)                 # 8-byte Spill
	movl	424(%r15), %eax
	movq	%rax, 152(%rsp)                 # 8-byte Spill
	movl	456(%r15), %eax
	movq	%rax, 144(%rsp)                 # 8-byte Spill
	movl	460(%r15), %eax
	movq	%rax, 136(%rsp)                 # 8-byte Spill
	movl	464(%r15), %eax
	movq	%rax, 128(%rsp)                 # 8-byte Spill
	movl	484(%r15), %eax
	movq	%rax, 120(%rsp)                 # 8-byte Spill
	movl	488(%r15), %eax
	movq	%rax, 112(%rsp)                 # 8-byte Spill
	movl	492(%r15), %eax
	movq	%rax, 104(%rsp)                 # 8-byte Spill
	movl	496(%r15), %eax
	movq	%rax, 96(%rsp)                  # 8-byte Spill
	movl	500(%r15), %eax
	movq	%rax, 88(%rsp)                  # 8-byte Spill
	movl	576(%r15), %eax
	movq	%rax, 80(%rsp)                  # 8-byte Spill
	movl	580(%r15), %eax
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	movl	584(%r15), %eax
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	movl	588(%r15), %eax
	movq	%rax, 56(%rsp)                  # 8-byte Spill
	movl	592(%r15), %eax
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	movl	596(%r15), %eax
	movq	%rax, 40(%rsp)                  # 8-byte Spill
	movl	600(%r15), %eax
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	movl	604(%r15), %eax
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movl	608(%r15), %r11d
	movl	612(%r15), %ebp
	movl	616(%r15), %ebx
	movl	624(%r15), %r14d
	movl	12(%rsp), %r10d
	subq	$8, %rsp
	.cfi_adjust_cfa_offset 8
	movl	$.L.str.4, %edi
	movl	%r13d, %esi
	movq	%r15, %rdx
	xorl	%eax, %eax
	pushq	%r10
	.cfi_adjust_cfa_offset 8
	pushq	%r14
	.cfi_adjust_cfa_offset 8
	pushq	%rbx
	.cfi_adjust_cfa_offset 8
	pushq	%rbp
	.cfi_adjust_cfa_offset 8
	pushq	%r11
	.cfi_adjust_cfa_offset 8
	pushq	72(%rsp)                        # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	88(%rsp)                        # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	104(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	120(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	136(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	152(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	168(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	184(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	568(%r15)
	.cfi_adjust_cfa_offset 8
	pushq	208(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	224(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	240(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	256(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	272(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	288(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	304(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	320(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	336(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	352(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	368(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	384(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	400(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	416(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	432(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	448(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	464(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	368(%r15)
	.cfi_adjust_cfa_offset 8
	pushq	488(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	504(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	352(%r15)
	.cfi_adjust_cfa_offset 8
	pushq	528(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	544(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	560(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	576(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	592(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	608(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	624(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	640(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	pushq	312(%r15)
	.cfi_adjust_cfa_offset 8
	pushq	664(%rsp)                       # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	callq	printf
	addq	$368, %rsp                      # imm = 0x170
	.cfi_adjust_cfa_offset -368
	movslq	8(%rsp), %rax
	addq	$1472, %r15                     # imm = 0x5C0
	movq	%r12, %r13
	cmpq	%rax, %r12
	jl	.LBB1_5
.LBB1_10:                               # %._crit_edge
	movq	16(%rsp), %rdi                  # 8-byte Reload
	callq	free
	xorl	%eax, %eax
	addq	$312, %rsp                      # imm = 0x138
	.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
.LBB1_8:
	.cfi_def_cfa_offset 368
	movl	$.L.str, %edi
	movl	$.L.str.3, %esi
	jmp	.LBB1_2
.LBB1_6:
	movl	$.L.str, %edi
	movl	$.L.str.2, %esi
.LBB1_2:
	xorl	%eax, %eax
	callq	printf
	movl	$1, %edi
	callq	exit
.LBB1_1:
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	jmp	.LBB1_2
.Lfunc_end1:
	.size	main, .Lfunc_end1-main
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Error: %s\n"
	.size	.L.str, 11

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"couldn't get number of devices"
	.size	.L.str.1, 31

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"couldn't get properties for device"
	.size	.L.str.2, 35

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"couldn't get peer access info"
	.size	.L.str.3, 30

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"PROPERTIES FOR DEVICE %d\n------------------------\n\nDevice name: %s\nTotal Global mem: %d\nShared mem per block: %d\nRegs per block: %d\nWarp size: %d\nMem pitch: %d\nMax threads per block: %d\nMax threads per dim: [%d,%d,%d]\nMax Grid size: [%d,%d,%d]\nClock rate: %d\nTotal const mem: %d\nCompute capability: %d.%d\nTexture alignment: %d\nDevice Overlap: %d\nMulti Processor Count: %d\nKernel Exec Timeout Enabled: %d\nIntegrated: %d\nCan Map Host Mem: %d\nCompute mode: %d\nMax texture 1D: %d\nMax texture 2D: [%d,%d]\nMax texture 3D: [%d,%d,%d]\nMax texture 1D layered: [%d,%d]\nMax texture 2D layered: [%d,%d,%d]\nSurface alignment: %d\nConcurrent kernels: %d\nECC Enabled: %d\nPCI Bus ID: %d\nPCI Device ID: %d\nPCI Domain ID: %d\nTCC Driver: %d\nAsync Engine Count: %d\nUnified Addressing: %d\nMemory Clock rate: %d\nMemory Bus Width: %d\nL2 Cache Size: %d\nMax Threads per SM: %d\nCan access peer: %d\n\n"
	.size	.L.str.4, 873

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

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

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

	.end_amdgpu_metadata
