	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sun4i_rgb_init                 ## -- Begin function sun4i_rgb_init
	.p2align	4, 0x90
_sun4i_rgb_init:                        ## @sun4i_rgb_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %r14
	movl	(%rdi), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$40, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	%r13, 32(%rax)
	movq	8(%r13), %rax
	movl	(%rax), %edi
	leaq	24(%r15), %rcx
	leaq	8(%r15), %r12
	xorl	%ebx, %ebx
	movl	$1, %esi
	xorl	%edx, %edx
	movq	%r12, %r8
	callq	_drm_of_find_panel_or_bridge
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	jmp	LBB0_15
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_4:
	movq	_sun4i_rgb_enc_helper_funcs@GOTPCREL(%rip), %rsi
	movq	%r15, %rdi
	callq	_drm_encoder_helper_add
	movq	_DRM_MODE_ENCODER_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_sun4i_rgb_enc_funcs@GOTPCREL(%rip), %rdx
	movq	%r14, %rdi
	movq	%r15, %rsi
	xorl	%r8d, %r8d
	callq	_drm_encoder_init
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_15
LBB0_6:
	movq	(%r13), %rdi
	callq	_drm_crtc_mask
	movl	%eax, (%r15)
	cmpq	$0, 24(%r15)
	je	LBB0_11
## %bb.7:
	movq	%r15, %r13
	addq	$16, %r13
	movq	_sun4i_rgb_con_helper_funcs@GOTPCREL(%rip), %rsi
	movq	%r13, %rdi
	callq	_drm_connector_helper_add
	movq	_DRM_MODE_CONNECTOR_Unknown@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_sun4i_rgb_con_funcs@GOTPCREL(%rip), %rdx
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_drm_connector_init
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_14
LBB0_9:
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_drm_connector_attach_encoder
	movq	24(%r15), %rdi
	movq	%r13, %rsi
	callq	_drm_panel_attach
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_14
LBB0_11:
	movq	(%r12), %rsi
	xorl	%ebx, %ebx
	testq	%rsi, %rsi
	je	LBB0_15
## %bb.12:
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_drm_bridge_attach
	testl	%eax, %eax
	je	LBB0_15
## %bb.13:
	leaq	L_.str.4(%rip), %rsi
	movl	%eax, %ebx
LBB0_14:
	movl	(%r14), %edi
	callq	_dev_err
	movq	%r15, %rdi
	callq	_drm_encoder_cleanup
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No panel or bridge found... RGB output disabled\n"

	.comm	_sun4i_rgb_enc_helper_funcs,4,2 ## @sun4i_rgb_enc_helper_funcs
	.comm	_sun4i_rgb_enc_funcs,4,2        ## @sun4i_rgb_enc_funcs
	.comm	_DRM_MODE_ENCODER_NONE,4,2      ## @DRM_MODE_ENCODER_NONE
L_.str.1:                               ## @.str.1
	.asciz	"Couldn't initialise the rgb encoder\n"

	.comm	_sun4i_rgb_con_helper_funcs,4,2 ## @sun4i_rgb_con_helper_funcs
	.comm	_sun4i_rgb_con_funcs,4,2        ## @sun4i_rgb_con_funcs
	.comm	_DRM_MODE_CONNECTOR_Unknown,4,2 ## @DRM_MODE_CONNECTOR_Unknown
L_.str.2:                               ## @.str.2
	.asciz	"Couldn't initialise the rgb connector\n"

L_.str.3:                               ## @.str.3
	.asciz	"Couldn't attach our panel\n"

L_.str.4:                               ## @.str.4
	.asciz	"Couldn't attach our bridge\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sun4i_rgb_init                 ; -- Begin function sun4i_rgb_init
	.p2align	2
