	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_udma_fill_sg_list         ## -- Begin function ivtv_udma_fill_sg_list
	.p2align	4, 0x90
_ivtv_udma_fill_sg_list:                ## @ivtv_udma_fill_sg_list
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	testl	%edx, %edx
	js	LBB0_14
## %bb.1:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_14
## %bb.2:
	movq	%rdi, %r15
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %esi
	leaq	16(%rdi), %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movl	%edx, %edx
	leaq	(,%rdx,4), %r13
	movq	%rdx, -96(%rbp)                 ## 8-byte Spill
	leaq	(,%rdx,8), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	callq	_local_irq_save
	movq	(%r15), %rax
	addq	-56(%rbp), %rax                 ## 8-byte Folded Reload
	movq	(%rax,%r12,8), %rdi
	callq	_kmap_atomic
	movl	%ebx, -76(%rbp)                 ## 4-byte Spill
	movslq	%ebx, %r14
	leaq	(%rax,%r14), %r15
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax), %rax
	addq	-56(%rbp), %rax                 ## 8-byte Folded Reload
	movq	(%rax,%r12,8), %rdi
	callq	_page_address
	addq	%rax, %r14
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edx
	callq	_memcpy
	movq	%r15, %rdi
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	callq	_kunmap_atomic
	callq	_local_irq_restore
	movl	%ebx, %edx
	movl	-76(%rbp), %ecx                 ## 4-byte Reload
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	-72(%rbp), %rax                 ## 8-byte Reload
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r15), %rdi
	addq	%r13, %rdi
	movq	(%rax), %rax
	addq	%r14, %rax
	movq	(%rax,%r12,8), %rsi
	callq	_sg_set_page
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %eax
	addq	$4, %r13
	incq	%r12
	xorl	%esi, %esi
	cmpl	%eax, %r12d
	jge	LBB0_13
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	decl	%eax
	cmpl	%eax, %r12d
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%esi, %ebx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %eax
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%esi, %ebx
	subl	%esi, %eax
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	(%r15), %rax
	addq	%r14, %rax
	movq	(%rax,%r12,8), %rdi
	callq	_PageHighMem
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	addq	%r14, %rax
	cmpq	$0, (%rax,%r12,8)
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_alloc_page
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	(%rsi), %rcx
	addq	%rdx, %rcx
	movq	%rax, (%rcx,%r12,8)
	movq	(%rsi), %rax
	addq	%rdx, %rax
	cmpq	$0, (%rax,%r12,8)
	jne	LBB0_11
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r15, %rax
	movl	%ebx, %ecx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	jmp	LBB0_12
LBB0_13:
	movq	-96(%rbp), %rdx                 ## 8-byte Reload
	addl	%r12d, %edx
	jmp	LBB0_14
LBB0_10:
	movl	$-1, %edx
LBB0_14:
	movl	%edx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_udma_fill_sg_list         ; -- Begin function ivtv_udma_fill_sg_list
	.p2align	2
_ivtv_udma_fill_sg_list:                ; @ivtv_udma_fill_sg_list
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	tbnz	w2, #31, LBB0_14
; %bb.1:
	mov	x19, x1
	ldr	w8, [x1, #4]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.2:
	mov	x20, x0
	mov	x24, #0
	ldr	w21, [x19]
	add	x23, x0, #16
	mov	w9, w2
	lsl	x27, x9, #2
	stp	x9, x23, [sp]                   ; 16-byte Folded Spill
	lsl	x22, x9, #3
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	bl	_local_irq_save
	ldr	x8, [x20]
	add	x8, x8, x22
	ldr	x0, [x8, x25]
	bl	_kmap_atomic
	mov	x26, x19
	sxtw	x19, w21
	add	x23, x0, x19
	ldr	x8, [x20, #16]
	add	x8, x8, x22
	ldr	x0, [x8, x25]
	bl	_page_address
	add	x0, x0, x19
	mov	x19, x26
	mov	x1, x23
	mov	x2, x28
	bl	_memcpy
	mov	x0, x23
	ldr	x23, [sp, #8]                   ; 8-byte Folded Reload
	bl	_kunmap_atomic
	bl	_local_irq_restore
	mov	x8, x23
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x9, [x20, #8]
	add	x0, x9, x27
	ldr	x8, [x8]
	add	x8, x8, x22
	ldr	x1, [x8, x24, lsl #3]
	mov	x2, x28
	mov	x3, x21
	bl	_sg_set_page
	mov	w21, #0
	ldr	w8, [x19, #4]
	add	x27, x27, #4
	add	x24, x24, #1
	cmp	w24, w8
	b.ge	LBB0_12
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	sub	w8, w8, #1
	cmp	w24, w8
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w28, [x19, #8]
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	sub	w28, w8, w21
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x20]
	add	x8, x8, x22
	ldr	x0, [x8, x24, lsl #3]
	bl	_PageHighMem
	cbz	x0, LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x23]
	add	x8, x8, x22
	ldr	x8, [x8, x24, lsl #3]
	lsl	x25, x24, #3
	cbnz	x8, LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_alloc_page
	ldr	x8, [x23]
	add	x8, x8, x22
	str	x0, [x8, x25]
	ldr	x8, [x23]
	add	x8, x8, x22
	ldr	x8, [x8, x25]
	cbnz	x8, LBB0_3
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x8, x20
	b	LBB0_4
LBB0_12:
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	add	w2, w8, w24
	b	LBB0_14
LBB0_13:
	mov	w2, #-1
LBB0_14:
	mov	x0, x2
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
.subsections_via_symbols
