	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function display_open
_display_open:                          ## @display_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	_driver_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_iminor
	movl	%eax, %r14d
	movq	_imon_driver@GOTPCREL(%rip), %rdi
	movl	%eax, %esi
	callq	_usb_find_interface
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rdi
	callq	_usb_get_intfdata
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %rbx
	movq	%rax, %r14
	addq	$4, %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	cmpl	$0, 12(%rbx)
	je	LBB0_6
## %bb.7:
	cmpl	$0, (%rbx)
	je	LBB0_9
## %bb.8:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_pr_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_10
LBB0_1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
LBB0_2:
	xorl	%r15d, %r15d
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_pr_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_11
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_pr_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_10
LBB0_9:
	movl	$1, (%rbx)
	movq	%rbx, (%r15)
	movl	8(%rbx), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_dbg
	xorl	%r15d, %r15d
LBB0_10:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_11:
	movq	_driver_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_driver_lock,4,2                ## @driver_lock
	.comm	_imon_driver,4,2                ## @imon_driver
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not find interface for minor %d\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"no context found for minor %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"display not supported by device\n"

L_.str.3:                               ## @.str.3
	.asciz	"display port is already open\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.4:                               ## @.str.4
	.asciz	"display port opened\n"

	.no_dead_strip	_display_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function display_open
_display_open:                          ; @display_open
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x0, _driver_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _driver_lock@GOTPAGEOFF]
	bl	_mutex_lock
	mov	x0, x19
	bl	_iminor
	mov	x19, x0
Lloh2:
	adrp	x0, _imon_driver@GOTPAGE
Lloh3:
	ldr	x0, [x0, _imon_driver@GOTPAGEOFF]
	mov	x1, x19
	bl	_usb_find_interface
	cbz	x0, LBB0_5
; %bb.1:
	bl	_usb_get_intfdata
	cbz	x0, LBB0_6
; %bb.2:
	mov	x21, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x21, #12]
	cbz	w8, LBB0_8
; %bb.3:
	ldr	w8, [x21]
	cbz	w8, LBB0_10
; %bb.4:
Lloh4:
	adrp	x0, l_.str.3@PAGE
Lloh5:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_err
Lloh6:
	adrp	x8, _EBUSY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_9
LBB0_5:
	str	x19, [sp]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_7
LBB0_6:
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
	str	x19, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_7:
	bl	_pr_err
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_12
LBB0_8:
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
Lloh17:
	adrp	x8, _ENODEV@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_10:
	mov	w8, #1
	str	w8, [x21]
	str	x21, [x20]
	ldr	w0, [x21, #8]
Lloh19:
	adrp	x1, l_.str.4@PAGE
Lloh20:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_dbg
	mov	w20, #0
LBB0_11:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_12:
Lloh21:
	adrp	x0, _driver_lock@GOTPAGE
Lloh22:
	ldr	x0, [x0, _driver_lock@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	x0, x20
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_driver_lock,4,2                ; @driver_lock
	.comm	_imon_driver,4,2                ; @imon_driver
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not find interface for minor %d\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"no context found for minor %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"display not supported by device\n"

l_.str.3:                               ; @.str.3
	.asciz	"display port is already open\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.4:                               ; @.str.4
	.asciz	"display port opened\n"

	.no_dead_strip	_display_open
.subsections_via_symbols
