	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov5640_set_bandingfilter
_ov5640_set_bandingfilter:              ## @ov5640_set_bandingfilter
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_ov5640_get_sysclk
	testl	%eax, %eax
	js	LBB0_3
## %bb.1:
	je	LBB0_2
## %bb.4:
	movl	%eax, (%rbx)
	movq	%rbx, %rdi
	callq	_ov5640_get_hts
	testl	%eax, %eax
	js	LBB0_3
## %bb.5:
	je	LBB0_2
## %bb.6:
	movl	%eax, 4(%rbx)
	movq	%rbx, %rdi
	callq	_ov5640_get_vts
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:
	imull	$100, (%rbx), %eax
	cltd
	idivl	4(%rbx)
	imull	$100, %eax, %r12d
	movslq	%r12d, %rax
	imulq	$-2004318071, %rax, %r15        ## imm = 0x88888889
	shrq	$32, %r15
	addl	%r12d, %r15d
	movl	%r15d, %eax
	shrl	$31, %eax
	sarl	$6, %r15d
	addl	%eax, %r15d
	movq	_OV5640_REG_AEC_B60_STEP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_ov5640_write_reg16
	testl	%eax, %eax
	jne	LBB0_3
## %bb.9:
	addl	$119, %r12d
	cmpl	$238, %r12d
	ja	LBB0_10
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	%r14d, %eax
	jmp	LBB0_3
LBB0_10:
	addl	$-4, %r14d
	movl	%r14d, %eax
	cltd
	idivl	%r15d
	movq	_OV5640_REG_AEC_CTRL0D@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_ov5640_write_reg
	testl	%eax, %eax
	jne	LBB0_3
## %bb.11:
	imull	$100, (%rbx), %eax
	cltd
	idivl	4(%rbx)
	movl	%eax, %r15d
	movq	_OV5640_REG_AEC_B50_STEP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_ov5640_write_reg16
	testl	%eax, %eax
	jne	LBB0_3
## %bb.12:
	testl	%r15d, %r15d
	je	LBB0_2
## %bb.13:
	movl	%r14d, %eax
	cltd
	idivl	%r15d
	movq	_OV5640_REG_AEC_CTRL0E@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ov5640_write_reg               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_OV5640_REG_AEC_B60_STEP,4,2    ## @OV5640_REG_AEC_B60_STEP
	.comm	_OV5640_REG_AEC_CTRL0D,4,2      ## @OV5640_REG_AEC_CTRL0D
	.comm	_OV5640_REG_AEC_B50_STEP,4,2    ## @OV5640_REG_AEC_B50_STEP
	.comm	_OV5640_REG_AEC_CTRL0E,4,2      ## @OV5640_REG_AEC_CTRL0E
	.no_dead_strip	_ov5640_set_bandingfilter
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov5640_set_bandingfilter
_ov5640_set_bandingfilter:              ; @ov5640_set_bandingfilter
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
	bl	_ov5640_get_sysclk
	tbnz	w0, #31, LBB0_8
; %bb.1:
	cbz	w0, LBB0_7
; %bb.2:
	str	w0, [x19]
	mov	x0, x19
	bl	_ov5640_get_hts
	tbnz	w0, #31, LBB0_8
; %bb.3:
	cbz	w0, LBB0_7
; %bb.4:
	str	w0, [x19, #4]
	mov	x0, x19
	bl	_ov5640_get_vts
	mov	x20, x0
	tbnz	w0, #31, LBB0_9
; %bb.5:
	mov	w8, #100
	ldp	w9, w10, [x19]
	mul	w9, w9, w8
	sdiv	w9, w9, w10
	mul	w22, w9, w8
	mov	w8, #34953
	movk	w8, #34952, lsl #16
	smull	x8, w22, w8
	lsr	x8, x8, #32
	add	w8, w8, w22
	asr	w9, w8, #6
	add	w21, w9, w8, lsr #31
Lloh0:
	adrp	x8, _OV5640_REG_AEC_B60_STEP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _OV5640_REG_AEC_B60_STEP@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_ov5640_write_reg16
	cbnz	w0, LBB0_8
; %bb.6:
	add	w8, w22, #119
	cmp	w8, #238
	b.hi	LBB0_10
LBB0_7:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_9:
	mov	x0, x20
	b	LBB0_8
LBB0_10:
	sub	w22, w20, #4
Lloh6:
	adrp	x8, _OV5640_REG_AEC_CTRL0D@GOTPAGE
Lloh7:
	ldr	x8, [x8, _OV5640_REG_AEC_CTRL0D@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	sdiv	w2, w22, w21
	mov	x0, x19
	bl	_ov5640_write_reg
	cbnz	w0, LBB0_8
; %bb.11:
	mov	w8, #100
	ldp	w9, w10, [x19]
	mul	w8, w9, w8
Lloh9:
	adrp	x9, _OV5640_REG_AEC_B50_STEP@GOTPAGE
Lloh10:
	ldr	x9, [x9, _OV5640_REG_AEC_B50_STEP@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x9]
	sdiv	w20, w8, w10
	mov	x0, x19
	mov	x2, x20
	bl	_ov5640_write_reg16
	cbnz	w0, LBB0_8
; %bb.12:
	cbz	w20, LBB0_7
; %bb.13:
	sdiv	w2, w22, w20
Lloh12:
	adrp	x8, _OV5640_REG_AEC_CTRL0E@GOTPAGE
Lloh13:
	ldr	x8, [x8, _OV5640_REG_AEC_CTRL0E@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_ov5640_write_reg
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_OV5640_REG_AEC_B60_STEP,4,2    ; @OV5640_REG_AEC_B60_STEP
	.comm	_OV5640_REG_AEC_CTRL0D,4,2      ; @OV5640_REG_AEC_CTRL0D
	.comm	_OV5640_REG_AEC_B50_STEP,4,2    ; @OV5640_REG_AEC_B50_STEP
	.comm	_OV5640_REG_AEC_CTRL0E,4,2      ; @OV5640_REG_AEC_CTRL0E
	.no_dead_strip	_ov5640_set_bandingfilter
.subsections_via_symbols
