	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov5640_set_mode
_ov5640_set_mode:                       ## @ov5640_set_mode
	.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, %r13
	movq	72(%rdi), %rdx
	movq	64(%rdi), %rax
	movl	(%rax), %ebx
	movq	16(%rdi), %rax
	movq	56(%rdi), %rcx
	movq	(%rcx), %r12
	movq	_V4L2_EXPOSURE_AUTO@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r14
	movq	%rdx, %r15
	movl	(%rdx), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	cmpl	$1, %ebx
	jne	LBB0_2
## %bb.1:
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_ov5640_set_autogain
	movl	%eax, %ecx
	testl	%eax, %eax
	jne	LBB0_36
LBB0_2:
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %rbx
	cmpq	%r14, %r12
	jne	LBB0_4
## %bb.3:
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_ov5640_set_autoexposure
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_33
LBB0_4:
	movq	%r15, %r14
	movl	4(%r15), %eax
	imull	8(%r15), %eax
	shll	$4, %eax
	cltq
	movq	_ov5640_framerates@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%r13), %rdx
	imulq	(%rcx,%rdx,8), %rax
	movq	32(%r13), %rcx
	movq	_V4L2_MBUS_CSI2_DPHY@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_7
## %bb.5:
	movq	48(%r13), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_9
## %bb.6:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_10
LBB0_7:
	movq	40(%r13), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_11
## %bb.8:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_12
LBB0_9:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_10:
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_ov5640_set_mipi_pclk
	jmp	LBB0_13
LBB0_11:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_12:
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_ov5640_set_dvp_pclk
LBB0_13:
	xorl	%ecx, %ecx
	testl	%eax, %eax
	js	LBB0_36
## %bb.14:
	movq	_SUBSAMPLING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_SCALING@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	cmpl	%eax, -44(%rbp)                 ## 4-byte Folded Reload
	jne	LBB0_16
## %bb.15:
	cmpl	%ecx, -52(%rbp)                 ## 4-byte Folded Reload
	je	LBB0_18
LBB0_16:
	cmpl	%ecx, -44(%rbp)                 ## 4-byte Folded Reload
	jne	LBB0_19
## %bb.17:
	cmpl	%eax, -52(%rbp)                 ## 4-byte Folded Reload
	jne	LBB0_19
LBB0_18:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_ov5640_set_mode_exposure_calc
	jmp	LBB0_20
