	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_buf_alloc                 ## -- Begin function mlx4_buf_alloc
	.p2align	4, 0x90
_mlx4_buf_alloc:                        ## @mlx4_buf_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movl	%esi, %r14d
	movq	%rdi, %r15
	cmpl	%edx, %esi
	jle	LBB0_10
## %bb.1:
	movq	$0, 24(%rbx)
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_DIV_ROUND_UP
	movl	%eax, (%rbx)
	movl	%eax, 4(%rbx)
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%rbx)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	movl	$8, %esi
	callq	_kcalloc
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_8
## %bb.2:
	cmpl	$0, (%rbx)
	jle	LBB0_6
## %bb.3:
	xorl	%r13d, %r13d
	leaq	-44(%rbp), %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movq	(%rax), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdx
	callq	_dma_alloc_coherent
	movq	8(%rbx), %rcx
	movl	%eax, 4(%rcx,%r13,8)
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	-44(%rbp), %eax
	movl	%eax, (%rcx,%r13,8)
	incq	%r13
	movslq	(%rbx), %rax
	cmpq	%rax, %r13
	jl	LBB0_4
LBB0_6:
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_10:
	movq	%r15, %rdi
	movl	%r14d, %esi
	movq	%rbx, %rdx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mlx4_buf_direct_alloc          ## TAILCALL
LBB0_7:
	movq	%r15, %rdi
	movl	%r14d, %esi
	movq	%rbx, %rdx
	callq	_mlx4_buf_free
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$8, %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	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_buf_alloc                 ; -- Begin function mlx4_buf_alloc
	.p2align	2
_mlx4_buf_alloc:                        ; @mlx4_buf_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x19, x3
	mov	x20, x1
	mov	x21, x0
	cmp	w1, w2
	b.le	LBB0_7
; %bb.1:
	str	xzr, [x19, #24]
Lloh0:
	adrp	x22, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_DIV_ROUND_UP
Lloh2:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
	stp	w0, w0, [x19]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x19, #16]
Lloh5:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	w1, #8
	bl	_kcalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_9
; %bb.2:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.3:
	mov	x24, #0
	mov	x25, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	ldr	x0, [x8]
	ldr	w1, [x22]
	ldr	w3, [x23]
	add	x2, sp, #12
	bl	_dma_alloc_coherent
	ldr	x8, [x19, #8]
	add	x9, x8, x24
	str	w0, [x9, #4]
	cbz	w0, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [sp, #12]
	str	w9, [x8, x24]
	add	x25, x25, #1
	ldrsw	x8, [x19]
	add	x24, x24, #8
	cmp	x25, x8
	b.lt	LBB0_4
LBB0_6:
	mov	w0, #0
	b	LBB0_10
LBB0_7:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	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
	add	sp, sp, #96
	b	_mlx4_buf_direct_alloc
LBB0_8:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_mlx4_buf_free
LBB0_9:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
