	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_device_open                 ## -- Begin function hl_device_open
	.p2align	4, 0x90
_hl_device_open:                        ## @hl_device_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	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.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, %rbx
	movq	_hl_devs_idr_lock@GOTPCREL(%rip), %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_iminor
	movq	_hl_devs_idr@GOTPCREL(%rip), %rdi
	movl	%eax, %esi
	callq	_idr_find
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_mutex_unlock
	testq	%r15, %r15
	je	LBB0_1
## %bb.2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$48, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rax, %r12
	movq	%r15, 16(%rax)
	movq	%rax, (%r14)
	movq	%r14, 40(%rax)
	leaq	4(%rax), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_mutex_init
	leaq	32(%r12), %rdi
	callq	_kref_init
	movq	%rbx, %rdi
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rsi
	callq	_nonseekable_open
	leaq	24(%r12), %rbx
	movq	%rbx, %rdi
	callq	_hl_cb_mgr_init
	leaq	8(%r12), %r14
	movq	%r14, %rdi
	callq	_hl_ctx_mgr_init
	movq	_current@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_find_get_pid
	movl	%eax, (%r12)
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	callq	_hl_device_disabled_or_in_reset
	testq	%rax, %rax
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_10
## %bb.6:
	movl	8(%r15), %ebx
	movl	%ebx, %edi
	callq	_dev_name
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_7
LBB0_1:
	movq	%rbx, %rdi
	callq	_imajor
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_iminor
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %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	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_17
LBB0_10:
	cmpq	$0, 24(%r15)
	je	LBB0_12
## %bb.11:
	movl	8(%r15), %ebx
	movl	%ebx, %edi
	callq	_dev_name
	leaq	L_.str.2(%rip), %rsi
LBB0_7:
	movl	%ebx, %edi
	movl	%eax, %edx
	callq	_dev_err_ratelimited
	movq	_EPERM@GOTPCREL(%rip), %rax
LBB0_8:
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_9:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	16(%r12), %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_hl_cb_mgr_fini
	movq	16(%r12), %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_hl_ctx_mgr_fini
	movq	$0, (%rbx)
	movq	%r14, %rdi
	callq	_mutex_destroy
	movl	(%r12), %edi
	callq	_put_pid
	movq	%r12, %rdi
	callq	_kfree
LBB0_17:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	cmpq	$0, 16(%r15)
	je	LBB0_14
