	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_table_put                ## -- Begin function mthca_table_put
	.p2align	4, 0x90
_mthca_table_put:                       ## @mthca_table_put
	.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
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	callq	_mthca_is_memfree
	testl	%eax, %eax
	je	LBB0_4
## %bb.1:
	movl	(%rbx), %eax
	decl	%eax
	andl	%r15d, %eax
	imull	4(%rbx), %eax
	movq	_MTHCA_TABLE_CHUNK_SIZE@GOTPCREL(%rip), %r13
	cltd
	idivl	(%r13)
	movl	%eax, %r12d
	leaq	8(%rbx), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	16(%rbx), %rax
	movslq	%r12d, %r12
	movq	(%rax,%r12,8), %rax
	decq	(%rax)
	jne	LBB0_3
## %bb.2:
	movl	(%r13), %eax
	movl	%r12d, %ecx
	imull	%eax, %ecx
	movslq	%ecx, %rsi
	addq	32(%rbx), %rsi
	movq	_MTHCA_ICM_PAGE_SIZE@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_mthca_UNMAP_ICM
	movq	16(%rbx), %rax
	movq	(%rax,%r12,8), %rsi
	movl	24(%rbx), %edx
	movq	%r14, %rdi
	callq	_mthca_free_icm
	movq	16(%rbx), %rax
	movq	$0, (%rax,%r12,8)
LBB0_3:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTHCA_TABLE_CHUNK_SIZE,4,2     ## @MTHCA_TABLE_CHUNK_SIZE
	.comm	_MTHCA_ICM_PAGE_SIZE,4,2        ## @MTHCA_ICM_PAGE_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_table_put                ; -- Begin function mthca_table_put
	.p2align	2
_mthca_table_put:                       ; @mthca_table_put
	.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	x21, x2
	mov	x19, x1
	mov	x20, x0
	bl	_mthca_is_memfree
	cbz	w0, LBB0_4
; %bb.1:
	ldp	w8, w9, [x19]
	sub	w8, w8, #1
	and	w8, w8, w21
	mul	w8, w8, w9
Lloh0:
	adrp	x22, _MTHCA_TABLE_CHUNK_SIZE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MTHCA_TABLE_CHUNK_SIZE@GOTPAGEOFF]
	ldr	w9, [x22]
	sdiv	w23, w8, w9
	add	x21, x19, #8
	mov	x0, x21
	bl	_mutex_lock
	ldr	x8, [x19, #16]
	ldr	x8, [x8, w23, sxtw #3]
	ldr	x9, [x8]
	subs	x9, x9, #1
	str	x9, [x8]
	b.ne	LBB0_3
; %bb.2:
	sxtw	x23, w23
	ldr	x8, [x19, #32]
	ldr	w9, [x22]
	mul	w10, w9, w23
	add	x1, x8, w10, sxtw
Lloh2:
	adrp	x8, _MTHCA_ICM_PAGE_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MTHCA_ICM_PAGE_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	sdiv	w2, w9, w8
	mov	x0, x20
	bl	_mthca_UNMAP_ICM
	ldr	x8, [x19, #16]
	lsl	x22, x23, #3
	ldr	x1, [x8, x22]
	ldr	w2, [x19, #24]
	mov	x0, x20
	bl	_mthca_free_icm
	ldr	x8, [x19, #16]
	str	xzr, [x8, x22]
LBB0_3:
	mov	x0, x21
	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
	b	_mutex_unlock
LBB0_4:
	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	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_MTHCA_TABLE_CHUNK_SIZE,4,2     ; @MTHCA_TABLE_CHUNK_SIZE
	.comm	_MTHCA_ICM_PAGE_SIZE,4,2        ; @MTHCA_ICM_PAGE_SIZE
.subsections_via_symbols
