	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function display_close
_display_close:                         ## @display_close
	.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), %rbx
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	leaq	4(%rbx), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	cmpl	$0, 16(%rbx)
	je	LBB0_3
## %bb.6:
	cmpl	$0, (%rbx)
	je	LBB0_7
## %bb.8:
	movl	$0, (%rbx)
	movl	12(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_dbg
	xorl	%r15d, %r15d
	cmpl	$0, 8(%rbx)
	jne	LBB0_5
## %bb.9:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%rbx, %rdi
	callq	_free_imon_context
	xorl	%r15d, %r15d
	jmp	LBB0_10
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_10
LBB0_3:
	movq	_ENODEV@GOTPCREL(%rip), %rbx
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_4
LBB0_7:
	movq	_EIO@GOTPCREL(%rip), %rbx
	leaq	L_.str.2(%rip), %rdi
LBB0_4:
	callq	_pr_err
	xorl	%r15d, %r15d
	subl	(%rbx), %r15d
LBB0_5:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_10:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no context for device\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"display not supported by device\n"

L_.str.2:                               ## @.str.2
	.asciz	"display is not open\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.3:                               ## @.str.3
	.asciz	"display port closed\n"

	.no_dead_strip	_display_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function display_close
_display_close:                         ; @display_close
	.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
	ldr	x20, [x1]
	cbz	x20, LBB0_5
; %bb.1:
	add	x19, x20, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20, #16]
	cbz	w8, LBB0_6
; %bb.2:
	ldr	w8, [x20]
	cbz	w8, LBB0_7
; %bb.3:
	str	wzr, [x20]
	ldr	w0, [x20, #12]
Lloh0:
	adrp	x1, l_.str.3@PAGE
Lloh1:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
	mov	w21, #0
	ldr	w8, [x20, #8]
	cbnz	w8, LBB0_9
; %bb.4:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	bl	_free_imon_context
	mov	w21, #0
	b	LBB0_10
LBB0_5:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh4:
	adrp	x8, _ENODEV@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
LBB0_6:
Lloh7:
	adrp	x20, _ENODEV@GOTPAGE
Lloh8:
	ldr	x20, [x20, _ENODEV@GOTPAGEOFF]
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_7:
Lloh11:
	adrp	x20, _EIO@GOTPAGE
Lloh12:
	ldr	x20, [x20, _EIO@GOTPAGEOFF]
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_8:
	bl	_pr_err
	ldr	w8, [x20]
	neg	w21, w8
LBB0_9:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_10:
	mov	x0, x21
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no context for device\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"display not supported by device\n"

l_.str.2:                               ; @.str.2
	.asciz	"display is not open\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.3:                               ; @.str.3
	.asciz	"display port closed\n"

	.no_dead_strip	_display_close
.subsections_via_symbols
