	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mthca_query_device
_mthca_query_device:                    ## @mthca_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, %r14
	movq	%rsi, %r12
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	callq	_to_mdev
	cmpq	$0, 8(%r14)
	jne	LBB0_2
## %bb.1:
	cmpq	$0, (%r14)
	je	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, %r15d
LBB0_13:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rax, %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	$16, %edi
	callq	_kzalloc
	movq	%rax, %r14
	movl	(%rbx), %esi
	movl	$16, %edi
	callq	_kmalloc
	movq	%rax, %rbx
	testq	%r14, %r14
	je	LBB0_12
## %bb.4:
	testq	%rbx, %rbx
	je	LBB0_12
## %bb.5:
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$152, %edx
	callq	_memset
	movl	152(%r13), %eax
	movl	%eax, 144(%r12)
	movq	%r14, %rdi
	callq	_init_query_mad
	movq	_IB_SMP_ATTR_NODE_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$1, %edx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	%rbx
	pushq	%r14
	callq	_mthca_MAD_IFC
	addq	$16, %rsp
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_12
## %bb.6:
	movl	148(%r13), %eax
	movl	%eax, 140(%r12)
	movq	(%rbx), %rdi
	addq	$36, %rdi
	callq	_be32_to_cpup
	andl	$16777215, %eax                 ## imm = 0xFFFFFF
	movl	%eax, (%r12)
	movq	(%rbx), %rdi
	addq	$30, %rdi
	callq	_be16_to_cpup
	movl	%eax, 136(%r12)
	movq	(%rbx), %rdi
	addq	$32, %rdi
	callq	_be32_to_cpup
	movl	%eax, 4(%r12)
	leaq	132(%r12), %rdi
	movq	(%rbx), %rsi
	addq	$4, %rsi
	movl	$8, %edx
	callq	_memcpy
	movq	$-1, 8(%r12)
	movl	136(%r13), %eax
	movl	%eax, 128(%r12)
	movl	8(%r13), %eax
	subl	12(%r13), %eax
	movl	%eax, 16(%r12)
	movq	128(%r13), %xmm0                ## xmm0 = mem[0],zero
	pshufd	$64, %xmm0, %xmm0               ## xmm0 = xmm0[0,0,0,1]
	movdqu	%xmm0, 112(%r12)
	movq	120(%r13), %rcx
	subq	112(%r13), %rcx
	movq	%rcx, 104(%r12)
	movl	104(%r13), %ecx
	movl	%ecx, 96(%r12)
	movq	32(%r13), %rdi
	movq	%rdi, %rcx
	subq	96(%r13), %rcx
	movq	%rcx, 88(%r12)
	movq	88(%r13), %rcx
	subq	80(%r13), %rcx
	movq	%rcx, 80(%r12)
	movb	144(%r13), %cl
	movl	$1, %edx
	shll	%cl, %edx
	movl	%edx, 20(%r12)
	movl	72(%r13), %edx
	movl	%edx, 72(%r12)
	shll	%cl, %eax
	movl	%eax, 24(%r12)
	movq	64(%r13), %rax
	subq	56(%r13), %rax
	movq	%rax, 64(%r12)
	movl	52(%r13), %eax
	movl	%eax, 60(%r12)
	movl	48(%r13), %eax
	movl	%eax, 56(%r12)
	movl	44(%r13), %eax
	movl	%eax, 52(%r12)
	movq	_DEV_LIM_FLAG_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	16(%r13), %eax
	jne	LBB0_7
## %bb.8:
	movq	_IB_ATOMIC_NONE@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_IB_ATOMIC_HCA@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	movl	%eax, 48(%r12)
	movl	40(%r13), %eax
	movl	%eax, 44(%r12)
	movl	24(%r13), %eax
	addl	20(%r13), %eax
	movl	%eax, 28(%r12)
	movq	_MTHCA_QP_PER_MGM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 32(%r12)
	imull	%ecx, %eax
	movl	%eax, 36(%r12)
	movq	_MTHCA_FLAG_SINAI_OPT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$255, %edx
	testl	%eax, (%r13)
	jne	LBB0_11
## %bb.10:
	callq	_ilog2
	negb	%al
	movl	$-1, %edx
	movl	%eax, %ecx
	shll	%cl, %edx
	notl	%edx
LBB0_11:
	movl	%edx, 40(%r12)
	xorl	%r15d, %r15d
LBB0_12:
	movq	%r14, %rdi
	callq	_kfree
	movq	%rbx, %rdi
	callq	_kfree
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_IB_SMP_ATTR_NODE_INFO,4,2      ## @IB_SMP_ATTR_NODE_INFO
	.comm	_DEV_LIM_FLAG_ATOMIC,4,2        ## @DEV_LIM_FLAG_ATOMIC
	.comm	_IB_ATOMIC_HCA,4,2              ## @IB_ATOMIC_HCA
	.comm	_IB_ATOMIC_NONE,4,2             ## @IB_ATOMIC_NONE
	.comm	_MTHCA_QP_PER_MGM,4,2           ## @MTHCA_QP_PER_MGM
	.comm	_MTHCA_FLAG_SINAI_OPT,4,2       ## @MTHCA_FLAG_SINAI_OPT
	.no_dead_strip	_mthca_query_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mthca_query_device
_mthca_query_device:                    ; @mthca_query_device
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x2
	mov	x19, x1
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	bl	_to_mdev
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x20]
	cbz	x8, LBB0_4
LBB0_2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_3:
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_4:
	mov	x22, x0
