	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun6i_csi_set_format
_sun6i_csi_set_format:                  ## @sun6i_csi_set_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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	movq	_CSI_CH_CFG_REG@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	leaq	-20(%rbp), %rdx
	callq	_regmap_read
	movq	_CSI_CH_CFG_INPUT_FMT_MASK@GOTPCREL(%rip), %rax
	movq	_CSI_CH_CFG_OUTPUT_FMT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_CSI_CH_CFG_VFLIP_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_CSI_CH_CFG_HFLIP_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_CSI_CH_CFG_FIELD_SEL_MASK@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_CSI_CH_CFG_INPUT_SEQ_MASK@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	notl	%ecx
	andl	%ecx, -20(%rbp)
	movl	16(%rbx), %edx
	movl	20(%rbx), %esi
	movq	%rbx, %rdi
	callq	_get_csi_input_format
	movl	%eax, %edi
	callq	_CSI_CH_CFG_INPUT_FMT
	orl	%eax, -20(%rbp)
	movl	16(%rbx), %esi
	movq	8(%rbx), %rdx
	movq	%rbx, %rdi
	callq	_get_csi_output_format
	movl	%eax, %edi
	callq	_CSI_CH_CFG_OUTPUT_FMT
	orl	%eax, -20(%rbp)
	movl	16(%rbx), %edx
	movl	20(%rbx), %esi
	movq	%rbx, %rdi
	callq	_get_csi_input_seq
	movl	%eax, %edi
	callq	_CSI_CH_CFG_INPUT_SEQ
	orl	-20(%rbp), %eax
	movq	8(%rbx), %rcx
	movq	_V4L2_FIELD_TOP@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_2
## %bb.1:
	movq	_CSI_CH_CFG_FIELD_SEL_FIELD0@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_2:
	movq	_V4L2_FIELD_BOTTOM@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_4
## %bb.3:
	movq	_CSI_CH_CFG_FIELD_SEL_FIELD1@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_4:
	movq	_CSI_CH_CFG_FIELD_SEL_BOTH@GOTPCREL(%rip), %rcx
LBB0_5:
	orl	(%rcx), %eax
	movl	%eax, -20(%rbp)
	movl	(%rbx), %edi
	movl	(%r14), %esi
	movl	%eax, %edx
	callq	_regmap_write
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CSI_CH_CFG_REG,4,2             ## @CSI_CH_CFG_REG
	.comm	_CSI_CH_CFG_INPUT_FMT_MASK,4,2  ## @CSI_CH_CFG_INPUT_FMT_MASK
	.comm	_CSI_CH_CFG_OUTPUT_FMT_MASK,4,2 ## @CSI_CH_CFG_OUTPUT_FMT_MASK
	.comm	_CSI_CH_CFG_VFLIP_EN,4,2        ## @CSI_CH_CFG_VFLIP_EN
	.comm	_CSI_CH_CFG_HFLIP_EN,4,2        ## @CSI_CH_CFG_HFLIP_EN
	.comm	_CSI_CH_CFG_FIELD_SEL_MASK,4,2  ## @CSI_CH_CFG_FIELD_SEL_MASK
	.comm	_CSI_CH_CFG_INPUT_SEQ_MASK,4,2  ## @CSI_CH_CFG_INPUT_SEQ_MASK
	.comm	_V4L2_FIELD_TOP,8,3             ## @V4L2_FIELD_TOP
	.comm	_CSI_CH_CFG_FIELD_SEL_FIELD0,4,2 ## @CSI_CH_CFG_FIELD_SEL_FIELD0
	.comm	_V4L2_FIELD_BOTTOM,8,3          ## @V4L2_FIELD_BOTTOM
	.comm	_CSI_CH_CFG_FIELD_SEL_FIELD1,4,2 ## @CSI_CH_CFG_FIELD_SEL_FIELD1
	.comm	_CSI_CH_CFG_FIELD_SEL_BOTH,4,2  ## @CSI_CH_CFG_FIELD_SEL_BOTH
	.no_dead_strip	_sun6i_csi_set_format
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun6i_csi_set_format
_sun6i_csi_set_format:                  ; @sun6i_csi_set_format
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x20, _CSI_CH_CFG_REG@GOTPAGE
Lloh1:
	ldr	x20, [x20, _CSI_CH_CFG_REG@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #12
	bl	_regmap_read
Lloh2:
	adrp	x8, _CSI_CH_CFG_INPUT_FMT_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CSI_CH_CFG_INPUT_FMT_MASK@GOTPAGEOFF]
Lloh4:
	adrp	x9, _CSI_CH_CFG_OUTPUT_FMT_MASK@GOTPAGE
