	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_usnic_ib_query_port            ## -- Begin function usnic_ib_query_port
	.p2align	4, 0x90
_usnic_ib_query_port:                   ## @usnic_ib_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movl	%esi, %r15d
	movq	%rdi, %rbx
	callq	_to_usdev
	movq	%rax, %r14
	leaq	L_.str(%rip), %rdi
	callq	_usnic_dbg
	leaq	92(%r12), %rdx
	leaq	88(%r12), %rcx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_ib_get_eth_speed
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_2:
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	$0, 80(%r12)
	movl	$1, (%r12)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 64(%r12)
	movq	8(%r14), %rax
	cmpl	$0, 8(%rax)
	je	LBB0_3
## %bb.4:
	cmpl	$0, 4(%rax)
	movq	_IB_PORT_ACTIVE@GOTPCREL(%rip), %rcx
	cmoveq	_IB_PORT_INIT@GOTPCREL(%rip), %rcx
	movq	_IB_PORT_PHYS_STATE_LINK_UP@GOTPCREL(%rip), %rdx
	cmoveq	_IB_PORT_PHYS_STATE_PORT_CONFIGURATION_TRAINING@GOTPCREL(%rip), %rdx
	jmp	LBB0_5
LBB0_3:
	movq	_IB_PORT_PHYS_STATE_DISABLED@GOTPCREL(%rip), %rdx
	movq	_IB_PORT_DOWN@GOTPCREL(%rip), %rcx
LBB0_5:
	movl	(%rcx), %ecx
	movl	%ecx, 60(%r12)
	movl	(%rdx), %ecx
	movl	%ecx, 56(%r12)
	movq	$0, 48(%r12)
	movabsq	$4294967297, %rcx               ## imm = 0x100000001
	movq	%rcx, 4(%r12)
	movups	%xmm0, 32(%r12)
	movq	_IB_MTU_4096@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 24(%r12)
	movl	(%rax), %edi
	callq	_iboe_get_mtu
	movl	%eax, 20(%r12)
	movq	8(%r14), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r12)
	movl	$1, 12(%r12)
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IB_PORT_DOWN,4,2               ## @IB_PORT_DOWN
	.comm	_IB_PORT_PHYS_STATE_DISABLED,4,2 ## @IB_PORT_PHYS_STATE_DISABLED
	.comm	_IB_PORT_INIT,4,2               ## @IB_PORT_INIT
	.comm	_IB_PORT_PHYS_STATE_PORT_CONFIGURATION_TRAINING,4,2 ## @IB_PORT_PHYS_STATE_PORT_CONFIGURATION_TRAINING
	.comm	_IB_PORT_ACTIVE,4,2             ## @IB_PORT_ACTIVE
	.comm	_IB_PORT_PHYS_STATE_LINK_UP,4,2 ## @IB_PORT_PHYS_STATE_LINK_UP
	.comm	_IB_MTU_4096,4,2                ## @IB_MTU_4096
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_usnic_ib_query_port            ; -- Begin function usnic_ib_query_port
	.p2align	2
_usnic_ib_query_port:                   ; @usnic_ib_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	x21, x1
	mov	x22, x0
	bl	_to_usdev
	mov	x20, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_usnic_dbg
	add	x2, x19, #92
	add	x3, x19, #88
	mov	x0, x22
	mov	x1, x21
	bl	_ib_get_eth_speed
	cbz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_2:
	mov	x0, x20
	bl	_mutex_lock
	stp	xzr, xzr, [x19, #72]
	mov	w21, #1
	str	w21, [x19]
	str	xzr, [x19, #64]
	ldr	x8, [x20, #8]
	ldr	w9, [x8, #8]
	cbz	w9, LBB0_4
; %bb.3:
	ldr	w9, [x8, #4]
Lloh5:
	adrp	x10, _IB_PORT_ACTIVE@GOTPAGE
Lloh6:
	ldr	x10, [x10, _IB_PORT_ACTIVE@GOTPAGEOFF]
Lloh7:
	adrp	x11, _IB_PORT_INIT@GOTPAGE
Lloh8:
	ldr	x11, [x11, _IB_PORT_INIT@GOTPAGEOFF]
	cmp	w9, #0
	csel	x9, x11, x10, eq
Lloh9:
	adrp	x10, _IB_PORT_PHYS_STATE_LINK_UP@GOTPAGE
Lloh10:
	ldr	x10, [x10, _IB_PORT_PHYS_STATE_LINK_UP@GOTPAGEOFF]
Lloh11:
	adrp	x11, _IB_PORT_PHYS_STATE_PORT_CONFIGURATION_TRAINING@GOTPAGE
Lloh12:
	ldr	x11, [x11, _IB_PORT_PHYS_STATE_PORT_CONFIGURATION_TRAINING@GOTPAGEOFF]
	csel	x10, x11, x10, eq
	b	LBB0_5
LBB0_4:
Lloh13:
	adrp	x10, _IB_PORT_PHYS_STATE_DISABLED@GOTPAGE
Lloh14:
	ldr	x10, [x10, _IB_PORT_PHYS_STATE_DISABLED@GOTPAGEOFF]
Lloh15:
	adrp	x9, _IB_PORT_DOWN@GOTPAGE
Lloh16:
	ldr	x9, [x9, _IB_PORT_DOWN@GOTPAGEOFF]
LBB0_5:
	ldr	w9, [x9]
	ldr	w10, [x10]
	stp	w10, w9, [x19, #56]
	stp	xzr, xzr, [x19, #40]
	movi.2s	v0, #1
	stur	d0, [x19, #4]
	str	xzr, [x19, #32]
Lloh17:
	adrp	x9, _IB_MTU_4096@GOTPAGE
Lloh18:
	ldr	x9, [x9, _IB_MTU_4096@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	str	w9, [x19, #24]
	ldr	w0, [x8]
	bl	_iboe_get_mtu
	str	w0, [x19, #20]
	ldr	x8, [x20, #8]
	ldr	w8, [x8]
	stp	w21, w8, [x19, #12]
	mov	x0, x20
	bl	_mutex_unlock
	mov	w0, #0
LBB0_6:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IB_PORT_DOWN,4,2               ; @IB_PORT_DOWN
	.comm	_IB_PORT_PHYS_STATE_DISABLED,4,2 ; @IB_PORT_PHYS_STATE_DISABLED
	.comm	_IB_PORT_INIT,4,2               ; @IB_PORT_INIT
	.comm	_IB_PORT_PHYS_STATE_PORT_CONFIGURATION_TRAINING,4,2 ; @IB_PORT_PHYS_STATE_PORT_CONFIGURATION_TRAINING
	.comm	_IB_PORT_ACTIVE,4,2             ; @IB_PORT_ACTIVE
	.comm	_IB_PORT_PHYS_STATE_LINK_UP,4,2 ; @IB_PORT_PHYS_STATE_LINK_UP
	.comm	_IB_MTU_4096,4,2                ; @IB_MTU_4096
.subsections_via_symbols