Lloh6:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	w0, #16
	bl	_kzalloc
	mov	x20, x0
	ldr	w1, [x21]
	mov	w0, #16
	bl	_kmalloc
	mov	x21, x0
	cmp	x20, #0
	ccmp	x0, #0, #4, ne
	b.ne	LBB0_6
; %bb.5:
	neg	w23, w23
	b	LBB0_11
LBB0_6:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #152
	bl	_memset
	ldr	w8, [x22, #152]
	str	w8, [x19, #144]
	mov	x0, x20
	bl	_init_query_mad
Lloh8:
	adrp	x8, _IB_SMP_ATTR_NODE_INFO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IB_SMP_ATTR_NODE_INFO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [x20, #8]
	mov	w24, #1
	mov	x0, x22
	mov	w1, #1
	mov	w2, #1
	mov	w3, #1
	mov	x4, #0
	mov	x5, #0
	mov	x6, x20
	mov	x7, x21
	bl	_mthca_MAD_IFC
	mov	x23, x0
	cbnz	w0, LBB0_11
; %bb.7:
	ldr	w8, [x22, #148]
	str	w8, [x19, #140]
	ldr	x8, [x21]
	add	x0, x8, #36
	bl	_be32_to_cpup
	and	w8, w0, #0xffffff
	str	w8, [x19]
	ldr	x8, [x21]
	add	x0, x8, #30
	bl	_be16_to_cpup
	str	w0, [x19, #136]
	ldr	x8, [x21]
	add	x0, x8, #32
	bl	_be32_to_cpup
	str	w0, [x19, #4]
	add	x0, x19, #132
	ldr	x8, [x21]
	add	x1, x8, #4
	mov	w2, #8
	bl	_memcpy
	mov	x8, #-1
	ldr	w9, [x22, #136]
	str	w9, [x19, #128]
	ldp	w9, w10, [x22, #8]
	sub	w9, w9, w10
	str	w9, [x19, #16]
	ldr	d0, [x22, #128]
	zip1.4s	v1, v0, v0
	mov.s	v1[2], v0[0]
	str	x8, [x19, #8]
	str	q1, [x19, #112]
	ldp	x10, x8, [x22, #112]
	sub	x8, x8, x10
	str	x8, [x19, #104]
	ldr	w8, [x22, #104]
	str	w8, [x19, #96]
	ldr	x0, [x22, #32]
	ldp	x10, x8, [x22, #80]
	sub	x8, x8, x10
	ldr	x10, [x22, #96]
	sub	x10, x0, x10
	stp	x8, x10, [x19, #80]
	ldr	w8, [x22, #144]
	lsl	w10, w24, w8
	ldr	w11, [x22, #72]
	str	w11, [x19, #72]
	lsl	w8, w9, w8
	stp	w10, w8, [x19, #20]
	ldp	x9, x8, [x22, #56]
	sub	x8, x8, x9
	str	x8, [x19, #64]
	ldr	w8, [x22, #52]
	str	w8, [x19, #60]
	ldur	d0, [x22, #44]
	stur	d0, [x19, #52]
Lloh11:
	adrp	x8, _DEV_LIM_FLAG_ATOMIC@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DEV_LIM_FLAG_ATOMIC@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _IB_ATOMIC_HCA@GOTPAGE
Lloh15:
	ldr	x9, [x9, _IB_ATOMIC_HCA@GOTPAGEOFF]
	ldp	w10, w11, [x22, #16]
	tst	w8, w10
Lloh16:
	adrp	x8, _IB_ATOMIC_NONE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _IB_ATOMIC_NONE@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	ldr	w9, [x22, #40]
	stp	w9, w8, [x19, #44]
	ldr	w8, [x22, #24]
	add	w8, w8, w11
Lloh18:
	adrp	x9, _MTHCA_QP_PER_MGM@GOTPAGE
Lloh19:
	ldr	x9, [x9, _MTHCA_QP_PER_MGM@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	stp	w8, w9, [x19, #28]
	mul	w8, w9, w8
	str	w8, [x19, #36]
	ldr	w8, [x22]
Lloh21:
	adrp	x9, _MTHCA_FLAG_SINAI_OPT@GOTPAGE
Lloh22:
	ldr	x9, [x9, _MTHCA_FLAG_SINAI_OPT@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.8:
	mov	w8, #255
	b	LBB0_10
LBB0_9:
	bl	_ilog2
	neg	w8, w0
	mov	w9, #-1
	lsl	w8, w9, w8
	mvn	w8, w8
LBB0_10:
	mov	w23, #0
	str	w8, [x19, #40]
LBB0_11:
	mov	x0, x20
	bl	_kfree
	mov	x0, x21
	bl	_kfree
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_IB_SMP_ATTR_NODE_INFO,4,2      ; @IB_SMP_ATTR_NODE_INFO
	.comm	_DEV_LIM_FLAG_ATOMIC,4,2        ; @DEV_LIM_FLAG_ATOMIC
	.comm	_IB_ATOMIC_HCA,4,2              ; @IB_ATOMIC_HCA
	.comm	_IB_ATOMIC_NONE,4,2             ; @IB_ATOMIC_NONE
	.comm	_MTHCA_QP_PER_MGM,4,2           ; @MTHCA_QP_PER_MGM
	.comm	_MTHCA_FLAG_SINAI_OPT,4,2       ; @MTHCA_FLAG_SINAI_OPT
	.no_dead_strip	_mthca_query_device
.subsections_via_symbols
