

#include <cuda_runtime.h>
#include <vector>
#include <iterator>
#include <iostream>
#include <algorithm>
#include <stdio.h>
static void print_device_info(int device_id){
  cudaDeviceProp prop;
  cudaGetDeviceProperties(&prop, device_id);
  printf(" Device ID: %d\n", device_id);
  printf(" Device name: %s\n", prop.name);
  printf(" Device architecture: %d.%d\n", prop.major, prop.minor);
  printf(" Device global memory: %d\n", prop.totalGlobalMem);
  printf(" Device clockrate: %d\n", prop.clockRate);
}
static std::vector<int> print_devices(){
  int devices;
  cudaGetDeviceCount(&devices);
  printf("CUDA Capable Devices with architecture greater than equal to 3.5\n\n");
  //int usable_devices = 0;
  std::vector<int> usable_devices;
  cudaDeviceProp prop;

  for(int device = 0; device < devices; device++){
      cudaGetDeviceProperties(&prop, device);

      if(prop.major > 3){
	  usable_devices.push_back(device);
	  printf(" Device ID: %d\n", device);
	  printf(" Device name: %s\n", prop.name);
	  printf(" Device architecture: %d.%d\n", prop.major, prop.minor);
      }else if((prop.major == 3) && (prop.minor >= 5)){
	  printf(" Device ID: %d\n", device);
	  printf(" Device name: %s\n", prop.name);
          printf(" Device architecture: %d.%d\n", prop.major, prop.minor);
	  usable_devices.push_back(device);
      }

  }
  printf("\n");
  return usable_devices;
}

extern "C" std::vector<int> select_devices(){
  bool devices_selected = false;
  bool get_input = true;
  std::vector<int> usable_devices = print_devices();
  std::vector<int> selected_devices;
  if(usable_devices.size() == 0)
    return selected_devices;
  std::string device_selected;
  printf("\n");
  do{
      printf("Select devices:\n");
      for(int iter = 0 ; iter < usable_devices.size(); iter++){

	  print_device_info(usable_devices[iter]);
	  get_input = true;

	  do{
	      try{
		  printf("y/n? ");
		  std::cin >> device_selected;
		  printf("\n");
		  std::transform(device_selected.begin(), device_selected.end(),device_selected.begin(), ::toupper);
		  if(device_selected == "Y" || device_selected == "YES"){
		      selected_devices.push_back(usable_devices[iter]);
		  }else if (device_selected != "N" && device_selected != "NO"){
		      throw;
		  }
		  get_input = false;
	      }catch(...){
		  printf("Error in selection\n");
	      }
	  }while(get_input);

      }

      get_input = true;
      printf("Devices selected:\n");
      do{
	  for(int iter = 0; iter < selected_devices.size(); iter++){
	      print_device_info(selected_devices[iter]);
	  }
	  try{
	      printf("Is this right (y/n)? ");
	      std::cin >> device_selected;
	      printf("\n");
	      std::transform(device_selected.begin(), device_selected.end(),device_selected.begin(), ::toupper);
	      if(device_selected == "Y" || device_selected == "YES"){
		 devices_selected = true;
	      }else if (device_selected != "N" && device_selected != "NO"){
		  throw;
	      }
	      get_input = false;
	  }catch(...){
	      printf("Error in selection\n");
	  }
      }while(get_input);
      if(devices_selected == false)
	selected_devices.clear();
  }while(devices_selected == false);

  return selected_devices;
}

	.file	"tmpxft_003a2189_00000000-6_cudafphi_device_functions.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" Device ID: %d\n"
.LC1:
	.string	" Device name: %s\n"
.LC2:
	.string	" Device architecture: %d.%d\n"
.LC3:
	.string	" Device global memory: %d\n"
.LC4:
	.string	" Device clockrate: %d\n"
#NO_APP
	.text
	.type	_ZL17print_device_infoi, @function
