	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun6i_dsi_setup_format
_sun6i_dsi_setup_format:                ## @sun6i_dsi_setup_format
	.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, %r12
	movq	%rdi, %r15
	movq	8(%rdi), %r14
	movl	4(%r14), %edi
	callq	_SUN6I_DSI_PIXEL_PH_VC
	movl	%eax, %r13d
	movl	(%r14), %eax
	addl	$-128, %eax
	cmpl	$3, %eax
	ja	LBB0_1
## %bb.2:
	cltq
	leaq	l_switch.table.sun6i_dsi_setup_format(%rip), %rcx
	movq	(%rcx,%rax,8), %rcx
	leaq	L_switch.table.sun6i_dsi_setup_format.1(%rip), %rdx
	movl	(%rdx,%rax,4), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	(%rcx), %edi
	callq	_SUN6I_DSI_PIXEL_PH_DT
	orl	%eax, %r13d
	movl	(%r12), %ebx
	movl	(%r14), %edi
	callq	_mipi_dsi_pixel_format_to_bpp
	imull	%eax, %ebx
	leal	7(%rbx), %edi
	testl	%ebx, %ebx
	cmovnsl	%ebx, %edi
	sarl	$3, %edi
	callq	_SUN6I_DSI_PIXEL_PH_WC
	orl	%eax, %r13d
	movl	%r13d, %edi
	callq	_sun6i_dsi_ecc_compute
	movl	%eax, %edi
	callq	_SUN6I_DSI_PIXEL_PH_ECC
	orl	%eax, %r13d
	movl	(%r15), %edi
	movq	_SUN6I_DSI_PIXEL_PH_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edx
	callq	_regmap_write
	movl	(%r15), %r12d
	movq	_SUN6I_DSI_PIXEL_PF0_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	$65535, %edi                    ## imm = 0xFFFF
	callq	_SUN6I_DSI_PIXEL_PF0_CRC_FORCE
	movl	%r12d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_regmap_write
	movl	(%r15), %r12d
	movq	_SUN6I_DSI_PIXEL_PF1_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	$65535, %edi                    ## imm = 0xFFFF
	callq	_SUN6I_DSI_PIXEL_PF1_CRC_INIT_LINE0
	movl	%eax, %ebx
	movl	$65535, %edi                    ## imm = 0xFFFF
	callq	_SUN6I_DSI_PIXEL_PF1_CRC_INIT_LINEN
	orl	%eax, %ebx
	movl	%r12d, %edi
	movl	%r13d, %esi
	movl	%ebx, %edx
	callq	_regmap_write
	movl	(%r15), %r15d
	movq	_SUN6I_DSI_PIXEL_CTL0_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_SUN6I_DSI_PIXEL_CTL0_PD_PLUG_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_SUN6I_DSI_PIXEL_CTL0_FORMAT
	orl	%eax, %ebx
	movl	%r15d, %edi
	movl	%r12d, %esi
	movl	%ebx, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_regmap_write                   ## TAILCALL
LBB0_1:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MIPI_DSI_PACKED_PIXEL_STREAM_24,4,2 ## @MIPI_DSI_PACKED_PIXEL_STREAM_24
	.comm	_MIPI_DSI_PIXEL_STREAM_3BYTE_18,4,2 ## @MIPI_DSI_PIXEL_STREAM_3BYTE_18
	.comm	_MIPI_DSI_PACKED_PIXEL_STREAM_18,4,2 ## @MIPI_DSI_PACKED_PIXEL_STREAM_18
	.comm	_MIPI_DSI_PACKED_PIXEL_STREAM_16,4,2 ## @MIPI_DSI_PACKED_PIXEL_STREAM_16
	.comm	_SUN6I_DSI_PIXEL_PH_REG,4,2     ## @SUN6I_DSI_PIXEL_PH_REG
	.comm	_SUN6I_DSI_PIXEL_PF0_REG,4,2    ## @SUN6I_DSI_PIXEL_PF0_REG
	.comm	_SUN6I_DSI_PIXEL_PF1_REG,4,2    ## @SUN6I_DSI_PIXEL_PF1_REG
	.comm	_SUN6I_DSI_PIXEL_CTL0_REG,4,2   ## @SUN6I_DSI_PIXEL_CTL0_REG
	.comm	_SUN6I_DSI_PIXEL_CTL0_PD_PLUG_DISABLE,4,2 ## @SUN6I_DSI_PIXEL_CTL0_PD_PLUG_DISABLE
	.no_dead_strip	_sun6i_dsi_setup_format
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.sun6i_dsi_setup_format
l_switch.table.sun6i_dsi_setup_format:
	.quad	_MIPI_DSI_PACKED_PIXEL_STREAM_24
	.quad	_MIPI_DSI_PACKED_PIXEL_STREAM_18
	.quad	_MIPI_DSI_PIXEL_STREAM_3BYTE_18
	.quad	_MIPI_DSI_PACKED_PIXEL_STREAM_16

	.section	__TEXT,__literal16,16byte_literals
	.p2align	2                               ## @switch.table.sun6i_dsi_setup_format.1
