	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msc_buffer_contig_free
_msc_buffer_contig_free:                ## @msc_buffer_contig_free
	.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
	movq	%rdi, %r15
	callq	_msc_dev
	movq	(%rax), %rax
	movl	(%rax), %edi
	leaq	16(%r15), %r14
	movl	16(%r15), %esi
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$1, %edx
	callq	_dma_unmap_sg
	movq	%r14, %rdi
	callq	_sg_free_table
	movq	(%r15), %rax
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %r14
	movb	(%r14), %cl
	shlq	%cl, %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rdi
	addq	%rbx, %rdi
	callq	_virt_to_page
	movq	$0, (%rax)
	movq	%rax, %rdi
	callq	___free_page
	addq	(%r12), %rbx
	movq	(%r15), %rax
	movzbl	(%r14), %ecx
	shlq	%cl, %rax
	cmpq	%rax, %rbx
	jb	LBB0_2
LBB0_3:
	movq	$0, (%r15)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.no_dead_strip	_msc_buffer_contig_free
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msc_buffer_contig_free
_msc_buffer_contig_free:                ; @msc_buffer_contig_free
	.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
	bl	_msc_dev
	ldr	x8, [x0]
	ldr	w0, [x8]
	mov	x20, x19
	ldr	w1, [x20, #16]!
Lloh0:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	w2, #1
	bl	_dma_unmap_sg
	mov	x0, x20
	bl	_sg_free_table
	ldr	x8, [x19]
Lloh3:
	adrp	x20, _PAGE_SHIFT@GOTPAGE
Lloh4:
	ldr	x20, [x20, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	w9, [x20]
	lsl	x8, x8, x9
	cbz	x8, LBB0_3
; %bb.1:
	mov	x21, #0
Lloh5:
	adrp	x22, _PAGE_SIZE@GOTPAGE
Lloh6:
	ldr	x22, [x22, _PAGE_SIZE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x0, x8, x21
	bl	_virt_to_page
	str	xzr, [x0]
	bl	___free_page
	ldr	x8, [x22]
	ldr	x9, [x19]
	ldr	w10, [x20]
	lsl	x9, x9, x10
	add	x21, x8, x21
	cmp	x21, x9
	b.lo	LBB0_2
LBB0_3:
	str	xzr, [x19]
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.no_dead_strip	_msc_buffer_contig_free
.subsections_via_symbols
