	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ttm_unmap_and_unpopulate_pages ## -- Begin function ttm_unmap_and_unpopulate_pages
	.p2align	4, 0x90
_ttm_unmap_and_unpopulate_pages:        ## @ttm_unmap_and_unpopulate_pages
	.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	%rsi, %r15
	movl	(%rsi), %eax
	testl	%eax, %eax
	je	LBB0_11
## %bb.1:
	movq	%rdi, %r14
	xorl	%ebx, %ebx
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	imulq	%r12, %rdx
	movl	(%r13), %ecx
	movq	%r14, %rdi
	callq	_dma_unmap_page
	movl	(%r15), %eax
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	addl	%r12d, %ebx
	cmpl	%eax, %ebx
	jae	LBB0_11
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	16(%r15), %rcx
	movl	%ebx, %ebx
	movl	(%rcx,%rbx,4), %esi
	movl	$1, %r12d
	testl	%esi, %esi
	je	LBB0_10
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r15), %rcx
	movq	(%rcx,%rbx,8), %rdx
	testq	%rdx, %rdx
	je	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	1(%rbx), %edi
	movl	$1, %r12d
	cmpl	%eax, %edi
	jae	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %r8d
	subl	%ebx, %r8d
	addl	$-2, %r8d
	addq	$2, %r8
	negl	%eax
	addq	%rbx, %rax
	movl	$1, %r12d
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	(%rbx,%r12), %edi
	addq	$4, %rdx
	cmpq	(%rcx,%rdi,8), %rdx
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	incq	%r12
	movl	%eax, %edi
	addl	%r12d, %edi
	jne	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r8, %r12
	jmp	LBB0_9
LBB0_11:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ttm_pool_unpopulate            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ttm_unmap_and_unpopulate_pages ; -- Begin function ttm_unmap_and_unpopulate_pages
	.p2align	2
_ttm_unmap_and_unpopulate_pages:        ; @ttm_unmap_and_unpopulate_pages
	.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	x19, x1
	ldr	w8, [x1]
	cbz	w8, LBB0_12
; %bb.1:
	mov	x20, x0
	mov	w11, #0
Lloh0:
	adrp	x21, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	adrp	x22, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh3:
	ldr	x22, [x22, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	w24, #1
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w11, w24, w23
	cmp	w11, w8
	b.hs	LBB0_12
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	mov	w23, w11
	ldp	x9, x12, [x19, #8]
	ldr	x10, [x9, w11, uxtw #3]
	ldr	w1, [x12, w11, uxtw #2]
	cmp	w1, #0
	ccmp	x10, #0, #4, ne
	b.eq	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w11, w23, #1
	cmp	w11, w8
	b.hs	LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	w11, w8, w23
	sub	w11, w11, #2
	add	x11, x11, #2
	neg	w8, w8
	add	x8, x23, x8
	mov	w24, #1
LBB0_7:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	w12, w23, w24
	add	x10, x10, #4
	ldr	x12, [x9, w12, uxtw #3]
	cmp	x10, x12
	b.ne	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	add	x24, x24, #1
	cmn	w8, w24
	b.ne	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x24, x11
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w24, #1
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x21]
	mul	x2, x8, x24
	ldr	w3, [x22]
	mov	x0, x20
	bl	_dma_unmap_page
	ldr	w8, [x19]
	b	LBB0_3
LBB0_12:
	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	_ttm_pool_unpopulate
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
.subsections_via_symbols
