	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_ib_query_ah               ## -- Begin function mlx4_ib_query_ah
	.p2align	4, 0x90
_mlx4_ib_query_ah:                      ## @mlx4_ib_query_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, %rbx
	movq	%rdi, %r12
	callq	_to_mah
	movq	%rax, %r14
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$56, %edx
	callq	_memset
	movl	16(%r14), %edi
	callq	_be32_to_cpu
	sarl	$28, %eax
	movl	%eax, (%rbx)
	movl	36(%r14), %edi
	callq	_be32_to_cpu
	sarl	$24, %eax
	movl	%eax, 4(%rbx)
	movl	(%r12), %edi
	movl	%eax, %esi
	callq	_rdma_port_get_link_layer
	movq	_IB_LINK_LAYER_INFINIBAND@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_2
## %bb.1:
	movl	32(%r14), %edi
	callq	_be16_to_cpu
	movl	%eax, %r15d
LBB0_2:
	movl	%r15d, 48(%rbx)
	movq	24(%r14), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_MLX4_STAT_RATE_OFFSET@GOTPCREL(%rip), %rcx
	subq	(%rcx), %rax
	movq	%rax, 40(%rbx)
LBB0_4:
	movl	(%r14), %eax
	andl	$127, %eax
	movl	%eax, 8(%rbx)
	movq	%r14, %rdi
	callq	_mlx4_ib_ah_grh_present
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_IB_AH_GRH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movl	16(%r14), %edi
	callq	_be32_to_cpu
	sarl	$20, %eax
	movl	%eax, 12(%rbx)
	movl	16(%r14), %edi
	callq	_be32_to_cpu
	andl	$1048575, %eax                  ## imm = 0xFFFFF
	movl	%eax, 16(%rbx)
	movl	12(%r14), %eax
	movl	%eax, 28(%rbx)
	movl	8(%r14), %eax
	movl	%eax, 24(%rbx)
	movl	20(%rbx), %edi
	movl	4(%r14), %esi
	movl	$16, %edx
	callq	_memcpy
LBB0_6:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_LINK_LAYER_INFINIBAND,4,2   ## @IB_LINK_LAYER_INFINIBAND
	.comm	_MLX4_STAT_RATE_OFFSET,8,3      ## @MLX4_STAT_RATE_OFFSET
	.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	_mlx4_ib_query_ah               ; -- Begin function mlx4_ib_query_ah
	.p2align	2
_mlx4_ib_query_ah:                      ; @mlx4_ib_query_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
	mov	x19, x1
	mov	x21, x0
	bl	_to_mah
	mov	x20, x0
	mov	x0, x19
	mov	w1, #0
	mov	w2, #56
	bl	_memset
	ldr	w0, [x20, #16]
	bl	_be32_to_cpu
	asr	w8, w0, #28
	str	w8, [x19]
	ldr	w0, [x20, #36]
	bl	_be32_to_cpu
	asr	w1, w0, #24
	str	w1, [x19, #4]
	ldr	w0, [x21]
	bl	_rdma_port_get_link_layer
	mov	x8, x0
	mov	w0, #0
Lloh0:
	adrp	x9, _IB_LINK_LAYER_INFINIBAND@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IB_LINK_LAYER_INFINIBAND@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	ldr	w0, [x20, #32]
	bl	_be16_to_cpu
LBB0_2:
	str	w0, [x19, #48]
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_4
; %bb.3:
Lloh3:
	adrp	x9, _MLX4_STAT_RATE_OFFSET@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MLX4_STAT_RATE_OFFSET@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	sub	x8, x8, x9
	str	x8, [x19, #40]
LBB0_4:
	ldr	w8, [x20]
	and	w8, w8, #0x7f
	str	w8, [x19, #8]
	mov	x0, x20
	bl	_mlx4_ib_ah_grh_present
	cbz	x0, LBB0_6
; %bb.5:
Lloh6:
	adrp	x8, _IB_AH_GRH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IB_AH_GRH@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x19, #32]
	ldr	w0, [x20, #16]
	bl	_be32_to_cpu
	asr	w8, w0, #20
	str	w8, [x19, #12]
	ldr	w0, [x20, #16]
	bl	_be32_to_cpu
	and	w8, w0, #0xfffff
	str	w8, [x19, #16]
	ldr	d0, [x20, #8]
	str	d0, [x19, #24]
	ldr	w0, [x19, #20]
	ldr	w1, [x20, #4]
	mov	w2, #16
	bl	_memcpy
LBB0_6:
	mov	w0, #0
	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	_IB_LINK_LAYER_INFINIBAND,4,2   ; @IB_LINK_LAYER_INFINIBAND
	.comm	_MLX4_STAT_RATE_OFFSET,8,3      ; @MLX4_STAT_RATE_OFFSET
	.comm	_IB_AH_GRH,4,2                  ; @IB_AH_GRH
.subsections_via_symbols
