	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_dma_sg_bytes_xferred
_tegra_dma_sg_bytes_xferred:            ## @tegra_dma_sg_bytes_xferred
	.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	%rsi, %r14
	movq	%rdi, %rbx
	leaq	16(%rsi), %rdi
	leaq	8(%rbx), %rsi
	callq	_list_is_first
	testl	%eax, %eax
	je	LBB0_13
## %bb.1:
	movq	(%rbx), %rax
	movq	(%rax), %rax
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.2:
	movq	_TEGRA_APBDMA_CHAN_WORD_TRANSFER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_tdc_read
	movq	%rax, %r15
	jmp	LBB0_5
LBB0_4:
	xorl	%r15d, %r15d
LBB0_5:
	movq	_TEGRA_APBDMA_CHAN_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_tdc_read
	movq	_TEGRA_APBDMA_STATUS_ISE_EOC@GOTPCREL(%rip), %rcx
	testq	%rax, (%rcx)
	je	LBB0_7
## %bb.6:
	movl	(%r14), %eax
	jmp	LBB0_14
LBB0_7:
	movq	(%rbx), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rcx)
	cmoveq	%rax, %r15
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_get_current_xferred_count
	movq	8(%r14), %rcx
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	cmpq	%rcx, %rax
	jae	LBB0_12
## %bb.9:
	movl	$1, %edi
	callq	_WARN_ON_ONCE
	jmp	LBB0_11
LBB0_10:
	testq	%rcx, %rcx
	je	LBB0_13
LBB0_11:
	movl	(%r14), %eax
	addl	$-4, %eax
	jmp	LBB0_14
LBB0_13:
	xorl	%eax, %eax
LBB0_14:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	%rax, 8(%r14)
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_TEGRA_APBDMA_CHAN_WORD_TRANSFER,4,2 ## @TEGRA_APBDMA_CHAN_WORD_TRANSFER
	.comm	_TEGRA_APBDMA_CHAN_STATUS,4,2   ## @TEGRA_APBDMA_CHAN_STATUS
	.comm	_TEGRA_APBDMA_STATUS_ISE_EOC,8,3 ## @TEGRA_APBDMA_STATUS_ISE_EOC
	.no_dead_strip	_tegra_dma_sg_bytes_xferred
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_dma_sg_bytes_xferred
_tegra_dma_sg_bytes_xferred:            ; @tegra_dma_sg_bytes_xferred
	.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, x1
	mov	x20, x0
	add	x0, x1, #16
	add	x1, x20, #8
	bl	_list_is_first
	cbz	w0, LBB0_13
; %bb.1:
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _TEGRA_APBDMA_CHAN_WORD_TRANSFER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TEGRA_APBDMA_CHAN_WORD_TRANSFER@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_tdc_read
	mov	x21, x0
	b	LBB0_4
LBB0_3:
	mov	x21, #0
LBB0_4:
Lloh3:
	adrp	x8, _TEGRA_APBDMA_CHAN_STATUS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TEGRA_APBDMA_CHAN_STATUS@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_tdc_read
Lloh6:
	adrp	x8, _TEGRA_APBDMA_STATUS_ISE_EOC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TEGRA_APBDMA_STATUS_ISE_EOC@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	tst	x8, x0
	b.eq	LBB0_6
; %bb.5:
	ldr	w0, [x19]
	b	LBB0_13
LBB0_6:
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	x8, [x8]
	cmp	x8, #0
	csel	x2, x0, x21, eq
	mov	x0, x20
	mov	x1, x19
	bl	_get_current_xferred_count
	ldr	x8, [x19, #8]
	cbz	x0, LBB0_9
; %bb.7:
	cmp	x0, x8
	b.hs	LBB0_11
; %bb.8:
	mov	w0, #1
	bl	_WARN_ON_ONCE
	b	LBB0_10
LBB0_9:
	cbz	x8, LBB0_12
LBB0_10:
	ldr	w8, [x19]
	sub	w0, w8, #4
	b	LBB0_13
LBB0_11:
	str	x0, [x19, #8]
	b	LBB0_13
LBB0_12:
	mov	x0, #0
LBB0_13:
                                        ; kill: def $w0 killed $w0 killed $x0
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_TEGRA_APBDMA_CHAN_WORD_TRANSFER,4,2 ; @TEGRA_APBDMA_CHAN_WORD_TRANSFER
	.comm	_TEGRA_APBDMA_CHAN_STATUS,4,2   ; @TEGRA_APBDMA_CHAN_STATUS
	.comm	_TEGRA_APBDMA_STATUS_ISE_EOC,8,3 ; @TEGRA_APBDMA_STATUS_ISE_EOC
	.no_dead_strip	_tegra_dma_sg_bytes_xferred
.subsections_via_symbols
