	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vkms_output_init               ## -- Begin function vkms_output_init
	.p2align	4, 0x90
_vkms_output_init:                      ## @vkms_output_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	_DRM_PLANE_TYPE_PRIMARY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	callq	_vkms_plane_init
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.18:
	movq	%r15, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movq	_enable_cursor@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.6:
	movq	_DRM_PLANE_TYPE_CURSOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_vkms_plane_init
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_3
## %bb.7:
	movq	%r14, %rdi
	callq	_PTR_ERR
	movl	%eax, %r13d
	jmp	LBB0_16
LBB0_2:
	xorl	%r14d, %r14d
LBB0_3:
	leaq	4(%r12), %rbx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	movq	%r14, %rcx
	callq	_vkms_crtc_init
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_14
## %bb.4:
	leaq	12(%r12), %rsi
	movq	_DRM_MODE_CONNECTOR_VIRTUAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_vkms_connector_funcs@GOTPCREL(%rip), %rdx
	movq	%r12, %rdi
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	callq	_drm_connector_init
	testl	%eax, %eax
	je	LBB0_8
## %bb.5:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_13
LBB0_8:
	leaq	8(%r12), %r13
	movq	_vkms_conn_helper_funcs@GOTPCREL(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_drm_connector_helper_add
	movq	_DRM_MODE_ENCODER_VIRTUAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_vkms_encoder_funcs@GOTPCREL(%rip), %rdx
	movq	%r12, %rdi
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %rsi
	xorl	%r8d, %r8d
	callq	_drm_encoder_init
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %r13d
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_12
LBB0_10:
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	$1, (%rsi)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_drm_connector_attach_encoder
	testl	%eax, %eax
	je	LBB0_19
## %bb.11:
	movl	%eax, %r13d
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_ERROR
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_drm_encoder_cleanup
LBB0_12:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_drm_connector_cleanup
LBB0_13:
	movq	%rbx, %rdi
	callq	_drm_crtc_cleanup
LBB0_14:
	movq	_enable_cursor@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_16
## %bb.15:
	movq	%r14, %rdi
	callq	_drm_plane_cleanup
LBB0_16:
	movq	%r15, %rdi
	callq	_drm_plane_cleanup
LBB0_17:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	%r12, %rdi
	callq	_drm_mode_config_reset
	xorl	%r13d, %r13d
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_PLANE_TYPE_PRIMARY,4,2     ## @DRM_PLANE_TYPE_PRIMARY
	.comm	_enable_cursor,8,3              ## @enable_cursor
	.comm	_DRM_PLANE_TYPE_CURSOR,4,2      ## @DRM_PLANE_TYPE_CURSOR
	.comm	_vkms_connector_funcs,4,2       ## @vkms_connector_funcs
	.comm	_DRM_MODE_CONNECTOR_VIRTUAL,4,2 ## @DRM_MODE_CONNECTOR_VIRTUAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to init connector\n"

	.comm	_vkms_conn_helper_funcs,4,2     ## @vkms_conn_helper_funcs
	.comm	_vkms_encoder_funcs,4,2         ## @vkms_encoder_funcs
	.comm	_DRM_MODE_ENCODER_VIRTUAL,4,2   ## @DRM_MODE_ENCODER_VIRTUAL
L_.str.1:                               ## @.str.1
	.asciz	"Failed to init encoder\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to attach connector to encoder\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vkms_output_init               ; -- Begin function vkms_output_init
	.p2align	2
_vkms_output_init:                      ; @vkms_output_init
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _DRM_PLANE_TYPE_PRIMARY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRM_PLANE_TYPE_PRIMARY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x2, x20
	bl	_vkms_plane_init
	mov	x19, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_2:
Lloh3:
	adrp	x26, _enable_cursor@GOTPAGE
Lloh4:
	ldr	x26, [x26, _enable_cursor@GOTPAGEOFF]
	ldr	x8, [x26]
	cbz	x8, LBB0_5
; %bb.3:
Lloh5:
	adrp	x8, _DRM_PLANE_TYPE_CURSOR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DRM_PLANE_TYPE_CURSOR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x20
	bl	_vkms_plane_init
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_6
; %bb.4:
	mov	x0, x20
	bl	_PTR_ERR
	mov	x23, x0
	b	LBB0_17
LBB0_5:
	mov	x20, #0
LBB0_6:
	add	x22, x21, #4
	mov	x0, x21
	mov	x1, x22
	mov	x2, x19
	mov	x3, x20
	bl	_vkms_crtc_init
	mov	x23, x0
	cbnz	w0, LBB0_15
; %bb.7:
	add	x24, x21, #12
Lloh8:
	adrp	x8, _DRM_MODE_CONNECTOR_VIRTUAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DRM_MODE_CONNECTOR_VIRTUAL@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
Lloh11:
	adrp	x2, _vkms_connector_funcs@GOTPAGE
Lloh12:
	ldr	x2, [x2, _vkms_connector_funcs@GOTPAGEOFF]
	mov	x0, x21
	mov	x1, x24
	bl	_drm_connector_init
	cbz	w0, LBB0_9
; %bb.8:
	mov	x23, x0
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_14
LBB0_9:
	add	x25, x21, #8
Lloh15:
	adrp	x1, _vkms_conn_helper_funcs@GOTPAGE
Lloh16:
	ldr	x1, [x1, _vkms_conn_helper_funcs@GOTPAGEOFF]
	mov	x0, x24
	bl	_drm_connector_helper_add
Lloh17:
	adrp	x8, _DRM_MODE_ENCODER_VIRTUAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _DRM_MODE_ENCODER_VIRTUAL@GOTPAGEOFF]
