	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_ah_query                 ## -- Begin function mthca_ah_query
	.p2align	4, 0x90
_mthca_ah_query:                        ## @mthca_ah_query
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	callq	_to_mah
	movq	%rax, %r13
	movl	(%rbx), %edi
	callq	_to_mdev
	movq	%rax, %r12
	movq	(%r13), %rax
	movq	_MTHCA_AH_ON_HCA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_ENOSYS@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_6
LBB0_2:
	xorl	%r14d, %r14d
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$44, %edx
	callq	_memset
	movq	8(%r13), %rax
	movl	28(%rax), %edi
	callq	_be16_to_cpu
	movl	%eax, 40(%r15)
	movq	8(%r13), %rax
	movl	20(%rax), %edi
	callq	_be32_to_cpu
	sarl	$28, %eax
	movl	%eax, (%r15)
	movq	8(%r13), %rax
	movl	24(%rax), %edi
	callq	_be32_to_cpu
	sarl	$24, %eax
	movl	%eax, 4(%r15)
	movq	8(%r13), %rcx
	movl	(%rcx), %esi
	andl	$7, %esi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_mthca_rate_to_ib
	movl	%eax, 36(%r15)
	movq	8(%r13), %rax
	movl	4(%rax), %eax
	andl	$127, %eax
	movl	%eax, 8(%r15)
	movq	%r13, %rdi
	callq	_mthca_ah_grh_present
	movl	$0, %ecx
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_IB_AH_GRH@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_4:
	movl	%ecx, 12(%r15)
	testl	%ecx, %ecx
	je	LBB0_6
## %bb.5:
	movq	8(%r13), %rax
	movl	20(%rax), %edi
	callq	_be32_to_cpu
	sarl	$20, %eax
	movl	%eax, 16(%r15)
	movq	8(%r13), %rax
	movl	20(%rax), %edi
	callq	_be32_to_cpu
	andl	$1048575, %eax                  ## imm = 0xFFFFF
	movl	%eax, 20(%r15)
	movq	8(%r13), %rax
	movl	16(%rax), %ecx
	movl	%ecx, 32(%r15)
	movl	(%r12), %ecx
	decl	%ecx
	andl	8(%rax), %ecx
	movl	%ecx, 24(%r15)
	movl	28(%r15), %edi
	movl	12(%rax), %esi
	movl	$16, %edx
	callq	_memcpy
LBB0_6:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTHCA_AH_ON_HCA,8,3            ## @MTHCA_AH_ON_HCA
	.comm	_ENOSYS,4,2                     ## @ENOSYS
	.comm	_IB_AH_GRH,4,2                  ## @IB_AH_GRH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_ah_query                 ; -- Begin function mthca_ah_query
	.p2align	2
_mthca_ah_query:                        ; @mthca_ah_query
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x1
	mov	x21, x0
	bl	_to_mah
	mov	x20, x0
	ldr	w0, [x21]
	bl	_to_mdev
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _MTHCA_AH_ON_HCA@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MTHCA_AH_ON_HCA@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _ENOSYS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOSYS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_2:
	mov	x21, x0
	mov	x0, x19
	mov	w1, #0
	mov	w2, #44
	bl	_memset
	ldr	x8, [x20, #8]
	ldr	w0, [x8, #28]
	bl	_be16_to_cpu
	str	w0, [x19, #40]
	ldr	x8, [x20, #8]
	ldr	w0, [x8, #20]
	bl	_be32_to_cpu
	asr	w8, w0, #28
	str	w8, [x19]
	ldr	x8, [x20, #8]
	ldr	w0, [x8, #24]
	bl	_be32_to_cpu
	asr	w2, w0, #24
	str	w2, [x19, #4]
	ldr	x8, [x20, #8]
	ldr	w8, [x8]
	and	w1, w8, #0x7
	mov	x0, x21
	bl	_mthca_rate_to_ib
	str	w0, [x19, #36]
	ldr	x8, [x20, #8]
	ldr	w8, [x8, #4]
	and	w8, w8, #0x7f
	str	w8, [x19, #8]
	mov	x0, x20
	bl	_mthca_ah_grh_present
Lloh6:
	adrp	x8, _IB_AH_GRH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IB_AH_GRH@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w8, wzr, w8, eq
	str	w8, [x19, #12]
	cbz	w8, LBB0_4
; %bb.3:
	ldr	x8, [x20, #8]
	ldr	w0, [x8, #20]
	bl	_be32_to_cpu
	asr	w8, w0, #20
	str	w8, [x19, #16]
	ldr	x8, [x20, #8]
	ldr	w0, [x8, #20]
	bl	_be32_to_cpu
	and	w8, w0, #0xfffff
	ldr	x9, [x20, #8]
	ldr	w10, [x9, #16]
	str	w10, [x19, #32]
	ldr	w10, [x21]
	sub	w10, w10, #1
	ldp	w11, w1, [x9, #8]
	and	w9, w10, w11
	stp	w8, w9, [x19, #20]
	ldr	w0, [x19, #28]
	mov	w2, #16
	bl	_memcpy
LBB0_4:
	mov	w0, #0
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MTHCA_AH_ON_HCA,8,3            ; @MTHCA_AH_ON_HCA
	.comm	_ENOSYS,4,2                     ; @ENOSYS
	.comm	_IB_AH_GRH,4,2                  ; @IB_AH_GRH
.subsections_via_symbols
