	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mthca_load_fw
_mthca_load_fw:                         ## @mthca_load_fw
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movl	4(%rdi), %esi
	movq	_GFP_HIGHUSER@GOTPCREL(%rip), %rax
	movq	___GFP_NOWARN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	xorl	%r14d, %r14d
	xorl	%ecx, %ecx
	callq	_mthca_alloc_icm
	movl	%eax, (%rbx)
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_mthca_MAP_FA
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_mthca_err
	jmp	LBB0_7
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_mthca_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_8
LBB0_4:
	movq	%rbx, %rdi
	callq	_mthca_RUN_FW
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movl	%eax, %r14d
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_mthca_err
	movq	%rbx, %rdi
	callq	_mthca_UNMAP_FA
LBB0_7:
	movl	(%rbx), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mthca_free_icm
LBB0_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	xorl	%r14d, %r14d
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_HIGHUSER,4,2               ## @GFP_HIGHUSER
	.comm	___GFP_NOWARN,4,2               ## @__GFP_NOWARN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't allocate FW area, aborting.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"MAP_FA command returned %d, aborting.\n"

L_.str.2:                               ## @.str.2
	.asciz	"RUN_FW command returned %d, aborting.\n"

	.no_dead_strip	_mthca_load_fw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mthca_load_fw
_mthca_load_fw:                         ; @mthca_load_fw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_HIGHUSER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_HIGHUSER@GOTPAGEOFF]
	ldr	w1, [x0, #4]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, ___GFP_NOWARN@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___GFP_NOWARN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	w3, #0
	bl	_mthca_alloc_icm
	str	w0, [x19]
	cbz	w0, LBB0_3
; %bb.1:
	mov	x1, x0
	mov	x0, x19
	bl	_mthca_MAP_FA
	cbz	w0, LBB0_4
; %bb.2:
	mov	x20, x0
	str	x20, [sp]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_mthca_err
	b	LBB0_6
LBB0_3:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_mthca_err
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_7
LBB0_4:
	mov	x0, x19
	bl	_mthca_RUN_FW
	mov	x20, x0
	cbz	w0, LBB0_7
; %bb.5:
	str	x20, [sp]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_mthca_err
	mov	x0, x19
	bl	_mthca_UNMAP_FA
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
LBB0_6:
	ldr	w1, [x19]
	mov	x0, x19
	mov	w2, #0
	bl	_mthca_free_icm
LBB0_7:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_HIGHUSER,4,2               ; @GFP_HIGHUSER
	.comm	___GFP_NOWARN,4,2               ; @__GFP_NOWARN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't allocate FW area, aborting.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"MAP_FA command returned %d, aborting.\n"

l_.str.2:                               ; @.str.2
	.asciz	"RUN_FW command returned %d, aborting.\n"

	.no_dead_strip	_mthca_load_fw
.subsections_via_symbols
