	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kirin_drm_kms_init
_kirin_drm_kms_init:                    ## @kirin_drm_kms_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	callq	_drm_mode_config_init
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%r15)
	movl	4(%rbx), %eax
	movl	%eax, 20(%r15)
	movl	%eax, 16(%r15)
	movl	(%rbx), %eax
	movl	%eax, 12(%r15)
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_kirin_drm_private_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	movl	4(%r15), %edi
	movq	%r15, %rsi
	callq	_component_bind_all
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_5
LBB0_3:
	movl	8(%r15), %esi
	movq	%r15, %rdi
	callq	_drm_vblank_init
	testl	%eax, %eax
	je	LBB0_8
## %bb.4:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	movl	4(%r15), %edi
	movq	%r15, %rsi
	callq	_component_unbind_all
LBB0_5:
	movq	%r15, %rdi
	callq	_kirin_drm_private_cleanup
LBB0_6:
	movq	%r15, %rdi
	callq	_drm_mode_config_cleanup
LBB0_7:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	$1, (%r15)
	movq	%r15, %rdi
	callq	_drm_mode_config_reset
	movq	%r15, %rdi
	callq	_drm_kms_helper_poll_init
	xorl	%r14d, %r14d
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to bind all component.\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to initialize vblank.\n"

	.no_dead_strip	_kirin_drm_kms_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kirin_drm_kms_init
_kirin_drm_kms_init:                    ; @kirin_drm_kms_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	bl	_drm_mode_config_init
	stp	xzr, xzr, [x19, #24]
	ldp	w9, w8, [x20]
	stp	w8, w8, [x19, #16]
	str	w9, [x19, #12]
	mov	x0, x19
	mov	x1, x20
	bl	_kirin_drm_private_init
	mov	x20, x0
	cbnz	w0, LBB0_6
; %bb.1:
	ldr	w0, [x19, #4]
	mov	x1, x19
	bl	_component_bind_all
	cbz	w0, LBB0_3
; %bb.2:
	mov	x20, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_5
LBB0_3:
	ldr	w1, [x19, #8]
	mov	x0, x19
	bl	_drm_vblank_init
	mov	x20, x0
	cbz	w0, LBB0_8
; %bb.4:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	ldr	w0, [x19, #4]
	mov	x1, x19
	bl	_component_unbind_all
LBB0_5:
	mov	x0, x19
	bl	_kirin_drm_private_cleanup
LBB0_6:
	mov	x0, x19
	bl	_drm_mode_config_cleanup
LBB0_7:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_8:
	mov	w8, #1
	str	w8, [x19]
	mov	x0, x19
	bl	_drm_mode_config_reset
	mov	x0, x19
	bl	_drm_kms_helper_poll_init
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to bind all component.\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to initialize vblank.\n"

	.no_dead_strip	_kirin_drm_kms_init
.subsections_via_symbols
