	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kfd_open
_kfd_open:                              ## @kfd_open
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	callq	_iminor
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_4
LBB0_2:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_in_compat_syscall
	testl	%eax, %eax
	je	LBB0_6
## %bb.3:
	movq	_kfd_device@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_current@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
	movq	_EPERM@GOTPCREL(%rip), %rax
LBB0_4:
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	movq	%r14, %rdi
	callq	_kfd_create_process
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_8:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_kfd_is_locked
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_10:
	movq	_kfd_device@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r14), %ecx
	movl	4(%r14), %edx
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_kfd_device,4,2                 ## @kfd_device
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Process %d (32-bit) failed to open /dev/kfd\n32-bit processes are not supported by amdkfd\n"

	.comm	_current,8,3                    ## @current
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_EAGAIN,4,2                     ## @EAGAIN
L_.str.1:                               ## @.str.1
	.asciz	"process %d opened, compat mode (32 bit) - %d\n"

	.no_dead_strip	_kfd_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kfd_open
_kfd_open:                              ; @kfd_open
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	bl	_iminor
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
	bl	_in_compat_syscall
	cbz	w0, LBB0_6
; %bb.3:
Lloh2:
	adrp	x8, _kfd_device@GOTPAGE
Lloh3:
	ldr	x8, [x8, _kfd_device@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x8, _current@GOTPAGE
Lloh6:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	ldr	w2, [x8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
Lloh10:
	adrp	x8, _EPERM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	x0, x19
	bl	_kfd_create_process
	mov	x19, x0
	bl	_IS_ERR
	cbz	x0, LBB0_8
; %bb.7:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_8:
	bl	_kfd_is_locked
	cbz	x0, LBB0_10
; %bb.9:
Lloh12:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_4
LBB0_10:
Lloh14:
	adrp	x8, _kfd_device@GOTPAGE
Lloh15:
	ldr	x8, [x8, _kfd_device@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	ldp	w3, w2, [x19]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_kfd_device,4,2                 ; @kfd_device
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Process %d (32-bit) failed to open /dev/kfd\n32-bit processes are not supported by amdkfd\n"

	.comm	_current,8,3                    ; @current
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_EAGAIN,4,2                     ; @EAGAIN
l_.str.1:                               ; @.str.1
	.asciz	"process %d opened, compat mode (32 bit) - %d\n"

	.no_dead_strip	_kfd_open
.subsections_via_symbols
