	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx4_alloc_pages
_mlx4_alloc_pages:                      ## @mlx4_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movq	%rdx, %r15
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_MLX4_EN_ALLOC_PREFER_ORDER@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	___GFP_NOWARN@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	movq	___GFP_COMP@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	testl	%ebx, %ebx
	cmovel	%ebx, %edi
	orl	%r14d, %edi
	movl	%ebx, %esi
	callq	_alloc_pages
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_likely
	testq	%rax, %rax
	jne	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	testl	%ebx, %ebx
	jle	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	decl	%ebx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	cmpl	(%r15), %eax
	jge	LBB0_1
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_8
LBB0_5:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movl	(%r12), %edi
	movq	_PCI_DMA_FROMDEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	xorl	%r14d, %r14d
	movq	%r13, %rsi
	xorl	%edx, %edx
	movl	%eax, %ecx
	callq	_dma_map_page
	movl	(%r12), %edi
	movl	%eax, %r12d
	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), %r14d
	jmp	LBB0_8
LBB0_7:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, (%rdx)
	movq	%r13, 16(%rdx)
	movl	%r12d, 8(%rdx)
	movl	8(%r15), %ecx
	movl	%ecx, 4(%rdx)
	cltd
	idivl	4(%r15)
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_atomic_set
LBB0_8:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX4_EN_ALLOC_PREFER_ORDER,4,2 ## @MLX4_EN_ALLOC_PREFER_ORDER
	.comm	___GFP_COMP,4,2                 ## @__GFP_COMP
	.comm	___GFP_NOWARN,4,2               ## @__GFP_NOWARN
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PCI_DMA_FROMDEVICE,4,2         ## @PCI_DMA_FROMDEVICE
	.no_dead_strip	_mlx4_alloc_pages
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx4_alloc_pages
_mlx4_alloc_pages:                      ; @mlx4_alloc_pages
	.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
	mov	x24, x3
	mov	x19, x2
	mov	x20, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _MLX4_EN_ALLOC_PREFER_ORDER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLX4_EN_ALLOC_PREFER_ORDER@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
Lloh3:
	adrp	x26, ___GFP_COMP@GOTPAGE
Lloh4:
	ldr	x26, [x26, ___GFP_COMP@GOTPAGEOFF]
Lloh5:
	adrp	x27, ___GFP_NOWARN@GOTPAGE
Lloh6:
	ldr	x27, [x27, ___GFP_NOWARN@GOTPAGEOFF]
Lloh7:
	adrp	x25, _PAGE_SIZE@GOTPAGE
Lloh8:
	ldr	x25, [x25, _PAGE_SIZE@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x26]
	ldr	w9, [x27]
	orr	w8, w9, w8
	cmp	w21, #0
	csel	w8, wzr, w8, eq
	orr	w0, w8, w24
	mov	x1, x21
	bl	_alloc_pages
	mov	x23, x0
	bl	_likely
	cbnz	x0, LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	subs	w21, w21, #1
	b.lt	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x25]
	lsl	w8, w8, w21
	ldr	w9, [x19]
	cmp	w8, w9
	b.ge	LBB0_1
	b	LBB0_6
LBB0_4:
	ldr	w0, [x22]
	ldr	w8, [x25]
	lsl	w3, w8, w21
Lloh9:
	adrp	x8, _PCI_DMA_FROMDEVICE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PCI_DMA_FROMDEVICE@GOTPAGEOFF]
Lloh11:
	ldr	w4, [x8]
	mov	x1, x23
	mov	w2, #0
	bl	_dma_map_page
	mov	x24, x0
	ldr	w0, [x22]
	mov	x1, x24
	bl	_dma_mapping_error
	cbz	x0, LBB0_8
; %bb.5:
	mov	x0, x23
	bl	_put_page
LBB0_6:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
LBB0_8:
	ldr	w8, [x25]
	lsl	w8, w8, w21
	str	x23, [x20, #16]
	str	w24, [x20, #8]
	ldp	w10, w9, [x19, #4]
	stp	w8, w9, [x20]
	sdiv	w1, w8, w10
	mov	x0, x23
	bl	_atomic_set
	mov	w0, #0
	b	LBB0_7
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX4_EN_ALLOC_PREFER_ORDER,4,2 ; @MLX4_EN_ALLOC_PREFER_ORDER
	.comm	___GFP_COMP,4,2                 ; @__GFP_COMP
	.comm	___GFP_NOWARN,4,2               ; @__GFP_NOWARN
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PCI_DMA_FROMDEVICE,4,2         ; @PCI_DMA_FROMDEVICE
	.no_dead_strip	_mlx4_alloc_pages
.subsections_via_symbols
