	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_read_ah                  ## -- Begin function mthca_read_ah
	.p2align	4, 0x90
_mthca_read_ah:                         ## @mthca_read_ah
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rsi), %rax
	movq	_MTHCA_AH_ON_HCA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_4
LBB0_2:
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	8(%rsi), %rax
	movl	(%rax), %edi
	callq	_be32_to_cpu
	sarl	$28, %eax
	movl	%eax, 20(%r14)
	movq	8(%rbx), %rax
	movl	16(%rax), %ecx
	movl	%ecx, 28(%r14)
	movl	4(%rax), %edi
	andl	$127, %edi
	callq	_cpu_to_be16
	movl	%eax, 24(%r14)
	movq	%rbx, %rdi
	callq	_mthca_ah_grh_present
	xorl	%r15d, %r15d
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	8(%rbx), %rax
	movl	(%rax), %edi
	callq	_be32_to_cpu
	shrl	$20, %eax
	movzbl	%al, %eax
	movl	%eax, (%r14)
	movq	8(%rbx), %rax
	movl	(%rax), %r12d
	movl	$1048575, %edi                  ## imm = 0xFFFFF
	callq	_cpu_to_be32
	andl	%r12d, %eax
	movl	%eax, 4(%r14)
	movq	8(%rbx), %rax
	movl	12(%rax), %ecx
	movl	%ecx, 16(%r14)
	movq	16(%rbx), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 12(%r14)
	movl	8(%r14), %edi
	movl	8(%rax), %esi
	movl	$16, %edx
	callq	_memcpy
LBB0_4:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTHCA_AH_ON_HCA,8,3            ## @MTHCA_AH_ON_HCA
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_read_ah                  ; -- Begin function mthca_read_ah
	.p2align	2
_mthca_read_ah:                         ; @mthca_read_ah
	.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
	ldr	x8, [x1]
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, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
LBB0_2:
	mov	x19, x2
	mov	x20, x1
	ldr	x8, [x1, #8]
	ldr	w0, [x8]
	bl	_be32_to_cpu
	asr	w8, w0, #28
	str	w8, [x19, #20]
	ldr	x8, [x20, #8]
	ldr	w9, [x8, #16]
	str	w9, [x19, #28]
	ldr	w8, [x8, #4]
	and	w0, w8, #0x7f
	bl	_cpu_to_be16
	str	w0, [x19, #24]
	mov	x0, x20
	bl	_mthca_ah_grh_present
	cbz	x0, LBB0_4
; %bb.3:
	ldr	x8, [x20, #8]
	ldr	w0, [x8]
	bl	_be32_to_cpu
	ubfx	w8, w0, #20, #8
	str	w8, [x19]
	ldr	x8, [x20, #8]
	ldr	w21, [x8]
	mov	w0, #1048575
	bl	_cpu_to_be32
	and	w8, w0, w21
	str	w8, [x19, #4]
	ldp	x8, x9, [x20, #8]
	ldr	w9, [x9]
	ldp	w1, w10, [x8, #8]
	stp	w9, w10, [x19, #12]
	ldr	w0, [x19, #8]
	mov	w2, #16
	bl	_memcpy
	mov	w0, #0
LBB0_4:
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_MTHCA_AH_ON_HCA,8,3            ; @MTHCA_AH_ON_HCA
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
