	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_query_qp                 ## -- Begin function mthca_query_qp
	.p2align	4, 0x90
_mthca_query_qp:                        ## @mthca_query_qp
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_to_mdev
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_to_mqp
	movq	%rax, %r14
	leaq	16(%rax), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	(%r14), %rax
	movq	_IB_QPS_RESET@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, (%r12)
	xorl	%r13d, %r13d
LBB0_10:
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 72(%r12)
	movl	40(%r14), %eax
	movl	%eax, 96(%r12)
	movdqu	24(%r14), %xmm0
	pshufd	$180, %xmm0, %xmm0              ## xmm0 = xmm0[0,1,3,2]
	movdqu	%xmm0, 80(%r12)
	movl	%eax, 20(%rcx)
	movups	80(%r12), %xmm0
	movups	%xmm0, 4(%rcx)
	movl	20(%r14), %eax
	movl	%eax, (%rcx)
	xorl	%r15d, %r15d
LBB0_11:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_mthca_free_mailbox
	jmp	LBB0_12
LBB0_2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_mthca_alloc_mailbox
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%r13, %rdi
	callq	_PTR_ERR
	movl	%eax, %r15d
LBB0_12:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	44(%r14), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	movq	%r13, %rcx
	callq	_mthca_QUERY_QP
	movq	%r15, %rdi
	testl	%eax, %eax
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_6
## %bb.5:
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_mthca_warn
	jmp	LBB0_11
LBB0_6:
	movq	(%r13), %r15
	movl	52(%r15), %edi
	callq	_be32_to_cpu
	sarl	$28, %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	%eax, %edi
	callq	_to_ib_qp_state
	movq	%rax, (%r14)
	movq	%rax, (%r12)
	movl	(%r15), %eax
	sarl	$5, %eax
	movl	%eax, 8(%r12)
	movl	52(%r15), %edi
	callq	_be32_to_cpu
	shrl	$11, %eax
	andl	$3, %eax
	movl	%eax, %edi
	callq	_to_ib_mig_state
	movl	%eax, 116(%r12)
	movl	48(%r15), %edi
	callq	_be32_to_cpu
	movl	%eax, 12(%r12)
	movl	32(%r15), %edi
	callq	_be32_to_cpu
	andl	$16777215, %eax                 ## imm = 0xFFFFFF
	movl	%eax, 16(%r12)
	movl	44(%r15), %edi
	callq	_be32_to_cpu
	andl	$16777215, %eax                 ## imm = 0xFFFFFF
	movl	%eax, 20(%r12)
	movl	40(%r15), %edi
	callq	_be32_to_cpu
	andl	$16777215, %eax                 ## imm = 0xFFFFFF
	movl	%eax, 24(%r12)
	movl	36(%r15), %edi
	callq	_be32_to_cpu
	movl	%eax, %edi
	callq	_to_ib_qp_access_flags
	movl	%eax, 112(%r12)
	movq	8(%r14), %rax
	movq	_RC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_8
## %bb.7:
	movq	_UC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
LBB0_8:
	leaq	108(%r12), %rsi
	leaq	16(%r15), %rdx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_to_rdma_ah_attr
	leaq	100(%r12), %rsi
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	4(%rax), %rdx
	movq	%r15, %rdi
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	callq	_to_rdma_ah_attr
	movl	12(%r15), %edi
	callq	_be32_to_cpu
	andl	$127, %eax
	movl	%eax, 28(%r12)
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_rdma_ah_get_port_num
	movl	%eax, 104(%r12)
LBB0_9:
	movl	24(%r15), %edi
	callq	_be32_to_cpu
	andl	$127, %eax
	movl	%eax, 32(%r12)
	movl	24(%r15), %edi
	callq	_be32_to_cpu
	shrl	$24, %eax
	andl	$3, %eax
	movl	%eax, 36(%r12)
	movq	_MTHCA_QP_STATE_DRAINING@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	cmpl	(%rax), %edx
	sete	%cl
	movl	%ecx, 40(%r12)
	movl	28(%r15), %edi
	callq	_be32_to_cpu
	shrl	$21, %eax
	andb	$7, %al
	movl	$1, %edx
	movl	%eax, %ecx
	shll	%cl, %edx
	movq	%r15, %rax
	movl	$1, %r15d
	movl	%edx, 44(%r12)
	movl	36(%rax), %edi
	callq	_be32_to_cpu
	shrl	$21, %eax
	andb	$7, %al
	movl	%eax, %ecx
	shll	%cl, %r15d
	movl	%r15d, 48(%r12)
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movl	32(%r15), %edi
	callq	_be32_to_cpu
	shrl	$24, %eax
	andl	$31, %eax
	movl	%eax, 52(%r12)
	movl	16(%r15), %eax
	sarl	$3, %eax
	movl	%eax, 56(%r12)
	movl	28(%r15), %edi
	callq	_be32_to_cpu
	shrl	$16, %eax
	andl	$7, %eax
	movl	%eax, 60(%r12)
	movl	20(%r15), %eax
	sarl	$5, %eax
	movl	%eax, 64(%r12)
	movl	4(%r15), %eax
	sarl	$3, %eax
	movl	%eax, 68(%r12)
	movq	(%r12), %rax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_QPS_RESET,8,3               ## @IB_QPS_RESET
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"QUERY_QP failed (%d)\n"

	.comm	_RC,8,3                         ## @RC
	.comm	_UC,8,3                         ## @UC
	.comm	_MTHCA_QP_STATE_DRAINING,4,2    ## @MTHCA_QP_STATE_DRAINING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_query_qp                 ; -- Begin function mthca_query_qp
	.p2align	2
