	.file	"extr_mthca_mcg.c_find_mgm.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"MGID_HASH failed (%d)\n"
.LC1:
	.string	"READ_MGM failed (%d)\n"
.LC2:
	.string	"Found zero MGID in AMGM.\n"
	.text
	.p2align 4
	.type	find_mgm, @function
find_mgm:
.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, rsi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, r9
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	mov	rbx, QWORD PTR [rdx]
	mov	QWORD PTR 24[rsp], rcx
	mov	QWORD PTR 8[rsp], r8
	call	mthca_alloc_mailbox@PLT
	mov	rdi, rax
	mov	QWORD PTR 16[rsp], rax
	call	IS_ERR@PLT
	test	rax, rax
	je	.L2
	mov	r15d, DWORD PTR ENOMEM[rip]
	neg	r15d
.L1:
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	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
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	r15, QWORD PTR 16[rsp]
	mov	edx, 16
	mov	rsi, r14
	mov	rdi, QWORD PTR [r15]
	call	memcpy@PLT
	mov	rdx, QWORD PTR 24[rsp]
	mov	rsi, r15
	mov	rdi, r12
	call	mthca_MGID_HASH@PLT
	mov	r15d, eax
	test	eax, eax
	jne	.L17
	mov	rax, QWORD PTR 24[rsp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR 0[rbp], eax
	mov	rax, QWORD PTR 8[rsp]
	mov	DWORD PTR [rax], -1
	mov	r15d, DWORD PTR 0[rbp]
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L6:
	mov	edi, DWORD PTR 4[rbx]
	mov	rsi, QWORD PTR zero_gid[rip]
	mov	edx, 16
	call	memcmp@PLT
	test	eax, eax
	je	.L18
	mov	edi, DWORD PTR 4[rbx]
	mov	edx, 16
	mov	rsi, r14
	call	memcmp@PLT
	test	eax, eax
	je	.L5
	mov	eax, DWORD PTR 0[rbp]
	mov	rcx, QWORD PTR 8[rsp]
	mov	DWORD PTR [rcx], eax
	mov	edi, DWORD PTR [rbx]
	call	be32_to_cpu@PLT
	sar	eax, 6
	mov	DWORD PTR 0[rbp], eax
	mov	r15d, eax
	je	.L19
.L10:
	mov	esi, r15d
	mov	rdx, r13
	mov	rdi, r12
	call	mthca_READ_MGM@PLT
	mov	r15d, eax
	test	eax, eax
	je	.L6
	mov	edx, eax
	lea	rsi, .LC1[rip]
	mov	rdi, r12
	xor	eax, eax
	call	mthca_err@PLT
.L5:
	mov	rsi, QWORD PTR 16[rsp]
	mov	rdi, r12
	call	mthca_free_mailbox@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	mov	edx, eax
	lea	rsi, .LC0[rip]
	mov	rdi, r12
	xor	eax, eax
	call	mthca_err@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rax, QWORD PTR 24[rsp]
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR 0[rbp], eax
	je	.L5
	lea	rsi, .LC2[rip]
	mov	rdi, r12
	xor	eax, eax
	call	mthca_err@PLT
	mov	r15d, DWORD PTR EINVAL[rip]
	neg	r15d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L19:
	mov	DWORD PTR 0[rbp], -1
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	find_mgm, .-find_mgm
	.comm	zero_gid,8,8
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,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_mcg.c_find_mgm.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"MGID_HASH failed (%d)\012\000"
	.align	2
.LC1:
	.ascii	"READ_MGM failed (%d)\012\000"
	.align	2
.LC2:
	.ascii	"Found zero MGID in AMGM.\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	find_mgm, %function
find_mgm:
	@ args = 8, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r7, r2
	ldr	r2, .L21
	sub	sp, sp, #12
	mov	r8, r1
	ldr	r1, [r2]
	str	r3, [sp]
	mov	r6, r0
	ldr	r4, [r7]
	ldr	r5, [sp, #52]
	bl	mthca_alloc_mailbox
	mov	r10, r0
	bl	IS_ERR
	cmp	r0, #0
	beq	.L2
	ldr	r3, .L21+4
	ldr	r3, [r3]
	rsb	r9, r3, #0
	mov	r0, r9
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	mov	r2, #16
	mov	r1, r8
	ldr	r0, [r10]
	bl	memcpy
	mov	r1, r10
	mov	r0, r6
	ldr	r2, [sp]
	bl	mthca_MGID_HASH
	subs	r9, r0, #0
	bne	.L18
	mvn	r3, #0
	ldr	r2, [sp]
	str	r10, [sp, #4]
	ldr	r2, [r2]
	ldr	fp, .L21+8
	str	r2, [r5]
	ldr	r2, [sp, #48]
	str	r3, [r2]
	mov	r10, r2
	ldr	r9, [r5]
	b	.L10
.L6:
	mov	r2, #16
	ldr	r1, [fp]
	ldr	r0, [r4, #4]
	bl	memcmp
	cmp	r0, #0
	beq	.L19
	mov	r2, #16
	mov	r1, r8
	ldr	r0, [r4, #4]
	bl	memcmp
	cmp	r0, #0
	beq	.L15
	ldr	r3, [r5]
	str	r3, [r10]
	ldr	r0, [r4]
	bl	be32_to_cpu
	asr	r9, r0, #6
	cmp	r9, #0
	str	r9, [r5]
	beq	.L20
.L10:
	mov	r1, r9
	mov	r2, r7
	mov	r0, r6
	bl	mthca_READ_MGM
	subs	r9, r0, #0
	beq	.L6
	mov	r2, r9
	mov	r0, r6
	ldr	r1, .L21+12
	ldr	r10, [sp, #4]
	bl	mthca_err
.L5:
	mov	r1, r10
	mov	r0, r6
	bl	mthca_free_mailbox
	mov	r0, r9
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L18:
	mov	r2, r9
	mov	r0, r6
	ldr	r1, .L21+16
	bl	mthca_err
	b	.L5
.L19:
	ldr	r3, [sp]
	ldr	r1, [r5]
	ldr	r2, [r3]
	ldr	r10, [sp, #4]
	cmp	r1, r2
	beq	.L5
	mov	r0, r6
	ldr	r1, .L21+20
	bl	mthca_err
	ldr	r3, .L21+24
	ldr	r3, [r3]
	rsb	r9, r3, #0
	b	.L5
.L15:
	ldr	r10, [sp, #4]
	b	.L5
.L20:
	mvn	r2, #0
	ldr	r10, [sp, #4]
	str	r2, [r5]
	b	.L5
.L22:
	.align	2
.L21:
	.word	GFP_KERNEL
	.word	ENOMEM
	.word	zero_gid
	.word	.LC1
	.word	.LC0
	.word	.LC2
	.word	EINVAL
	.size	find_mgm, .-find_mgm
	.comm	zero_gid,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
