	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function zx_vga_register
_zx_vga_register:                       ## @zx_vga_register
	.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
	movq	%rsi, %r12
	movq	%rdi, %r13
	leaq	16(%rsi), %r14
	movq	8(%rsi), %r15
	movq	_VOU_CRTC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rsi)
	movq	_DRM_MODE_ENCODER_DAC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_zx_vga_encoder_funcs@GOTPCREL(%rip), %rdx
	movq	%r14, %rsi
	xorl	%r8d, %r8d
	callq	_drm_encoder_init
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_DRM_DEV_ERROR
	jmp	LBB0_8
LBB0_2:
	movq	_zx_vga_encoder_helper_funcs@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	callq	_drm_encoder_helper_add
	movq	_DRM_CONNECTOR_POLL_HPD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r12)
	movq	_DRM_MODE_CONNECTOR_VGA@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_zx_vga_connector_funcs@GOTPCREL(%rip), %rdx
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_drm_connector_init
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_DRM_DEV_ERROR
	jmp	LBB0_7
LBB0_4:
	movq	_zx_vga_connector_helper_funcs@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	callq	_drm_connector_helper_add
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_drm_connector_attach_encoder
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_DRM_DEV_ERROR
	movq	%r12, %rdi
	callq	_drm_connector_cleanup
LBB0_7:
	movq	%r14, %rdi
	callq	_drm_encoder_cleanup
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	xorl	%ebx, %ebx
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_VOU_CRTC_MASK,4,2              ## @VOU_CRTC_MASK
	.comm	_zx_vga_encoder_funcs,4,2       ## @zx_vga_encoder_funcs
	.comm	_DRM_MODE_ENCODER_DAC,4,2       ## @DRM_MODE_ENCODER_DAC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to init encoder: %d\n"

	.comm	_zx_vga_encoder_helper_funcs,4,2 ## @zx_vga_encoder_helper_funcs
	.comm	_DRM_CONNECTOR_POLL_HPD,4,2     ## @DRM_CONNECTOR_POLL_HPD
	.comm	_zx_vga_connector_funcs,4,2     ## @zx_vga_connector_funcs
	.comm	_DRM_MODE_CONNECTOR_VGA,4,2     ## @DRM_MODE_CONNECTOR_VGA
L_.str.1:                               ## @.str.1
	.asciz	"failed to init connector: %d\n"

	.comm	_zx_vga_connector_helper_funcs,4,2 ## @zx_vga_connector_helper_funcs
L_.str.2:                               ## @.str.2
	.asciz	"failed to attach encoder: %d\n"

	.no_dead_strip	_zx_vga_register
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function zx_vga_register
_zx_vga_register:                       ; @zx_vga_register
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x23, x0
Lloh0:
	adrp	x8, _VOU_CRTC_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VOU_CRTC_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mov	x19, x1
	str	w8, [x19, #16]!
	ldur	x21, [x19, #-8]
Lloh3:
	adrp	x8, _DRM_MODE_ENCODER_DAC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DRM_MODE_ENCODER_DAC@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
Lloh6:
	adrp	x2, _zx_vga_encoder_funcs@GOTPAGE
Lloh7:
	ldr	x2, [x2, _zx_vga_encoder_funcs@GOTPAGEOFF]
	mov	x1, x19
	mov	x4, #0
	bl	_drm_encoder_init
	cbz	w0, LBB0_2
; %bb.1:
	mov	x22, x0
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_DRM_DEV_ERROR
	b	LBB0_7
LBB0_2:
Lloh10:
	adrp	x1, _zx_vga_encoder_helper_funcs@GOTPAGE
Lloh11:
	ldr	x1, [x1, _zx_vga_encoder_helper_funcs@GOTPAGEOFF]
	mov	x0, x19
	bl	_drm_encoder_helper_add
Lloh12:
	adrp	x8, _DRM_CONNECTOR_POLL_HPD@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DRM_CONNECTOR_POLL_HPD@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x20]
Lloh15:
	adrp	x8, _DRM_MODE_CONNECTOR_VGA@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DRM_MODE_CONNECTOR_VGA@GOTPAGEOFF]
Lloh17:
	ldr	w3, [x8]
Lloh18:
	adrp	x2, _zx_vga_connector_funcs@GOTPAGE
Lloh19:
	ldr	x2, [x2, _zx_vga_connector_funcs@GOTPAGEOFF]
	mov	x0, x23
	mov	x1, x20
	bl	_drm_connector_init
	cbz	w0, LBB0_4
; %bb.3:
	mov	x22, x0
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_DRM_DEV_ERROR
	b	LBB0_6
LBB0_4:
Lloh22:
	adrp	x1, _zx_vga_connector_helper_funcs@GOTPAGE
Lloh23:
	ldr	x1, [x1, _zx_vga_connector_helper_funcs@GOTPAGEOFF]
	mov	x0, x20
	bl	_drm_connector_helper_add
	mov	x0, x20
	mov	x1, x19
	bl	_drm_connector_attach_encoder
	mov	x22, x0
	cbz	w0, LBB0_7
; %bb.5:
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_DRM_DEV_ERROR
	mov	x0, x20
	bl	_drm_connector_cleanup
LBB0_6:
	mov	x0, x19
	bl	_drm_encoder_cleanup
LBB0_7:
	mov	x0, x22
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_VOU_CRTC_MASK,4,2              ; @VOU_CRTC_MASK
	.comm	_zx_vga_encoder_funcs,4,2       ; @zx_vga_encoder_funcs
	.comm	_DRM_MODE_ENCODER_DAC,4,2       ; @DRM_MODE_ENCODER_DAC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to init encoder: %d\n"

	.comm	_zx_vga_encoder_helper_funcs,4,2 ; @zx_vga_encoder_helper_funcs
	.comm	_DRM_CONNECTOR_POLL_HPD,4,2     ; @DRM_CONNECTOR_POLL_HPD
	.comm	_zx_vga_connector_funcs,4,2     ; @zx_vga_connector_funcs
	.comm	_DRM_MODE_CONNECTOR_VGA,4,2     ; @DRM_MODE_CONNECTOR_VGA
l_.str.1:                               ; @.str.1
	.asciz	"failed to init connector: %d\n"

	.comm	_zx_vga_connector_helper_funcs,4,2 ; @zx_vga_connector_helper_funcs
l_.str.2:                               ; @.str.2
	.asciz	"failed to attach encoder: %d\n"

	.no_dead_strip	_zx_vga_register
.subsections_via_symbols