Lloh5:
	ldr	x9, [x9, _CSI_CH_CFG_OUTPUT_FMT_MASK@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh8:
	adrp	x9, _CSI_CH_CFG_VFLIP_EN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _CSI_CH_CFG_VFLIP_EN@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh11:
	adrp	x9, _CSI_CH_CFG_HFLIP_EN@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CSI_CH_CFG_HFLIP_EN@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
Lloh14:
	adrp	x10, _CSI_CH_CFG_FIELD_SEL_MASK@GOTPAGE
Lloh15:
	ldr	x10, [x10, _CSI_CH_CFG_FIELD_SEL_MASK@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh16:
	ldr	w9, [x10]
	orr	w8, w8, w9
Lloh17:
	adrp	x9, _CSI_CH_CFG_INPUT_SEQ_MASK@GOTPAGE
Lloh18:
	ldr	x9, [x9, _CSI_CH_CFG_INPUT_SEQ_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [sp, #12]
	bic	w8, w9, w8
	str	w8, [sp, #12]
	ldp	w2, w1, [x19, #16]
	mov	x0, x19
	bl	_get_csi_input_format
	bl	_CSI_CH_CFG_INPUT_FMT
	ldr	w8, [sp, #12]
	orr	w8, w8, w0
	str	w8, [sp, #12]
	ldr	w1, [x19, #16]
	ldr	x2, [x19, #8]
	mov	x0, x19
	bl	_get_csi_output_format
	bl	_CSI_CH_CFG_OUTPUT_FMT
	ldr	w8, [sp, #12]
	orr	w8, w8, w0
	str	w8, [sp, #12]
	ldp	w2, w1, [x19, #16]
	mov	x0, x19
	bl	_get_csi_input_seq
	bl	_CSI_CH_CFG_INPUT_SEQ
	ldr	w8, [sp, #12]
	orr	w8, w8, w0
	ldr	x9, [x19, #8]
Lloh20:
	adrp	x10, _V4L2_FIELD_TOP@GOTPAGE
Lloh21:
	ldr	x10, [x10, _V4L2_FIELD_TOP@GOTPAGEOFF]
Lloh22:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_2
; %bb.1:
Lloh23:
	adrp	x9, _CSI_CH_CFG_FIELD_SEL_FIELD0@GOTPAGE
Lloh24:
	ldr	x9, [x9, _CSI_CH_CFG_FIELD_SEL_FIELD0@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:
Lloh25:
	adrp	x10, _V4L2_FIELD_BOTTOM@GOTPAGE
Lloh26:
	ldr	x10, [x10, _V4L2_FIELD_BOTTOM@GOTPAGEOFF]
Lloh27:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_4
; %bb.3:
Lloh28:
	adrp	x9, _CSI_CH_CFG_FIELD_SEL_FIELD1@GOTPAGE
Lloh29:
	ldr	x9, [x9, _CSI_CH_CFG_FIELD_SEL_FIELD1@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh30:
	adrp	x9, _CSI_CH_CFG_FIELD_SEL_BOTH@GOTPAGE
Lloh31:
	ldr	x9, [x9, _CSI_CH_CFG_FIELD_SEL_BOTH@GOTPAGEOFF]
LBB0_5:
	ldr	w9, [x9]
	orr	w2, w9, w8
	str	w2, [sp, #12]
	ldr	w0, [x19]
	ldr	w1, [x20]
	bl	_regmap_write
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_CSI_CH_CFG_REG,4,2             ; @CSI_CH_CFG_REG
	.comm	_CSI_CH_CFG_INPUT_FMT_MASK,4,2  ; @CSI_CH_CFG_INPUT_FMT_MASK
	.comm	_CSI_CH_CFG_OUTPUT_FMT_MASK,4,2 ; @CSI_CH_CFG_OUTPUT_FMT_MASK
	.comm	_CSI_CH_CFG_VFLIP_EN,4,2        ; @CSI_CH_CFG_VFLIP_EN
	.comm	_CSI_CH_CFG_HFLIP_EN,4,2        ; @CSI_CH_CFG_HFLIP_EN
	.comm	_CSI_CH_CFG_FIELD_SEL_MASK,4,2  ; @CSI_CH_CFG_FIELD_SEL_MASK
	.comm	_CSI_CH_CFG_INPUT_SEQ_MASK,4,2  ; @CSI_CH_CFG_INPUT_SEQ_MASK
	.comm	_V4L2_FIELD_TOP,8,3             ; @V4L2_FIELD_TOP
	.comm	_CSI_CH_CFG_FIELD_SEL_FIELD0,4,2 ; @CSI_CH_CFG_FIELD_SEL_FIELD0
	.comm	_V4L2_FIELD_BOTTOM,8,3          ; @V4L2_FIELD_BOTTOM
	.comm	_CSI_CH_CFG_FIELD_SEL_FIELD1,4,2 ; @CSI_CH_CFG_FIELD_SEL_FIELD1
	.comm	_CSI_CH_CFG_FIELD_SEL_BOTH,4,2  ; @CSI_CH_CFG_FIELD_SEL_BOTH
	.no_dead_strip	_sun6i_csi_set_format
.subsections_via_symbols