## %bb.13:
	movl	8(%r15), %ebx
	movl	%ebx, %edi
	callq	_dev_name
	leaq	L_.str.3(%rip), %rsi
	movl	%ebx, %edi
	movl	%eax, %edx
	callq	_dev_dbg_ratelimited
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_14:
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_hl_ctx_create
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	movl	%eax, %r13d
	movl	8(%r15), %edi
	leaq	L_.str.4(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_9
LBB0_16:
	movq	_PLL_HIGH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_hl_device_set_frequency
	movq	%r12, %rdi
	addq	$28, %rdi
	movq	%r15, %rsi
	addq	$4, %rsi
	callq	_list_add
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	%r12, %rdi
	callq	_hl_debugfs_add_file
	xorl	%r13d, %r13d
	jmp	LBB0_17
	.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
	.comm	_current,8,3                    ## @current
L_.str.1:                               ## @.str.1
	.asciz	"Can't open %s because it is disabled or in reset\n"

	.comm	_EPERM,4,2                      ## @EPERM
L_.str.2:                               ## @.str.2
	.asciz	"Can't open %s because it is being debugged by another user\n"

L_.str.3:                               ## @.str.3
	.asciz	"Can't open %s because another user is working on it\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.4:                               ## @.str.4
	.asciz	"Failed to create context %d\n"

	.comm	_PLL_HIGH,4,2                   ## @PLL_HIGH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_device_open                 ; -- Begin function hl_device_open
	.p2align	2
_hl_device_open:                        ; @hl_device_open
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x23, 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, x23
	bl	_iminor
	mov	x1, x0
Lloh2:
	adrp	x0, _hl_devs_idr@GOTPAGE
Lloh3:
	ldr	x0, [x0, _hl_devs_idr@GOTPAGEOFF]
	bl	_idr_find
	mov	x21, x0
	mov	x0, x20
	bl	_mutex_unlock
	cbz	x21, LBB0_4
; %bb.1:
Lloh4:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	w0, #48
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.2:
	mov	x20, x0
	str	x21, [x0, #16]
	str	x0, [x19]
	add	x22, x0, #4
	str	x19, [x0, #40]
	mov	x0, x22
	bl	_mutex_init
	add	x0, x20, #32
	bl	_kref_init
	mov	x0, x23
	mov	x1, x19
	bl	_nonseekable_open
	add	x24, x20, #24
	mov	x0, x24
	bl	_hl_cb_mgr_init
	add	x23, x20, #8
	mov	x0, x23
	bl	_hl_ctx_mgr_init
Lloh7:
	adrp	x8, _current@GOTPAGE
Lloh8:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_find_get_pid
	str	w0, [x20]
	mov	x0, x21
	bl	_mutex_lock
	mov	x0, x21
	bl	_hl_device_disabled_or_in_reset
	cbz	x0, LBB0_7
; %bb.3:
	ldr	w25, [x21, #8]
	mov	x0, x25
	bl	_dev_name
	mov	x2, x0
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_4:
	mov	x0, x23
	bl	_imajor
	mov	x19, x0
	mov	x0, x23
	bl	_iminor
	mov	x2, x0
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	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	w25, w8
	b	LBB0_12
LBB0_7:
	ldr	x8, [x21, #24]
	cbz	x8, LBB0_13
; %bb.8:
	ldr	w25, [x21, #8]
	mov	x0, x25
	bl	_dev_name
	mov	x2, x0
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_9:
	mov	x0, x25
	bl	_dev_err_ratelimited
Lloh20:
	adrp	x8, _EPERM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_11:
	mov	x0, x21
	bl	_mutex_unlock
	ldr	x0, [x20, #16]
	mov	x1, x24
	bl	_hl_cb_mgr_fini
	ldr	x0, [x20, #16]
	mov	x1, x23
	bl	_hl_ctx_mgr_fini
	str	xzr, [x19]
	mov	x0, x22
	bl	_mutex_destroy
	ldr	w0, [x20]
	bl	_put_pid
	mov	x0, x20
	bl	_kfree
LBB0_12:
	mov	x0, x25
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_13:
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_15
; %bb.14:
	ldr	w25, [x21, #8]
	mov	x0, x25
	bl	_dev_name
	mov	x2, x0
Lloh22:
	adrp	x1, l_.str.3@PAGE
Lloh23:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x25
	bl	_dev_dbg_ratelimited
Lloh24:
	adrp	x8, _EBUSY@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_10
LBB0_15:
	mov	x0, x21
	mov	x1, x20
	bl	_hl_ctx_create
	mov	x25, x0
	cbz	w0, LBB0_17
; %bb.16:
	ldr	w0, [x21, #8]
Lloh26:
	adrp	x1, l_.str.4@PAGE
Lloh27:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x2, x25
	bl	_dev_err
	b	LBB0_11
LBB0_17:
Lloh28:
	adrp	x8, _PLL_HIGH@GOTPAGE
Lloh29:
	ldr	x8, [x8, _PLL_HIGH@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_hl_device_set_frequency
	add	x0, x20, #28
	add	x1, x21, #4
	bl	_list_add
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, x20
	bl	_hl_debugfs_add_file
	b	LBB0_12
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.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
	.comm	_current,8,3                    ; @current
l_.str.1:                               ; @.str.1
	.asciz	"Can't open %s because it is disabled or in reset\n"

	.comm	_EPERM,4,2                      ; @EPERM
l_.str.2:                               ; @.str.2
	.asciz	"Can't open %s because it is being debugged by another user\n"

l_.str.3:                               ; @.str.3
	.asciz	"Can't open %s because another user is working on it\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.4:                               ; @.str.4
	.asciz	"Failed to create context %d\n"

	.comm	_PLL_HIGH,4,2                   ; @PLL_HIGH
.subsections_via_symbols
