	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_table_get                ## -- Begin function mthca_table_get
	.p2align	4, 0x90
_mthca_table_get:                       ## @mthca_table_get
	.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	%rsi, %rbx
	movq	%rdi, %r15
	movl	(%rsi), %eax
	decl	%eax
	andl	%edx, %eax
	imull	4(%rsi), %eax
	movq	_MTHCA_TABLE_CHUNK_SIZE@GOTPCREL(%rip), %r13
	cltd
	idivl	(%r13)
	movl	%eax, %r12d
	leaq	8(%rsi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	16(%rbx), %rax
	movslq	%r12d, %r12
	movq	(%rax,%r12,8), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	incl	(%rax)
LBB0_10:
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_2:
	movl	(%r13), %esi
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %esi
	cmpq	$0, 40(%rbx)
	jne	LBB0_3
## %bb.4:
	movq	_GFP_HIGHUSER@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %edx
	movq	___GFP_NOWARN@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	24(%rbx), %ecx
	movq	%r15, %rdi
	callq	_mthca_alloc_icm
	movq	16(%rbx), %rcx
	movq	%rax, (%rcx,%r12,8)
	movq	16(%rbx), %rax
	movq	(%rax,%r12,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_6
## %bb.7:
	movslq	(%r13), %rdx
	imulq	%r12, %rdx
	addq	32(%rbx), %rdx
	movq	%r15, %rdi
	callq	_mthca_MAP_ICM
	movq	16(%rbx), %rcx
	movq	(%rcx,%r12,8), %rsi
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movl	24(%rbx), %edx
	movq	%r15, %rdi
	callq	_mthca_free_icm
	movq	16(%rbx), %rax
	movq	$0, (%rax,%r12,8)
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	incl	(%rsi)
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_MTHCA_TABLE_CHUNK_SIZE,4,2     ## @MTHCA_TABLE_CHUNK_SIZE
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_GFP_HIGHUSER,4,2               ## @GFP_HIGHUSER
	.comm	___GFP_NOWARN,4,2               ## @__GFP_NOWARN
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_table_get                ; -- Begin function mthca_table_get
	.p2align	2
_mthca_table_get:                       ; @mthca_table_get
	.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	x20, x1
	mov	x21, x0
	ldp	w8, w9, [x1]
	sub	w8, w8, #1
	and	w8, w8, w2
	mul	w8, w8, w9
Lloh0:
	adrp	x23, _MTHCA_TABLE_CHUNK_SIZE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MTHCA_TABLE_CHUNK_SIZE@GOTPAGEOFF]
	ldr	w9, [x23]
	sdiv	w22, w8, w9
	add	x19, x1, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x20, #16]
	ldr	x8, [x8, w22, sxtw #3]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w20, #0
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	b	LBB0_7
LBB0_2:
	sxtw	x22, w22
	ldr	w8, [x23]
Lloh2:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	asr	w1, w8, w9
	ldr	x8, [x20, #40]
Lloh5:
	adrp	x9, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x9, [x9, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	adrp	x10, _GFP_HIGHUSER@GOTPAGE
Lloh8:
	ldr	x10, [x10, _GFP_HIGHUSER@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x10, x9, eq
	ldr	w8, [x8]
Lloh9:
	adrp	x9, ___GFP_NOWARN@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___GFP_NOWARN@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w2, w8, w9
	ldr	w3, [x20, #24]
	mov	x0, x21
	bl	_mthca_alloc_icm
	ldr	x8, [x20, #16]
	lsl	x9, x22, #3
	str	x0, [x8, x9]
	ldr	x8, [x20, #16]
	ldr	x1, [x8, x9]
	cbz	x1, LBB0_5
; %bb.3:
	ldr	x8, [x20, #32]
	ldrsw	x9, [x23]
	madd	x2, x9, x22, x8
	mov	x0, x21
	bl	_mthca_MAP_ICM
	ldr	x8, [x20, #16]
	ldr	x1, [x8, x22, lsl #3]
	cbz	x0, LBB0_6
; %bb.4:
	ldr	w2, [x20, #24]
	mov	x0, x21
	bl	_mthca_free_icm
	ldr	x8, [x20, #16]
	str	xzr, [x8, x22, lsl #3]
LBB0_5:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_7
LBB0_6:
	mov	w20, #0
	ldr	w8, [x1]
	add	w8, w8, #1
	str	w8, [x1]
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_MTHCA_TABLE_CHUNK_SIZE,4,2     ; @MTHCA_TABLE_CHUNK_SIZE
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_GFP_HIGHUSER,4,2               ; @GFP_HIGHUSER
	.comm	___GFP_NOWARN,4,2               ; @__GFP_NOWARN
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
