	.file	"extr_mthca_mr.c_mthca_write_mtt.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	mthca_write_mtt
	.type	mthca_write_mtt, @function
mthca_write_mtt:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rcx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, r8d
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, edx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	call	mthca_write_mtt_size@PLT
	mov	DWORD PTR 12[rsp], eax
	lea	rax, 8[rbp]
	cmp	QWORD PTR 16[rbp], rax
	jne	.L2
	mov	eax, DWORD PTR 0[rbp]
	test	DWORD PTR MTHCA_FLAG_FMR[rip], eax
	jne	.L14
.L2:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	r8d, r14d
	mov	rcx, r15
	mov	edx, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	mov	rsi, r13
	mov	rdi, rbp
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	jmp	__mthca_write_mtt@PLT
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	call	mthca_arbel_write_mtt_seg@PLT
.L6:
	sub	r14d, ebx
	add	r12d, ebx
	lea	r15, [r15+rbx*4]
.L14:
	test	r14d, r14d
	jle	.L16
	mov	edi, DWORD PTR 12[rsp]
	mov	esi, r14d
	call	min@PLT
	mov	rdi, rbp
	movsx	rbx, eax
	call	mthca_is_memfree@PLT
	mov	r8d, ebx
	mov	rcx, r15
	mov	edx, r12d
	mov	rsi, r13
	mov	rdi, rbp
	test	rax, rax
	jne	.L17
	call	mthca_tavor_write_mtt_seg@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L16:
	add	rsp, 24
	.cfi_def_cfa_offset 56
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	mthca_write_mtt, .-mthca_write_mtt
	.comm	MTHCA_FLAG_FMR,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_mr.c_mthca_write_mtt.c"
	.text
	.align	2
	.global	mthca_write_mtt
	.syntax unified
	.arm
	.fpu softvfp
	.type	mthca_write_mtt, %function
mthca_write_mtt:
	@ args = 4, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r8, r0
	sub	sp, sp, #8
	mov	r6, r2
	mov	r7, r3
	mov	r9, r1
	ldr	r5, [sp, #40]
	bl	mthca_write_mtt_size
	ldr	r2, [r8, #8]
	add	r3, r8, #4
	cmp	r2, r3
	bne	.L2
	ldr	r3, .L16
	ldr	r2, [r8]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L2
	cmp	r5, #0
	mov	r10, r0
	bgt	.L3
	b	.L7
.L15:
	bl	mthca_arbel_write_mtt_seg
.L6:
	sub	r5, r5, r4
	cmp	r5, #0
	add	r6, r6, r4
	add	r7, r7, r4, lsl #2
	ble	.L7
.L3:
	mov	r1, r5
	mov	r0, r10
	bl	min
	mov	r4, r0
	mov	r0, r8
	bl	mthca_is_memfree
	cmp	r0, #0
	mov	r3, r7
	mov	r2, r6
	mov	r1, r9
	mov	r0, r8
	str	r4, [sp]
	bne	.L15
	bl	mthca_tavor_write_mtt_seg
	b	.L6
.L2:
	mov	r3, r7
	mov	r2, r6
	mov	r1, r9
	mov	r0, r8
	str	r5, [sp, #40]
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	__mthca_write_mtt
.L7:
	mov	r0, #0
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L17:
	.align	2
.L16:
	.word	MTHCA_FLAG_FMR
	.size	mthca_write_mtt, .-mthca_write_mtt
	.comm	MTHCA_FLAG_FMR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
