	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_system_page
_alloc_system_page:                     ## @alloc_system_page
	.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, %r12d
	movq	%rdi, %r15
	movq	(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_dev_to_node
	movq	_GFP_HIGHUSER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	xorl	%r13d, %r13d
	movl	%eax, %edi
	xorl	%edx, %edx
	callq	_alloc_pages_node
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %r14
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%eax, %r15d
	movl	(%r12), %ecx
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_dma_map_page
	movq	%rax, %r13
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_dma_mapping_error
	testq	%rax, %rax
	jne	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movb	$1, %al
	testq	%r13, %r13
	je	LBB0_2
## %bb.4:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%r14, %rdx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_insert_page
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	je	LBB0_11
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mlx5_core_err
	movl	(%r12), %edx
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_dma_unmap_page
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	jmp	LBB0_9
LBB0_6:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_mlx5_core_warn
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_13
LBB0_7:
	leaq	L_.str.1(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mlx5_core_warn
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	testl	%r13d, %r13d
	je	LBB0_11
## %bb.8:
	negl	%r13d
LBB0_9:
	movq	%r14, %rdi
	callq	___free_page
	testb	$1, %r15b
	je	LBB0_13
LBB0_12:
	movl	(%r12), %edx
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_dma_unmap_page
LBB0_13:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	xorl	%r13d, %r13d
	testb	$1, %r15b
	je	LBB0_13
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_HIGHUSER,4,2               ## @GFP_HIGHUSER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate page\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
L_.str.1:                               ## @.str.1
	.asciz	"failed dma mapping page\n"

L_.str.2:                               ## @.str.2
	.asciz	"failed to track allocated page\n"

	.no_dead_strip	_alloc_system_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_system_page
_alloc_system_page:                     ; @alloc_system_page
	.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	x22, x1
	mov	x21, x0
	ldr	x19, [x0]
	mov	x0, x19
	bl	_dev_to_node
Lloh0:
	adrp	x8, _GFP_HIGHUSER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_HIGHUSER@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_alloc_pages_node
	cbz	x0, LBB0_6
; %bb.1:
	mov	x20, x0
	mov	w8, #0
Lloh3:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
Lloh5:
	adrp	x25, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh6:
	ldr	x25, [x25, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x26, x8
	ldr	w3, [x24]
	ldr	w4, [x25]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_dma_map_page
	mov	x23, x0
	mov	x0, x19
	mov	x1, x23
	bl	_dma_mapping_error
	cbnz	x0, LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w8, #1
	cbz	x23, LBB0_2
; %bb.4:
	mov	x0, x21
	mov	x1, x23
	mov	x2, x20
	mov	x3, x22
	bl	_insert_page
	mov	x22, x0
	cbz	w0, LBB0_10
; %bb.5:
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_mlx5_core_err
	ldr	w2, [x24]
	ldr	w3, [x25]
	mov	x0, x19
	mov	x1, x23
	bl	_dma_unmap_page
	b	LBB0_9
LBB0_6:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_mlx5_core_warn
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_12
LBB0_7:
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_mlx5_core_warn
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cbz	w8, LBB0_13
; %bb.8:
	neg	w22, w8
LBB0_9:
	mov	x0, x20
	bl	___free_page
LBB0_10:
	tbz	w26, #0, LBB0_12
LBB0_11:
	ldr	w2, [x24]
	ldr	w3, [x25]
	mov	x0, x19
	mov	x1, #0
	bl	_dma_unmap_page
LBB0_12:
	mov	x0, x22
	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
LBB0_13:
	mov	w22, #0
	tbnz	w26, #0, LBB0_11
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_HIGHUSER,4,2               ; @GFP_HIGHUSER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate page\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
l_.str.1:                               ; @.str.1
	.asciz	"failed dma mapping page\n"

l_.str.2:                               ; @.str.2
	.asciz	"failed to track allocated page\n"

	.no_dead_strip	_alloc_system_page
.subsections_via_symbols