_sun4i_rgb_init:                        ; @sun4i_rgb_init
	.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	x23, x1
	mov	x19, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #40
	bl	_devm_kzalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x0
	str	x23, [x0, #32]
	ldr	x8, [x23, #8]
	ldr	w0, [x8]
	add	x3, x20, #24
	add	x21, x20, #8
	mov	w1, #1
	mov	w2, #0
	mov	x4, x21
	bl	_drm_of_find_panel_or_bridge
	cbz	w0, LBB0_5
; %bb.2:
	ldr	w0, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
LBB0_3:
	mov	w22, #0
	b	LBB0_16
LBB0_4:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_16
LBB0_5:
Lloh8:
	adrp	x1, _sun4i_rgb_enc_helper_funcs@GOTPAGE
Lloh9:
	ldr	x1, [x1, _sun4i_rgb_enc_helper_funcs@GOTPAGEOFF]
	mov	x0, x20
	bl	_drm_encoder_helper_add
Lloh10:
	adrp	x8, _DRM_MODE_ENCODER_NONE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DRM_MODE_ENCODER_NONE@GOTPAGEOFF]
Lloh12:
	ldr	w3, [x8]
Lloh13:
	adrp	x2, _sun4i_rgb_enc_funcs@GOTPAGE
Lloh14:
	ldr	x2, [x2, _sun4i_rgb_enc_funcs@GOTPAGEOFF]
	mov	x0, x19
	mov	x1, x20
	mov	x4, #0
	bl	_drm_encoder_init
	cbz	w0, LBB0_7
; %bb.6:
	mov	x22, x0
	ldr	w0, [x19]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_16
LBB0_7:
	ldr	x0, [x23]
	bl	_drm_crtc_mask
	str	w0, [x20]
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_12
; %bb.8:
	add	x23, x20, #16
Lloh17:
	adrp	x1, _sun4i_rgb_con_helper_funcs@GOTPAGE
Lloh18:
	ldr	x1, [x1, _sun4i_rgb_con_helper_funcs@GOTPAGEOFF]
	mov	x0, x23
	bl	_drm_connector_helper_add
Lloh19:
	adrp	x8, _DRM_MODE_CONNECTOR_Unknown@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DRM_MODE_CONNECTOR_Unknown@GOTPAGEOFF]
Lloh21:
	ldr	w3, [x8]
Lloh22:
	adrp	x2, _sun4i_rgb_con_funcs@GOTPAGE
Lloh23:
	ldr	x2, [x2, _sun4i_rgb_con_funcs@GOTPAGEOFF]
	mov	x0, x19
	mov	x1, x23
	bl	_drm_connector_init
	cbz	w0, LBB0_10
; %bb.9:
	mov	x22, x0
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_15
LBB0_10:
	mov	x0, x23
	mov	x1, x20
	bl	_drm_connector_attach_encoder
	ldr	x0, [x20, #24]
	mov	x1, x23
	bl	_drm_panel_attach
	cbz	w0, LBB0_12
; %bb.11:
	mov	x22, x0
Lloh26:
	adrp	x1, l_.str.3@PAGE
Lloh27:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_15
LBB0_12:
	ldr	x1, [x21]
	cbz	x1, LBB0_3
; %bb.13:
	mov	x0, x20
	mov	x2, #0
	bl	_drm_bridge_attach
	mov	x22, x0
	cbz	w0, LBB0_16
; %bb.14:
Lloh28:
	adrp	x1, l_.str.4@PAGE
Lloh29:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_15:
	ldr	w0, [x19]
	bl	_dev_err
	mov	x0, x20
	bl	_drm_encoder_cleanup
LBB0_16:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No panel or bridge found... RGB output disabled\n"

	.comm	_sun4i_rgb_enc_helper_funcs,4,2 ; @sun4i_rgb_enc_helper_funcs
	.comm	_sun4i_rgb_enc_funcs,4,2        ; @sun4i_rgb_enc_funcs
	.comm	_DRM_MODE_ENCODER_NONE,4,2      ; @DRM_MODE_ENCODER_NONE
l_.str.1:                               ; @.str.1
	.asciz	"Couldn't initialise the rgb encoder\n"

	.comm	_sun4i_rgb_con_helper_funcs,4,2 ; @sun4i_rgb_con_helper_funcs
	.comm	_sun4i_rgb_con_funcs,4,2        ; @sun4i_rgb_con_funcs
	.comm	_DRM_MODE_CONNECTOR_Unknown,4,2 ; @DRM_MODE_CONNECTOR_Unknown
l_.str.2:                               ; @.str.2
	.asciz	"Couldn't initialise the rgb connector\n"

l_.str.3:                               ; @.str.3
	.asciz	"Couldn't attach our panel\n"

l_.str.4:                               ; @.str.4
	.asciz	"Couldn't attach our bridge\n"

.subsections_via_symbols
