	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vb2_dma_sg_alloc_compacted
_vb2_dma_sg_alloc_compacted:            ## @vb2_dma_sg_alloc_compacted
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_19
## %bb.1:
	movq	%rdi, %r12
	xorl	%r14d, %r14d
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	movl	%r15d, %ecx
	shll	%cl, %eax
	cltq
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	subq	%rax, %rbx
	je	LBB0_19
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
                                        ##     Child Loop BB0_13 Depth 2
                                        ##     Child Loop BB0_17 Depth 2
	movq	%rbx, %rdi
	callq	_get_order
	movl	%eax, %r15d
	movl	(%r13), %eax
	movl	%r15d, %ecx
	shll	%cl, %eax
	cltq
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	cmpq	%rax, %rbx
	sbbl	$0, %r15d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_3:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rbx), %edi
	orl	-44(%rbp), %edi                 ## 4-byte Folded Reload
	movq	___GFP_ZERO@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	___GFP_NOWARN@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movl	%r15d, %esi
	callq	_alloc_pages
	testq	%rax, %rax
	jne	LBB0_9
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	subl	$1, %r15d
	jae	LBB0_3
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r13
	movq	%rax, %rdi
	movl	%r15d, %esi
	callq	_split_page
	cmpl	$31, %r15d
	je	LBB0_18
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %r9d
	movl	%r15d, %ecx
	shll	%cl, %r9d
	cmpl	$2, %r9d
	movl	$1, %eax
	cmovll	%eax, %r9d
	leaq	-1(%r9), %rcx
	movl	%r9d, %eax
	andl	$3, %eax
	cmpq	$3, %rcx
	jae	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	xorl	%ecx, %ecx
	testq	%rax, %rax
	jne	LBB0_16
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	andl	$2147483644, %r9d               ## imm = 0x7FFFFFFC
	movl	%r14d, %r8d
	movq	%r13, %rdi
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leaq	(%r8,%rcx), %rsi
	movq	8(%r12), %rdx
	leal	1(%rsi), %r10d
	movl	%esi, %ebx
	movq	%rdi, (%rdx,%rbx,8)
	leaq	4(%rdi), %rdx
	movq	8(%r12), %rbx
	leal	2(%rsi), %r11d
	movq	%rdx, (%rbx,%r10,8)
	leaq	8(%rdi), %rdx
	movq	8(%r12), %rbx
	addl	$3, %esi
	movq	%rdx, (%rbx,%r11,8)
	leaq	12(%rdi), %rdx
	movq	8(%r12), %rbx
	movq	%rdx, (%rbx,%rsi,8)
	addq	$4, %rcx
	addq	$16, %rdi
	cmpq	%rcx, %r9
	jne	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	addl	%ecx, %r14d
	testq	%rax, %rax
	je	LBB0_18
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	leaq	(,%rcx,4), %rcx
	addq	%r13, %rcx
	.p2align	4, 0x90
LBB0_17:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%r12), %rdx
	movl	%r14d, %esi
	incl	%r14d
	movq	%rcx, (%rdx,%rsi,8)
	addq	$4, %rcx
	decq	%rax
	jne	LBB0_17
	jmp	LBB0_18
LBB0_5:
	testl	%r14d, %r14d
	je	LBB0_8
## %bb.6:
	movl	%r14d, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movq	-8(%rax,%rbx,8), %rdi
	callq	___free_page
	decq	%rbx
	jne	LBB0_7
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_20
LBB0_19:
	xorl	%eax, %eax
LBB0_20:
	addq	$24, %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
	.comm	___GFP_ZERO,4,2                 ## @__GFP_ZERO
	.comm	___GFP_NOWARN,4,2               ## @__GFP_NOWARN
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_vb2_dma_sg_alloc_compacted
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vb2_dma_sg_alloc_compacted
_vb2_dma_sg_alloc_compacted:            ; @vb2_dma_sg_alloc_compacted
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	ldr	x21, [x0]
	cbz	x21, LBB0_15
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	mov	w27, #0
Lloh0:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	adrp	x25, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x25, [x25, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	adrp	x26, ___GFP_ZERO@GOTPAGE
Lloh5:
	ldr	x26, [x26, ___GFP_ZERO@GOTPAGEOFF]
Lloh6:
	adrp	x28, ___GFP_NOWARN@GOTPAGE
Lloh7:
	ldr	x28, [x28, ___GFP_NOWARN@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x9, x27
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x24]
	lsl	w8, w8, w22
	subs	x21, x21, w8, sxtw
	mov	x27, x9
	b.eq	LBB0_15
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
                                        ;     Child Loop BB0_10 Depth 2
	mov	x0, x21
	bl	_get_order
	ldr	w8, [x24]
	lsl	w8, w8, w0
	cmp	x21, w8, sxtw
	cset	w8, lo
	sub	w22, w0, w8
LBB0_5:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x25]
	ldr	w9, [x26]
	ldr	w10, [x28]
	orr	w8, w8, w20
	orr	w8, w8, w9
	orr	w0, w8, w10
	mov	x1, x22
	bl	_alloc_pages
	cbnz	x0, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	cbz	w22, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=2
	sub	w22, w22, #1
	b	LBB0_5
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x23, x0
	mov	x1, x22
	bl	_split_page
	cmp	w22, #31
	b.eq	LBB0_2
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w8, #1
	lsl	w8, w8, w22
	cmp	w8, #1
	csinc	w8, w8, wzr, gt
LBB0_10:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	w9, w27, #1
	ldr	x10, [x19, #8]
	str	x23, [x10, w27, uxtw #3]
	add	x23, x23, #4
	mov	x27, x9
	subs	x8, x8, #1
	b.ne	LBB0_10
	b	LBB0_3
LBB0_11:
	cbz	w27, LBB0_14
; %bb.12:
	mov	w8, w27
	lsl	x8, x8, #3
	sub	x20, x8, #8
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x0, [x8, x20]
	bl	___free_page
	sub	x20, x20, #8
	cmn	x20, #8
	b.ne	LBB0_13
LBB0_14:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_16
LBB0_15:
	mov	w0, #0
LBB0_16:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	___GFP_ZERO,4,2                 ; @__GFP_ZERO
	.comm	___GFP_NOWARN,4,2               ; @__GFP_NOWARN
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_vb2_dma_sg_alloc_compacted
.subsections_via_symbols
