	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_init_mr_table            ## -- Begin function mthca_init_mr_table
	.p2align	4, 0x90
_mthca_init_mr_table:                   ## @mthca_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
	leaq	16(%rdi), %r14
	movl	56(%rdi), %esi
	movl	76(%rdi), %ecx
	movq	%r14, %rdi
	movl	$-1, %edx
	callq	_mthca_alloc_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_34
## %bb.1:
	movq	%r12, %rdi
	callq	_mthca_is_memfree
	movl	(%r12), %ecx
	testl	%eax, %eax
	je	LBB0_2
LBB0_4:
	movq	_MTHCA_FLAG_FMR@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, (%r12)
	jmp	LBB0_5
LBB0_2:
	movq	_MTHCA_FLAG_DDR_HIDDEN@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_4
## %bb.3:
	movl	$0, 60(%r12)
LBB0_5:
	movq	_MTHCA_FLAG_SINAI_OPT@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_mthca_dbg
LBB0_7:
	leaq	20(%r12), %r15
	movl	64(%r12), %edi
	decl	%edi
	callq	_fls
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_mthca_buddy_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_33
## %bb.8:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%r12)
	movl	60(%r12), %edi
	testl	%edi, %edi
	je	LBB0_12
## %bb.9:
	decl	%edi
	callq	_fls
	cmpl	$31, %eax
	jl	LBB0_11
## %bb.10:
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_mthca_warn
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_32
LBB0_12:
	movl	56(%r12), %ebx
	movl	64(%r12), %r13d
	jmp	LBB0_13
LBB0_11:
	movl	$1, %ebx
	movl	%eax, %ecx
	shll	%cl, %ebx
	movl	%ebx, %r13d
LBB0_13:
	movq	%r12, %rdi
	callq	_mthca_is_memfree
	testl	%eax, %eax
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_14
LBB0_19:
	cmpl	$0, 60(%r12)
	je	LBB0_22
## %bb.20:
	leaq	40(%r12), %r15
	decl	%r13d
	movl	%r13d, %edi
	callq	_fls
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_mthca_buddy_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_27
## %bb.21:
	movl	%r13d, %edi
	callq	_fls
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_mthca_buddy_alloc
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_25
LBB0_22:
	movq	%r15, 48(%r12)
	movl	72(%r12), %edi
	xorl	%ebx, %ebx
	testl	%edi, %edi
	je	LBB0_34
## %bb.23:
	decl	%edi
	callq	_fls
	movq	48(%r12), %rdx
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_mthca_alloc_mtt_range
	cmpl	$-1, %eax
	jne	LBB0_34
