	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_QUERY_FW                 ## -- Begin function mthca_QUERY_FW
	.p2align	4, 0x90
_mthca_QUERY_FW:                        ## @mthca_QUERY_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mthca_alloc_mailbox
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.6:
	movq	%r14, %rdi
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movq	(%r14), %r12
	movl	8(%r14), %edx
	movq	_CMD_QUERY_FW@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_CMD_TIME_CLASS_A@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_mthca_cmd_box
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_5
## %bb.2:
	movl	(%rbx), %edi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_MTHCA_GET
	roll	$16, (%rbx)
	movl	$15, %edx
	movq	%r12, %rsi
	callq	_MTHCA_GET
	movslq	(%rbx), %rdx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_mthca_dbg
	movl	48(%rbx), %edi
	movl	$48, %edx
	movq	%r12, %rsi
	callq	_MTHCA_GET
	movl	52(%rbx), %edi
	movl	$56, %edx
	movq	%r12, %rsi
	callq	_MTHCA_GET
	movslq	48(%rbx), %rdx
	movl	52(%rbx), %ecx
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_mthca_dbg
	movl	$16, %edx
	movq	%r12, %rsi
	callq	_MTHCA_GET
	movq	%rbx, %rdi
	callq	_mthca_is_memfree
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movl	12(%rbx), %edi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_MTHCA_GET
	movl	16(%rbx), %edi
	movl	$32, %edx
	movq	%r12, %rsi
	callq	_MTHCA_GET
	movl	20(%rbx), %edi
	movl	$64, %edx
	movq	%r12, %rsi
	callq	_MTHCA_GET
	movl	24(%rbx), %edi
	movl	$72, %edx
	movq	%r12, %rsi
	callq	_MTHCA_GET
	movl	12(%rbx), %edx
	shll	$2, %edx
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_mthca_dbg
	movl	12(%rbx), %edi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_MTHCA_ICM_PAGE_SIZE@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%eax, %esi
	callq	_ALIGN
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_MTHCA_ICM_PAGE_SHIFT@GOTPCREL(%rip), %rdx
	subl	(%rdx), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %eax
	movl	%eax, 12(%rbx)
	movslq	16(%rbx), %rdx
	movslq	20(%rbx), %rcx
	movslq	24(%rbx), %r8
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_mthca_dbg
	jmp	LBB0_5
