	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kgd2kfd_probe                  ## -- Begin function kgd2kfd_probe
	.p2align	4, 0x90
_kgd2kfd_probe:                         ## @kgd2kfd_probe
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %r12
	movl	(%rsi), %edi
	callq	_lookup_device_info
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$64, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_amdgpu_amdkfd_have_atomics_support
	movl	%eax, 56(%rbx)
	cmpq	$0, (%r13)
	je	LBB0_7
## %bb.3:
	testl	%eax, %eax
	jne	LBB0_7
## %bb.4:
	movq	_kfd_device@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r14), %ecx
	movl	4(%r14), %edx
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_info
	movq	%rbx, %rdi
	callq	_kfree
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_5:
	movq	_kfd_device@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_6:
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_7:
	movq	%r12, 48(%rbx)
	movq	%r13, 40(%rbx)
	movq	%r14, 32(%rbx)
	movl	$0, (%rbx)
	movq	%r15, 24(%rbx)
	leaq	16(%rbx), %rdi
	xorl	%esi, %esi
	callq	_atomic_set
	leaq	12(%rbx), %rdi
	callq	_mutex_init
	leaq	8(%rbx), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	%rbx, %rdi
	addq	$4, %rdi
	xorl	%esi, %esi
	callq	_atomic_set
LBB0_8:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_kfd_device,4,2                 ## @kfd_device
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"kgd2kfd_probe failed\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"skipped device %x:%x, PCI rejects atomics\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kgd2kfd_probe                  ; -- Begin function kgd2kfd_probe
	.p2align	2
_kgd2kfd_probe:                         ; @kgd2kfd_probe
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x20, x1
	mov	x22, x0
	ldr	w0, [x1]
	bl	_lookup_device_info
	cbz	x0, LBB0_4
; %bb.1:
	mov	x23, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #64
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_7
; %bb.2:
	mov	x0, x22
	bl	_amdgpu_amdkfd_have_atomics_support
	str	w0, [x19, #56]
	ldr	x8, [x23]
	cmp	x8, #0
	ccmp	w0, #0, #0, ne
	b.eq	LBB0_5
; %bb.3:
	stp	x23, x22, [x19, #40]
	str	wzr, [x19]
	add	x0, x19, #16
	stp	x21, x20, [x19, #24]
	mov	w1, #0
	bl	_atomic_set
	add	x0, x19, #12
	bl	_mutex_init
	add	x0, x19, #8
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	add	x0, x19, #4
	mov	w1, #0
	bl	_atomic_set
	b	LBB0_7
LBB0_4:
Lloh3:
	adrp	x8, _kfd_device@GOTPAGE
Lloh4:
	ldr	x8, [x8, _kfd_device@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_6
LBB0_5:
Lloh8:
	adrp	x8, _kfd_device@GOTPAGE
Lloh9:
	ldr	x8, [x8, _kfd_device@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldp	w3, w2, [x20]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_info
	mov	x0, x19
	bl	_kfree
LBB0_6:
	mov	x19, #0
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_kfd_device,4,2                 ; @kfd_device
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"kgd2kfd_probe failed\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"skipped device %x:%x, PCI rejects atomics\n"

.subsections_via_symbols