LBB0_19:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_ov5640_set_mode_direct
LBB0_20:
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_31
## %bb.21:
	cmpl	$1, -48(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_23
## %bb.22:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_ov5640_set_autogain
LBB0_23:
	cmpq	%rbx, -64(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_25
## %bb.24:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_ov5640_set_autoexposure
LBB0_25:
	xorl	%esi, %esi
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpl	(%r15), %eax
	setne	%sil
	movq	%r13, %rdi
	callq	_ov5640_set_binning
	testl	%eax, %eax
	js	LBB0_37
## %bb.26:
	movl	24(%r13), %esi
	movq	%r13, %rdi
	callq	_ov5640_set_ae_target
	testl	%eax, %eax
	js	LBB0_37
## %bb.27:
	movq	%r13, %rdi
	callq	_ov5640_get_light_freq
	testl	%eax, %eax
	js	LBB0_37
## %bb.28:
	movq	%r13, %rdi
	callq	_ov5640_set_bandingfilter
	testl	%eax, %eax
	js	LBB0_37
## %bb.29:
	movq	%r13, %rdi
	callq	_ov5640_set_virtual_channel
	testl	%eax, %eax
	js	LBB0_37
## %bb.30:
	movl	$0, 8(%r13)
	movq	%r14, 16(%r13)
	xorl	%ecx, %ecx
	jmp	LBB0_36
LBB0_37:
	movl	%eax, %ecx
	jmp	LBB0_36
LBB0_31:
	cmpq	%rbx, -64(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_33
## %bb.32:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_ov5640_set_autoexposure
LBB0_33:
	cmpl	$1, -48(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_35
## %bb.34:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_ov5640_set_autogain
LBB0_35:
	movl	%r12d, %ecx
LBB0_36:
	movl	%ecx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_EXPOSURE_AUTO,8,3         ## @V4L2_EXPOSURE_AUTO
	.comm	_ov5640_framerates,8,3          ## @ov5640_framerates
	.comm	_V4L2_MBUS_CSI2_DPHY,8,3        ## @V4L2_MBUS_CSI2_DPHY
	.comm	_SUBSAMPLING,4,2                ## @SUBSAMPLING
	.comm	_SCALING,4,2                    ## @SCALING
	.no_dead_strip	_ov5640_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov5640_set_mode
_ov5640_set_mode:                       ; @ov5640_set_mode
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldp	x9, x20, [x0, #64]
	ldr	x8, [x0, #16]
	ldr	x10, [x0, #56]
	ldr	w23, [x9]
	ldr	x24, [x10]
Lloh0:
	adrp	x9, _V4L2_EXPOSURE_AUTO@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_EXPOSURE_AUTO@GOTPAGEOFF]
Lloh2:
	ldr	x25, [x9]
	ldr	w22, [x20]
	ldr	w26, [x8]
	cmp	w23, #1
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	mov	w1, #0
	bl	_ov5640_set_autogain
	mov	x21, x0
	cbnz	w0, LBB0_29
LBB0_2:
	cmp	x24, x25
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x19
	mov	w1, #0
	bl	_ov5640_set_autoexposure
	mov	x21, x0
	cbnz	w0, LBB0_27
LBB0_4:
	ldp	w8, w9, [x20, #4]
	mul	w8, w8, w9
	lsl	w8, w8, #4
	sxtw	x8, w8
Lloh3:
	adrp	x9, _ov5640_framerates@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ov5640_framerates@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ldr	x10, [x19]
	ldr	x9, [x9, x10, lsl #3]
	mul	x8, x9, x8
	ldr	x9, [x19, #32]
Lloh6:
	adrp	x10, _V4L2_MBUS_CSI2_DPHY@GOTPAGE
Lloh7:
	ldr	x10, [x10, _V4L2_MBUS_CSI2_DPHY@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_21
; %bb.5:
	ldr	x9, [x19, #48]
	udiv	x1, x8, x9
	mov	x0, x19
	bl	_ov5640_set_mipi_pclk
	tbnz	w0, #31, LBB0_22
LBB0_6:
Lloh9:
	adrp	x8, _SUBSAMPLING@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SUBSAMPLING@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x27, _SCALING@GOTPAGE
Lloh13:
	ldr	x27, [x27, _SCALING@GOTPAGEOFF]
	ldr	w9, [x27]
	cmp	w22, w8
	b.ne	LBB0_8
; %bb.7:
	cmp	w26, w9
	b.eq	LBB0_10
LBB0_8:
	cmp	w22, w9
	b.ne	LBB0_24
; %bb.9:
	cmp	w26, w8
	b.ne	LBB0_24
LBB0_10:
	mov	x0, x19
	mov	x1, x20
	bl	_ov5640_set_mode_exposure_calc
	mov	x21, x0
	tbnz	w0, #31, LBB0_25
LBB0_11:
	cmp	w23, #1
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x19
	mov	w1, #1
	bl	_ov5640_set_autogain
LBB0_13:
	cmp	x24, x25
	b.ne	LBB0_15
; %bb.14:
	mov	x0, x19
	mov	w1, #1
	bl	_ov5640_set_autoexposure
LBB0_15:
	ldr	w8, [x27]
	cmp	w22, w8
	cset	w1, ne
	mov	x0, x19
	bl	_ov5640_set_binning
	tbnz	w0, #31, LBB0_23
; %bb.16:
	ldr	w1, [x19, #24]
	mov	x0, x19
	bl	_ov5640_set_ae_target
	tbnz	w0, #31, LBB0_23
; %bb.17:
	mov	x0, x19
	bl	_ov5640_get_light_freq
	tbnz	w0, #31, LBB0_23
; %bb.18:
	mov	x0, x19
	bl	_ov5640_set_bandingfilter
	tbnz	w0, #31, LBB0_23
; %bb.19:
	mov	x0, x19
	bl	_ov5640_set_virtual_channel
	tbnz	w0, #31, LBB0_23
; %bb.20:
	mov	w21, #0
	str	wzr, [x19, #8]
	str	x20, [x19, #16]
	b	LBB0_29
LBB0_21:
	ldr	x9, [x19, #40]
	udiv	x1, x8, x9
	mov	x0, x19
	bl	_ov5640_set_dvp_pclk
	tbz	w0, #31, LBB0_6
LBB0_22:
	mov	w21, #0
	b	LBB0_29
LBB0_23:
	mov	x21, x0
	b	LBB0_29
LBB0_24:
	mov	x0, x19
	mov	x1, x20
	bl	_ov5640_set_mode_direct
	mov	x21, x0
	tbz	w0, #31, LBB0_11
LBB0_25:
	cmp	x24, x25
	b.ne	LBB0_27
; %bb.26:
	mov	x0, x19
	mov	w1, #1
	bl	_ov5640_set_autoexposure
LBB0_27:
	cmp	w23, #1
	b.ne	LBB0_29
; %bb.28:
	mov	x0, x19
	mov	w1, #1
	bl	_ov5640_set_autogain
LBB0_29:
	mov	x0, 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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_EXPOSURE_AUTO,8,3         ; @V4L2_EXPOSURE_AUTO
	.comm	_ov5640_framerates,8,3          ; @ov5640_framerates
	.comm	_V4L2_MBUS_CSI2_DPHY,8,3        ; @V4L2_MBUS_CSI2_DPHY
	.comm	_SUBSAMPLING,4,2                ; @SUBSAMPLING
	.comm	_SCALING,4,2                    ; @SCALING
	.no_dead_strip	_ov5640_set_mode
.subsections_via_symbols
