	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5k5baf_s_stream
_s5k5baf_s_stream:                      ## @s5k5baf_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, %r12d
	callq	_to_s5k5baf
	movq	%rax, %r15
	leaq	4(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	xorl	%eax, %eax
	testl	%r12d, %r12d
	setne	%al
	xorl	%ebx, %ebx
	cmpl	%eax, (%r15)
	je	LBB0_8
## %bb.1:
	movq	%r15, %rdi
	testl	%r12d, %r12d
	je	LBB0_5
## %bb.2:
	callq	_s5k5baf_hw_set_config
	movq	%r15, %rdi
	callq	_s5k5baf_hw_set_crop_rects
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_s5k5baf_hw_set_stream
	movq	%r15, %rdi
	movl	$45260, %esi                    ## imm = 0xB0CC
	movl	$11, %edx
	callq	_s5k5baf_i2c_write
	jmp	LBB0_6
LBB0_5:
	xorl	%esi, %esi
	callq	_s5k5baf_hw_set_stream
LBB0_6:
	movq	%r15, %rdi
	callq	_s5k5baf_clear_error
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	xorl	%eax, %eax
	cmpl	$0, (%r15)
	sete	%al
	movl	%eax, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_3:
	movl	%eax, %ebx
LBB0_8:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_s5k5baf_s_stream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s5k5baf_s_stream
_s5k5baf_s_stream:                      ; @s5k5baf_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	x21, x1
	bl	_to_s5k5baf
	mov	x20, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20]
	cmp	w21, #0
	cset	w9, ne
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	mov	w21, #0
	b	LBB0_9
LBB0_2:
	mov	x0, x20
	cbz	w21, LBB0_5
; %bb.3:
	bl	_s5k5baf_hw_set_config
	mov	x0, x20
	bl	_s5k5baf_hw_set_crop_rects
	tbnz	w0, #31, LBB0_8
; %bb.4:
	mov	x0, x20
	mov	w1, #1
	bl	_s5k5baf_hw_set_stream
	mov	x0, x20
	mov	w1, #45260
	mov	w2, #11
	bl	_s5k5baf_i2c_write
	b	LBB0_6
LBB0_5:
	mov	w1, #0
	bl	_s5k5baf_hw_set_stream
LBB0_6:
	mov	x0, x20
	bl	_s5k5baf_clear_error
	mov	x21, x0
	cbnz	w0, LBB0_9
; %bb.7:
	ldr	w8, [x20]
	cmp	w8, #0
	cset	w8, eq
	str	w8, [x20]
	b	LBB0_9
LBB0_8:
	mov	x21, x0
LBB0_9:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_s5k5baf_s_stream
.subsections_via_symbols