LBB0_4:
	movl	4(%rbx), %edi
	movl	$32, %edx
	movq	%r12, %rsi
	callq	_MTHCA_GET
	movl	8(%rbx), %edi
	movl	$40, %edx
	movq	%r12, %rsi
	callq	_MTHCA_GET
	movslq	8(%rbx), %r8
	movslq	4(%rbx), %rcx
	movl	%r8d, %edx
	subl	%ecx, %edx
	sarl	$10, %edx
	leaq	L_.str.5(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_mthca_dbg
LBB0_5:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_mthca_free_mailbox
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_CMD_QUERY_FW,4,2               ## @CMD_QUERY_FW
	.comm	_CMD_TIME_CLASS_A,4,2           ## @CMD_TIME_CLASS_A
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FW version %012llx, max commands %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Catastrophic error buffer at 0x%llx, size 0x%x\n"

	.comm	_MTHCA_CMD_NUM_DBELL_DWORDS,4,2 ## @MTHCA_CMD_NUM_DBELL_DWORDS
L_.str.3:                               ## @.str.3
	.asciz	"FW size %d KB\n"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_MTHCA_ICM_PAGE_SIZE,4,2        ## @MTHCA_ICM_PAGE_SIZE
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_MTHCA_ICM_PAGE_SHIFT,4,2       ## @MTHCA_ICM_PAGE_SHIFT
L_.str.4:                               ## @.str.4
	.asciz	"Clear int @ %llx, EQ arm @ %llx, EQ set CI @ %llx\n"

L_.str.5:                               ## @.str.5
	.asciz	"FW size %d KB (start %llx, end %llx)\n"

	.comm	_QUERY_FW_CLR_INT_BASE_OFFSET,8,3 ## @QUERY_FW_CLR_INT_BASE_OFFSET
	.comm	_QUERY_FW_CMD_DB_BASE,8,3       ## @QUERY_FW_CMD_DB_BASE
	.comm	_QUERY_FW_CMD_DB_EN_OFFSET,8,3  ## @QUERY_FW_CMD_DB_EN_OFFSET
	.comm	_QUERY_FW_CMD_DB_OFFSET,8,3     ## @QUERY_FW_CMD_DB_OFFSET
	.comm	_QUERY_FW_END_OFFSET,8,3        ## @QUERY_FW_END_OFFSET
	.comm	_QUERY_FW_EQ_ARM_BASE_OFFSET,8,3 ## @QUERY_FW_EQ_ARM_BASE_OFFSET
	.comm	_QUERY_FW_EQ_SET_CI_BASE_OFFSET,8,3 ## @QUERY_FW_EQ_SET_CI_BASE_OFFSET
	.comm	_QUERY_FW_ERR_SIZE_OFFSET,8,3   ## @QUERY_FW_ERR_SIZE_OFFSET
	.comm	_QUERY_FW_ERR_START_OFFSET,8,3  ## @QUERY_FW_ERR_START_OFFSET
	.comm	_QUERY_FW_MAX_CMD_OFFSET,8,3    ## @QUERY_FW_MAX_CMD_OFFSET
	.comm	_QUERY_FW_SIZE_OFFSET,8,3       ## @QUERY_FW_SIZE_OFFSET
	.comm	_QUERY_FW_START_OFFSET,8,3      ## @QUERY_FW_START_OFFSET
	.comm	_QUERY_FW_VER_OFFSET,8,3        ## @QUERY_FW_VER_OFFSET
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_QUERY_FW                 ; -- Begin function mthca_QUERY_FW
	.p2align	2
_mthca_QUERY_FW:                        ; @mthca_QUERY_FW
	.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
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:
	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
	b	_PTR_ERR
LBB0_2:
	ldr	x22, [x20]
	ldr	w2, [x20, #8]
Lloh3:
	adrp	x8, _CMD_QUERY_FW@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CMD_QUERY_FW@GOTPAGEOFF]
Lloh5:
	ldr	w5, [x8]
Lloh6:
	adrp	x8, _CMD_TIME_CLASS_A@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CMD_TIME_CLASS_A@GOTPAGEOFF]