L_switch.table.sun6i_dsi_setup_format.1:
	.long	8                               ## 0x8
	.long	10                              ## 0xa
	.long	9                               ## 0x9
	.long	11                              ## 0xb

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun6i_dsi_setup_format
_sun6i_dsi_setup_format:                ; @sun6i_dsi_setup_format
	.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	x21, x1
	mov	x19, x0
	ldr	x23, [x0, #8]
	ldr	w0, [x23, #4]
	bl	_SUN6I_DSI_PIXEL_PH_VC
	ldr	w8, [x23]
	sub	w8, w8, #128
	cmp	w8, #3
	b.hi	LBB0_2
; %bb.1:
	mov	x22, x0
Lloh0:
	adrp	x9, l_switch.table.sun6i_dsi_setup_format@PAGE
Lloh1:
	add	x9, x9, l_switch.table.sun6i_dsi_setup_format@PAGEOFF
	ldr	x9, [x9, w8, sxtw #3]
Lloh2:
	adrp	x10, l_switch.table.sun6i_dsi_setup_format.1@PAGE
Lloh3:
	add	x10, x10, l_switch.table.sun6i_dsi_setup_format.1@PAGEOFF
	ldr	w20, [x10, w8, sxtw #2]
	ldr	w0, [x9]
	bl	_SUN6I_DSI_PIXEL_PH_DT
	orr	w22, w0, w22
	ldr	w21, [x21]
	ldr	w0, [x23]
	bl	_mipi_dsi_pixel_format_to_bpp
	mul	w8, w0, w21
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w0, w8, #3
	bl	_SUN6I_DSI_PIXEL_PH_WC
	orr	w21, w22, w0
	mov	x0, x21
	bl	_sun6i_dsi_ecc_compute
	bl	_SUN6I_DSI_PIXEL_PH_ECC
	orr	w2, w0, w21
	ldr	w0, [x19]
Lloh4:
	adrp	x8, _SUN6I_DSI_PIXEL_PH_REG@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SUN6I_DSI_PIXEL_PH_REG@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	bl	_regmap_write
	ldr	w21, [x19]
Lloh7:
	adrp	x8, _SUN6I_DSI_PIXEL_PF0_REG@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SUN6I_DSI_PIXEL_PF0_REG@GOTPAGEOFF]
Lloh9:
	ldr	w22, [x8]
	mov	w0, #65535
	bl	_SUN6I_DSI_PIXEL_PF0_CRC_FORCE
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_regmap_write
	ldr	w21, [x19]
Lloh10:
	adrp	x8, _SUN6I_DSI_PIXEL_PF1_REG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SUN6I_DSI_PIXEL_PF1_REG@GOTPAGEOFF]
Lloh12:
	ldr	w22, [x8]
	mov	w0, #65535
	bl	_SUN6I_DSI_PIXEL_PF1_CRC_INIT_LINE0
	mov	x23, x0
	mov	w0, #65535
	bl	_SUN6I_DSI_PIXEL_PF1_CRC_INIT_LINEN
	orr	w2, w0, w23
	mov	x0, x21
	mov	x1, x22
	bl	_regmap_write
	ldr	w19, [x19]
Lloh13:
	adrp	x8, _SUN6I_DSI_PIXEL_CTL0_REG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SUN6I_DSI_PIXEL_CTL0_REG@GOTPAGEOFF]
Lloh15:
	ldr	w21, [x8]
Lloh16:
	adrp	x8, _SUN6I_DSI_PIXEL_CTL0_PD_PLUG_DISABLE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SUN6I_DSI_PIXEL_CTL0_PD_PLUG_DISABLE@GOTPAGEOFF]
Lloh18:
	ldr	w22, [x8]
	mov	x0, x20
	bl	_SUN6I_DSI_PIXEL_CTL0_FORMAT
	orr	w2, w0, w22
	mov	x0, x19
	mov	x1, x21
	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
	b	_regmap_write
LBB0_2:
	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	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_MIPI_DSI_PACKED_PIXEL_STREAM_24,4,2 ; @MIPI_DSI_PACKED_PIXEL_STREAM_24
	.comm	_MIPI_DSI_PIXEL_STREAM_3BYTE_18,4,2 ; @MIPI_DSI_PIXEL_STREAM_3BYTE_18
	.comm	_MIPI_DSI_PACKED_PIXEL_STREAM_18,4,2 ; @MIPI_DSI_PACKED_PIXEL_STREAM_18
	.comm	_MIPI_DSI_PACKED_PIXEL_STREAM_16,4,2 ; @MIPI_DSI_PACKED_PIXEL_STREAM_16
	.comm	_SUN6I_DSI_PIXEL_PH_REG,4,2     ; @SUN6I_DSI_PIXEL_PH_REG
	.comm	_SUN6I_DSI_PIXEL_PF0_REG,4,2    ; @SUN6I_DSI_PIXEL_PF0_REG
	.comm	_SUN6I_DSI_PIXEL_PF1_REG,4,2    ; @SUN6I_DSI_PIXEL_PF1_REG
	.comm	_SUN6I_DSI_PIXEL_CTL0_REG,4,2   ; @SUN6I_DSI_PIXEL_CTL0_REG
	.comm	_SUN6I_DSI_PIXEL_CTL0_PD_PLUG_DISABLE,4,2 ; @SUN6I_DSI_PIXEL_CTL0_PD_PLUG_DISABLE
	.no_dead_strip	_sun6i_dsi_setup_format
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.sun6i_dsi_setup_format
l_switch.table.sun6i_dsi_setup_format:
	.quad	_MIPI_DSI_PACKED_PIXEL_STREAM_24
	.quad	_MIPI_DSI_PACKED_PIXEL_STREAM_18
	.quad	_MIPI_DSI_PIXEL_STREAM_3BYTE_18
	.quad	_MIPI_DSI_PACKED_PIXEL_STREAM_16

	.section	__TEXT,__literal16,16byte_literals
	.p2align	2                               ; @switch.table.sun6i_dsi_setup_format.1
l_switch.table.sun6i_dsi_setup_format.1:
	.long	8                               ; 0x8
	.long	10                              ; 0xa
	.long	9                               ; 0x9
	.long	11                              ; 0xb

.subsections_via_symbols
