	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_omap24xxcam_sgdma_sync         ## -- Begin function omap24xxcam_sgdma_sync
	.p2align	4, 0x90
_omap24xxcam_sgdma_sync:                ## @omap24xxcam_sgdma_sync
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_CAMDMA_CSR_TRANS_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	addq	$24, %rdi
	movl	%r15d, %esi
	callq	_omap24xxcam_dma_stop
	leaq	8(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movl	(%rbx), %ecx
	movq	_NUM_SG_DMA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jge	LBB0_4
## %bb.1:
	movl	4(%rbx), %eax
	addl	%ecx, %eax
	cltd
	idivl	%esi
	movq	16(%rbx), %rax
	movslq	%edx, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	cmpq	$0, (%rax,%rdx,8)
	je	LBB0_4
## %bb.2:
	movq	8(%rax,%rdx,8), %r12
	movq	16(%rax,%rdx,8), %r13
	incl	%ecx
	movl	%ecx, (%rbx)
	testq	%r13, %r13
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_spin_unlock
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	%r12, %rdx
	callq	*%r13
	movq	%r14, %rdi
	callq	_spin_lock
LBB0_4:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CAMDMA_CSR_TRANS_ERR,4,2       ## @CAMDMA_CSR_TRANS_ERR
	.comm	_NUM_SG_DMA,4,2                 ## @NUM_SG_DMA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_omap24xxcam_sgdma_sync         ; -- Begin function omap24xxcam_sgdma_sync
	.p2align	2
_omap24xxcam_sgdma_sync:                ; @omap24xxcam_sgdma_sync
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x0
Lloh0:
	adrp	x8, _CAMDMA_CSR_TRANS_ERR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CAMDMA_CSR_TRANS_ERR@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	add	x0, x0, #24
	mov	x1, x21
	bl	_omap24xxcam_dma_stop
	add	x19, x20, #8
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	w8, [x20]
Lloh3:
	adrp	x9, _NUM_SG_DMA@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NUM_SG_DMA@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_4
; %bb.1:
	ldr	w10, [x20, #4]
	add	w10, w10, w8
	sdiv	w11, w10, w9
	msub	w10, w11, w9, w10
	ldr	x9, [x20, #16]
	mov	w11, #24
	smull	x11, w10, w11
	ldr	x11, [x9, x11]
	cbz	x11, LBB0_4
; %bb.2:
	sxtw	x10, w10
	mov	w11, #24
	madd	x9, x10, x11, x9
	ldp	x22, x23, [x9, #8]
	add	w8, w8, #1
	str	w8, [x20]
	cbz	x23, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_spin_unlock
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	blr	x23
	mov	x0, x19
	bl	_spin_lock
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CAMDMA_CSR_TRANS_ERR,4,2       ; @CAMDMA_CSR_TRANS_ERR
	.comm	_NUM_SG_DMA,4,2                 ; @NUM_SG_DMA
.subsections_via_symbols
