	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mthca_init_arbel
_mthca_init_arbel:                      ## @mthca_init_arbel
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	callq	_mthca_QUERY_FW
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
LBB0_8:
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_mthca_err
LBB0_21:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_2:
	movq	%r14, %rdi
	callq	_mthca_ENABLE_LAM
	movl	%eax, %ebx
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	jne	LBB0_6
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_mthca_dbg
	movq	_MTHCA_FLAG_NO_LAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r14)
	jmp	LBB0_4
LBB0_6:
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.7:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_8
LBB0_4:
	movq	%r14, %rdi
	callq	_mthca_load_fw
	testl	%eax, %eax
	je	LBB0_9
## %bb.5:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_mthca_err
	jmp	LBB0_19
LBB0_9:
	leaq	-32(%rbp), %rsi
	movq	%r14, %rdi
	callq	_mthca_dev_lim
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_mthca_err
LBB0_18:
	movq	%r14, %rdi
	callq	_mthca_UNMAP_FA
	movl	4(%r14), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_mthca_free_icm
LBB0_19:
	movq	_MTHCA_FLAG_NO_LAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	jne	LBB0_21
## %bb.20:
	movq	%r14, %rdi
	callq	_mthca_DISABLE_LAM
	jmp	LBB0_21
LBB0_11:
	movq	_hca_profile@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	-32(%rbp), %eax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%eax, -48(%rbp)
	movq	$0, -40(%rbp)
	movq	_MTHCA_FLAG_SRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_13
## %bb.12:
	movl	-28(%rbp), %eax
	movl	%eax, -44(%rbp)
LBB0_13:
	leaq	-48(%rbp), %rsi
	leaq	-32(%rbp), %rdx
	leaq	-24(%rbp), %rcx
	movq	%r14, %rdi
	callq	_mthca_make_profile
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_18
## %bb.14:
	leaq	-32(%rbp), %rsi
	leaq	-24(%rbp), %rdx
	movq	%r14, %rdi
	movl	%ebx, %ecx
	callq	_mthca_init_icm
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.15:
	leaq	-24(%rbp), %rsi
	movq	%r14, %rdi
	callq	_mthca_INIT_HCA
	testl	%eax, %eax
	je	LBB0_16
