	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xlgmac_alloc_pages
_xlgmac_alloc_pages:                    ## @xlgmac_alloc_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
	testl	%ecx, %ecx
	js	LBB0_4
## %bb.1:
	movl	%ecx, %ebx
	movl	%edx, %r12d
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	___GFP_COMP@GOTPCREL(%rip), %rax
	movq	___GFP_NOWARN@GOTPCREL(%rip), %rcx
	orl	(%rax), %r12d
	orl	(%rcx), %r12d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	movl	%ebx, %esi
	callq	_alloc_pages
	testq	%rax, %rax
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	-1(%rbx), %eax
	testl	%ebx, %ebx
	movl	%eax, %ebx
	jg	LBB0_2
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_8
LBB0_5:
	movq	%rax, %r13
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	movl	(%r15), %edi
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	xorl	%r12d, %r12d
	movq	%r13, %rsi
	xorl	%edx, %edx
	movl	%eax, %ecx
	callq	_dma_map_page
	movl	%eax, %r14d
	movl	(%r15), %edi
	movl	%eax, %esi
	callq	_dma_mapping_error
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%r13, %rdi
	callq	_put_page
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_8
LBB0_7:
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	%r13, 16(%rdx)
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	movl	%eax, (%rdx)
	movq	$0, 8(%rdx)
	movl	%r14d, 4(%rdx)
LBB0_8:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	___GFP_COMP,4,2                 ## @__GFP_COMP
	.comm	___GFP_NOWARN,4,2               ## @__GFP_NOWARN
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.no_dead_strip	_xlgmac_alloc_pages
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xlgmac_alloc_pages
_xlgmac_alloc_pages:                    ; @xlgmac_alloc_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
	tbnz	w3, #31, LBB0_6
; %bb.1:
	mov	x20, x3
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___GFP_COMP@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___GFP_COMP@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, ___GFP_NOWARN@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___GFP_NOWARN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w8, w2
	orr	w23, w8, w9
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	mov	x1, x20
	bl	_alloc_pages
	cbnz	x0, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	w8, w20, #1
	cmp	w20, #0
	mov	x20, x8
	b.gt	LBB0_2
	b	LBB0_6
LBB0_4:
	mov	x22, x0
Lloh6:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w0, [x21]
	ldr	w8, [x24]
	lsl	w3, w8, w20
Lloh8:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh10:
	ldr	w4, [x8]
	mov	x1, x22
	mov	w2, #0
	bl	_dma_map_page
	mov	x23, x0
	ldr	w0, [x21]
	mov	x1, x23
	bl	_dma_mapping_error
	cbz	x0, LBB0_8
; %bb.5:
	mov	x0, x22
	bl	_put_page
LBB0_6:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
	ret
LBB0_8:
	ldr	w8, [x24]
	lsl	w8, w8, w20
	stp	xzr, x22, [x19, #8]
	stp	w8, w23, [x19]
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	___GFP_COMP,4,2                 ; @__GFP_COMP
	.comm	___GFP_NOWARN,4,2               ; @__GFP_NOWARN
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.no_dead_strip	_xlgmac_alloc_pages
.subsections_via_symbols