Lloh19:
	ldr	w3, [x8]
Lloh20:
	adrp	x2, _vkms_encoder_funcs@GOTPAGE
Lloh21:
	ldr	x2, [x2, _vkms_encoder_funcs@GOTPAGEOFF]
	mov	x0, x21
	mov	x1, x25
	mov	x4, #0
	bl	_drm_encoder_init
	cbz	w0, LBB0_11
; %bb.10:
	mov	x23, x0
Lloh22:
	adrp	x0, l_.str.1@PAGE
Lloh23:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_13
LBB0_11:
	mov	w8, #1
	str	w8, [x25]
	mov	x0, x24
	mov	x1, x25
	bl	_drm_connector_attach_encoder
	mov	x23, x0
	cbz	w0, LBB0_19
; %bb.12:
Lloh24:
	adrp	x0, l_.str.2@PAGE
Lloh25:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
	mov	x0, x25
	bl	_drm_encoder_cleanup
LBB0_13:
	mov	x0, x24
	bl	_drm_connector_cleanup
LBB0_14:
	mov	x0, x22
	bl	_drm_crtc_cleanup
LBB0_15:
	ldr	x8, [x26]
	cbz	x8, LBB0_17
; %bb.16:
	mov	x0, x20
	bl	_drm_plane_cleanup
LBB0_17:
	mov	x0, x19
	bl	_drm_plane_cleanup
LBB0_18:
	mov	x0, x23
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_19:
	mov	x0, x21
	bl	_drm_mode_config_reset
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_PLANE_TYPE_PRIMARY,4,2     ; @DRM_PLANE_TYPE_PRIMARY
	.comm	_enable_cursor,8,3              ; @enable_cursor
	.comm	_DRM_PLANE_TYPE_CURSOR,4,2      ; @DRM_PLANE_TYPE_CURSOR
	.comm	_vkms_connector_funcs,4,2       ; @vkms_connector_funcs
	.comm	_DRM_MODE_CONNECTOR_VIRTUAL,4,2 ; @DRM_MODE_CONNECTOR_VIRTUAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to init connector\n"

	.comm	_vkms_conn_helper_funcs,4,2     ; @vkms_conn_helper_funcs
	.comm	_vkms_encoder_funcs,4,2         ; @vkms_encoder_funcs
	.comm	_DRM_MODE_ENCODER_VIRTUAL,4,2   ; @DRM_MODE_ENCODER_VIRTUAL
l_.str.1:                               ; @.str.1
	.asciz	"Failed to init encoder\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to attach connector to encoder\n"

.subsections_via_symbols
