	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_query_port
_hns_roce_query_port:                   ## @hns_roce_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, %rbx
	movq	%rsi, %r15
	callq	_to_hr_dev
	movq	%rax, %r14
	movq	32(%rax), %r12
	xorl	%edi, %edi
	testq	%r15, %r15
	setg	%dil
	callq	_assert
	movl	24(%r14), %eax
	movl	%eax, 28(%rbx)
	movq	16(%r14), %rax
	movl	-4(%rax,%r15,4), %eax
	movl	%eax, 44(%rbx)
	movq	_IB_PORT_CM_SUP@GOTPCREL(%rip), %rax
	movq	_IB_PORT_REINIT_SUP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_IB_PORT_VENDOR_CLASS_SUP@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_IB_PORT_BOOT_MGMT_SUP@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, (%rbx)
	movq	_HNS_ROCE_MAX_MSG_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movl	$1, 4(%rbx)
	movq	_IB_WIDTH_4X@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%rbx)
	movl	$1, 8(%rbx)
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	8(%r14), %rax
	movq	-8(%rax,%r15,8), %r13
	testq	%r13, %r13
	je	LBB0_1
## %bb.2:
	movl	(%r13), %edi
	callq	_iboe_get_mtu
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	28(%rbx), %edi
	movl	%eax, %esi
	callq	_min
	jmp	LBB0_5
LBB0_1:
	decq	%r15
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_13
LBB0_4:
	movq	_IB_MTU_256@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_5:
	movl	%eax, 32(%rbx)
	movq	%r13, %rdi
	callq	_netif_running
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	movq	%r13, %rdi
	callq	_netif_carrier_ok
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_IB_PORT_ACTIVE@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_8:
	movq	_IB_PORT_DOWN@GOTPCREL(%rip), %rax
LBB0_9:
	movq	(%rax), %rax
	movq	%rax, 16(%rbx)
	movq	_IB_PORT_ACTIVE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.11:
	movq	_IB_PORT_PHYS_STATE_LINK_UP@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_10:
	movq	_IB_PORT_PHYS_STATE_DISABLED@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_PORT_CM_SUP,4,2             ## @IB_PORT_CM_SUP
	.comm	_IB_PORT_REINIT_SUP,4,2         ## @IB_PORT_REINIT_SUP
	.comm	_IB_PORT_VENDOR_CLASS_SUP,4,2   ## @IB_PORT_VENDOR_CLASS_SUP
	.comm	_IB_PORT_BOOT_MGMT_SUP,4,2      ## @IB_PORT_BOOT_MGMT_SUP
	.comm	_HNS_ROCE_MAX_MSG_LEN,4,2       ## @HNS_ROCE_MAX_MSG_LEN
	.comm	_IB_WIDTH_4X,4,2                ## @IB_WIDTH_4X
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"find netdev %d failed!\r\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IB_MTU_256,4,2                 ## @IB_MTU_256
	.comm	_IB_PORT_ACTIVE,8,3             ## @IB_PORT_ACTIVE
	.comm	_IB_PORT_DOWN,8,3               ## @IB_PORT_DOWN
	.comm	_IB_PORT_PHYS_STATE_LINK_UP,4,2 ## @IB_PORT_PHYS_STATE_LINK_UP
	.comm	_IB_PORT_PHYS_STATE_DISABLED,4,2 ## @IB_PORT_PHYS_STATE_DISABLED
	.no_dead_strip	_hns_roce_query_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_roce_query_port
