	.file	"extr_mthca_memfree.c_mthca_table_put.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	mthca_table_put
	.type	mthca_table_put, @function
mthca_table_put:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12d, edx
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rsi
	call	mthca_is_memfree@PLT
	test	eax, eax
	jne	.L6
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	mov	eax, DWORD PTR [rbx]
	lea	r13, 8[rbx]
	mov	rdi, r13
	sub	eax, 1
	and	eax, r12d
	imul	eax, DWORD PTR 4[rbx]
	cdq
	idiv	DWORD PTR MTHCA_TABLE_CHUNK_SIZE[rip]
	movsx	r14, eax
	call	mutex_lock@PLT
	mov	rax, QWORD PTR 16[rbx]
	mov	rax, QWORD PTR [rax+r14*8]
	sub	QWORD PTR [rax], 1
	je	.L7
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rdi, r13
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	jmp	mutex_unlock@PLT
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	mov	esi, DWORD PTR MTHCA_TABLE_CHUNK_SIZE[rip]
	mov	rdi, rbp
	mov	eax, esi
	imul	esi, r14d
	cdq
	idiv	DWORD PTR MTHCA_ICM_PAGE_SIZE[rip]
	movsx	rsi, esi
	add	rsi, QWORD PTR 32[rbx]
	mov	edx, eax
	call	mthca_UNMAP_ICM@PLT
	mov	rax, QWORD PTR 16[rbx]
	mov	edx, DWORD PTR 24[rbx]
	mov	rdi, rbp
	mov	rsi, QWORD PTR [rax+r14*8]
	call	mthca_free_icm@PLT
	mov	rax, QWORD PTR 16[rbx]
	mov	rdi, r13
	mov	QWORD PTR [rax+r14*8], 0
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	jmp	mutex_unlock@PLT
	.cfi_endproc
.LFE0:
	.size	mthca_table_put, .-mthca_table_put
	.comm	MTHCA_TABLE_CHUNK_SIZE,4,4
	.comm	MTHCA_ICM_PAGE_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_mthca_memfree.c_mthca_table_put.c"
	.text
	.global	__aeabi_idiv
	.align	2
	.global	mthca_table_put
	.syntax unified
	.arm
	.fpu softvfp
	.type	mthca_table_put, %function
mthca_table_put:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r1
	mov	r5, r2
	mov	r6, r0
	bl	mthca_is_memfree
	cmp	r0, #0
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r3, [r4]
	ldr	r0, [r4, #4]
	ldr	r8, .L7
	sub	r3, r3, #1
	and	r3, r3, r5
	mul	r0, r3, r0
	ldr	r1, [r8]
	bl	__aeabi_idiv
	mov	r7, r0
	add	r9, r4, #8
	mov	r0, r9
	bl	mutex_lock
	ldr	r3, [r4, #12]
	ldr	r3, [r3, r7, lsl #2]
	ldr	r5, [r3]
	sub	r5, r5, #1
	cmp	r5, #0
	str	r5, [r3]
	beq	.L6
	mov	r0, r9
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	mutex_unlock
.L6:
	ldr	r8, [r8]
	ldr	r3, .L7+4
	mov	r0, r8
	ldr	r1, [r3]
	bl	__aeabi_idiv
	ldr	r1, [r4, #20]
	mov	r2, r0
	mla	r1, r7, r8, r1
	mov	r0, r6
	bl	mthca_UNMAP_ICM
	ldr	r3, [r4, #12]
	mov	r0, r6
	ldr	r1, [r3, r7, lsl #2]
	ldr	r2, [r4, #16]
	bl	mthca_free_icm
	ldr	r3, [r4, #12]
	mov	r0, r9
	str	r5, [r3, r7, lsl #2]
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	mutex_unlock
.L8:
	.align	2
.L7:
	.word	MTHCA_TABLE_CHUNK_SIZE
	.word	MTHCA_ICM_PAGE_SIZE
	.size	mthca_table_put, .-mthca_table_put
	.comm	MTHCA_TABLE_CHUNK_SIZE,4,4
	.comm	MTHCA_ICM_PAGE_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
