	.file	"extr_mthca_mr.c___mthca_write_mtt.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"WRITE_MTT failed (%d)\n"
	.text
	.p2align 4
	.type	__mthca_write_mtt, @function
__mthca_write_mtt:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rcx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, r8d
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	QWORD PTR 24[rsp], rsi
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	mov	QWORD PTR [rsp], rdi
	mov	DWORD PTR 12[rsp], edx
	call	mthca_alloc_mailbox@PLT
	mov	rdi, rax
	mov	QWORD PTR 16[rsp], rax
	call	IS_ERR@PLT
	test	rax, rax
	jne	.L19
	mov	rax, QWORD PTR 16[rsp]
	mov	r13, QWORD PTR [rax]
	test	r12d, r12d
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rsi, QWORD PTR [rsp]
	mov	rax, QWORD PTR 24[rsp]
	xor	r15d, r15d
	mov	edx, DWORD PTR 12[rsp]
	mov	eax, DWORD PTR [rax]
	imul	eax, DWORD PTR [rsi]
	add	eax, DWORD PTR 4[rsi]
	lea	edi, [rax+rdx*8]
	call	cpu_to_be64@PLT
	mov	QWORD PTR 8[r13], 0
	mov	QWORD PTR 0[r13], rax
	.p2align 4,,10
	.p2align 3
.L5:
	mov	ecx, DWORD PTR MTHCA_MAILBOX_SIZE[rip]
	movsx	rbx, r15d
	lea	ebp, 1[r15]
	test	ecx, ecx
	lea	eax, 7[rcx]
	cmovns	eax, ecx
	sar	eax, 3
	sub	eax, 2
	cmp	eax, r15d
	jle	.L6
	mov	edi, DWORD PTR [r14+r15*4]
	or	edi, DWORD PTR MTHCA_MTT_FLAG_PRESENT[rip]
	call	cpu_to_be64@PLT
	mov	QWORD PTR 16[r13+r15*8], rax
	add	r15, 1
	cmp	r12d, r15d
	jg	.L5
	lea	eax, 2[rbx]
	movsx	rbx, ebp
	mov	ebp, eax
.L6:
	test	bl, 1
	je	.L8
	movsx	rax, ebx
	mov	QWORD PTR 16[r13+rax*8], 0
.L8:
	mov	edx, ebp
	mov	rsi, QWORD PTR 16[rsp]
	mov	rdi, QWORD PTR [rsp]
	and	edx, -2
	call	mthca_WRITE_MTT@PLT
	mov	ebp, eax
	test	eax, eax
	jne	.L20
	sub	r12d, ebx
	add	DWORD PTR 12[rsp], ebx
	lea	r14, [r14+rbx*4]
	test	r12d, r12d
	jg	.L3
.L10:
	xor	ebp, ebp
.L4:
	mov	rsi, QWORD PTR 16[rsp]
	mov	rdi, QWORD PTR [rsp]
	call	mthca_free_mailbox@PLT
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, ebp
	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
.L20:
	.cfi_restore_state
	mov	rdi, QWORD PTR [rsp]
	mov	edx, eax
	lea	rsi, .LC0[rip]
	call	mthca_warn@PLT
	jmp	.L4
.L19:
	mov	rdi, QWORD PTR 16[rsp]
	add	rsp, 40
	.cfi_def_cfa_offset 56
	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
	jmp	PTR_ERR@PLT
	.cfi_endproc
.LFE0:
	.size	__mthca_write_mtt, .-__mthca_write_mtt
	.comm	MTHCA_MTT_FLAG_PRESENT,4,4
	.comm	MTHCA_MAILBOX_SIZE,4,4
	.comm	GFP_KERNEL,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
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"WRITE_MTT failed (%d)\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	__mthca_write_mtt, %function
__mthca_write_mtt:
	@ args = 4, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	ip, .L21
	sub	sp, sp, #36
	str	r1, [sp, #20]
	ldr	r1, [ip]
	stmib	sp, {r2, r3}
	mov	r8, r0
	ldr	r5, [sp, #72]
	bl	mthca_alloc_mailbox
	str	r0, [sp, #16]
	bl	IS_ERR
	subs	r3, r0, #0
	str	r3, [sp, #28]
	bne	.L19
	ldr	r3, [sp, #16]
	cmp	r5, #0
	ldr	r3, [r3]
	str	r3, [sp, #12]
	ble	.L4
	add	r3, r3, #4
	ldr	r6, .L21+4
	ldr	r7, .L21+8
	str	r3, [sp, #24]
.L3:
	ldr	r3, [sp, #20]
	ldr	r1, [sp, #8]
	ldr	r0, [r3]
	ldm	r8, {r2, r3}
	mla	r0, r2, r0, r3
	ldr	r3, [sp, #4]
	sub	r4, r1, #4
	add	r0, r0, r3, lsl #3
	bl	cpu_to_be64
	mov	r2, #0
	mov	r9, r2
	ldr	r3, [sp, #12]
	ldr	r10, [sp, #24]
	stm	r3, {r0, r2}
.L5:
	ldr	r3, [r6]
	mov	fp, r9
	cmp	r3, #0
	add	r2, r3, #7
	movlt	r3, r2
	asr	r3, r3, #3
	sub	r3, r3, #2
	cmp	r3, r9
	add	r9, r9, #1
	ble	.L6
	ldr	r0, [r4, #4]!
	ldr	r3, [r7]
	orr	r0, r0, r3
	bl	cpu_to_be64
	cmp	r5, r9
	str	r0, [r10, #4]!
	bgt	.L5
	add	r1, fp, #2
	mov	fp, r9
	mov	r9, r1
.L6:
	tst	fp, #1
	movne	r2, #0
	ldrne	r3, [sp, #12]
	addne	r1, fp, #2
	strne	r2, [r3, r1, lsl #2]
	mov	r0, r8
	ldr	r1, [sp, #16]
	bic	r2, r9, #1
	bl	mthca_WRITE_MTT
	cmp	r0, #0
	bne	.L20
	ldr	r3, [sp, #4]
	sub	r5, r5, fp
	add	r3, r3, fp
	str	r3, [sp, #4]
	ldr	r3, [sp, #8]
	cmp	r5, #0
	add	r3, r3, fp, lsl #2
	str	r3, [sp, #8]
	bgt	.L3
.L4:
	mov	r0, r8
	ldr	r1, [sp, #16]
	bl	mthca_free_mailbox
	ldr	r0, [sp, #28]
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L20:
	mov	r2, r0
	ldr	r1, .L21+12
	mov	r0, r8
	str	r2, [sp, #28]
	bl	mthca_warn
	b	.L4
.L19:
	ldr	r0, [sp, #16]
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	PTR_ERR
.L22:
	.align	2
.L21:
	.word	GFP_KERNEL
	.word	MTHCA_MAILBOX_SIZE
	.word	MTHCA_MTT_FLAG_PRESENT
	.word	.LC0
	.size	__mthca_write_mtt, .-__mthca_write_mtt
	.comm	MTHCA_MTT_FLAG_PRESENT,4,4
	.comm	MTHCA_MAILBOX_SIZE,4,4
	.comm	GFP_KERNEL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
