	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_query_device            ## -- Begin function ocrdma_query_device
	.p2align	4, 0x90
_ocrdma_query_device:                   ## @ocrdma_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	%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	%rdx, %rbx
	movq	%rsi, %r12
	callq	_get_ocrdma_dev
	cmpq	$0, 8(%rbx)
	jne	LBB0_2
## %bb.1:
	cmpq	$0, (%rbx)
	je	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_4:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rax, %r14
	xorl	%r15d, %r15d
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$136, %edx
	callq	_memset
	leaq	128(%r12), %rbx
	movq	72(%r14), %r13
	movl	$8, %edi
	movl	$4, %esi
	callq	_min
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movl	%eax, %edx
	callq	_memcpy
	leaq	124(%r12), %rsi
	movq	%r14, %rdi
	callq	_ocrdma_get_guid
	movl	68(%r14), %eax
	movl	%eax, 120(%r12)
	movl	$268431360, (%r12)              ## imm = 0xFFFF000
	movq	88(%r14), %rax
	movl	4(%rax), %ecx
	movl	%ecx, 116(%r12)
	movl	(%rax), %eax
	movl	%eax, 112(%r12)
	movl	80(%r14), %eax
	movl	%eax, 108(%r12)
	movl	64(%r14), %eax
	movl	%eax, 104(%r12)
	movq	_OCRDMA_MAX_AH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 100(%r12)
	movl	60(%r14), %eax
	movl	%eax, 96(%r12)
	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_SHUTDOWN_PORT@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_IB_DEVICE_SYS_IMAGE_GUID@GOTPCREL(%rip), %rax
	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, 4(%r12)
	movups	44(%r14), %xmm0
	movups	%xmm0, 80(%r12)
	movups	28(%r14), %xmm0
	movups	%xmm0, 64(%r12)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%r12)
	movq	$0, 56(%r12)
	movl	(%r14), %edi
	movl	4(%r14), %esi
	callq	_min
	movl	%eax, 36(%r12)
	movl	(%r14), %eax
	movl	%eax, 8(%r12)
	movl	24(%r14), %eax
	movl	%eax, 32(%r12)
	movups	8(%r14), %xmm0
	movups	%xmm0, 16(%r12)
	movl	$1, 12(%r12)
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_OCRDMA_MAX_AH,4,2              ## @OCRDMA_MAX_AH
	.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_SHUTDOWN_PORT,4,2    ## @IB_DEVICE_SHUTDOWN_PORT
	.comm	_IB_DEVICE_SYS_IMAGE_GUID,4,2   ## @IB_DEVICE_SYS_IMAGE_GUID
	.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
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_query_device            ; -- Begin function ocrdma_query_device
	.p2align	2
_ocrdma_query_device:                   ; @ocrdma_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	x21, x2
	mov	x19, x1
	bl	_get_ocrdma_dev
	ldr	x8, [x21, #8]
	cbnz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x21]
	cbz	x8, LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	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
LBB0_4:
	mov	x20, x0
	mov	x0, x19
	mov	w1, #0
	mov	w2, #136
	bl	_memset
	add	x21, x19, #128
	ldr	x22, [x20, #72]
	mov	w0, #8
	mov	w1, #4
	bl	_min
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_memcpy
	add	x1, x19, #124
	mov	x0, x20
	bl	_ocrdma_get_guid
	ldr	w8, [x20, #68]
	str	w8, [x19, #120]
	mov	w8, #268431360
	str	w8, [x19]
	ldr	x8, [x20, #88]
	ldr	d0, [x8]
	str	d0, [x19, #112]
	ldr	w8, [x20, #80]
	ldp	w10, w9, [x20, #60]
	stp	w9, w8, [x19, #104]
Lloh3:
	adrp	x8, _OCRDMA_MAX_AH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OCRDMA_MAX_AH@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	stp	w10, w8, [x19, #96]
Lloh6:
	adrp	x8, _IB_DEVICE_CURR_QP_STATE_MOD@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IB_DEVICE_CURR_QP_STATE_MOD@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _IB_DEVICE_RC_RNR_NAK_GEN@GOTPAGE
Lloh10:
	ldr	x9, [x9, _IB_DEVICE_RC_RNR_NAK_GEN@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh12:
	adrp	x9, _IB_DEVICE_SHUTDOWN_PORT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _IB_DEVICE_SHUTDOWN_PORT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh15:
	adrp	x9, _IB_DEVICE_SYS_IMAGE_GUID@GOTPAGE
Lloh16:
	ldr	x9, [x9, _IB_DEVICE_SYS_IMAGE_GUID@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh18:
	adrp	x9, _IB_DEVICE_LOCAL_DMA_LKEY@GOTPAGE
Lloh19:
	ldr	x9, [x9, _IB_DEVICE_LOCAL_DMA_LKEY@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh21:
	adrp	x9, _IB_DEVICE_MEM_MGT_EXTENSIONS@GOTPAGE
Lloh22:
	ldr	x9, [x9, _IB_DEVICE_MEM_MGT_EXTENSIONS@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x19, #4]
	ldur	q0, [x20, #44]
	str	q0, [x19, #80]
	ldur	q0, [x20, #28]
	str	q0, [x19, #64]
	stp	xzr, xzr, [x19, #48]
	str	xzr, [x19, #40]
	ldp	w0, w1, [x20]
	bl	_min
	mov	x8, x0
	mov	w0, #0
	ldr	w9, [x20]
	str	w9, [x19, #8]
	ldr	w9, [x20, #24]
	stp	w9, w8, [x19, #32]
	ldur	q0, [x20, #8]
	str	q0, [x19, #16]
	mov	w8, #1
	str	w8, [x19, #12]
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.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
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_OCRDMA_MAX_AH,4,2              ; @OCRDMA_MAX_AH
	.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_SHUTDOWN_PORT,4,2    ; @IB_DEVICE_SHUTDOWN_PORT
	.comm	_IB_DEVICE_SYS_IMAGE_GUID,4,2   ; @IB_DEVICE_SYS_IMAGE_GUID
	.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
.subsections_via_symbols