## %bb.24:
	movq	48(%r12), %rax
	movl	(%rax), %edx
	leaq	L_.str.4(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_mthca_warn
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_25:
	cmpl	$0, 60(%r12)
	je	LBB0_27
## %bb.26:
	leaq	40(%r12), %rdi
	callq	_mthca_buddy_cleanup
LBB0_27:
	movq	32(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_29
## %bb.28:
	callq	_iounmap
LBB0_29:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
LBB0_30:
	addq	$24, %r12
	movq	(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_32
## %bb.31:
	callq	_iounmap
LBB0_32:
	movq	%r15, %rdi
	callq	_mthca_buddy_cleanup
LBB0_33:
	movq	%r14, %rdi
	callq	_mthca_alloc_cleanup
LBB0_34:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	_MTHCA_FLAG_FMR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_19
## %bb.15:
	movl	80(%r12), %edi
	movl	$4, %esi
	callq	_pci_resource_start
	movq	%rax, %r15
	movl	80(%r12), %edi
	movl	$4, %esi
	callq	_pci_resource_len
	cltq
	decq	%rax
	movslq	8(%r12), %rdi
	andq	%rax, %rdi
	addq	%r15, %rdi
	shll	$2, %ebx
	movl	%ebx, %esi
	callq	_ioremap
	movq	%rax, 24(%r12)
	testq	%rax, %rax
	je	LBB0_16
## %bb.17:
	movl	80(%r12), %edi
	movl	$4, %esi
	callq	_pci_resource_start
	movq	%rax, %rbx
	movl	80(%r12), %edi
	movl	$4, %esi
	callq	_pci_resource_len
	cltq
	decq	%rax
	movslq	12(%r12), %rdi
	andq	%rax, %rdi
	addq	%rbx, %rdi
	movl	68(%r12), %esi
	imull	%r13d, %esi
	callq	_ioremap
	movq	%rax, 32(%r12)
	testq	%rax, %rax
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jne	LBB0_19
## %bb.18:
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_mthca_warn
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_30
LBB0_16:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_mthca_warn
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_32
	.cfi_endproc
                                        ## -- End function
	.comm	_MTHCA_FLAG_DDR_HIDDEN,4,2      ## @MTHCA_FLAG_DDR_HIDDEN
	.comm	_MTHCA_FLAG_FMR,4,2             ## @MTHCA_FLAG_FMR
	.comm	_MTHCA_FLAG_SINAI_OPT,4,2       ## @MTHCA_FLAG_SINAI_OPT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Memory key throughput optimization activated.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Unable to reserve 2^31 FMR MTTs.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"MPT ioremap for FMR failed.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.3:                               ## @.str.3
	.asciz	"MTT ioremap for FMR failed.\n"

L_.str.4:                               ## @.str.4
	.asciz	"MTT table of order %d is too small.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_init_mr_table            ; -- Begin function mthca_init_mr_table
	.p2align	2
_mthca_init_mr_table:                   ; @mthca_init_mr_table
	.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	x21, x0
	add	x19, x0, #16
	ldr	w1, [x0, #56]
	ldr	w3, [x0, #76]
	mov	x0, x19
	mov	w2, #-1
	bl	_mthca_alloc_init
	mov	x22, x0
	cbnz	w0, LBB0_34
; %bb.1:
	mov	x0, x21
	bl	_mthca_is_memfree
	ldr	w8, [x21]
	cbz	w0, LBB0_3
LBB0_2:
Lloh0:
	adrp	x9, _MTHCA_FLAG_FMR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MTHCA_FLAG_FMR@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x21]
	b	LBB0_5
LBB0_3:
Lloh3:
	adrp	x9, _MTHCA_FLAG_DDR_HIDDEN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MTHCA_FLAG_DDR_HIDDEN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.4:
	str	wzr, [x21, #60]
LBB0_5:
Lloh6:
	adrp	x9, _MTHCA_FLAG_SINAI_OPT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MTHCA_FLAG_SINAI_OPT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_mthca_dbg
LBB0_7:
	add	x20, x21, #20
	ldr	w8, [x21, #64]
	sub	w0, w8, #1
	bl	_fls
	mov	x1, x0
	mov	x0, x20
	bl	_mthca_buddy_init
	mov	x22, x0
	cbnz	w0, LBB0_33
; %bb.8:
	mov	x25, x21
	stp	xzr, xzr, [x25, #24]!
	ldr	w8, [x25, #36]
	cbz	w8, LBB0_12
; %bb.9:
	sub	w0, w8, #1
	bl	_fls
	cmp	w0, #31
	b.lt	LBB0_13
; %bb.10:
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_mthca_warn
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_32
LBB0_12:
	ldr	w24, [x21, #64]
	ldr	w23, [x21, #56]
	b	LBB0_14
LBB0_13:
	mov	w8, #1
	lsl	w23, w8, w0
	mov	x24, x23
LBB0_14:
	mov	x0, x21
	bl	_mthca_is_memfree
	cbz	w0, LBB0_21
LBB0_15:
	ldr	w8, [x21, #60]
	mov	x23, x20
	cbz	w8, LBB0_18
; %bb.16:
	add	x23, x21, #40
	sub	w24, w24, #1
	mov	x0, x24
	bl	_fls
	mov	x1, x0
	mov	x0, x23
	bl	_mthca_buddy_init
	mov	x22, x0
	cbnz	w0, LBB0_28
; %bb.17:
	mov	x0, x24
	bl	_fls
	mov	x1, x0
	mov	x0, x20
	bl	_mthca_buddy_alloc
	mov	x22, x0
	cbnz	w0, LBB0_26
LBB0_18:
	str	x23, [x21, #48]
	ldr	w8, [x21, #72]
	cbz	w8, LBB0_20
; %bb.19:
	sub	w0, w8, #1
	bl	_fls
	mov	x1, x0
	ldr	x2, [x21, #48]
	mov	x0, x21
	bl	_mthca_alloc_mtt_range
	cmn	w0, #1
	b.eq	LBB0_25
LBB0_20:
	mov	w22, #0
	b	LBB0_34
LBB0_21:
	ldr	w8, [x21]
Lloh15:
	adrp	x9, _MTHCA_FLAG_FMR@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MTHCA_FLAG_FMR@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.22:
	ldr	w0, [x21, #80]
	mov	w1, #4
	bl	_pci_resource_start
	mov	x22, x0
	ldr	w0, [x21, #80]
	mov	w1, #4
	bl	_pci_resource_len
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	sub	x8, x8, #1
	ldrsw	x9, [x21, #8]
	and	x8, x8, x9
	add	x0, x22, x8
	lsl	w1, w23, #2
	bl	_ioremap
	str	x0, [x21, #24]
	cbz	x0, LBB0_35
; %bb.23:
	ldr	w0, [x21, #80]
	mov	w1, #4
	bl	_pci_resource_start
	mov	x22, x0
	ldr	w0, [x21, #80]
	mov	w1, #4
	bl	_pci_resource_len
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	sub	x8, x8, #1
	ldrsw	x9, [x21, #12]
	and	x8, x8, x9
	add	x0, x22, x8
	ldr	w8, [x21, #68]
	mul	w1, w8, w24
	bl	_ioremap
	str	x0, [x21, #32]
	cbnz	x0, LBB0_15
; %bb.24:
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_mthca_warn
Lloh20:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_30
LBB0_25:
	ldr	x8, [x21, #48]
	ldr	w8, [x8]
	str	x8, [sp]
Lloh23:
	adrp	x1, l_.str.4@PAGE
Lloh24:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	bl	_mthca_warn
Lloh25:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_26:
	ldr	w8, [x21, #60]
	cbz	w8, LBB0_28
; %bb.27:
	add	x0, x21, #40
	bl	_mthca_buddy_cleanup
LBB0_28:
	ldr	x0, [x21, #32]
	cbz	x0, LBB0_30
; %bb.29:
	bl	_iounmap
LBB0_30:
	ldr	x0, [x25]
	cbz	x0, LBB0_32
; %bb.31:
	bl	_iounmap
LBB0_32:
	mov	x0, x20
	bl	_mthca_buddy_cleanup
LBB0_33:
	mov	x0, x19
	bl	_mthca_alloc_cleanup
LBB0_34:
	mov	x0, x22
	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
LBB0_35:
Lloh28:
	adrp	x1, l_.str.2@PAGE
Lloh29:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_mthca_warn
Lloh30:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_MTHCA_FLAG_DDR_HIDDEN,4,2      ; @MTHCA_FLAG_DDR_HIDDEN
	.comm	_MTHCA_FLAG_FMR,4,2             ; @MTHCA_FLAG_FMR
	.comm	_MTHCA_FLAG_SINAI_OPT,4,2       ; @MTHCA_FLAG_SINAI_OPT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Memory key throughput optimization activated.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Unable to reserve 2^31 FMR MTTs.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"MPT ioremap for FMR failed.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.3:                               ; @.str.3
	.asciz	"MTT ioremap for FMR failed.\n"

l_.str.4:                               ; @.str.4
	.asciz	"MTT table of order %d is too small.\n"

.subsections_via_symbols
