	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function query_port
_query_port:                            ## @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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movl	%esi, %r14d
	callq	_dev_from_rdi
	movq	%rax, %rdi
	callq	_dd_from_dev
	movq	(%rax), %r15
	movslq	%r14d, %rbx
	shlq	$5, %rbx
	leaq	(%rbx,%r15), %r14
	addq	$-32, %r14
	movq	-8(%rbx,%r15), %rax
	movq	%rax, 48(%r12)
	movl	-16(%rbx,%r15), %eax
	movl	%eax, 40(%r12)
	movq	%r14, %rdi
	callq	_driver_lstate
	movl	%eax, 36(%r12)
	movq	%r14, %rdi
	callq	_driver_pstate
	movl	%eax, 32(%r12)
	movq	_HFI1_GUIDS_PER_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r12)
	movl	-20(%rbx,%r15), %edi
	callq	_opa_width_to_ib
	movl	%eax, (%r12)
	movl	-24(%rbx,%r15), %edi
	callq	_opa_speed_to_ib
	movl	%eax, 4(%r12)
	movl	-28(%rbx,%r15), %eax
	movl	%eax, 24(%r12)
	movq	_hfi1_max_mtu@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_valid_ib_mtu
	movl	$4096, %edi                     ## imm = 0x1000
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	(%r13), %edi
LBB0_2:
	movq	_IB_MTU_4096@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_mtu_to_enum
	movq	%rax, 8(%r12)
	movl	-32(%rbx,%r15), %edi
	callq	_valid_ib_mtu
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	(%r14), %edi
	movl	(%r13), %esi
	callq	_mtu_to_enum
	jmp	LBB0_5
LBB0_3:
	movq	8(%r12), %rax
LBB0_5:
	movq	%rax, 16(%r12)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HFI1_GUIDS_PER_PORT,4,2        ## @HFI1_GUIDS_PER_PORT
	.comm	_hfi1_max_mtu,4,2               ## @hfi1_max_mtu
	.comm	_IB_MTU_4096,4,2                ## @IB_MTU_4096
	.no_dead_strip	_query_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function query_port
_query_port:                            ; @query_port
	.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, x2
	mov	x20, x1
	bl	_dev_from_rdi
	bl	_dd_from_dev
	ldr	x8, [x0]
	sxtw	x9, w20
	add	x21, x8, x9, lsl #5
	sub	x20, x21, #32
	ldur	x8, [x21, #-8]
	str	x8, [x19, #48]
	ldur	w8, [x21, #-16]
	str	w8, [x19, #40]
	mov	x0, x20
	bl	_driver_lstate
	str	w0, [x19, #36]
	mov	x0, x20
	bl	_driver_pstate
Lloh0:
	adrp	x8, _HFI1_GUIDS_PER_PORT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HFI1_GUIDS_PER_PORT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	stp	w8, w0, [x19, #28]
	ldur	w0, [x21, #-20]
	bl	_opa_width_to_ib
	str	w0, [x19]
	ldur	w0, [x21, #-24]
	bl	_opa_speed_to_ib
	str	w0, [x19, #4]
	ldur	w8, [x21, #-28]
	str	w8, [x19, #24]
Lloh3:
	adrp	x22, _hfi1_max_mtu@GOTPAGE
Lloh4:
	ldr	x22, [x22, _hfi1_max_mtu@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_valid_ib_mtu
	ldr	w8, [x22]
	mov	w9, #4096
	cmp	w0, #0
	csel	w0, w9, w8, eq
Lloh5:
	adrp	x22, _IB_MTU_4096@GOTPAGE
Lloh6:
	ldr	x22, [x22, _IB_MTU_4096@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_mtu_to_enum
	str	x0, [x19, #8]
	ldur	w0, [x21, #-32]
	bl	_valid_ib_mtu
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x20]
	ldr	w1, [x22]
	bl	_mtu_to_enum
	b	LBB0_3
LBB0_2:
	ldr	x0, [x19, #8]
LBB0_3:
	str	x0, [x19, #16]
	mov	w0, #0
	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 AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_HFI1_GUIDS_PER_PORT,4,2        ; @HFI1_GUIDS_PER_PORT
	.comm	_hfi1_max_mtu,4,2               ; @hfi1_max_mtu
	.comm	_IB_MTU_4096,4,2                ; @IB_MTU_4096
	.no_dead_strip	_query_port
.subsections_via_symbols