## %bb.17:
	movl	%eax, %ebx
	leaq	L_.str.5(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_mthca_err
	movq	%r14, %rdi
	callq	_mthca_free_icms
	jmp	LBB0_18
LBB0_16:
	xorl	%ebx, %ebx
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"QUERY_FW command failed %d, aborting.\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
L_.str.1:                               ## @.str.1
	.asciz	"No HCA-attached memory (running in MemFree mode)\n"

	.comm	_MTHCA_FLAG_NO_LAM,4,2          ## @MTHCA_FLAG_NO_LAM
L_.str.2:                               ## @.str.2
	.asciz	"ENABLE_LAM returned %d, aborting.\n"

L_.str.3:                               ## @.str.3
	.asciz	"Loading FW returned %d, aborting.\n"

L_.str.4:                               ## @.str.4
	.asciz	"QUERY_DEV_LIM returned %d, aborting.\n"

	.comm	_hca_profile,16,3               ## @hca_profile
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_MTHCA_FLAG_SRQ,4,2             ## @MTHCA_FLAG_SRQ
L_.str.5:                               ## @.str.5
	.asciz	"INIT_HCA command returned %d, aborting.\n"

	.no_dead_strip	_mthca_init_arbel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mthca_init_arbel
_mthca_init_arbel:                      ; @mthca_init_arbel
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	bl	_mthca_QUERY_FW
	cbz	w0, LBB0_4
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
LBB0_2:
	mov	x0, x19
	mov	x2, x20
	bl	_mthca_err
LBB0_3:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_4:
	mov	x0, x19
	bl	_mthca_ENABLE_LAM
Lloh2:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x21, _MTHCA_FLAG_NO_LAM@GOTPAGE
Lloh6:
	ldr	x21, [x21, _MTHCA_FLAG_NO_LAM@GOTPAGEOFF]
	cmn	w0, w8
	b.ne	LBB0_6
; %bb.5:
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_mthca_dbg
	ldr	w8, [x21]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	b	LBB0_8
LBB0_6:
	mov	x20, x0
	cbz	w0, LBB0_8
; %bb.7:
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_2
LBB0_8:
	mov	x0, x19
	bl	_mthca_load_fw
	cbz	w0, LBB0_10
; %bb.9:
	mov	x20, x0
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_mthca_err
	b	LBB0_13
LBB0_10:
	add	x1, sp, #24
	mov	x0, x19
	bl	_mthca_dev_lim
	cbz	w0, LBB0_15
; %bb.11:
	mov	x20, x0
Lloh13:
	adrp	x1, l_.str.4@PAGE
Lloh14:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_mthca_err
LBB0_12:
	mov	x0, x19
	bl	_mthca_UNMAP_FA
	ldr	w1, [x19, #4]
	mov	x0, x19
	mov	w2, #0
	bl	_mthca_free_icm
LBB0_13:
	ldr	w8, [x19]
	ldr	w9, [x21]
	tst	w9, w8
	b.ne	LBB0_3
; %bb.14:
	mov	x0, x19
	bl	_mthca_DISABLE_LAM
	b	LBB0_3
LBB0_15:
Lloh15:
	adrp	x8, _hca_profile@GOTPAGE
Lloh16:
	ldr	x8, [x8, _hca_profile@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	ldr	w9, [sp, #24]
Lloh18:
	adrp	x10, _PAGE_SIZE@GOTPAGE
Lloh19:
	ldr	x10, [x10, _PAGE_SIZE@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	sdiv	w9, w9, w10
	stp	x8, xzr, [sp, #8]
	str	w9, [sp, #8]
	ldr	w8, [x19]
Lloh21:
	adrp	x9, _MTHCA_FLAG_SRQ@GOTPAGE
Lloh22:
	ldr	x9, [x9, _MTHCA_FLAG_SRQ@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_17
; %bb.16:
	ldr	w8, [sp, #28]
	str	w8, [sp, #12]
LBB0_17:
	add	x1, sp, #8
	add	x2, sp, #24
	mov	x3, sp
	mov	x0, x19
	bl	_mthca_make_profile
	mov	x20, x0
	tbnz	w0, #31, LBB0_12
; %bb.18:
	add	x1, sp, #24
	mov	x2, sp
	mov	x0, x19
	mov	x3, x20
	bl	_mthca_init_icm
	mov	x20, x0
	cbnz	w0, LBB0_12
; %bb.19:
	mov	x1, sp
	mov	x0, x19
	bl	_mthca_INIT_HCA
	mov	x20, x0
	cbz	w0, LBB0_3
; %bb.20:
Lloh24:
	adrp	x1, l_.str.5@PAGE
Lloh25:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_mthca_err
	mov	x0, x19
	bl	_mthca_free_icms
	b	LBB0_12
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"QUERY_FW command failed %d, aborting.\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
l_.str.1:                               ; @.str.1
	.asciz	"No HCA-attached memory (running in MemFree mode)\n"

	.comm	_MTHCA_FLAG_NO_LAM,4,2          ; @MTHCA_FLAG_NO_LAM
l_.str.2:                               ; @.str.2
	.asciz	"ENABLE_LAM returned %d, aborting.\n"

l_.str.3:                               ; @.str.3
	.asciz	"Loading FW returned %d, aborting.\n"

l_.str.4:                               ; @.str.4
	.asciz	"QUERY_DEV_LIM returned %d, aborting.\n"

	.comm	_hca_profile,16,3               ; @hca_profile
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_MTHCA_FLAG_SRQ,4,2             ; @MTHCA_FLAG_SRQ
l_.str.5:                               ; @.str.5
	.asciz	"INIT_HCA command returned %d, aborting.\n"

	.no_dead_strip	_mthca_init_arbel
.subsections_via_symbols
