	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msc_buffer_contig_alloc
_msc_buffer_contig_alloc:               ## @msc_buffer_contig_alloc
	.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
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movq	%rsi, %r14
	shrq	%cl, %r14
	movq	%rsi, %rdi
	callq	_get_order
	testq	%r13, %r13
	je	LBB0_5
## %bb.1:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leaq	8(%r12), %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_sg_alloc_table
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	___GFP_ZERO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_GFP_DMA32@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_alloc_pages
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, %r15
	movq	%rax, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_split_page
	movl	8(%r12), %ebx
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_page_address
	movl	%ebx, %edi
	movl	%eax, %esi
	movq	%r13, %rdx
	callq	_sg_set_buf
	movq	%r12, %rdi
	callq	_msc_dev
	movq	(%rax), %rax
	movl	(%rax), %edi
	movl	8(%r12), %esi
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$1, %edx
	callq	_dma_map_sg
	testl	%eax, %eax
	js	LBB0_6
## %bb.4:
	movq	%r14, (%r12)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_page_address
	movl	%eax, 16(%r12)
	movl	8(%r12), %edi
	callq	_sg_dma_address
	movl	%eax, 12(%r12)
LBB0_5:
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_6:
	movl	%eax, %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	___free_pages
	movq	-64(%rbp), %r15                 ## 8-byte Reload
LBB0_7:
	movq	%r15, %rdi
	callq	_sg_free_table
LBB0_8:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	___GFP_ZERO,4,2                 ## @__GFP_ZERO
	.comm	_GFP_DMA32,4,2                  ## @GFP_DMA32
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.no_dead_strip	_msc_buffer_contig_alloc
.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_alloc
_msc_buffer_contig_alloc:               ; @msc_buffer_contig_alloc
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	x25, [x8]
	mov	x0, x1
	bl	_get_order
	cbz	x21, LBB0_5
; %bb.1:
	mov	x22, x0
	add	x20, x19, #8
Lloh3:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x20
	mov	w1, #1
	bl	_sg_alloc_table
	mov	x24, x0
	cbnz	w0, LBB0_9
; %bb.2:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w24, [x8]
	ldr	w8, [x23]
Lloh8:
	adrp	x9, ___GFP_ZERO@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___GFP_ZERO@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh11:
	adrp	x9, _GFP_DMA32@GOTPAGE
Lloh12:
	ldr	x9, [x9, _GFP_DMA32@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w0, w8, w9
	mov	x1, x22
	bl	_alloc_pages
	cbz	x0, LBB0_6
; %bb.3:
	mov	x23, x0
	mov	x1, x22
	bl	_split_page
	ldr	w24, [x19, #8]
	mov	x0, x23
	bl	_page_address
	mov	x1, x0
	mov	x0, x24
	mov	x2, x21
	bl	_sg_set_buf
	mov	x0, x19
	bl	_msc_dev
	ldr	x8, [x0]
	ldr	w0, [x8]
	ldr	w1, [x19, #8]
Lloh14:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh16:
	ldr	w3, [x8]
	mov	w2, #1
	bl	_dma_map_sg
	tbnz	w0, #31, LBB0_7
; %bb.4:
	lsr	x8, x21, x25
	str	x8, [x19]
	mov	x0, x23
	bl	_page_address
	str	w0, [x19, #16]
	ldr	w0, [x19, #8]
	bl	_sg_dma_address
	mov	w24, #0
	str	w0, [x19, #12]
	b	LBB0_9
LBB0_5:
	mov	w24, #0
	b	LBB0_9
LBB0_6:
	neg	w24, w24
	b	LBB0_8
LBB0_7:
	mov	x24, x0
	mov	x0, x23
	mov	x1, x22
	bl	___free_pages
LBB0_8:
	mov	x0, x20
	bl	_sg_free_table
LBB0_9:
	mov	x0, x24
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	___GFP_ZERO,4,2                 ; @__GFP_ZERO
	.comm	_GFP_DMA32,4,2                  ; @GFP_DMA32
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.no_dead_strip	_msc_buffer_contig_alloc
.subsections_via_symbols
