	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun6i_csi_set_window
_sun6i_csi_set_window:                  ## @sun6i_csi_set_window
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	16(%rdi), %ebx
	movl	20(%rdi), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	24(%rdi), %eax
	addl	$-128, %eax
	movl	%ebx, %edi
	cmpl	$6, %eax
	ja	LBB0_3
## %bb.1:
	movl	$101, %ecx
	btl	%eax, %ecx
	movl	%ebx, %edi
	jae	LBB0_3
## %bb.2:
	movl	12(%r14), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	leal	(%rbx,%rbx), %edi
LBB0_3:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	8(%r14), %r13d
	movq	_CSI_CH_HSIZE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	callq	_CSI_CH_HSIZE_HOR_LEN
	movl	%eax, %r12d
	xorl	%edi, %edi
	callq	_CSI_CH_HSIZE_HOR_START
	orl	%eax, %r12d
	movl	%r13d, %edi
	movl	%r15d, %esi
	movl	%r12d, %edx
	callq	_regmap_write
	movl	8(%r14), %r15d
	movq	_CSI_CH_VSIZE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	-52(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %edi
	callq	_CSI_CH_VSIZE_VER_LEN
	movl	%eax, %ebx
	xorl	%edi, %edi
	callq	_CSI_CH_VSIZE_VER_START
	orl	%eax, %ebx
	movl	%r15d, %edi
	movl	%r12d, %esi
	movl	%ebx, %edx
	callq	_regmap_write
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	$0, (%rbx)
	movl	24(%r14), %edx
	leal	-129(%rdx), %eax
	cmpl	$10, %eax
	ja	LBB0_8
## %bb.4:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_5:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	imull	%r12d, %r13d
	movl	%r13d, 4(%rbx)
	movl	$-1, %eax
	movl	%r12d, %edi
	jmp	LBB0_9
LBB0_6:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movl	%r12d, %edi
	shrl	$31, %edi
	addl	%r12d, %edi
	sarl	%edi
	movl	%edi, %ecx
	imull	%r13d, %ecx
	imull	%r12d, %r13d
	movl	%r13d, 4(%rbx)
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	addl	%r13d, %eax
	jmp	LBB0_9
LBB0_8:
	movl	12(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	24(%r14), %edi
	callq	_sun6i_csi_get_bpp
                                        ## kill: def $eax killed $eax def $rax
	imull	16(%r14), %eax
	leal	7(%rax), %r12d
	testl	%eax, %eax
	cmovnsl	%eax, %r12d
	sarl	$3, %r12d
	movl	$-1, 4(%rbx)
	movl	$-1, %eax
	xorl	%edi, %edi
	jmp	LBB0_9
LBB0_7:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movl	%r12d, %edi
	shrl	$31, %edi
	addl	%r12d, %edi
	sarl	%edi
	movl	%edi, %eax
	imull	%r13d, %eax
	imull	%r12d, %r13d
	movl	%r13d, 4(%rbx)
	addl	%eax, %r13d
	movl	%r13d, %eax
LBB0_9:
	movl	%eax, 8(%rbx)
	movl	8(%r14), %r14d
	movq	_CSI_CH_BUF_LEN_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	callq	_CSI_CH_BUF_LEN_BUF_LEN_C
	movl	%eax, %ebx
	movl	%r12d, %edi
	callq	_CSI_CH_BUF_LEN_BUF_LEN_Y
	orl	%eax, %ebx
	movl	%r14d, %edi
	movl	%r15d, %esi
	movl	%ebx, %edx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_regmap_write                   ## TAILCALL
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
LJTI0_0:
	.long	L0_0_set_6
	.long	L0_0_set_8
	.long	L0_0_set_7
	.long	L0_0_set_6
	.long	L0_0_set_8
	.long	L0_0_set_8
	.long	L0_0_set_5
	.long	L0_0_set_5
	.long	L0_0_set_5
	.long	L0_0_set_5
	.long	L0_0_set_5
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Horizontal length should be 2 times of width for packed YUV formats!\n"

	.comm	_CSI_CH_HSIZE_REG,4,2           ## @CSI_CH_HSIZE_REG
	.comm	_CSI_CH_VSIZE_REG,4,2           ## @CSI_CH_VSIZE_REG
L_.str.1:                               ## @.str.1
	.asciz	"Calculating pixelformat(0x%x)'s bytesperline as a packed format\n"

	.comm	_CSI_CH_BUF_LEN_REG,4,2         ## @CSI_CH_BUF_LEN_REG
	.no_dead_strip	_sun6i_csi_set_window
.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_window
_sun6i_csi_set_window:                  ; @sun6i_csi_set_window
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	x25, [x0]
	ldp	w20, w21, [x0, #16]
	ldr	w8, [x0, #24]
	sub	w8, w8, #128
	cmp	w8, #6
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #101
	and	w8, w8, w9
	ccmp	w8, #0, #4, ls
	mov	x0, x20
	b.eq	LBB0_2
; %bb.1:
	ldr	w0, [x19, #12]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	lsl	w0, w20, #1
LBB0_2:
	ldr	w22, [x19, #8]
Lloh2:
	adrp	x8, _CSI_CH_HSIZE_REG@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CSI_CH_HSIZE_REG@GOTPAGEOFF]
Lloh4:
	ldr	w23, [x8]
	bl	_CSI_CH_HSIZE_HOR_LEN
	mov	x24, x0
	mov	w0, #0
	bl	_CSI_CH_HSIZE_HOR_START
	orr	w2, w0, w24
	mov	x0, x22
	mov	x1, x23
	bl	_regmap_write
	ldr	w22, [x19, #8]
Lloh5:
	adrp	x8, _CSI_CH_VSIZE_REG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CSI_CH_VSIZE_REG@GOTPAGEOFF]
Lloh7:
	ldr	w23, [x8]
	mov	x0, x21
	bl	_CSI_CH_VSIZE_VER_LEN
	mov	x24, x0
	mov	w0, #0
	bl	_CSI_CH_VSIZE_VER_START
	orr	w2, w0, w24
	mov	x0, x22
	mov	x1, x23
	bl	_regmap_write
	str	wzr, [x25]
	ldr	w8, [x19, #24]
	sub	w9, w8, #129
	cmp	w9, #10
	b.hi	LBB0_6
; %bb.3:
Lloh8:
	adrp	x10, lJTI0_0@PAGE
Lloh9:
	add	x10, x10, lJTI0_0@PAGEOFF
	adr	x11, LBB0_4
	ldrb	w12, [x10, x9]
	add	x11, x11, x12, lsl #2
	br	x11
LBB0_4:
	mul	w8, w21, w20
	str	w8, [x25, #4]
	mov	w8, #-1
	mov	x0, x20
	b	LBB0_8
LBB0_5:
	cmp	w20, #0
	cinc	w8, w20, lt
	asr	w0, w8, #1
	mul	w8, w21, w20
	str	w8, [x25, #4]
	mul	w9, w0, w21
	cmp	w9, #0
	cinc	w9, w9, lt
	add	w8, w8, w9, asr #1
	b	LBB0_8
LBB0_6:
	ldr	w0, [x19, #12]
	str	x8, [sp]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	ldr	w0, [x19, #24]
	bl	_sun6i_csi_get_bpp
	mov	x8, x0
	mov	w0, #0
	ldr	w9, [x19, #16]
	mul	w8, w9, w8
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w20, w8, #3
	mov	w8, #-1
	str	w8, [x25, #4]
	b	LBB0_8
LBB0_7:
	cmp	w20, #0
	cinc	w8, w20, lt
	asr	w0, w8, #1
	mul	w8, w21, w20
	str	w8, [x25, #4]
	madd	w8, w0, w21, w8
LBB0_8:
	str	w8, [x25, #8]
	ldr	w19, [x19, #8]
Lloh12:
	adrp	x8, _CSI_CH_BUF_LEN_REG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CSI_CH_BUF_LEN_REG@GOTPAGEOFF]
Lloh14:
	ldr	w21, [x8]
	bl	_CSI_CH_BUF_LEN_BUF_LEN_C
	mov	x22, x0
	mov	x0, x20
	bl	_CSI_CH_BUF_LEN_BUF_LEN_Y
	orr	w2, w0, w22
	mov	x0, x19
	mov	x1, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_regmap_write
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_5-LBB0_4)>>2
	.byte	(LBB0_6-LBB0_4)>>2
	.byte	(LBB0_7-LBB0_4)>>2
	.byte	(LBB0_5-LBB0_4)>>2
	.byte	(LBB0_6-LBB0_4)>>2
	.byte	(LBB0_6-LBB0_4)>>2
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_4-LBB0_4)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Horizontal length should be 2 times of width for packed YUV formats!\n"

	.comm	_CSI_CH_HSIZE_REG,4,2           ; @CSI_CH_HSIZE_REG
	.comm	_CSI_CH_VSIZE_REG,4,2           ; @CSI_CH_VSIZE_REG
l_.str.1:                               ; @.str.1
	.asciz	"Calculating pixelformat(0x%x)'s bytesperline as a packed format\n"

	.comm	_CSI_CH_BUF_LEN_REG,4,2         ; @CSI_CH_BUF_LEN_REG
	.no_dead_strip	_sun6i_csi_set_window
.subsections_via_symbols
