	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_device_open_ctrl            ## -- Begin function hl_device_open_ctrl
	.p2align	4, 0x90
_hl_device_open_ctrl:                   ## @hl_device_open_ctrl
	.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	%rsi, %r14
	movq	%rdi, %r12
	movq	_hl_devs_idr_lock@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	%r12, %rdi
	callq	_iminor
	movq	_hl_devs_idr@GOTPCREL(%rip), %rdi
	movl	%eax, %esi
	callq	_idr_find
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_mutex_unlock
	testq	%r13, %r13
	je	LBB0_1
## %bb.2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rax, %r15
	movq	%r13, %rdi
	callq	_mutex_lock
	movq	%r13, %rdi
	callq	_hl_device_disabled_or_in_reset
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	8(%r13), %ebx
	movl	%ebx, %edi
	callq	_dev_name
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movl	%eax, %edx
	callq	_dev_err_ratelimited
	movq	_EPERM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r13, %rdi
	callq	_mutex_unlock
	movq	%r15, %rdi
	callq	_kfree
	jmp	LBB0_8
LBB0_1:
	movq	%r12, %rdi
	callq	_imajor
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_iminor
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_pr_err
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_7:
	movq	%r15, %rdi
	addq	$24, %rdi
	movq	%r13, %rsi
	addq	$4, %rsi
	callq	_list_add
	movq	%r13, %rdi
	callq	_mutex_unlock
	movq	%r13, 16(%r15)
	movq	%r15, (%r14)
	movq	%r14, 8(%r15)
	movl	$1, (%r15)
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_nonseekable_open
	movq	_current@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_find_get_pid
	movl	%eax, 4(%r15)
	xorl	%ebx, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_hl_devs_idr_lock,4,2           ## @hl_devs_idr_lock
	.comm	_hl_devs_idr,4,2                ## @hl_devs_idr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't find device %d:%d\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"Can't open %s because it is disabled or in reset\n"

	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_current,8,3                    ## @current
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_device_open_ctrl            ; -- Begin function hl_device_open_ctrl
	.p2align	2
_hl_device_open_ctrl:                   ; @hl_device_open_ctrl
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x20, _hl_devs_idr_lock@GOTPAGE
Lloh1:
	ldr	x20, [x20, _hl_devs_idr_lock@GOTPAGEOFF]
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x19
	bl	_iminor
	mov	x1, x0
Lloh2:
	adrp	x0, _hl_devs_idr@GOTPAGE
Lloh3:
	ldr	x0, [x0, _hl_devs_idr@GOTPAGEOFF]
	bl	_idr_find
	mov	x22, x0
	mov	x0, x20
	bl	_mutex_unlock
	cbz	x22, LBB0_4
; %bb.1:
Lloh4:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	w0, #32
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.2:
	mov	x20, x0
	mov	x0, x22
	bl	_mutex_lock
	mov	x0, x22
	bl	_hl_device_disabled_or_in_reset
	cbz	x0, LBB0_7
; %bb.3:
	ldr	w19, [x22, #8]
	mov	x0, x19
	bl	_dev_name
	mov	x2, x0
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err_ratelimited
Lloh9:
	adrp	x8, _EPERM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w19, w8
	mov	x0, x22
	bl	_mutex_unlock
	mov	x0, x20
	bl	_kfree
	b	LBB0_8
LBB0_4:
	mov	x0, x19
	bl	_imajor
	mov	x20, x0
	mov	x0, x19
	bl	_iminor
	mov	x2, x0
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_pr_err
Lloh14:
	adrp	x8, _ENXIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_8
LBB0_7:
	add	x0, x20, #24
	add	x1, x22, #4
	bl	_list_add
	mov	x0, x22
	bl	_mutex_unlock
	str	x20, [x21]
	stp	x21, x22, [x20, #8]
	mov	w8, #1
	str	w8, [x20]
	mov	x0, x19
	mov	x1, x21
	bl	_nonseekable_open
Lloh18:
	adrp	x8, _current@GOTPAGE
Lloh19:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_find_get_pid
	mov	w19, #0
	str	w0, [x20, #4]
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_hl_devs_idr_lock,4,2           ; @hl_devs_idr_lock
	.comm	_hl_devs_idr,4,2                ; @hl_devs_idr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't find device %d:%d\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"Can't open %s because it is disabled or in reset\n"

	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_current,8,3                    ; @current
.subsections_via_symbols
