	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mcam_read_setup
_mcam_read_setup:                       ## @mcam_read_setup
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	_B_vmalloc@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.1:
	cmpq	$0, 8(%rbx)
	je	LBB0_2
LBB0_4:
	movq	%rbx, %rdi
	callq	_mcam_needs_config
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	_mcam_cam_configure
	movq	%rbx, %rdi
	callq	_mcam_ctlr_configure
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_12
LBB0_6:
	leaq	24(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	_CF_DMA_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	28(%rbx), %r15
	movq	%r15, %rsi
	callq	_clear_bit
	movq	%rbx, %rdi
	callq	_mcam_reset_buffers
	movq	16(%rbx), %rax
	movq	_V4L2_MBUS_CSI2_DPHY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	_mcam_enable_mipi
	jmp	LBB0_9
LBB0_8:
	movq	%rbx, %rdi
	callq	_mcam_disable_mipi
LBB0_9:
	movq	%rbx, %rdi
	callq	_mcam_ctlr_irq_enable
	movq	_S_STREAMING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	_CF_SG_RESTART@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_test_bit
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:
	movq	%rbx, %rdi
	callq	_mcam_ctlr_start
LBB0_11:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%r14d, %r14d
LBB0_12:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_mcam_alloc_dma_bufs
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_B_vmalloc,8,3                  ## @B_vmalloc
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CF_DMA_ACTIVE,4,2              ## @CF_DMA_ACTIVE
	.comm	_V4L2_MBUS_CSI2_DPHY,8,3        ## @V4L2_MBUS_CSI2_DPHY
	.comm	_S_STREAMING,4,2                ## @S_STREAMING
	.comm	_CF_SG_RESTART,4,2              ## @CF_SG_RESTART
	.no_dead_strip	_mcam_read_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mcam_read_setup
_mcam_read_setup:                       ; @mcam_read_setup
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _B_vmalloc@GOTPAGE
Lloh1:
	ldr	x9, [x9, _B_vmalloc@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_11
LBB0_2:
	mov	x0, x19
	bl	_mcam_needs_config
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_mcam_cam_configure
	mov	x0, x19
	bl	_mcam_ctlr_configure
	cbnz	w0, LBB0_10
LBB0_4:
	add	x20, x19, #24
	mov	x0, x20
	bl	_spin_lock_irqsave
Lloh3:
	adrp	x8, _CF_DMA_ACTIVE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CF_DMA_ACTIVE@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	add	x21, x19, #28
	mov	x1, x21
	bl	_clear_bit
	mov	x0, x19
	bl	_mcam_reset_buffers
	ldr	x8, [x19, #16]
Lloh6:
	adrp	x9, _V4L2_MBUS_CSI2_DPHY@GOTPAGE
Lloh7:
	ldr	x9, [x9, _V4L2_MBUS_CSI2_DPHY@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	mov	x0, x19
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	bl	_mcam_enable_mipi
	b	LBB0_7
LBB0_6:
	bl	_mcam_disable_mipi
LBB0_7:
	mov	x0, x19
	bl	_mcam_ctlr_irq_enable
Lloh9:
	adrp	x8, _S_STREAMING@GOTPAGE
Lloh10:
	ldr	x8, [x8, _S_STREAMING@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x19, #32]
Lloh12:
	adrp	x8, _CF_SG_RESTART@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CF_SG_RESTART@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_test_bit
	cbnz	w0, LBB0_9
; %bb.8:
	mov	x0, x19
	bl	_mcam_ctlr_start
LBB0_9:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	w0, #0
LBB0_10:
	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:
	mov	x0, x19
	mov	w1, #0
	bl	_mcam_alloc_dma_bufs
	cbz	x0, LBB0_2
; %bb.12:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_B_vmalloc,8,3                  ; @B_vmalloc
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CF_DMA_ACTIVE,4,2              ; @CF_DMA_ACTIVE
	.comm	_V4L2_MBUS_CSI2_DPHY,8,3        ; @V4L2_MBUS_CSI2_DPHY
	.comm	_S_STREAMING,4,2                ; @S_STREAMING
	.comm	_CF_SG_RESTART,4,2              ; @CF_SG_RESTART
	.no_dead_strip	_mcam_read_setup
.subsections_via_symbols
