	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kirin_drm_bind
_kirin_drm_bind:                        ## @kirin_drm_bind
	.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	%rdi, %rbx
	callq	_of_device_get_match_data
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	movl	8(%rax), %edi
	movq	%rbx, %rsi
	callq	_drm_dev_alloc
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_3
## %bb.11:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_10
LBB0_3:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_dev_set_drvdata
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_kirin_drm_kms_init
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.4:
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_drm_dev_register
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_8
## %bb.5:
	movq	%r14, %rdi
	movl	$32, %esi
	callq	_drm_fbdev_generic_setup
	cmpq	$0, (%r13)
	je	LBB0_10
## %bb.6:
	movq	%r14, %rdi
	callq	_kirin_drm_connectors_register
	testl	%eax, %eax
	je	LBB0_10
## %bb.7:
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_drm_dev_unregister
LBB0_8:
	movq	%r14, %rdi
	callq	_kirin_drm_kms_cleanup
LBB0_9:
	movq	%r14, %rdi
	callq	_drm_dev_put
	movl	%r12d, %r15d
LBB0_10:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_kirin_drm_bind
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kirin_drm_bind
_kirin_drm_bind:                        ; @kirin_drm_bind
	.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	x21, x0
	bl	_of_device_get_match_data
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	w0, [x0, #8]
	mov	x1, x21
	bl	_drm_dev_alloc
	mov	x19, x0
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x19
	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
	b	_PTR_ERR
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_8
LBB0_4:
	mov	x0, x21
	mov	x1, x19
	bl	_dev_set_drvdata
	mov	x0, x19
	mov	x1, x20
	bl	_kirin_drm_kms_init
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.5:
	mov	x0, x19
	mov	w1, #0
	bl	_drm_dev_register
	mov	x21, x0
	cbz	w0, LBB0_9
LBB0_6:
	mov	x0, x19
	bl	_kirin_drm_kms_cleanup
LBB0_7:
	mov	x0, x19
	bl	_drm_dev_put
LBB0_8:
	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
LBB0_9:
	mov	x0, x19
	mov	w1, #32
	bl	_drm_fbdev_generic_setup
	ldr	x8, [x20]
	cbz	x8, LBB0_12
; %bb.10:
	mov	x0, x19
	bl	_kirin_drm_connectors_register
	mov	x21, x0
	cbz	w0, LBB0_8
; %bb.11:
	mov	x0, x19
	bl	_drm_dev_unregister
	b	LBB0_6
LBB0_12:
	mov	w21, #0
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_kirin_drm_bind
.subsections_via_symbols