Lloh8:
	ldr	w6, [x8]
	mov	x0, x19
	mov	w1, #0
	mov	w3, #0
	mov	w4, #0
	bl	_mthca_cmd_box
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.3:
	ldr	w0, [x19]
	mov	x1, x22
	mov	x2, #0
	bl	_MTHCA_GET
	ldr	w8, [x19]
	ror	w8, w8, #16
	str	w8, [x19]
	mov	x1, x22
	mov	w2, #15
	bl	_MTHCA_GET
	ldrsw	x8, [x19]
	str	x8, [sp]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_mthca_dbg
	ldr	w0, [x19, #48]
	mov	x1, x22
	mov	w2, #48
	bl	_MTHCA_GET
	ldr	w0, [x19, #52]
	mov	x1, x22
	mov	w2, #56
	bl	_MTHCA_GET
	ldp	w8, w9, [x19, #48]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	stp	x8, x9, [sp]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_mthca_dbg
	mov	x1, x22
	mov	w2, #16
	bl	_MTHCA_GET
	mov	x0, x19
	bl	_mthca_is_memfree
	cbz	x0, LBB0_5
; %bb.4:
	ldr	w0, [x19, #12]
	mov	x1, x22
	mov	x2, #0
	bl	_MTHCA_GET
	ldr	w0, [x19, #16]
	mov	x1, x22
	mov	w2, #32
	bl	_MTHCA_GET
	ldr	w0, [x19, #20]
	mov	x1, x22
	mov	w2, #64
	bl	_MTHCA_GET
	ldr	w0, [x19, #24]
	mov	x1, x22
	mov	w2, #72
	bl	_MTHCA_GET
	ldr	w8, [x19, #12]
	lsl	w8, w8, #2
	str	x8, [sp]
Lloh13:
	adrp	x1, l_.str.3@PAGE
Lloh14:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_mthca_dbg
Lloh15:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w0, [x19, #12]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _MTHCA_ICM_PAGE_SIZE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _MTHCA_ICM_PAGE_SIZE@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	sdiv	w1, w8, w9
	bl	_ALIGN
Lloh21:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _MTHCA_ICM_PAGE_SHIFT@GOTPAGE
Lloh25:
	ldr	x9, [x9, _MTHCA_ICM_PAGE_SHIFT@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	sub	w8, w8, w9
	asr	w8, w0, w8
	str	w8, [x19, #12]
	ldpsw	x8, x9, [x19, #16]
	ldrsw	x10, [x19, #24]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh27:
	adrp	x1, l_.str.4@PAGE
Lloh28:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_6
LBB0_5:
	ldr	w0, [x19, #4]
	mov	x1, x22
	mov	w2, #32
	bl	_MTHCA_GET
	ldr	w0, [x19, #8]
	mov	x1, x22
	mov	w2, #40
	bl	_MTHCA_GET
	ldpsw	x9, x8, [x19, #4]
	sub	w10, w8, w9
	asr	w10, w10, #10
	stp	x9, x8, [sp, #8]
	str	x10, [sp]
Lloh29:
	adrp	x1, l_.str.5@PAGE
Lloh30:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_6:
	mov	x0, x19
	bl	_mthca_dbg
LBB0_7:
	mov	x0, x19
	mov	x1, x20
	bl	_mthca_free_mailbox
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_CMD_QUERY_FW,4,2               ; @CMD_QUERY_FW
	.comm	_CMD_TIME_CLASS_A,4,2           ; @CMD_TIME_CLASS_A
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FW version %012llx, max commands %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Catastrophic error buffer at 0x%llx, size 0x%x\n"

	.comm	_MTHCA_CMD_NUM_DBELL_DWORDS,4,2 ; @MTHCA_CMD_NUM_DBELL_DWORDS
l_.str.3:                               ; @.str.3
	.asciz	"FW size %d KB\n"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_MTHCA_ICM_PAGE_SIZE,4,2        ; @MTHCA_ICM_PAGE_SIZE
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_MTHCA_ICM_PAGE_SHIFT,4,2       ; @MTHCA_ICM_PAGE_SHIFT
l_.str.4:                               ; @.str.4
	.asciz	"Clear int @ %llx, EQ arm @ %llx, EQ set CI @ %llx\n"

l_.str.5:                               ; @.str.5
	.asciz	"FW size %d KB (start %llx, end %llx)\n"

	.comm	_QUERY_FW_CLR_INT_BASE_OFFSET,8,3 ; @QUERY_FW_CLR_INT_BASE_OFFSET
	.comm	_QUERY_FW_CMD_DB_BASE,8,3       ; @QUERY_FW_CMD_DB_BASE
	.comm	_QUERY_FW_CMD_DB_EN_OFFSET,8,3  ; @QUERY_FW_CMD_DB_EN_OFFSET
	.comm	_QUERY_FW_CMD_DB_OFFSET,8,3     ; @QUERY_FW_CMD_DB_OFFSET
	.comm	_QUERY_FW_END_OFFSET,8,3        ; @QUERY_FW_END_OFFSET
	.comm	_QUERY_FW_EQ_ARM_BASE_OFFSET,8,3 ; @QUERY_FW_EQ_ARM_BASE_OFFSET
	.comm	_QUERY_FW_EQ_SET_CI_BASE_OFFSET,8,3 ; @QUERY_FW_EQ_SET_CI_BASE_OFFSET
	.comm	_QUERY_FW_ERR_SIZE_OFFSET,8,3   ; @QUERY_FW_ERR_SIZE_OFFSET
	.comm	_QUERY_FW_ERR_START_OFFSET,8,3  ; @QUERY_FW_ERR_START_OFFSET
	.comm	_QUERY_FW_MAX_CMD_OFFSET,8,3    ; @QUERY_FW_MAX_CMD_OFFSET
	.comm	_QUERY_FW_SIZE_OFFSET,8,3       ; @QUERY_FW_SIZE_OFFSET
	.comm	_QUERY_FW_START_OFFSET,8,3      ; @QUERY_FW_START_OFFSET
	.comm	_QUERY_FW_VER_OFFSET,8,3        ; @QUERY_FW_VER_OFFSET
.subsections_via_symbols
