	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kfd_ioctl_dbg_register
_kfd_ioctl_dbg_register:                ## @kfd_ioctl_dbg_register
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	(%rdx), %edi
	callq	_kfd_device_by_id
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	8(%rax), %rax
	movq	(%rax), %rax
	movq	_CHIP_CARRIZO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_pr_debug
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_4:
	movq	%r14, %rdi
	callq	_mutex_lock
	xorl	%eax, %eax
	callq	_kfd_get_dbgmgr_mutex
	movq	%rax, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_kfd_bind_process_to_device
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	_PTR_ERR
	movq	%rax, %rbx
	jmp	LBB0_13
LBB0_6:
	cmpq	$0, (%r15)
	je	LBB0_7
## %bb.12:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_debug
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_13:
	xorl	%eax, %eax
	callq	_kfd_get_dbgmgr_mutex
	movq	%rax, %rdi
	callq	_mutex_unlock
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	leaq	-32(%rbp), %rdi
	movq	%r15, %rsi
	callq	_kfd_dbgmgr_create
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movq	-32(%rbp), %rdi
	movq	%r14, %rsi
	callq	_kfd_dbgmgr_register
	movq	-32(%rbp), %rdi
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	%rax, %rbx
	callq	_kfd_dbgmgr_destroy
	jmp	LBB0_13
LBB0_8:
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_11:
	movq	%rdi, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CHIP_CARRIZO,8,3               ## @CHIP_CARRIZO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"kfd_ioctl_dbg_register not supported on CZ\n"

L_.str.1:                               ## @.str.1
	.asciz	"debugger already registered\n"

	.no_dead_strip	_kfd_ioctl_dbg_register
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kfd_ioctl_dbg_register
_kfd_ioctl_dbg_register:                ; @kfd_ioctl_dbg_register
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
	ldr	w0, [x2]
	bl	_kfd_device_by_id
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _CHIP_CARRIZO@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CHIP_CARRIZO@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
LBB0_3:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_9
LBB0_4:
	mov	x0, x19
	bl	_mutex_lock
	bl	_kfd_get_dbgmgr_mutex
	bl	_mutex_lock
	mov	x0, x20
	mov	x1, x19
	bl	_kfd_bind_process_to_device
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_6
; %bb.5:
	mov	x0, x21
	bl	_PTR_ERR
	mov	x21, x0
	b	LBB0_8
LBB0_6:
	ldr	x8, [x20]
	cbz	x8, LBB0_10
; %bb.7:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_debug
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_8:
	bl	_kfd_get_dbgmgr_mutex
	bl	_mutex_unlock
	mov	x0, x19
	bl	_mutex_unlock
LBB0_9:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
LBB0_10:
	add	x0, sp, #8
	mov	x1, x20
	bl	_kfd_dbgmgr_create
	cbz	w0, LBB0_13
; %bb.11:
	ldr	x0, [sp, #8]
	mov	x1, x19
	bl	_kfd_dbgmgr_register
	mov	x21, x0
	ldr	x0, [sp, #8]
	cbz	x21, LBB0_14
; %bb.12:
	bl	_kfd_dbgmgr_destroy
	b	LBB0_8
LBB0_13:
	mov	x21, #0
	b	LBB0_8
LBB0_14:
	str	x0, [x20]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CHIP_CARRIZO,8,3               ; @CHIP_CARRIZO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"kfd_ioctl_dbg_register not supported on CZ\n"

l_.str.1:                               ; @.str.1
	.asciz	"debugger already registered\n"

	.no_dead_strip	_kfd_ioctl_dbg_register
.subsections_via_symbols
