	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gx_priv_open_screen
_gx_priv_open_screen:                   ## @gx_priv_open_screen
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	_gx@GOTPCREL(%rip), %r12
	leaq	16(%r12), %r14
	movq	%r14, %rdi
	callq	_vcos_mutex_lock
	movq	(%r12), %rax
	movl	(%rax,%rbx,4), %ecx
	testl	%ecx, %ecx
	je	LBB0_2
## %bb.1:
	movq	8(%r12), %rdx
	movq	(%rdx,%rbx,8), %rdx
	movq	%rdx, (%r15)
	incl	%ecx
	movl	%ecx, (%rax,%rbx,4)
	jmp	LBB0_5
LBB0_2:
	movq	%rbx, %rdi
	callq	_vc_dispmanx_display_open
	movq	_DISPMANX_NO_HANDLE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	callq	_GX_LOG
	movl	$-1, %ebx
	jmp	LBB0_6
LBB0_4:
	movq	8(%r12), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	(%r12), %rcx
	movl	$1, (%rcx,%rbx,4)
	movq	%rax, (%r15)
LBB0_5:
	xorl	%ebx, %ebx
LBB0_6:
	movq	%r14, %rdi
	callq	_vcos_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_gx,24,3                        ## @gx
	.comm	_DISPMANX_NO_HANDLE,8,3         ## @DISPMANX_NO_HANDLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not open dispmanx display %d"

	.no_dead_strip	_gx_priv_open_screen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gx_priv_open_screen
_gx_priv_open_screen:                   ; @gx_priv_open_screen
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _gx@GOTPAGE
Lloh1:
	ldr	x22, [x22, _gx@GOTPAGEOFF]
	add	x0, x22, #16
	bl	_vcos_mutex_lock
	ldr	x8, [x22]
	ldr	w9, [x8, x19, lsl #2]
	cbz	w9, LBB0_2
; %bb.1:
	mov	w21, #0
	ldr	x10, [x22, #8]
	ldr	x10, [x10, x19, lsl #3]
	str	x10, [x20]
	add	w9, w9, #1
	str	w9, [x8, x19, lsl #2]
	b	LBB0_5
LBB0_2:
	mov	x0, x19
	bl	_vc_dispmanx_display_open
Lloh2:
	adrp	x8, _DISPMANX_NO_HANDLE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DISPMANX_NO_HANDLE@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.3:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_GX_LOG
	mov	w21, #-1
	b	LBB0_5
LBB0_4:
	mov	w21, #0
	ldp	x9, x8, [x22]
	str	x0, [x8, x19, lsl #3]
	mov	w8, #1
	str	w8, [x9, x19, lsl #2]
	str	x0, [x20]
LBB0_5:
	add	x0, x22, #16
	bl	_vcos_mutex_unlock
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_gx,24,3                        ; @gx
	.comm	_DISPMANX_NO_HANDLE,8,3         ; @DISPMANX_NO_HANDLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not open dispmanx display %d"

	.no_dead_strip	_gx_priv_open_screen
.subsections_via_symbols
