	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_drm_bind
_mtk_drm_bind:                          ## @mtk_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_dev_get_drvdata
	movq	%rax, %r14
	movq	_mtk_drm_driver@GOTPCREL(%rip), %rdi
	movq	%rbx, %rsi
	callq	_drm_dev_alloc
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.9:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movq	%r14, (%rbx)
	movq	%rbx, (%r14)
	movq	%rbx, %rdi
	callq	_mtk_drm_kms_init
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_drm_dev_register
	testl	%eax, %eax
	js	LBB0_6
## %bb.4:
	movq	%rbx, %rdi
	movl	$32, %esi
	callq	_drm_fbdev_generic_setup
	testl	%eax, %eax
	je	LBB0_8
## %bb.5:
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_DRM_ERROR
	jmp	LBB0_8
LBB0_2:
	movl	%eax, %r14d
	jmp	LBB0_7
LBB0_6:
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_mtk_drm_kms_deinit
	movl	%r15d, %r14d
LBB0_7:
	movq	%rbx, %rdi
	callq	_drm_dev_put
LBB0_8:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mtk_drm_driver,4,2             ## @mtk_drm_driver
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to initialize fbdev: %d\n"

	.no_dead_strip	_mtk_drm_bind
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_drm_bind
_mtk_drm_bind:                          ; @mtk_drm_bind
	.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	x19, x0
	bl	_dev_get_drvdata
	mov	x20, x0
Lloh0:
	adrp	x0, _mtk_drm_driver@GOTPAGE
Lloh1:
	ldr	x0, [x0, _mtk_drm_driver@GOTPAGEOFF]
	mov	x1, x19
	bl	_drm_dev_alloc
	mov	x19, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_2:
	str	x20, [x19]
	str	x19, [x20]
	mov	x0, x19
	bl	_mtk_drm_kms_init
	tbnz	w0, #31, LBB0_7
; %bb.3:
	mov	x0, x19
	mov	w1, #0
	bl	_drm_dev_register
	tbnz	w0, #31, LBB0_8
; %bb.4:
	mov	x0, x19
	mov	w1, #32
	bl	_drm_fbdev_generic_setup
	cbz	w0, LBB0_6
; %bb.5:
	mov	x1, x0
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_6:
	mov	w20, #0
	b	LBB0_10
LBB0_7:
	mov	x20, x0
	b	LBB0_9
LBB0_8:
	mov	x20, x0
	mov	x0, x19
	bl	_mtk_drm_kms_deinit
LBB0_9:
	mov	x0, x19
	bl	_drm_dev_put
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_mtk_drm_driver,4,2             ; @mtk_drm_driver
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to initialize fbdev: %d\n"

	.no_dead_strip	_mtk_drm_bind
.subsections_via_symbols
