	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function find_mgm
_find_mgm:                              ## @find_mgm
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -72(%rbp)                  ## 8-byte Spill
	movq	%r8, %r15
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r14
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movq	(%rdx), %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mthca_alloc_mailbox
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_15
LBB0_2:
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	$16, %edx
	callq	_memcpy
	movq	%r12, %rdi
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rsi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_mthca_MGID_HASH
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rsi
LBB0_4:
	movq	%r12, %rdi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_mthca_err
LBB0_14:
	movq	%r12, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_mthca_free_mailbox
LBB0_15:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	(%rbx), %eax
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, (%rbx)
	movl	$-1, (%r15)
	movl	(%rbx), %esi
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	callq	_mthca_READ_MGM
	testl	%eax, %eax
	jne	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	4(%r13), %edi
	movq	_zero_gid@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	$16, %edx
	callq	_memcmp
	testl	%eax, %eax
	je	LBB0_9
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	4(%r13), %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	$16, %edx
	callq	_memcmp
	xorl	%r14d, %r14d
	testl	%eax, %eax
	je	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	(%rbx), %eax
	movl	%eax, (%r15)
	movl	(%r13), %edi
	callq	_be32_to_cpu
	movl	%eax, %esi
	sarl	$6, %esi
	movl	%esi, (%rbx)
	cmpl	$63, %eax
	ja	LBB0_6
## %bb.13:
	movl	$-1, (%rbx)
	jmp	LBB0_14
LBB0_7:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_4
LBB0_9:
	movl	(%rbx), %eax
	xorl	%r14d, %r14d
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpl	(%rcx), %eax
	je	LBB0_14
## %bb.10:
	leaq	L_.str.2(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_mthca_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MGID_HASH failed (%d)\n"

L_.str.1:                               ## @.str.1
	.asciz	"READ_MGM failed (%d)\n"

	.comm	_zero_gid,8,3                   ## @zero_gid
L_.str.2:                               ## @.str.2
	.asciz	"Found zero MGID in AMGM.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_find_mgm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function find_mgm
_find_mgm:                              ; @find_mgm
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x5
	mov	x23, x4
	mov	x22, x3
	mov	x24, x2
	mov	x25, x1
	mov	x19, x0
	ldr	x27, [x2]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_mthca_alloc_mailbox
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w26, w8
	b	LBB0_5
LBB0_2:
	ldr	x0, [x20]
	mov	x1, x25
	mov	w2, #16
	bl	_memcpy
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_mthca_MGID_HASH
	cbz	w0, LBB0_6
; %bb.3:
	mov	x26, x0
	str	x26, [sp]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_mthca_err
LBB0_4:
	mov	x0, x19
	mov	x1, x20
	bl	_mthca_free_mailbox
LBB0_5:
	mov	x0, x26
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_6:
	ldr	w8, [x22]
	str	w8, [x21]
	mov	w8, #-1
	str	w8, [x23]
	ldr	w1, [x21]
Lloh8:
	adrp	x28, _zero_gid@GOTPAGE
Lloh9:
	ldr	x28, [x28, _zero_gid@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x2, x24
	bl	_mthca_READ_MGM
	cbnz	w0, LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x27, #4]
	ldr	x1, [x28]
	mov	w2, #16
	bl	_memcmp
	cbz	w0, LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x27, #4]
	mov	x1, x25
	mov	w2, #16
	bl	_memcmp
	cbz	w0, LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x21]
	str	w8, [x23]
	ldr	w0, [x27]
	bl	_be32_to_cpu
	asr	w1, w0, #6
	str	w1, [x21]
	cmp	w0, #63
	b.hi	LBB0_7
; %bb.11:
	mov	w26, #0
	mov	w8, #-1
	str	w8, [x21]
	b	LBB0_4
LBB0_12:
	mov	x26, x0
	str	x26, [sp]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_mthca_err
                                        ; kill: def $w26 killed $w26 killed $x26 def $x26
	b	LBB0_4
LBB0_13:
	ldr	w8, [x21]
	ldr	w9, [x22]
	cmp	w8, w9
	b.ne	LBB0_15
LBB0_14:
	mov	w26, #0
	b	LBB0_4
LBB0_15:
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_mthca_err
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w26, w8
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MGID_HASH failed (%d)\n"

l_.str.1:                               ; @.str.1
	.asciz	"READ_MGM failed (%d)\n"

	.comm	_zero_gid,8,3                   ; @zero_gid
l_.str.2:                               ; @.str.2
	.asciz	"Found zero MGID in AMGM.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_find_mgm
.subsections_via_symbols
