	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_en_map_buffer             ## -- Begin function mlx4_en_map_buffer
	.p2align	4, 0x90
_mlx4_en_map_buffer:                    ## @mlx4_en_map_buffer
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_BITS_PER_LONG@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	cmpl	$64, (%rax)
	je	LBB0_8
## %bb.1:
	movq	%rdi, %r12
	movl	(%rdi), %edi
	cmpl	$1, %edi
	je	LBB0_8
## %bb.2:
	shll	$3, %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movq	%rax, %r15
	movl	(%r12), %esi
	testl	%esi, %esi
	jle	LBB0_6
## %bb.4:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_virt_to_page
	movq	%rax, (%r15,%rbx,8)
	incq	%rbx
	movslq	(%r12), %rsi
	cmpq	%rsi, %rbx
	jl	LBB0_5
LBB0_6:
	movq	_VM_MAP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_PAGE_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_vmap
	movl	%eax, 4(%r12)
	movq	%r15, %rdi
	callq	_kfree
	cmpl	$0, 4(%r12)
	jne	LBB0_8
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BITS_PER_LONG,4,2              ## @BITS_PER_LONG
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_VM_MAP,4,2                     ## @VM_MAP
	.comm	_PAGE_KERNEL,4,2                ## @PAGE_KERNEL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_en_map_buffer             ; -- Begin function mlx4_en_map_buffer
	.p2align	2
_mlx4_en_map_buffer:                    ; @mlx4_en_map_buffer
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x8, _BITS_PER_LONG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BITS_PER_LONG@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #64
	b.eq	LBB0_7
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0]
	cmp	w8, #1
	b.eq	LBB0_7
; %bb.2:
	lsl	w0, w8, #3
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_9
; %bb.3:
	mov	x20, x0
	ldr	w1, [x19]
	cmp	w1, #1
	b.lt	LBB0_6
; %bb.4:
	mov	x21, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	w0, [x8, x21, lsl #2]
	bl	_virt_to_page
	str	x0, [x20, x21, lsl #3]
	add	x21, x21, #1
	ldrsw	x1, [x19]
	cmp	x21, x1
	b.lt	LBB0_5
LBB0_6:
Lloh6:
	adrp	x8, _VM_MAP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VM_MAP@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x8, _PAGE_KERNEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PAGE_KERNEL@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	mov	x0, x20
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_vmap
	str	w0, [x19, #4]
	mov	x0, x20
	bl	_kfree
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_9
LBB0_7:
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_9:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_BITS_PER_LONG,4,2              ; @BITS_PER_LONG
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_VM_MAP,4,2                     ; @VM_MAP
	.comm	_PAGE_KERNEL,4,2                ; @PAGE_KERNEL
.subsections_via_symbols
