	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mthca_query_port
_mthca_query_port:                      ## @mthca_query_port
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, %r13d
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	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, %r15
	testq	%r14, %r14
	je	LBB0_4
## %bb.1:
	testq	%r15, %r15
	je	LBB0_4
## %bb.2:
	movq	%r14, %rdi
	callq	_init_query_mad
	movq	_IB_SMP_ATTR_PORT_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r14)
	movl	%r13d, %edi
	callq	_cpu_to_be32
	movl	%eax, 8(%r14)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_to_mdev
	movq	%rax, %rdi
	movl	$1, %esi
	movl	$1, %edx
	movl	%r13d, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	%r15
	pushq	%r14
	callq	_mthca_MAD_IFC
	addq	$16, %rsp
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	(%r15), %rdi
	addq	$64, %rdi
	callq	_be16_to_cpup
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rax, 88(%rbx)
	movq	(%r15), %rdi
	movl	136(%rdi), %eax
	andl	$7, %eax
	movl	%eax, (%rbx)
	addq	$72, %rdi
	callq	_be16_to_cpup
	movq	%rax, 80(%rbx)
	movq	(%r15), %rdi
	movl	144(%rdi), %eax
	andl	$15, %eax
	movl	%eax, 4(%rbx)
	movl	128(%rdi), %eax
	andl	$15, %eax
	movl	%eax, 8(%rbx)
	movl	132(%rdi), %eax
	sarl	$4, %eax
	movl	%eax, 12(%rbx)
	addq	$80, %rdi
	callq	_be32_to_cpup
	movl	%eax, 72(%rbx)
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	callq	_to_mdev
	movl	4(%rax), %eax
	movl	%eax, 68(%rbx)
	movl	$-2147483648, 16(%rbx)          ## imm = 0x80000000
	movq	%r12, %rdi
	callq	_to_mdev
	movl	(%rax), %eax
	movl	%eax, 64(%rbx)
	movl	$184, %edi
	addq	(%r15), %rdi
	callq	_be16_to_cpup
	movq	%rax, 56(%rbx)
	movl	$192, %edi
	addq	(%r15), %rdi
	callq	_be16_to_cpup
	movq	%rax, 48(%rbx)
	movq	(%r15), %rax
	movl	124(%rax), %ecx
	andl	$15, %ecx
	movl	%ecx, 20(%rbx)
	movl	140(%rax), %ecx
	sarl	$4, %ecx
	movl	%ecx, 24(%rbx)
	movl	164(%rax), %ecx
	andl	$15, %ecx
	movl	%ecx, 28(%rbx)
	movl	144(%rax), %ecx
	sarl	$4, %ecx
	movl	%ecx, 32(%rbx)
	movl	204(%rax), %ecx
	andl	$31, %ecx
	movl	%ecx, 36(%rbx)
	movl	148(%rax), %ecx
	sarl	$4, %ecx
	movl	%ecx, 40(%rbx)
	movl	164(%rax), %eax
	sarl	$4, %eax
	movl	%eax, 44(%rbx)
	xorl	%r12d, %r12d
LBB0_4:
	movq	%r14, %rdi
	callq	_kfree
	movq	%r15, %rdi
	callq	_kfree
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_IB_SMP_ATTR_PORT_INFO,4,2      ## @IB_SMP_ATTR_PORT_INFO
	.no_dead_strip	_mthca_query_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mthca_query_port
_mthca_query_port:                      ; @mthca_query_port
	.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	x23, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
Lloh3:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	w0, #16
	bl	_kzalloc
	mov	x19, x0
	ldr	w1, [x21]
	mov	w0, #16
	bl	_kmalloc
	mov	x21, x0
	cmp	x19, #0
	ccmp	x0, #0, #4, ne
	b.ne	LBB0_2
; %bb.1:
	neg	w23, w24
	b	LBB0_4
LBB0_2:
	mov	x0, x19
	bl	_init_query_mad
Lloh5:
	adrp	x8, _IB_SMP_ATTR_PORT_INFO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IB_SMP_ATTR_PORT_INFO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x19, #12]
	mov	x0, x23
	bl	_cpu_to_be32
	str	w0, [x19, #8]
	mov	x0, x22
	bl	_to_mdev
	mov	w1, #1
	mov	w2, #1
	mov	x3, x23
	mov	x4, #0
	mov	x5, #0
	mov	x6, x19
	mov	x7, x21
	bl	_mthca_MAD_IFC
	mov	x23, x0
	cbnz	w0, LBB0_4
; %bb.3:
	ldr	x8, [x21]
	add	x0, x8, #64
	bl	_be16_to_cpup
	str	x0, [x20, #88]
	ldr	x8, [x21]
	ldr	w9, [x8, #136]
	and	w9, w9, #0x7
	str	w9, [x20]
	add	x0, x8, #72
	bl	_be16_to_cpup
	str	x0, [x20, #80]
	ldr	x8, [x21]
	ldr	w9, [x8, #144]
	and	w9, w9, #0xf
	str	w9, [x20, #4]
	ldr	w9, [x8, #128]
	and	w9, w9, #0xf
	str	w9, [x20, #8]
	ldr	w9, [x8, #132]
	asr	w9, w9, #4
	str	w9, [x20, #12]
	add	x0, x8, #80
	bl	_be32_to_cpup
	str	w0, [x20, #72]
	mov	x0, x22
	bl	_to_mdev
	ldr	w8, [x0, #4]
	str	w8, [x20, #68]
	mov	w8, #-2147483648
	str	w8, [x20, #16]
	mov	x0, x22
	bl	_to_mdev
	ldr	w8, [x0]
	str	w8, [x20, #64]
	ldr	x8, [x21]
	add	x0, x8, #184
	bl	_be16_to_cpup
	str	x0, [x20, #56]
	ldr	x8, [x21]
	add	x0, x8, #192
	bl	_be16_to_cpup
	str	x0, [x20, #48]
	ldr	x8, [x21]
	ldr	w9, [x8, #124]
	and	w9, w9, #0xf
	str	w9, [x20, #20]
	ldr	w9, [x8, #140]
	asr	w9, w9, #4
	str	w9, [x20, #24]
	ldr	w9, [x8, #164]
	and	w9, w9, #0xf
	str	w9, [x20, #28]
	ldr	w9, [x8, #144]
	asr	w9, w9, #4
	str	w9, [x20, #32]
	ldr	w9, [x8, #204]
	and	w9, w9, #0x1f
	str	w9, [x20, #36]
	ldr	w9, [x8, #148]
	asr	w9, w9, #4
	str	w9, [x20, #40]
	ldr	w8, [x8, #164]
	asr	w8, w8, #4
	str	w8, [x20, #44]
LBB0_4:
	mov	x0, x19
	bl	_kfree
	mov	x0, x21
	bl	_kfree
	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
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_IB_SMP_ATTR_PORT_INFO,4,2      ; @IB_SMP_ATTR_PORT_INFO
	.no_dead_strip	_mthca_query_port
.subsections_via_symbols
