	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_alloc_buf_contig          ## -- Begin function mlx5_alloc_buf_contig
	.p2align	4, 0x90
_mlx5_alloc_buf_contig:                 ## @mlx5_alloc_buf_contig
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movq	%rdx, %rbx
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	leaq	-52(%rbp), %rdi
	leaq	-48(%rbp), %rsi
	movq	%r8, %rdx
	callq	_mlx5_alloc_get_env_info
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_mlx5_get_block_order
	movl	-52(%rbp), %ebx
	cmpl	%ebx, %eax
	cmovll	%eax, %ebx
	leaq	-44(%rbp), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	$0, -44(%rbp)
	movq	_MLX5_MMAP_GET_CONTIGUOUS_PAGES_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_set_command
	movl	%ebx, %edi
	movq	%r14, %rsi
	callq	_set_order
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_PROT_WRITE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_MAP_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	4(%r13), %r8d
	movl	-44(%rbp), %r9d
	imull	%r12d, %r9d
	xorl	%edi, %edi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_mmap
	movq	%rax, %r15
	movq	_MAP_FAILED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jne	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	leal	-1(%rbx), %ecx
	cmpl	-48(%rbp), %ebx
	movl	%ecx, %ebx
	jg	LBB0_1
	jmp	LBB0_6
LBB0_2:
	movl	%ebx, %ecx
LBB0_6:
	movl	(%r13), %edi
	movq	_MLX5_DBG_CONTIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r15, %r8
	callq	_mlx5_dbg
	movl	$-1, %ebx
	movq	_MAP_FAILED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	je	LBB0_10
## %bb.7:
	movq	%r15, %rdi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_ibv_dontfork_range
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_munmap
	jmp	LBB0_10
LBB0_4:
	movl	$-1, %ebx
	jmp	LBB0_10
LBB0_9:
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	%r15, 16(%rcx)
	movq	%r14, (%rcx)
	movq	_MLX5_ALLOC_TYPE_CONTIG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rcx)
	xorl	%ebx, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
	.comm	_MLX5_MMAP_GET_CONTIGUOUS_PAGES_CMD,4,2 ## @MLX5_MMAP_GET_CONTIGUOUS_PAGES_CMD
	.comm	_PROT_WRITE,4,2                 ## @PROT_WRITE
	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_errno,8,3                      ## @errno
	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_MLX5_DBG_CONTIG,4,2            ## @MLX5_DBG_CONTIG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"block order %d, addr %p\n"

	.comm	_MLX5_ALLOC_TYPE_CONTIG,4,2     ## @MLX5_ALLOC_TYPE_CONTIG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_alloc_buf_contig          ; -- Begin function mlx5_alloc_buf_contig
	.p2align	2
_mlx5_alloc_buf_contig:                 ; @mlx5_alloc_buf_contig
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x22, x3
	mov	x19, x2
	str	x1, [sp, #8]                    ; 8-byte Folded Spill
	mov	x21, x0
	add	x0, sp, #28
	add	x1, sp, #24
	mov	x2, x4
	bl	_mlx5_alloc_get_env_info
	mov	x0, x19
	bl	_mlx5_get_block_order
	ldr	w8, [sp, #28]
	cmp	w0, w8
	csel	w23, w0, w8, lt
Lloh0:
	adrp	x27, _PROT_WRITE@GOTPAGE
Lloh1:
	ldr	x27, [x27, _PROT_WRITE@GOTPAGEOFF]
Lloh2:
	adrp	x28, _PROT_READ@GOTPAGE
Lloh3:
	ldr	x28, [x28, _PROT_READ@GOTPAGEOFF]
Lloh4:
	adrp	x20, _MAP_SHARED@GOTPAGE
Lloh5:
	ldr	x20, [x20, _MAP_SHARED@GOTPAGEOFF]
Lloh6:
	adrp	x25, _errno@GOTPAGE
Lloh7:
	ldr	x25, [x25, _errno@GOTPAGEOFF]
Lloh8:
	adrp	x26, _EINVAL@GOTPAGE
Lloh9:
	ldr	x26, [x26, _EINVAL@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	str	wzr, [sp, #20]
Lloh10:
	adrp	x8, _MLX5_MMAP_GET_CONTIGUOUS_PAGES_CMD@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MLX5_MMAP_GET_CONTIGUOUS_PAGES_CMD@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	add	x1, sp, #20
	bl	_set_command
	add	x1, sp, #20
	mov	x0, x23
	bl	_set_order
	ldr	w8, [x27]
	ldr	w9, [x28]
	orr	w2, w9, w8
	ldr	w3, [x20]
	ldr	w4, [x21, #4]
	ldr	w8, [sp, #20]
	mul	w5, w8, w22
	mov	x0, #0
	mov	x1, x19
	bl	_mmap
	mov	x24, x0
Lloh13:
	adrp	x8, _MAP_FAILED@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MAP_FAILED@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x25]
	ldr	x9, [x26]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	sub	w3, w23, #1
	ldr	w8, [sp, #24]
	cmp	w23, w8
	mov	x23, x3
	b.gt	LBB0_1
	b	LBB0_5
LBB0_4:
	mov	x3, x23
LBB0_5:
	ldr	w0, [x21]
Lloh16:
	adrp	x8, _MLX5_DBG_CONTIG@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MLX5_DBG_CONTIG@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
Lloh19:
	adrp	x2, l_.str@PAGE
Lloh20:
	add	x2, x2, l_.str@PAGEOFF
	mov	x4, x24
	bl	_mlx5_dbg
Lloh21:
	adrp	x8, _MAP_FAILED@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MAP_FAILED@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	cmp	x24, x8
	b.eq	LBB0_8
; %bb.6:
	mov	x0, x24
	mov	x1, x19
	bl	_ibv_dontfork_range
	cbz	x0, LBB0_10
; %bb.7:
	mov	x0, x24
	mov	x1, x19
	bl	_munmap
LBB0_8:
	mov	w0, #-1
LBB0_9:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_10:
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	str	x24, [x9, #16]
	str	x19, [x9]
Lloh24:
	adrp	x8, _MLX5_ALLOC_TYPE_CONTIG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MLX5_ALLOC_TYPE_CONTIG@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	w8, [x9, #8]
	b	LBB0_9
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
	.comm	_MLX5_MMAP_GET_CONTIGUOUS_PAGES_CMD,4,2 ; @MLX5_MMAP_GET_CONTIGUOUS_PAGES_CMD
	.comm	_PROT_WRITE,4,2                 ; @PROT_WRITE
	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_errno,8,3                      ; @errno
	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_MLX5_DBG_CONTIG,4,2            ; @MLX5_DBG_CONTIG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"block order %d, addr %p\n"

	.comm	_MLX5_ALLOC_TYPE_CONTIG,4,2     ; @MLX5_ALLOC_TYPE_CONTIG
.subsections_via_symbols