_mthca_query_qp:                        ; @mthca_query_qp
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x3
	mov	x22, x1
	mov	x19, x0
	ldr	w0, [x0]
	bl	_to_mdev
	mov	x20, x0
	mov	x0, x19
	bl	_to_mqp
	mov	x24, x0
	add	x19, x0, #16
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x24]
Lloh0:
	adrp	x9, _IB_QPS_RESET@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IB_QPS_RESET@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.1:
	mov	x23, #0
	str	x8, [x22]
LBB0_2:
	mov	w25, #0
	str	x8, [x22, #72]
	ldr	w8, [x24, #40]
	str	w8, [x22, #96]
	ldur	q0, [x24, #24]
	mov.16b	v1, v0
	mov.s	v1[2], v0[3]
	mov.s	v1[3], v0[2]
	str	q1, [x22, #80]
	ldr	q0, [x22, #80]
	str	w8, [x21, #20]
	stur	q0, [x21, #4]
	ldr	w8, [x24, #20]
	str	w8, [x21]
LBB0_3:
	mov	x0, x20
	mov	x1, x23
	bl	_mthca_free_mailbox
	b	LBB0_6
LBB0_4:
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_mthca_alloc_mailbox
	mov	x23, x0
	bl	_IS_ERR
	cbz	x0, LBB0_7
; %bb.5:
	mov	x0, x23
	bl	_PTR_ERR
	mov	x25, x0
LBB0_6:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x25
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_7:
	ldr	w1, [x24, #44]
	mov	x0, x20
	mov	w2, #0
	mov	x3, x23
	bl	_mthca_QUERY_QP
	cbz	w0, LBB0_9
; %bb.8:
	mov	x25, x0
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x25
	bl	_mthca_warn
	b	LBB0_3
LBB0_9:
	ldr	x27, [x23]
	ldr	w0, [x27, #52]
	bl	_be32_to_cpu
	asr	w25, w0, #28
	mov	x0, x25
	bl	_to_ib_qp_state
	str	x0, [x24]
	str	x0, [x22]
	ldr	w8, [x27]
	asr	w8, w8, #5
	str	w8, [x22, #8]
	ldr	w0, [x27, #52]
	bl	_be32_to_cpu
	ubfx	w0, w0, #11, #2
	bl	_to_ib_mig_state
	str	w0, [x22, #116]
	ldr	w0, [x27, #48]
	bl	_be32_to_cpu
	str	w0, [x22, #12]
	ldr	w0, [x27, #32]
	bl	_be32_to_cpu
	and	w8, w0, #0xffffff
	str	w8, [x22, #16]
	ldr	w0, [x27, #44]
	bl	_be32_to_cpu
	and	w8, w0, #0xffffff
	str	w8, [x22, #20]
	ldr	w0, [x27, #40]
	bl	_be32_to_cpu
	and	w8, w0, #0xffffff
	str	w8, [x22, #24]
	ldr	w0, [x27, #36]
	bl	_be32_to_cpu
	bl	_to_ib_qp_access_flags
	str	w0, [x22, #112]
	ldr	x8, [x24, #8]
Lloh8:
	adrp	x9, _RC@GOTPAGE
Lloh9:
	ldr	x9, [x9, _RC@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_11
; %bb.10:
Lloh11:
	adrp	x9, _UC@GOTPAGE
Lloh12:
	ldr	x9, [x9, _UC@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
LBB0_11:
	add	x1, x22, #108
	add	x2, x27, #16
	mov	x0, x20
	bl	_to_rdma_ah_attr
	add	x26, x22, #100
	add	x2, x27, #4
	mov	x0, x20
	mov	x1, x26
	bl	_to_rdma_ah_attr
	ldr	w0, [x27, #12]
	bl	_be32_to_cpu
	and	w8, w0, #0x7f
	str	w8, [x22, #28]
	mov	x0, x26
	bl	_rdma_ah_get_port_num
	str	w0, [x22, #104]
LBB0_12:
	ldr	w0, [x27, #24]
	bl	_be32_to_cpu
	and	w8, w0, #0x7f
	str	w8, [x22, #32]
	ldr	w0, [x27, #24]
	bl	_be32_to_cpu
	ubfx	w8, w0, #24, #2
Lloh14:
	adrp	x9, _MTHCA_QP_STATE_DRAINING@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MTHCA_QP_STATE_DRAINING@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	w25, w9
	cset	w9, eq
	stp	w8, w9, [x22, #36]
	ldr	w0, [x27, #28]
	bl	_be32_to_cpu
	ubfx	w8, w0, #21, #3
	mov	w25, #1
	lsl	w8, w25, w8
	str	w8, [x22, #44]
	ldr	w0, [x27, #36]
	bl	_be32_to_cpu
	ubfx	w8, w0, #21, #3
	lsl	w8, w25, w8
	str	w8, [x22, #48]
	ldr	w0, [x27, #32]
	bl	_be32_to_cpu
	ubfx	w8, w0, #24, #5
	ldr	w9, [x27, #16]
	asr	w9, w9, #3
	stp	w8, w9, [x22, #52]
	ldr	w0, [x27, #28]
	bl	_be32_to_cpu
	ubfx	w8, w0, #16, #3
	ldr	w9, [x27, #20]
	asr	w9, w9, #5
	stp	w8, w9, [x22, #60]
	ldr	w8, [x27, #4]
	asr	w8, w8, #3
	str	w8, [x22, #68]
	ldr	x8, [x22]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_QPS_RESET,8,3               ; @IB_QPS_RESET
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"QUERY_QP failed (%d)\n"

	.comm	_RC,8,3                         ; @RC
	.comm	_UC,8,3                         ; @UC
	.comm	_MTHCA_QP_STATE_DRAINING,4,2    ; @MTHCA_QP_STATE_DRAINING
.subsections_via_symbols
