	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov5640_s_stream
_ov5640_s_stream:                       ## @ov5640_s_stream
	.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
	movl	%esi, %r14d
	callq	_to_ov5640_dev
	movq	%rax, %r12
	leaq	8(%rax), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	xorl	%eax, %eax
	testl	%r14d, %r14d
	sete	%al
	xorl	%ebx, %ebx
	cmpl	%eax, (%r12)
	jne	LBB0_12
## %bb.1:
	testl	%r14d, %r14d
	je	LBB0_7
## %bb.2:
	cmpq	$0, 32(%r12)
	je	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	callq	_ov5640_set_mode
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
LBB0_4:
	cmpl	$0, 4(%r12)
	je	LBB0_7
## %bb.5:
	movq	%r12, %rsi
	addq	$24, %rsi
	movq	%r12, %rdi
	callq	_ov5640_set_framefmt
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.6:
	movl	$0, 4(%r12)
LBB0_7:
	movq	16(%r12), %rax
	movq	_V4L2_MBUS_CSI2_DPHY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.8:
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_ov5640_set_stream_mipi
	jmp	LBB0_10
LBB0_9:
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_ov5640_set_stream_dvp
LBB0_10:
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:
	movl	%r14d, (%r12)
	xorl	%ebx, %ebx
LBB0_12:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_MBUS_CSI2_DPHY,8,3        ## @V4L2_MBUS_CSI2_DPHY
	.no_dead_strip	_ov5640_s_stream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov5640_s_stream
_ov5640_s_stream:                       ; @ov5640_s_stream
	.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	x20, x1
	bl	_to_ov5640_dev
	mov	x21, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x21]
	cmp	w20, #0
	cset	w9, eq
	cmp	w8, w9
	b.ne	LBB0_9
; %bb.1:
	cbz	w20, LBB0_7
; %bb.2:
	ldr	x8, [x21, #32]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x0, x21
	bl	_ov5640_set_mode
	mov	x22, x0
	cbnz	w0, LBB0_10
LBB0_4:
	ldr	w8, [x21, #4]
	cbz	w8, LBB0_7
; %bb.5:
	add	x1, x21, #24
	mov	x0, x21
	bl	_ov5640_set_framefmt
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.6:
	str	wzr, [x21, #4]
LBB0_7:
	ldr	x8, [x21, #16]
Lloh0:
	adrp	x9, _V4L2_MBUS_CSI2_DPHY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_MBUS_CSI2_DPHY@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	mov	x0, x21
	mov	x1, x20
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.8:
	bl	_ov5640_set_stream_mipi
	mov	x22, x0
	cbnz	w0, LBB0_10
	b	LBB0_12
LBB0_9:
	mov	w22, #0
LBB0_10:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x22
	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_11:
	bl	_ov5640_set_stream_dvp
	mov	x22, x0
	cbnz	w0, LBB0_10
LBB0_12:
	str	w20, [x21]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_MBUS_CSI2_DPHY,8,3        ; @V4L2_MBUS_CSI2_DPHY
	.no_dead_strip	_ov5640_s_stream
.subsections_via_symbols
