	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_init_mr_table             ## -- Begin function mlx4_init_mr_table
	.p2align	4, 0x90
_mlx4_init_mr_table:                    ## @mlx4_init_mr_table
	.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	%rdi, %r12
	callq	_mlx4_priv
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_mlx4_is_slave
	xorl	%ebx, %ebx
	testq	%rax, %rax
	je	LBB0_1
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	20(%r12), %edi
	callq	_is_power_of_2
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	leaq	8(%r15), %r14
	movl	16(%r12), %ecx
	movl	20(%r12), %esi
	movq	%r14, %rdi
	movl	$-1, %edx
	xorl	%r8d, %r8d
	callq	_mlx4_bitmap_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.4:
	movq	_log_mtts_per_seg@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$1, %esi
	shll	%cl, %esi
	leaq	12(%r15), %r13
	movl	8(%r12), %eax
	cltd
	idivl	%esi
	movl	%eax, %edi
	callq	_ilog2
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_mlx4_buddy_init
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_5
LBB0_8:
	movq	%r14, %rdi
	callq	_mlx4_bitmap_cleanup
	jmp	LBB0_9
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_5:
	movq	(%r12), %rdi
	xorl	%ebx, %ebx
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.6:
	decq	%rdi
	callq	_fls
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_mlx4_alloc_mtt_range
	movq	%rax, (%r15)
	testq	%rax, %rax
	jns	LBB0_9
## %bb.7:
	movl	(%r13), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_mlx4_warn
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r13, %rdi
	callq	_mlx4_buddy_cleanup
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_log_mtts_per_seg,4,2           ## @log_mtts_per_seg
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MTT table of order %u is too small\n"

	.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_init_mr_table             ; -- Begin function mlx4_init_mr_table
	.p2align	2
_mlx4_init_mr_table:                    ; @mlx4_init_mr_table
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	bl	_mlx4_priv
	mov	x21, x0
	mov	x0, x19
	bl	_mlx4_is_slave
	cbz	x0, LBB0_3
LBB0_1:
	mov	w23, #0
LBB0_2:
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_3:
	ldr	w0, [x19, #20]
	bl	_is_power_of_2
	cbz	w0, LBB0_7
; %bb.4:
	add	x20, x21, #8
	ldp	w3, w1, [x19, #16]
	mov	x0, x20
	mov	w2, #-1
	mov	w4, #0
	bl	_mlx4_bitmap_init
	mov	x23, x0
	cbnz	w0, LBB0_2
; %bb.5:
	add	x22, x21, #12
	ldr	w8, [x19, #8]
Lloh0:
	adrp	x9, _log_mtts_per_seg@GOTPAGE
Lloh1:
	ldr	x9, [x9, _log_mtts_per_seg@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	mov	w10, #1
	lsl	w9, w10, w9
	sdiv	w0, w8, w9
	bl	_ilog2
	mov	x1, x0
	mov	x0, x22
	bl	_mlx4_buddy_init
	mov	x23, x0
	cbz	w0, LBB0_8
LBB0_6:
	mov	x0, x20
	bl	_mlx4_bitmap_cleanup
	b	LBB0_2
LBB0_7:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_2
LBB0_8:
	ldr	x8, [x19]
	cbz	x8, LBB0_1
; %bb.9:
	sub	x0, x8, #1
	bl	_fls
	mov	x1, x0
	mov	x0, x19
	bl	_mlx4_alloc_mtt_range
	str	x0, [x21]
	tbz	x0, #63, LBB0_1
; %bb.10:
	ldr	w2, [x22]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_mlx4_warn
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w23, w8
	mov	x0, x22
	bl	_mlx4_buddy_cleanup
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_log_mtts_per_seg,4,2           ; @log_mtts_per_seg
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MTT table of order %u is too small\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