_hns_roce_query_port:                   ; @hns_roce_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	x19, x2
	mov	x22, x1
	bl	_to_hr_dev
	mov	x20, x0
	ldr	x21, [x0, #32]
	cmp	x22, #0
	cset	w0, gt
	bl	_assert
	sub	x22, x22, #1
	ldr	w8, [x20, #24]
	str	w8, [x19, #28]
	ldr	x8, [x20, #16]
	ldr	w8, [x8, x22, lsl #2]
	str	w8, [x19, #44]
Lloh0:
	adrp	x8, _IB_PORT_CM_SUP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IB_PORT_CM_SUP@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _IB_PORT_REINIT_SUP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IB_PORT_REINIT_SUP@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _IB_PORT_VENDOR_CLASS_SUP@GOTPAGE
Lloh7:
	ldr	x10, [x10, _IB_PORT_VENDOR_CLASS_SUP@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh8:
	ldr	w9, [x10]
	orr	w8, w8, w9
Lloh9:
	adrp	x9, _IB_PORT_BOOT_MGMT_SUP@GOTPAGE
Lloh10:
	ldr	x9, [x9, _IB_PORT_BOOT_MGMT_SUP@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x19]
Lloh12:
	adrp	x8, _HNS_ROCE_MAX_MSG_LEN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _HNS_ROCE_MAX_MSG_LEN@GOTPAGEOFF]
Lloh14:
	adrp	x9, _IB_WIDTH_4X@GOTPAGE
Lloh15:
	ldr	x9, [x9, _IB_WIDTH_4X@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #36]
	movi.2s	v0, #1
	stur	d0, [x19, #4]
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	x8, [x20, #8]
	ldr	x23, [x8, x22, lsl #3]
	cbz	x23, LBB0_3
; %bb.1:
	ldr	w0, [x23]
	bl	_iboe_get_mtu
	cbz	w0, LBB0_4
; %bb.2:
	mov	x1, x0
	ldr	w0, [x19, #28]
	bl	_min
	b	LBB0_5
LBB0_3:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_dev_err
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_4:
Lloh23:
	adrp	x8, _IB_MTU_256@GOTPAGE
Lloh24:
	ldr	x8, [x8, _IB_MTU_256@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
LBB0_5:
	str	w0, [x19, #32]
	mov	x0, x23
	bl	_netif_running
Lloh26:
	adrp	x21, _IB_PORT_ACTIVE@GOTPAGE
Lloh27:
	ldr	x21, [x21, _IB_PORT_ACTIVE@GOTPAGEOFF]
	cbz	x0, LBB0_8
; %bb.6:
	mov	x0, x23
	bl	_netif_carrier_ok
	cbz	x0, LBB0_8
; %bb.7:
Lloh28:
	adrp	x8, _IB_PORT_ACTIVE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _IB_PORT_ACTIVE@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh30:
	adrp	x8, _IB_PORT_DOWN@GOTPAGE
Lloh31:
	ldr	x8, [x8, _IB_PORT_DOWN@GOTPAGEOFF]
LBB0_9:
	ldr	x8, [x8]
	str	x8, [x19, #16]
	ldr	x9, [x21]
Lloh32:
	adrp	x10, _IB_PORT_PHYS_STATE_LINK_UP@GOTPAGE
Lloh33:
	ldr	x10, [x10, _IB_PORT_PHYS_STATE_LINK_UP@GOTPAGEOFF]
Lloh34:
	adrp	x11, _IB_PORT_PHYS_STATE_DISABLED@GOTPAGE
Lloh35:
	ldr	x11, [x11, _IB_PORT_PHYS_STATE_DISABLED@GOTPAGEOFF]
	cmp	x8, x9
	csel	x8, x10, x11, eq
	ldr	w8, [x8]
	str	w8, [x19, #24]
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	w0, #0
LBB0_10:
	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 AdrpLdrGotLdr	Lloh14, Lloh15, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh16
	.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
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_PORT_CM_SUP,4,2             ; @IB_PORT_CM_SUP
	.comm	_IB_PORT_REINIT_SUP,4,2         ; @IB_PORT_REINIT_SUP
	.comm	_IB_PORT_VENDOR_CLASS_SUP,4,2   ; @IB_PORT_VENDOR_CLASS_SUP
	.comm	_IB_PORT_BOOT_MGMT_SUP,4,2      ; @IB_PORT_BOOT_MGMT_SUP
	.comm	_HNS_ROCE_MAX_MSG_LEN,4,2       ; @HNS_ROCE_MAX_MSG_LEN
	.comm	_IB_WIDTH_4X,4,2                ; @IB_WIDTH_4X
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"find netdev %d failed!\r\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IB_MTU_256,4,2                 ; @IB_MTU_256
	.comm	_IB_PORT_ACTIVE,8,3             ; @IB_PORT_ACTIVE
	.comm	_IB_PORT_DOWN,8,3               ; @IB_PORT_DOWN
	.comm	_IB_PORT_PHYS_STATE_LINK_UP,4,2 ; @IB_PORT_PHYS_STATE_LINK_UP
	.comm	_IB_PORT_PHYS_STATE_DISABLED,4,2 ; @IB_PORT_PHYS_STATE_DISABLED
	.no_dead_strip	_hns_roce_query_port
.subsections_via_symbols
