	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_randr_init                     ## -- Begin function randr_init
	.p2align	4, 0x90
_randr_init:                            ## @randr_init
	.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
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_conn@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_create_root_output
	movq	_root_output@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_outputs@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edx
	movl	%eax, %esi
	callq	_TAILQ_INSERT_TAIL
	movl	(%r13), %edi
	movq	_xcb_randr_id@GOTPCREL(%rip), %rsi
	callq	_xcb_get_extension_data
	cmpl	$0, 4(%rax)
	je	LBB0_10
## %bb.1:
	movq	%rax, %r12
	movl	(%r13), %ebx
	movq	_XCB_RANDR_MAJOR_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_XCB_RANDR_MINOR_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %edi
	callq	_xcb_randr_query_version
	leaq	-48(%rbp), %rdx
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_xcb_randr_query_version_reply
	movq	-48(%rbp), %rcx
	testq	%rcx, %rcx
	je	LBB0_3
## %bb.2:
	movl	8(%rcx), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_ELOG
	movq	-48(%rbp), %rdi
	callq	_free
	xorl	%eax, %eax
	callq	_fallback_to_root_output
	jmp	LBB0_9
LBB0_10:
	leaq	L_.str(%rip), %rdi
	callq	_DLOG
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_fallback_to_root_output        ## TAILCALL
LBB0_3:
	xorl	%ecx, %ecx
	cmpl	$0, (%rax)
	jle	LBB0_6
## %bb.4:
	cmpl	$5, 4(%rax)
	jl	LBB0_6
## %bb.5:
	xorl	%ecx, %ecx
	testl	%r15d, %r15d
	sete	%cl
LBB0_6:
	movq	_has_randr_1_5@GOTPCREL(%rip), %rdx
	movl	%ecx, (%rdx)
	movq	%rax, %rdi
	callq	_free
	xorl	%eax, %eax
	callq	_randr_query_outputs
	testq	%r14, %r14
	je	LBB0_8
## %bb.7:
	movl	(%r12), %eax
	movl	%eax, (%r14)
LBB0_8:
	movl	(%r13), %edi
	movq	_XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE@GOTPCREL(%rip), %rax
	movq	_XCB_RANDR_NOTIFY_MASK_OUTPUT_CHANGE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_root@GOTPCREL(%rip), %rax
	movq	_XCB_RANDR_NOTIFY_MASK_CRTC_CHANGE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movl	(%rax), %esi
	movq	_XCB_RANDR_NOTIFY_MASK_OUTPUT_PROPERTY@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	callq	_xcb_randr_select_input
	movl	(%r13), %edi
	callq	_xcb_flush
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_conn,4,2                       ## @conn
	.comm	_root_output,4,2                ## @root_output
	.comm	_outputs,4,2                    ## @outputs
	.comm	_xcb_randr_id,4,2               ## @xcb_randr_id
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"RandR is not present, activating root output.\n"

	.comm	_XCB_RANDR_MAJOR_VERSION,4,2    ## @XCB_RANDR_MAJOR_VERSION
	.comm	_XCB_RANDR_MINOR_VERSION,4,2    ## @XCB_RANDR_MINOR_VERSION
L_.str.1:                               ## @.str.1
	.asciz	"Could not query RandR version: X11 error code %d\n"

	.comm	_has_randr_1_5,4,2              ## @has_randr_1_5
	.comm	_root,4,2                       ## @root
	.comm	_XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE,4,2 ## @XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE
	.comm	_XCB_RANDR_NOTIFY_MASK_OUTPUT_CHANGE,4,2 ## @XCB_RANDR_NOTIFY_MASK_OUTPUT_CHANGE
	.comm	_XCB_RANDR_NOTIFY_MASK_CRTC_CHANGE,4,2 ## @XCB_RANDR_NOTIFY_MASK_CRTC_CHANGE
	.comm	_XCB_RANDR_NOTIFY_MASK_OUTPUT_PROPERTY,4,2 ## @XCB_RANDR_NOTIFY_MASK_OUTPUT_PROPERTY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_randr_init                     ; -- Begin function randr_init
	.p2align	2