_ZL17print_device_infoi:
.LFB4270:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edi, %esi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	subq	$1048, %rsp
	.cfi_def_cfa_offset 1072
	movq	%fs:40, %rax
	movq	%rax, 1032(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	movq	%rbp, %rdi
	call	cudaGetDeviceProperties_v2@PLT
	movl	%ebx, %edx
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	%rbp, %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movl	364(%rsp), %ecx
	movl	$2, %edi
	xorl	%eax, %eax
	movl	360(%rsp), %edx
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	288(%rsp), %rdx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	348(%rsp), %edx
	xorl	%eax, %eax
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	1032(%rsp), %rax
	subq	%fs:40, %rax
	je	.L2
	call	__stack_chk_fail@PLT
.L2:
	addq	$1048, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4270:
	.size	_ZL17print_device_infoi, .-_ZL17print_device_infoi
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4292:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4292:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4315:
	.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
.LFE4315:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorIiSaIiEED2Ev,"axG",@progbits,_ZNSt6vectorIiSaIiEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEED2Ev
	.type	_ZNSt6vectorIiSaIiEED2Ev, @function
_ZNSt6vectorIiSaIiEED2Ev:
.LFB4625:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L8
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L8:
	ret
	.cfi_endproc
.LFE4625:
	.size	_ZNSt6vectorIiSaIiEED2Ev, .-_ZNSt6vectorIiSaIiEED2Ev
	.weak	_ZNSt6vectorIiSaIiEED1Ev
	.set	_ZNSt6vectorIiSaIiEED1Ev,_ZNSt6vectorIiSaIiEED2Ev
	.section	.text._ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_,"axG",@progbits,_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_,comdat
	.weak	_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_
	.type	_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_, @function
_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_:
.LFB4640:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movq	8(%rdi), %r12
	movq	%rsi, %rdi
	movq	%rsi, 8(%rsp)
	call	strlen@PLT
	movq	8(%rsp), %rsi
	movq	%rax, %rdx
	xorl	%eax, %eax
	cmpq	%rdx, %r12
	jne	.L10
	movb	$1, %al
	testq	%r12, %r12
	je	.L10
	movq	(%rbx), %rdi
	movq	%r12, %rdx
	call	memcmp@PLT
	testl	%eax, %eax
	sete	%al
.L10:
	addq	$24, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4640:
	.size	_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_, .-_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_
	.section	.rodata._ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_.str1.1,"aMS",@progbits,1
.LC5:
	.string	"vector::_M_realloc_insert"
	.section	.text._ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.type	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_, @function
_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_:
.LFB4796:
	.cfi_startproc
	endbr64
	movabsq	$2305843009213693951, %rcx
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	8(%rdi), %rax
	movq	(%rdi), %r14
	movq	%rax, %rbx
	movq	%rax, (%rsp)
	subq	%r14, %rbx
	sarq	$2, %rbx
	cmpq	%rcx, %rbx
	jne	.L16
	leaq	.LC5(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L16:
	cmpq	%r14, (%rsp)
	movl	$1, %eax
	movq	%rsi, %r15
	movq	%rdi, %r13
	cmovne	%rbx, %rax
	movq	%rsi, %rbp
	addq	%rax, %rbx
	setc	%al
	subq	%r14, %r15
	movzbl	%al, %eax
	testq	%rax, %rax
	jne	.L26
	xorl	%r12d, %r12d
	testq	%rbx, %rbx
	je	.L21
	movabsq	$2305843009213693951, %rax
	cmpq	%rax, %rbx
	cmova	%rax, %rbx
	jmp	.L20
.L26:
	movq	%rcx, %rbx
.L20:
	leaq	0(,%rbx,4), %rdi
	movq	%rdx, 8(%rsp)
	call	_Znwm@PLT
	movq	8(%rsp), %rdx
	movq	%rax, %r12
.L21:
	movl	(%rdx), %eax
	movl	%eax, (%r12,%r15)
	testq	%r15, %r15
	jle	.L22
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r12, %rdi
	call	memmove@PLT
.L22:
	movq	(%rsp), %rax
	leaq	4(%r12,%r15), %rdx
	subq	%rbp, %rax
	testq	%rax, %rax
	jle	.L23
	movq	%rdx, %rdi
	movq	%rbp, %rsi
	movq	%rax, %rcx
	rep movsb
.L23:
	leaq	(%rdx,%rax), %rbp
	testq	%r14, %r14
	je	.L24
	movq	16(%r13), %rsi
	movq	%r14, %rdi
	subq	%r14, %rsi
	call	_ZdlPvm@PLT
.L24:
	leaq	(%r12,%rbx,4), %rax
	movq	%r12, 0(%r13)
	movq	%rbp, 8(%r13)
	movq	%rax, 16(%r13)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4796:
	.size	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_, .-_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.section	.text._ZNSt6vectorIiSaIiEE9push_backERKi,"axG",@progbits,_ZNSt6vectorIiSaIiEE9push_backERKi,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEE9push_backERKi
	.type	_ZNSt6vectorIiSaIiEE9push_backERKi, @function
_ZNSt6vectorIiSaIiEE9push_backERKi:
.LFB4627:
	.cfi_startproc
	endbr64
	movq	%rsi, %rdx
	movq	8(%rdi), %rsi
	cmpq	16(%rdi), %rsi
	je	.L34
	movl	(%rdx), %eax
	addq	$4, %rsi
	movl	%eax, -4(%rsi)
	movq	%rsi, 8(%rdi)
	ret
.L34:
	jmp	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.cfi_endproc
.LFE4627:
	.size	_ZNSt6vectorIiSaIiEE9push_backERKi, .-_ZNSt6vectorIiSaIiEE9push_backERKi
	.section	.rodata.str1.1
.LC6:
	.string	"CUDA Capable Devices with architecture greater than equal to 3.5\n\n"
.LC7:
	.string	"\n"
	.text
	.type	_ZL13print_devicesv, @function
_ZL13print_devicesv:
.LFB4271:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4271
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rdi, %rbx
	subq	$1064, %rsp
	.cfi_def_cfa_offset 1104
	movq	%fs:40, %rax
	movq	%rax, 1048(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
.LEHB0:
	call	cudaGetDeviceCount@PLT
	leaq	.LC6(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.LEHE0:
	xorl	%eax, %eax
	movq	%rax, (%rbx)
	movq	%rax, 8(%rbx)
	movq	%rax, 16(%rbx)
.L38:
	movl	%ebp, 12(%rsp)
	cmpl	%ebp, 8(%rsp)
	jle	.L49
	leaq	16(%rsp), %r12
	movl	%ebp, %esi
	movq	%r12, %rdi
.LEHB1:
	call	cudaGetDeviceProperties_v2@PLT
	cmpl	$3, 376(%rsp)
	jle	.L39
	leaq	12(%rsp), %rsi
	movq	%rbx, %rdi
	call	_ZNSt6vectorIiSaIiEE9push_backERKi
	movl	%ebp, %edx
	movq	%r13, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r12, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	380(%rsp), %ecx
	movl	376(%rsp), %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
.L40:
	incl	%ebp
	jmp	.L38
.L39:
	jne	.L40
	cmpl	$4, 380(%rsp)
	jle	.L40
	movl	%ebp, %edx
	leaq	.LC0(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r12, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	380(%rsp), %ecx
	movl	376(%rsp), %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	leaq	12(%rsp), %rsi
	movq	%rbx, %rdi
	call	_ZNSt6vectorIiSaIiEE9push_backERKi
	jmp	.L40
.L49:
	leaq	.LC7(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.LEHE1:
	jmp	.L50
.L45:
	endbr64
	movq	%rax, %rbp
.L42:
	movq	%rbx, %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movq	1048(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L48
	movq	%rbp, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L50:
	movq	1048(%rsp), %rax
	subq	%fs:40, %rax
	je	.L44
.L48:
	call	__stack_chk_fail@PLT
.L44:
	addq	$1064, %rsp
	.cfi_def_cfa_offset 40
	movq	%rbx, %rax
	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
.LFE4271:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4271:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4271-.LLSDACSB4271
.LLSDACSB4271:
	.uleb128 .LEHB0-.LFB4271
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4271
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L45-.LFB4271
	.uleb128 0
	.uleb128 .LEHB2-.LFB4271
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE4271:
	.text
	.size	_ZL13print_devicesv, .-_ZL13print_devicesv
	.section	.rodata.str1.1
.LC8:
	.string	"Select devices:\n"
.LC9:
	.string	"y/n? "
.LC10:
	.string	"Y"
.LC11:
	.string	"YES"
.LC12:
	.string	"N"
.LC13:
	.string	"NO"
.LC14:
	.string	"Devices selected:\n"
.LC15:
	.string	"Is this right (y/n)? "
.LC16:
	.string	"Error in selection\n"
	.text
	.globl	select_devices
	.type	select_devices, @function
select_devices:
.LFB4288:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4288
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 16(%rsp)
.LEHB3:
	call	_ZL13print_devicesv
.LEHE3:
	movq	40(%rsp), %rbp
	movq	32(%rsp), %r13
	xorl	%edx, %edx
	movq	%rdx, (%rbx)
	movq	%rdx, 8(%rbx)
	movq	%rdx, 16(%rbx)
	cmpq	%rbp, %r13
	je	.L52
	leaq	72(%rsp), %rax
	movl	$2, %edi
	movb	$0, 72(%rsp)
	leaq	.LC7(%rip), %rsi
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	movq	%rax, 64(%rsp)
	xorl	%eax, %eax
.LEHB4:
	call	__printf_chk@PLT
	subq	%r13, %rbp
	sarq	$2, %rbp
.L68:
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r13, %r12
	xorl	%r14d, %r14d
.L53:
	cmpq	%rbp, %r14
	je	.L88
	movl	(%r12), %edi
	call	_ZL17print_device_infoi
.LEHE4:
.L71:
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
.LEHB5:
	call	__printf_chk@PLT
	leaq	56(%rsp), %rax
	leaq	_ZSt3cin(%rip), %rdi
	movq	%rax, %rsi
	movq	%rax, 8(%rsp)
	call	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	leaq	.LC7(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	56(%rsp), %r15
	movq	64(%rsp), %rax
	addq	%r15, %rax
	movq	%rax, 24(%rsp)
.L54:
	cmpq	%r15, 24(%rsp)
	je	.L89
	movsbl	(%r15), %edi
	incq	%r15
	call	toupper@PLT
	movb	%al, -1(%r15)
	jmp	.L54
.L89:
	movq	8(%rsp), %rdi
	leaq	.LC10(%rip), %rsi
	call	_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_
	testb	%al, %al
	jne	.L56
	movq	8(%rsp), %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_
	testb	%al, %al
	je	.L57
.L56:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	_ZNSt6vectorIiSaIiEE9push_backERKi
	jmp	.L58
.L57:
	movq	8(%rsp), %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_
	testb	%al, %al
	jne	.L58
	movq	8(%rsp), %rdi
	leaq	.LC13(%rip), %rsi
	call	_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_
	testb	%al, %al
	jne	.L58
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L85
	call	__cxa_rethrow@PLT
.LEHE5:
.L58:
	incq	%r14
	addq	$4, %r12
	jmp	.L53
.L88:
	leaq	.LC14(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
.LEHB6:
	call	__printf_chk@PLT
	leaq	.LC15(%rip), %r14
.L75:
	xorl	%r12d, %r12d
.L61:
	movq	(%rbx), %rdx
	movq	8(%rbx), %rax
	subq	%rdx, %rax
	sarq	$2, %rax
	cmpq	%rax, %r12
	jnb	.L90
	movl	(%rdx,%r12,4), %edi
	call	_ZL17print_device_infoi
.LEHE6:
	incq	%r12
	jmp	.L61
.L90:
	movq	%r14, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
.LEHB7:
	call	__printf_chk@PLT
	leaq	56(%rsp), %rax
	leaq	_ZSt3cin(%rip), %rdi
	movq	%rax, %rsi
	movq	%rax, 8(%rsp)
	call	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	leaq	.LC7(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	56(%rsp), %r12
	movq	64(%rsp), %r15
	addq	%r12, %r15
.L63:
	cmpq	%r15, %r12
	je	.L91
	movsbl	(%r12), %edi
	incq	%r12
	call	toupper@PLT
	movb	%al, -1(%r12)
	jmp	.L63
.L91:
	movq	8(%rsp), %rdi
	leaq	.LC10(%rip), %rsi
	call	_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_
	testb	%al, %al
	jne	.L65
	movq	8(%rsp), %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_
	testb	%al, %al
	jne	.L65
	movq	8(%rsp), %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_
	testb	%al, %al
	jne	.L66
	movq	8(%rsp), %rdi
	leaq	.LC13(%rip), %rsi
	call	_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_
	testb	%al, %al
	jne	.L66
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L85
	call	__cxa_rethrow@PLT
.LEHE7:
.L65:
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L52
.L66:
	movq	(%rbx), %rax
	cmpq	8(%rbx), %rax
	je	.L68
	movq	%rax, 8(%rbx)
	jmp	.L68
.L52:
	movq	16(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L78
	jmp	.L85
.L80:
	endbr64
	movq	%rax, %rdi
.L70:
	call	__cxa_begin_catch@PLT
	leaq	.LC16(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
.LEHB8:
	call	__printf_chk@PLT
.LEHE8:
.LEHB9:
	call	__cxa_end_catch@PLT
.LEHE9:
	jmp	.L71
.L81:
	endbr64
	movq	%rax, %rbp
.L72:
	call	__cxa_end_catch@PLT
	jmp	.L73
.L82:
	endbr64
	movq	%rax, %rdi
.L74:
	call	__cxa_begin_catch@PLT
	leaq	.LC16(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
.LEHB10:
	call	__printf_chk@PLT
.LEHE10:
.LEHB11:
	call	__cxa_end_catch@PLT
.LEHE11:
	jmp	.L75
.L83:
	endbr64
	movq	%rax, %rbp
.L76:
	call	__cxa_end_catch@PLT
	jmp	.L73
.L79:
	endbr64
	movq	%rax, %rbp
.L73:
	leaq	56(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbx, %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movq	16(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L85
	movq	%rbp, %rdi
.LEHB12:
	call	_Unwind_Resume@PLT
.LEHE12:
.L85:
	call	__stack_chk_fail@PLT
.L78:
	addq	$104, %rsp
	.cfi_def_cfa_offset 56
	movq	%rbx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4288:
	.section	.gcc_except_table
	.align 4
.LLSDA4288:
	.byte	0xff
	.byte	0x9b
	.uleb128 .LLSDATT4288-.LLSDATTD4288
.LLSDATTD4288:
	.byte	0x1
	.uleb128 .LLSDACSE4288-.LLSDACSB4288
.LLSDACSB4288:
	.uleb128 .LEHB3-.LFB4288
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB4-.LFB4288
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L79-.LFB4288
	.uleb128 0
	.uleb128 .LEHB5-.LFB4288
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L80-.LFB4288
	.uleb128 0x1
	.uleb128 .LEHB6-.LFB4288
	.uleb128 .LEHE6-.LEHB6
	.uleb128 .L79-.LFB4288
	.uleb128 0
	.uleb128 .LEHB7-.LFB4288
	.uleb128 .LEHE7-.LEHB7
	.uleb128 .L82-.LFB4288
	.uleb128 0x1
	.uleb128 .LEHB8-.LFB4288
	.uleb128 .LEHE8-.LEHB8
	.uleb128 .L81-.LFB4288
	.uleb128 0
	.uleb128 .LEHB9-.LFB4288
	.uleb128 .LEHE9-.LEHB9
	.uleb128 .L79-.LFB4288
	.uleb128 0
	.uleb128 .LEHB10-.LFB4288
	.uleb128 .LEHE10-.LEHB10
	.uleb128 .L83-.LFB4288
	.uleb128 0
	.uleb128 .LEHB11-.LFB4288
	.uleb128 .LEHE11-.LEHB11
	.uleb128 .L79-.LFB4288
	.uleb128 0
	.uleb128 .LEHB12-.LFB4288
	.uleb128 .LEHE12-.LEHB12
	.uleb128 0
	.uleb128 0
.LLSDACSE4288:
	.byte	0x1
	.byte	0
	.align 4
	.long	0

.LLSDATT4288:
	.text
	.size	select_devices, .-select_devices
	.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
	.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 <vector>
#include <iterator>
#include <iostream>
#include <algorithm>
#include <stdio.h>
static void print_device_info(int device_id){
  hipDeviceProp_t prop;
  hipGetDeviceProperties(&prop, device_id);
  printf(" Device ID: %d\n", device_id);
  printf(" Device name: %s\n", prop.name);
  printf(" Device architecture: %d.%d\n", prop.major, prop.minor);
  printf(" Device global memory: %d\n", prop.totalGlobalMem);
  printf(" Device clockrate: %d\n", prop.clockRate);
}
static std::vector<int> print_devices(){
  int devices;
  hipGetDeviceCount(&devices);
  printf("CUDA Capable Devices with architecture greater than equal to 3.5\n\n");
  //int usable_devices = 0;
  std::vector<int> usable_devices;
  hipDeviceProp_t prop;

  for(int device = 0; device < devices; device++){
      hipGetDeviceProperties(&prop, device);

      if(prop.major > 3){
	  usable_devices.push_back(device);
	  printf(" Device ID: %d\n", device);
	  printf(" Device name: %s\n", prop.name);
	  printf(" Device architecture: %d.%d\n", prop.major, prop.minor);
      }else if((prop.major == 3) && (prop.minor >= 5)){
	  printf(" Device ID: %d\n", device);
	  printf(" Device name: %s\n", prop.name);
          printf(" Device architecture: %d.%d\n", prop.major, prop.minor);
	  usable_devices.push_back(device);
      }

  }
  printf("\n");
  return usable_devices;
}

extern "C" std::vector<int> select_devices(){
  bool devices_selected = false;
  bool get_input = true;
  std::vector<int> usable_devices = print_devices();
  std::vector<int> selected_devices;
  if(usable_devices.size() == 0)
    return selected_devices;
  std::string device_selected;
  printf("\n");
  do{
      printf("Select devices:\n");
      for(int iter = 0 ; iter < usable_devices.size(); iter++){

	  print_device_info(usable_devices[iter]);
	  get_input = true;

	  do{
	      try{
		  printf("y/n? ");
		  std::cin >> device_selected;
		  printf("\n");
		  std::transform(device_selected.begin(), device_selected.end(),device_selected.begin(), ::toupper);
		  if(device_selected == "Y" || device_selected == "YES"){
		      selected_devices.push_back(usable_devices[iter]);
		  }else if (device_selected != "N" && device_selected != "NO"){
		      throw;
		  }
		  get_input = false;
	      }catch(...){
		  printf("Error in selection\n");
	      }
	  }while(get_input);

      }

      get_input = true;
      printf("Devices selected:\n");
      do{
	  for(int iter = 0; iter < selected_devices.size(); iter++){
	      print_device_info(selected_devices[iter]);
	  }
	  try{
	      printf("Is this right (y/n)? ");
	      std::cin >> device_selected;
	      printf("\n");
	      std::transform(device_selected.begin(), device_selected.end(),device_selected.begin(), ::toupper);
	      if(device_selected == "Y" || device_selected == "YES"){
		 devices_selected = true;
	      }else if (device_selected != "N" && device_selected != "NO"){
		  throw;
	      }
	      get_input = false;
	  }catch(...){
	      printf("Error in selection\n");
	  }
      }while(get_input);
      if(devices_selected == false)
	selected_devices.clear();
  }while(devices_selected == false);

  return selected_devices;
}

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

                                        # End of file scope inline assembly
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function select_devices
.LCPI0_0:
	.zero	16
	.text
	.globl	select_devices
	.type	select_devices,@function
select_devices:                         # @select_devices
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$1528, %rsp                     # imm = 0x5F8
	.cfi_def_cfa_offset 1584
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdi, %rbx
	leaq	52(%rsp), %r14
	movq	%r14, %rdi
	callq	hipGetDeviceCount
	movl	$.Lstr.4, %edi
	callq	puts@PLT
	xorps	%xmm0, %xmm0
	movaps	%xmm0, 16(%rsp)
	movq	$0, 32(%rsp)
	movl	$0, 12(%rsp)
	cmpl	$0, (%r14)
	jle	.LBB0_19
# %bb.1:                                # %.lr.ph.i
	leaq	56(%rsp), %r14
	leaq	16(%rsp), %r15
	leaq	12(%rsp), %r12
	xorl	%esi, %esi
.LBB0_2:                                # =>This Inner Loop Header: Depth=1
.Ltmp0:
	movq	%r14, %rdi
	callq	hipGetDevicePropertiesR0600
.Ltmp1:
# %bb.3:                                #   in Loop: Header=BB0_2 Depth=1
	movl	416(%rsp), %eax
	cmpl	$4, %eax
	jl	.LBB0_13
# %bb.4:                                #   in Loop: Header=BB0_2 Depth=1
	movq	24(%rsp), %rax
	cmpq	32(%rsp), %rax
	je	.LBB0_6
# %bb.5:                                #   in Loop: Header=BB0_2 Depth=1
	movl	12(%rsp), %esi
	movl	%esi, (%rax)
	addq	$4, %rax
	movq	%rax, 24(%rsp)
	jmp	.LBB0_8
.LBB0_13:                               #   in Loop: Header=BB0_2 Depth=1
	cmpl	$3, %eax
	jne	.LBB0_18
# %bb.14:                               #   in Loop: Header=BB0_2 Depth=1
	cmpl	$5, 420(%rsp)
	jl	.LBB0_18
# %bb.15:                               #   in Loop: Header=BB0_2 Depth=1
	movl	12(%rsp), %esi
	movl	$.L.str.11, %edi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.12, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	printf
	movl	416(%rsp), %esi
	movl	420(%rsp), %edx
	movl	$.L.str.13, %edi
	xorl	%eax, %eax
	callq	printf
	movq	24(%rsp), %rsi
	cmpq	32(%rsp), %rsi
	je	.LBB0_17
# %bb.16:                               #   in Loop: Header=BB0_2 Depth=1
	movl	12(%rsp), %eax
	movl	%eax, (%rsi)
	addq	$4, %rsi
	movq	%rsi, 24(%rsp)
	jmp	.LBB0_18
.LBB0_6:                                #   in Loop: Header=BB0_2 Depth=1
.Ltmp4:
	movq	%r15, %rdi
	movq	%rax, %rsi
	movq	%r12, %rdx
	callq	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
.Ltmp5:
# %bb.7:                                # %._ZNSt6vectorIiSaIiEE9push_backERKi.exit_crit_edge.i
                                        #   in Loop: Header=BB0_2 Depth=1
	movl	12(%rsp), %esi
.LBB0_8:                                # %_ZNSt6vectorIiSaIiEE9push_backERKi.exit.i
                                        #   in Loop: Header=BB0_2 Depth=1
	movl	$.L.str.11, %edi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.12, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	printf
	movl	416(%rsp), %esi
	movl	420(%rsp), %edx
	movl	$.L.str.13, %edi
	xorl	%eax, %eax
	callq	printf
.LBB0_18:                               # %_ZNSt6vectorIiSaIiEE9push_backERKi.exit7.i
                                        #   in Loop: Header=BB0_2 Depth=1
	movl	12(%rsp), %esi
	incl	%esi
	movl	%esi, 12(%rsp)
	cmpl	52(%rsp), %esi
	jl	.LBB0_2
	jmp	.LBB0_19
.LBB0_17:                               #   in Loop: Header=BB0_2 Depth=1
.Ltmp2:
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
.Ltmp3:
	jmp	.LBB0_18
.LBB0_19:                               # %_ZL13print_devicesv.exit
	movl	$10, %edi
	callq	putchar@PLT
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rbx)
	movq	$0, 16(%rbx)
	movq	24(%rsp), %rdi
	cmpq	16(%rsp), %rdi
	je	.LBB0_69
# %bb.20:
	leaq	72(%rsp), %rax
	movq	%rax, -16(%rax)
	movq	$0, -8(%rax)
	movb	$0, (%rax)
	movl	$10, %edi
	callq	putchar@PLT
	leaq	56(%rsp), %r14
.LBB0_21:                               # %_ZNSt6vectorIiSaIiEE5clearEv.exit
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_23 Depth 2
                                        #       Child Loop BB0_24 Depth 3
                                        #         Child Loop BB0_27 Depth 4
                                        #     Child Loop BB0_44 Depth 2
                                        #       Child Loop BB0_46 Depth 3
                                        #       Child Loop BB0_51 Depth 3
	movl	$.Lstr, %edi
	callq	puts@PLT
	movq	16(%rsp), %rax
	cmpq	%rax, 24(%rsp)
	je	.LBB0_43
# %bb.22:                               # %.lr.ph.preheader
                                        #   in Loop: Header=BB0_21 Depth=1
	xorl	%r15d, %r15d
.LBB0_23:                               # %.lr.ph
                                        #   Parent Loop BB0_21 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB0_24 Depth 3
                                        #         Child Loop BB0_27 Depth 4
	movl	(%rax,%r15,4), %edi
.Ltmp7:
	callq	_ZL17print_device_infoi
.Ltmp8:
.LBB0_24:                               # %_ZNSt6vectorIiSaIiEE9push_backERKi.exit
                                        #   Parent Loop BB0_21 Depth=1
                                        #     Parent Loop BB0_23 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB0_27 Depth 4
	movl	$.L.str.2, %edi
	xorl	%eax, %eax
	callq	printf
.Ltmp10:
	movl	$_ZSt3cin, %edi
	movq	%r14, %rsi
	callq	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE
.Ltmp11:
# %bb.25:                               #   in Loop: Header=BB0_24 Depth=3
	movl	$10, %edi
	callq	putchar@PLT
	movq	64(%rsp), %r13
	testq	%r13, %r13
	je	.LBB0_34
# %bb.26:                               # %.lr.ph.i40.preheader
                                        #   in Loop: Header=BB0_24 Depth=3
	movq	56(%rsp), %rbp
	xorl	%r12d, %r12d
.LBB0_27:                               # %.lr.ph.i40
                                        #   Parent Loop BB0_21 Depth=1
                                        #     Parent Loop BB0_23 Depth=2
                                        #       Parent Loop BB0_24 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	movsbl	(%rbp,%r12), %edi
	callq	toupper
	movb	%al, (%rbp,%r12)
	incq	%r12
	cmpq	%r12, %r13
	jne	.LBB0_27
# %bb.28:                               # %_ZSt9transformIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEES9_PDoFiiEET0_T_SD_SC_T1_.exit
                                        #   in Loop: Header=BB0_24 Depth=3
	movq	64(%rsp), %rdx
	cmpq	$3, %rdx
	je	.LBB0_35
# %bb.29:                               # %_ZSt9transformIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEES9_PDoFiiEET0_T_SD_SC_T1_.exit
                                        #   in Loop: Header=BB0_24 Depth=3
	cmpq	$2, %rdx
	je	.LBB0_59
# %bb.30:                               # %_ZSt9transformIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEES9_PDoFiiEET0_T_SD_SC_T1_.exit
                                        #   in Loop: Header=BB0_24 Depth=3
	cmpq	$1, %rdx
	jne	.LBB0_34
# %bb.31:                               # %_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit
                                        #   in Loop: Header=BB0_24 Depth=3
	movq	56(%rsp), %rdi
	cmpb	$89, (%rdi)
	je	.LBB0_36
# %bb.32:                               # %_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit
                                        #   in Loop: Header=BB0_24 Depth=3
	movl	$.L.str.5, %esi
	jmp	.LBB0_33
.LBB0_59:                               # %_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit45
                                        #   in Loop: Header=BB0_24 Depth=3
	movq	56(%rsp), %rdi
	movl	$.L.str.6, %esi
.LBB0_33:                               # %_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit
                                        #   in Loop: Header=BB0_24 Depth=3
	callq	bcmp@PLT
	testl	%eax, %eax
	je	.LBB0_42
.LBB0_34:                               # %_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit45.thread
                                        #   in Loop: Header=BB0_24 Depth=3
.Ltmp14:
	callq	__cxa_rethrow
.Ltmp15:
	jmp	.LBB0_77
.LBB0_35:                               # %_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit42
                                        #   in Loop: Header=BB0_24 Depth=3
	movq	56(%rsp), %rdi
	movl	$.L.str.4, %esi
	callq	bcmp@PLT
	testl	%eax, %eax
	jne	.LBB0_34
.LBB0_36:                               # %_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit.thread
                                        #   in Loop: Header=BB0_24 Depth=3
	leaq	(,%r15,4), %rdx
	addq	16(%rsp), %rdx
	movq	8(%rbx), %rsi
	cmpq	16(%rbx), %rsi
	jne	.LBB0_37
# %bb.41:                               #   in Loop: Header=BB0_24 Depth=3
.Ltmp12:
	movq	%rbx, %rdi
	callq	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
.Ltmp13:
	jmp	.LBB0_42
.LBB0_40:                               #   in Loop: Header=BB0_24 Depth=3
.Ltmp16:
	movq	%rax, %rdi
	callq	__cxa_begin_catch
	movl	$.Lstr.3, %edi
	callq	puts@PLT
.Ltmp17:
	callq	__cxa_end_catch
.Ltmp18:
	jmp	.LBB0_24
.LBB0_37:                               #   in Loop: Header=BB0_23 Depth=2
	movl	(%rdx), %eax
	movl	%eax, (%rsi)
	addq	$4, %rsi
	movq	%rsi, 8(%rbx)
.LBB0_42:                               # %_ZNSt6vectorIiSaIiEE9push_backERKi.exit.thread
                                        #   in Loop: Header=BB0_23 Depth=2
	incq	%r15
	movq	16(%rsp), %rax
	movq	24(%rsp), %rcx
	subq	%rax, %rcx
	sarq	$2, %rcx
	cmpq	%r15, %rcx
	ja	.LBB0_23
.LBB0_43:                               # %._crit_edge
                                        #   in Loop: Header=BB0_21 Depth=1
	movl	$.Lstr.1, %edi
	callq	puts@PLT
.LBB0_44:                               #   Parent Loop BB0_21 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB0_46 Depth 3
                                        #       Child Loop BB0_51 Depth 3
	movq	(%rbx), %rax
	cmpq	%rax, 8(%rbx)
	je	.LBB0_48
# %bb.45:                               # %.lr.ph100.preheader
                                        #   in Loop: Header=BB0_44 Depth=2
	xorl	%r15d, %r15d
.LBB0_46:                               # %.lr.ph100
                                        #   Parent Loop BB0_21 Depth=1
                                        #     Parent Loop BB0_44 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	(%rax,%r15,4), %edi
.Ltmp20:
	callq	_ZL17print_device_infoi
.Ltmp21:
# %bb.47:                               #   in Loop: Header=BB0_46 Depth=3
	incq	%r15
	movq	(%rbx), %rax
	movq	8(%rbx), %rcx
	subq	%rax, %rcx
	sarq	$2, %rcx
	cmpq	%r15, %rcx
	ja	.LBB0_46
.LBB0_48:                               # %._crit_edge101
                                        #   in Loop: Header=BB0_44 Depth=2
	movl	$.L.str.9, %edi
	xorl	%eax, %eax
	callq	printf
.Ltmp23:
	movl	$_ZSt3cin, %edi
	movq	%r14, %rsi
	callq	_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE
.Ltmp24:
# %bb.49:                               #   in Loop: Header=BB0_44 Depth=2
	movl	$10, %edi
	callq	putchar@PLT
	movq	64(%rsp), %r15
	testq	%r15, %r15
	je	.LBB0_58
# %bb.50:                               # %.lr.ph.i47.preheader
                                        #   in Loop: Header=BB0_44 Depth=2
	movq	56(%rsp), %r13
	xorl	%r12d, %r12d
.LBB0_51:                               # %.lr.ph.i47
                                        #   Parent Loop BB0_21 Depth=1
                                        #     Parent Loop BB0_44 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movsbl	(%r13,%r12), %edi
	callq	toupper
	movb	%al, (%r13,%r12)
	incq	%r12
	cmpq	%r12, %r15
	jne	.LBB0_51
# %bb.52:                               # %_ZSt9transformIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEES9_PDoFiiEET0_T_SD_SC_T1_.exit52
                                        #   in Loop: Header=BB0_44 Depth=2
	movq	64(%rsp), %rdx
	cmpq	$3, %rdx
	je	.LBB0_65
# %bb.53:                               # %_ZSt9transformIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEES9_PDoFiiEET0_T_SD_SC_T1_.exit52
                                        #   in Loop: Header=BB0_44 Depth=2
	cmpq	$2, %rdx
	je	.LBB0_64
# %bb.54:                               # %_ZSt9transformIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEES9_PDoFiiEET0_T_SD_SC_T1_.exit52
                                        #   in Loop: Header=BB0_44 Depth=2
	cmpq	$1, %rdx
	jne	.LBB0_58
# %bb.55:                               # %_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit54
                                        #   in Loop: Header=BB0_44 Depth=2
	movq	56(%rsp), %r15
	cmpb	$89, (%r15)
	je	.LBB0_66
# %bb.56:                               # %_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit59
                                        #   in Loop: Header=BB0_44 Depth=2
	movl	$.L.str.5, %esi
	movq	%r15, %rdi
	jmp	.LBB0_57
.LBB0_64:                               # %_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit61
                                        #   in Loop: Header=BB0_44 Depth=2
	movq	56(%rsp), %rdi
	movl	$.L.str.6, %esi
.LBB0_57:                               # %_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit59
                                        #   in Loop: Header=BB0_44 Depth=2
	callq	bcmp@PLT
	testl	%eax, %eax
	je	.LBB0_62
	jmp	.LBB0_58
.LBB0_65:                               # %_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit56
                                        #   in Loop: Header=BB0_44 Depth=2
	movq	56(%rsp), %r15
	movl	$.L.str.4, %esi
	movq	%r15, %rdi
	callq	bcmp@PLT
	testl	%eax, %eax
	je	.LBB0_66
.LBB0_58:                               # %_ZStneIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit61.thread
                                        #   in Loop: Header=BB0_44 Depth=2
.Ltmp25:
	callq	__cxa_rethrow
.Ltmp26:
	jmp	.LBB0_78
.LBB0_61:                               #   in Loop: Header=BB0_44 Depth=2
.Ltmp27:
	movq	%rax, %rdi
	callq	__cxa_begin_catch
	movl	$.Lstr.3, %edi
	callq	puts@PLT
.Ltmp28:
	callq	__cxa_end_catch
.Ltmp29:
	jmp	.LBB0_44
.LBB0_62:                               # %.thread
                                        #   in Loop: Header=BB0_21 Depth=1
	movq	(%rbx), %rax
	cmpq	%rax, 8(%rbx)
	je	.LBB0_21
# %bb.63:                               #   in Loop: Header=BB0_21 Depth=1
	movq	%rax, 8(%rbx)
	jmp	.LBB0_21
.LBB0_66:                               # %.critedge
	leaq	72(%rsp), %rax
	cmpq	%rax, %r15
	je	.LBB0_68
# %bb.67:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	movq	%r15, %rdi
	callq	_ZdlPv
.LBB0_68:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	movq	16(%rsp), %rdi
.LBB0_69:
	testq	%rdi, %rdi
	je	.LBB0_71
# %bb.70:
	callq	_ZdlPv
.LBB0_71:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit68
	movq	%rbx, %rax
	addq	$1528, %rsp                     # imm = 0x5F8
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB0_77:                               # %.loopexit.unreachable
	.cfi_def_cfa_offset 1584
.LBB0_78:                               # %.loopexit89.unreachable
.LBB0_72:
.Ltmp30:
	jmp	.LBB0_73
.LBB0_38:                               # %.loopexit88
.Ltmp19:
	jmp	.LBB0_73
.LBB0_9:
.Ltmp6:
	movq	%rax, %r14
	jmp	.LBB0_10
.LBB0_39:                               # %.loopexit.split-lp
.Ltmp9:
	jmp	.LBB0_73
.LBB0_60:
.Ltmp22:
.LBB0_73:
	movq	%rax, %r14
	movq	56(%rsp), %rdi
	leaq	72(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB0_75
# %bb.74:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i62
	callq	_ZdlPv
.LBB0_75:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit64
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	.LBB0_10
# %bb.76:
	callq	_ZdlPv
.LBB0_10:
	movq	16(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB0_12
# %bb.11:
	callq	_ZdlPv
.LBB0_12:                               # %common.resume
	movq	%r14, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end0:
	.size	select_devices, .Lfunc_end0-select_devices
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table0:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.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 .Ltmp3-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp3
	.uleb128 .Ltmp6-.Lfunc_begin0           #     jumps to .Ltmp6
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp7-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp8-.Ltmp7                  #   Call between .Ltmp7 and .Ltmp8
	.uleb128 .Ltmp9-.Lfunc_begin0           #     jumps to .Ltmp9
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp10-.Lfunc_begin0          # >> Call Site 4 <<
	.uleb128 .Ltmp13-.Ltmp10                #   Call between .Ltmp10 and .Ltmp13
	.uleb128 .Ltmp16-.Lfunc_begin0          #     jumps to .Ltmp16
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp13-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp17-.Ltmp13                #   Call between .Ltmp13 and .Ltmp17
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp17-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp18-.Ltmp17                #   Call between .Ltmp17 and .Ltmp18
	.uleb128 .Ltmp19-.Lfunc_begin0          #     jumps to .Ltmp19
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp20-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp21-.Ltmp20                #   Call between .Ltmp20 and .Ltmp21
	.uleb128 .Ltmp22-.Lfunc_begin0          #     jumps to .Ltmp22
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp23-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp26-.Ltmp23                #   Call between .Ltmp23 and .Ltmp26
	.uleb128 .Ltmp27-.Lfunc_begin0          #     jumps to .Ltmp27
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp26-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp28-.Ltmp26                #   Call between .Ltmp26 and .Ltmp28
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp28-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp29-.Ltmp28                #   Call between .Ltmp28 and .Ltmp29
	.uleb128 .Ltmp30-.Lfunc_begin0          #     jumps to .Ltmp30
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp29-.Lfunc_begin0          # >> Call Site 11 <<
	.uleb128 .Lfunc_end0-.Ltmp29            #   Call between .Ltmp29 and .Lfunc_end0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.type	_ZL17print_device_infoi,@function # -- Begin function _ZL17print_device_infoi
_ZL17print_device_infoi:                # @_ZL17print_device_infoi
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	subq	$1480, %rsp                     # imm = 0x5C8
	.cfi_def_cfa_offset 1504
	.cfi_offset %rbx, -24
	.cfi_offset %rbp, -16
	movl	%edi, %ebp
	leaq	8(%rsp), %rbx
	movq	%rbx, %rdi
	movl	%ebp, %esi
	callq	hipGetDevicePropertiesR0600
	movl	$.L.str.11, %edi
	movl	%ebp, %esi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.12, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	printf
	movl	360(%rbx), %esi
	movl	364(%rbx), %edx
	movl	$.L.str.13, %edi
	xorl	%eax, %eax
	callq	printf
	movq	288(%rbx), %rsi
	movl	$.L.str.14, %edi
	xorl	%eax, %eax
	callq	printf
	movl	348(%rbx), %esi
	movl	$.L.str.15, %edi
	xorl	%eax, %eax
	callq	printf
	addq	$1480, %rsp                     # imm = 0x5C8
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_ZL17print_device_infoi, .Lfunc_end1-_ZL17print_device_infoi
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,comdat
	.weak	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_ # -- Begin function _ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,@function
_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_: # @_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdx, (%rsp)                    # 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movl	$1, %esi
	movl	$.L.str.16, %edx
	callq	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	movq	(%rbx), %r13
	movq	8(%rbx), %r15
	movq	%r12, 8(%rsp)                   # 8-byte Spill
	subq	%r13, %r12
	movq	%r12, %r14
	sarq	$2, %r14
	testq	%rax, %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	je	.LBB2_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIiE8allocateEmPKv
	movq	%rax, %rbp
	jmp	.LBB2_3
.LBB2_1:
	xorl	%ebp, %ebp
.LBB2_3:                                # %_ZNSt12_Vector_baseIiSaIiEE11_M_allocateEm.exit
	movq	(%rsp), %rax                    # 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, (%rbp,%r14,4)
	testq	%r12, %r12
	jle	.LBB2_5
# %bb.4:
	movq	%rbp, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	memmove@PLT
.LBB2_5:                                # %_ZNSt6vectorIiSaIiEE11_S_relocateEPiS2_S2_RS0_.exit
	addq	%rbp, %r12
	addq	$4, %r12
	movq	8(%rsp), %rsi                   # 8-byte Reload
	subq	%rsi, %r15
	testq	%r15, %r15
	jle	.LBB2_7
# %bb.6:
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	memmove@PLT
.LBB2_7:                                # %_ZNSt6vectorIiSaIiEE11_S_relocateEPiS2_S2_RS0_.exit16
	testq	%r13, %r13
	je	.LBB2_9
# %bb.8:
	movq	%r13, %rdi
	callq	_ZdlPv
.LBB2_9:                                # %_ZNSt12_Vector_baseIiSaIiEE13_M_deallocateEPim.exit
	addq	%r15, %r12
	movq	%rbp, (%rbx)
	movq	%r12, 8(%rbx)
	movq	16(%rsp), %rax                  # 8-byte Reload
	leaq	(,%rax,4), %rax
	addq	%rbp, %rax
	movq	%rax, 16(%rbx)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_, .Lfunc_end2-_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc,"axG",@progbits,_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc,comdat
	.weak	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc # -- Begin function _ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	.p2align	1, 0x90
	.type	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc,@function
_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc: # @_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	.cfi_startproc
# %bb.0:
	movabsq	$2305843009213693951, %rcx      # imm = 0x1FFFFFFFFFFFFFFF
	movq	8(%rdi), %r8
	subq	(%rdi), %r8
	sarq	$2, %r8
	movq	%rcx, %rax
	subq	%r8, %rax
	cmpq	%rsi, %rax
	jb	.LBB3_2
# %bb.1:
	cmpq	%rsi, %r8
	cmovaq	%r8, %rsi
	leaq	(%rsi,%r8), %rax
	cmpq	%rcx, %rax
	cmovaeq	%rcx, %rax
	addq	%r8, %rsi
	cmovbq	%rcx, %rax
	retq
.LBB3_2:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdx, %rdi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end3:
	.size	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc, .Lfunc_end3-_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIiE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIiE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIiE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIiE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIiE8allocateEmPKv,@function
_ZNSt15__new_allocatorIiE8allocateEmPKv: # @_ZNSt15__new_allocatorIiE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$61, %rax
	jne	.LBB4_1
# %bb.3:
	shlq	$2, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB4_1:
	.cfi_def_cfa_offset 16
	shrq	$62, %rsi
	je	.LBB4_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB4_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end4:
	.size	_ZNSt15__new_allocatorIiE8allocateEmPKv, .Lfunc_end4-_ZNSt15__new_allocatorIiE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.type	.L.str.2,@object                # @.str.2
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.2:
	.asciz	"y/n? "
	.size	.L.str.2, 6

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"YES"
	.size	.L.str.4, 4

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

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

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"Is this right (y/n)? "
	.size	.L.str.9, 22

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	" Device ID: %d\n"
	.size	.L.str.11, 16

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	" Device name: %s\n"
	.size	.L.str.12, 18

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	" Device architecture: %d.%d\n"
	.size	.L.str.13, 29

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	" Device global memory: %d\n"
	.size	.L.str.14, 27

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	" Device clockrate: %d\n"
	.size	.L.str.15, 23

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"vector::_M_realloc_insert"
	.size	.L.str.16, 26

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

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"Select devices:"
	.size	.Lstr, 16

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"Devices selected:"
	.size	.Lstr.1, 18

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"Error in selection"
	.size	.Lstr.3, 19

	.type	.Lstr.4,@object                 # @str.4
.Lstr.4:
	.asciz	"CUDA Capable Devices with architecture greater than equal to 3.5\n"
	.size	.Lstr.4, 66

	.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 __gxx_personality_v0
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _ZSt3cin
	.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
