	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qedr_query_device              ## -- Begin function qedr_query_device
	.p2align	4, 0x90
_qedr_query_device:                     ## @qedr_query_device
	.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
	callq	_get_qedr_dev
	movq	%rax, %r15
	cmpl	$0, 4(%rax)
	je	LBB0_1
## %bb.2:
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$120, %edx
	callq	_memset
	movups	88(%r15), %xmm0
	movups	%xmm0, 104(%rbx)
	movups	72(%r15), %xmm0
	movups	%xmm0, 88(%rbx)
	movq	_u32@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	64(%r15), %edx
	movl	68(%r15), %esi
	callq	_max_t
	movl	%eax, 84(%rbx)
	movq	_IB_DEVICE_CURR_QP_STATE_MOD@GOTPCREL(%rip), %rax
	movq	_IB_DEVICE_RC_RNR_NAK_GEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_IB_DEVICE_LOCAL_DMA_LKEY@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_IB_DEVICE_MEM_MGT_EXTENSIONS@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, (%rbx)
	movl	60(%r15), %eax
	movl	%eax, 80(%rbx)
	movl	%eax, 76(%rbx)
	movl	%eax, 72(%rbx)
	movl	8(%r15), %eax
	movl	%eax, 4(%rbx)
	movups	44(%r15), %xmm0
	movups	%xmm0, 56(%rbx)
	movl	(%r15), %eax
	movl	%eax, 52(%rbx)
	movl	40(%r15), %eax
	movl	%eax, 48(%rbx)
	movl	$16, 8(%rbx)
	movl	36(%r15), %edi
	callq	_fls
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %ecx
	movl	$1, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movl	$1, %r12d
	movl	%eax, 12(%rbx)
	movl	32(%r15), %edi
	callq	_fls
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r12d
	movl	12(%rbx), %esi
	movl	%r12d, %edi
	callq	_min
	movl	%eax, 44(%rbx)
	movups	16(%r15), %xmm0
	movups	%xmm0, 28(%rbx)
	movl	8(%r15), %eax
	leal	7(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$3, %ecx
	movl	%ecx, 16(%rbx)
	movq	_QEDR_ROCE_PKEY_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movl	12(%r15), %eax
	movl	%eax, 20(%rbx)
	jmp	LBB0_3
LBB0_1:
	leaq	L_.str(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_DP_ERR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
LBB0_3:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"qedr_query_device called with invalid params rdma_ctx=%p\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_u32,4,2                        ## @u32
	.comm	_IB_DEVICE_CURR_QP_STATE_MOD,4,2 ## @IB_DEVICE_CURR_QP_STATE_MOD
	.comm	_IB_DEVICE_RC_RNR_NAK_GEN,4,2   ## @IB_DEVICE_RC_RNR_NAK_GEN
	.comm	_IB_DEVICE_LOCAL_DMA_LKEY,4,2   ## @IB_DEVICE_LOCAL_DMA_LKEY
	.comm	_IB_DEVICE_MEM_MGT_EXTENSIONS,4,2 ## @IB_DEVICE_MEM_MGT_EXTENSIONS
	.comm	_QEDR_ROCE_PKEY_MAX,4,2         ## @QEDR_ROCE_PKEY_MAX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qedr_query_device              ; -- Begin function qedr_query_device
	.p2align	2
_qedr_query_device:                     ; @qedr_query_device
	.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
	bl	_get_qedr_dev
	mov	x20, x0
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #120
	bl	_memset
	ldur	q0, [x20, #88]
	stur	q0, [x19, #104]
	ldur	q0, [x20, #72]
	stur	q0, [x19, #88]
Lloh0:
	adrp	x8, _u32@GOTPAGE
Lloh1:
	ldr	x8, [x8, _u32@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldp	w2, w1, [x20, #64]
	bl	_max_t
Lloh3:
	adrp	x8, _IB_DEVICE_CURR_QP_STATE_MOD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IB_DEVICE_CURR_QP_STATE_MOD@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _IB_DEVICE_RC_RNR_NAK_GEN@GOTPAGE
Lloh7:
	ldr	x9, [x9, _IB_DEVICE_RC_RNR_NAK_GEN@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _IB_DEVICE_LOCAL_DMA_LKEY@GOTPAGE
Lloh10:
	ldr	x10, [x10, _IB_DEVICE_LOCAL_DMA_LKEY@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh11:
	ldr	w9, [x10]
	orr	w8, w8, w9
Lloh12:
	adrp	x9, _IB_DEVICE_MEM_MGT_EXTENSIONS@GOTPAGE
Lloh13:
	ldr	x9, [x9, _IB_DEVICE_MEM_MGT_EXTENSIONS@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x20, #60]
	stp	w9, w0, [x19, #80]
	stp	w9, w9, [x19, #72]
	ldr	w9, [x20, #8]
	stp	w8, w9, [x19]
	ldur	q0, [x20, #44]
	stur	q0, [x19, #56]
	ldr	w8, [x20]
	ldp	w0, w9, [x20, #36]
	stp	w9, w8, [x19, #48]
	mov	w8, #16
	str	w8, [x19, #8]
	bl	_fls
	sub	w8, w0, #1
	mov	w21, #1
	lsl	w8, w21, w8
	str	w8, [x19, #12]
	ldr	w0, [x20, #32]
	bl	_fls
	sub	w8, w0, #1
	lsl	w0, w21, w8
	ldr	w1, [x19, #12]
	bl	_min
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19, #44]
	ldr	q0, [x20, #16]
	stur	q0, [x19, #28]
	ldp	w8, w9, [x20, #8]
	add	w10, w8, #7
Lloh15:
	adrp	x11, _QEDR_ROCE_PKEY_MAX@GOTPAGE
Lloh16:
	ldr	x11, [x11, _QEDR_ROCE_PKEY_MAX@GOTPAGEOFF]
	cmp	w8, #0
	csel	w8, w10, w8, lt
Lloh17:
	ldr	w10, [x11]
	stp	w9, w10, [x19, #20]
	asr	w8, w8, #3
	str	w8, [x19, #16]
	b	LBB0_3
LBB0_2:
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	w2, #0
	bl	_DP_ERR
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"qedr_query_device called with invalid params rdma_ctx=%p\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_u32,4,2                        ; @u32
	.comm	_IB_DEVICE_CURR_QP_STATE_MOD,4,2 ; @IB_DEVICE_CURR_QP_STATE_MOD
	.comm	_IB_DEVICE_RC_RNR_NAK_GEN,4,2   ; @IB_DEVICE_RC_RNR_NAK_GEN
	.comm	_IB_DEVICE_LOCAL_DMA_LKEY,4,2   ; @IB_DEVICE_LOCAL_DMA_LKEY
	.comm	_IB_DEVICE_MEM_MGT_EXTENSIONS,4,2 ; @IB_DEVICE_MEM_MGT_EXTENSIONS
	.comm	_QEDR_ROCE_PKEY_MAX,4,2         ; @QEDR_ROCE_PKEY_MAX
.subsections_via_symbols