_randr_init:                            ; @randr_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x23, _conn@GOTPAGE
Lloh1:
	ldr	x23, [x23, _conn@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_create_root_output
	mov	x1, x0
Lloh2:
	adrp	x8, _root_output@GOTPAGE
Lloh3:
	ldr	x8, [x8, _root_output@GOTPAGEOFF]
Lloh4:
	str	w0, [x8]
Lloh5:
	adrp	x0, _outputs@GOTPAGE
Lloh6:
	ldr	x0, [x0, _outputs@GOTPAGEOFF]
	ldr	w2, [x0]
	bl	_TAILQ_INSERT_TAIL
	ldr	w0, [x23]
Lloh7:
	adrp	x1, _xcb_randr_id@GOTPAGE
Lloh8:
	ldr	x1, [x1, _xcb_randr_id@GOTPAGEOFF]
	bl	_xcb_get_extension_data
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	w22, [x23]
Lloh9:
	adrp	x8, _XCB_RANDR_MAJOR_VERSION@GOTPAGE
Lloh10:
	ldr	x8, [x8, _XCB_RANDR_MAJOR_VERSION@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _XCB_RANDR_MINOR_VERSION@GOTPAGE
Lloh13:
	ldr	x8, [x8, _XCB_RANDR_MINOR_VERSION@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x22
	bl	_xcb_randr_query_version
	mov	x1, x0
	add	x2, sp, #8
	mov	x0, x22
	bl	_xcb_randr_query_version_reply
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_4
; %bb.2:
	ldr	w1, [x8, #8]
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ELOG
	ldr	x0, [sp, #8]
	bl	_free
	bl	_fallback_to_root_output
	b	LBB0_11
LBB0_3:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DLOG
	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
	add	sp, sp, #80
	b	_fallback_to_root_output
LBB0_4:
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.5:
	ldr	w8, [x0, #4]
	cmp	w8, #5
	b.lt	LBB0_7
; %bb.6:
	cmp	w21, #0
	cset	w8, eq
	b	LBB0_8
LBB0_7:
	mov	w8, #0
LBB0_8:
Lloh19:
	adrp	x9, _has_randr_1_5@GOTPAGE
Lloh20:
	ldr	x9, [x9, _has_randr_1_5@GOTPAGEOFF]
Lloh21:
	str	w8, [x9]
	bl	_free
	bl	_randr_query_outputs
	cbz	x19, LBB0_10
; %bb.9:
	ldr	w8, [x20]
	str	w8, [x19]
LBB0_10:
	ldr	w0, [x23]
Lloh22:
	adrp	x8, _root@GOTPAGE
Lloh23:
	ldr	x8, [x8, _root@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x8, _XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
Lloh28:
	adrp	x9, _XCB_RANDR_NOTIFY_MASK_OUTPUT_CHANGE@GOTPAGE
Lloh29:
	ldr	x9, [x9, _XCB_RANDR_NOTIFY_MASK_OUTPUT_CHANGE@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh31:
	adrp	x9, _XCB_RANDR_NOTIFY_MASK_CRTC_CHANGE@GOTPAGE
Lloh32:
	ldr	x9, [x9, _XCB_RANDR_NOTIFY_MASK_CRTC_CHANGE@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh34:
	adrp	x9, _XCB_RANDR_NOTIFY_MASK_OUTPUT_PROPERTY@GOTPAGE
Lloh35:
	ldr	x9, [x9, _XCB_RANDR_NOTIFY_MASK_OUTPUT_PROPERTY@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	orr	w2, w8, w9
	bl	_xcb_randr_select_input
	ldr	w0, [x23]
	bl	_xcb_flush
LBB0_11:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotStr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotStr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_conn,4,2                       ; @conn
	.comm	_root_output,4,2                ; @root_output
	.comm	_outputs,4,2                    ; @outputs
	.comm	_xcb_randr_id,4,2               ; @xcb_randr_id
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"RandR is not present, activating root output.\n"

	.comm	_XCB_RANDR_MAJOR_VERSION,4,2    ; @XCB_RANDR_MAJOR_VERSION
	.comm	_XCB_RANDR_MINOR_VERSION,4,2    ; @XCB_RANDR_MINOR_VERSION
l_.str.1:                               ; @.str.1
	.asciz	"Could not query RandR version: X11 error code %d\n"

	.comm	_has_randr_1_5,4,2              ; @has_randr_1_5
	.comm	_root,4,2                       ; @root
	.comm	_XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE,4,2 ; @XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE
	.comm	_XCB_RANDR_NOTIFY_MASK_OUTPUT_CHANGE,4,2 ; @XCB_RANDR_NOTIFY_MASK_OUTPUT_CHANGE
	.comm	_XCB_RANDR_NOTIFY_MASK_CRTC_CHANGE,4,2 ; @XCB_RANDR_NOTIFY_MASK_CRTC_CHANGE
	.comm	_XCB_RANDR_NOTIFY_MASK_OUTPUT_PROPERTY,4,2 ; @XCB_RANDR_NOTIFY_MASK_OUTPUT_PROPERTY
.subsections_via_symbols
