	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function switch_lookup
_switch_lookup:                         ## @switch_lookup
	.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
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	(%rdi), %r15
	movq	24(%rdi), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	_IB_ATTR_SWITCH_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_timeout@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_srcport@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r12, %rdi
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	callq	_smp_query_via
	movl	$-1, %ecx
	testl	%eax, %eax
	je	LBB0_6
## %bb.1:
	movq	%r15, %rbx
	movq	_IB_SW_LINEAR_FDB_CAP_F@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	8(%r13), %rdx
	movq	%r12, %rdi
	callq	_mad_decode_field
	movq	_IB_SW_LINEAR_FDB_TOP_F@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	12(%r13), %r15
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	_mad_decode_field
	movq	_IB_SW_ENHANCED_PORT0_F@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	16(%r13), %rdx
	movq	%r12, %rdi
	callq	_mad_decode_field
	cmpl	%r14d, 8(%r13)
	jg	LBB0_4
## %bb.2:
	cmpl	%r14d, (%r15)
	jge	LBB0_4
## %bb.3:
	movl	$-1, %ecx
	jmp	LBB0_6
LBB0_4:
	movq	%rbx, %r15
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	_IB_ATTR_LINEARFORWTBL@GOTPCREL(%rip), %rax
	leal	63(%r14), %ebx
	testl	%r14d, %r14d
	cmovnsl	%r14d, %ebx
	movl	(%rax), %edx
	movl	%ebx, %ecx
	sarl	$6, %ecx
	movq	_timeout@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_srcport@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r15, %rdi
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rsi
	callq	_smp_query_via
	testl	%eax, %eax
	movl	$-1, %ecx
	je	LBB0_6
## %bb.5:
	andl	$-64, %ebx
	movl	%r14d, %r15d
	subl	%ebx, %r15d
	movq	%r12, %rdi
	callq	_portid2str
	movq	(%r13), %rcx
	movslq	%r15d, %rbx
	movl	(%rcx,%rbx,4), %ecx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	movl	%r14d, %edx
	callq	_DEBUG
	movq	(%r13), %rax
	movl	(%rax,%rbx,4), %ecx
LBB0_6:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_ATTR_SWITCH_INFO,4,2        ## @IB_ATTR_SWITCH_INFO
	.comm	_timeout,4,2                    ## @timeout
	.comm	_srcport,4,2                    ## @srcport
	.comm	_IB_SW_LINEAR_FDB_CAP_F,4,2     ## @IB_SW_LINEAR_FDB_CAP_F
	.comm	_IB_SW_LINEAR_FDB_TOP_F,4,2     ## @IB_SW_LINEAR_FDB_TOP_F
	.comm	_IB_SW_ENHANCED_PORT0_F,4,2     ## @IB_SW_ENHANCED_PORT0_F
	.comm	_IB_ATTR_LINEARFORWTBL,4,2      ## @IB_ATTR_LINEARFORWTBL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"portid %s: forward lid %d to port %d"

	.no_dead_strip	_switch_lookup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function switch_lookup
_switch_lookup:                         ; @switch_lookup
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x23, [x0, #24]
	ldr	x22, [x0]
	mov	x0, x23
	mov	w1, #0
	mov	w2, #8
	bl	_memset
Lloh0:
	adrp	x8, _IB_ATTR_SWITCH_INFO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IB_ATTR_SWITCH_INFO@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
Lloh3:
	adrp	x25, _timeout@GOTPAGE
Lloh4:
	ldr	x25, [x25, _timeout@GOTPAGEOFF]
	ldr	w4, [x25]
Lloh5:
	adrp	x26, _srcport@GOTPAGE
Lloh6:
	ldr	x26, [x26, _srcport@GOTPAGEOFF]
	ldr	w5, [x26]
	mov	x0, x23
	mov	x1, x21
	mov	w3, #0
	bl	_smp_query_via
	cbz	w0, LBB0_5
; %bb.1:
Lloh7:
	adrp	x8, _IB_SW_LINEAR_FDB_CAP_F@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IB_SW_LINEAR_FDB_CAP_F@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	add	x2, x19, #8
	mov	x0, x23
	bl	_mad_decode_field
Lloh10:
	adrp	x8, _IB_SW_LINEAR_FDB_TOP_F@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IB_SW_LINEAR_FDB_TOP_F@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	add	x24, x19, #12
	mov	x0, x23
	mov	x2, x24
	bl	_mad_decode_field
Lloh13:
	adrp	x8, _IB_SW_ENHANCED_PORT0_F@GOTPAGE
Lloh14:
	ldr	x8, [x8, _IB_SW_ENHANCED_PORT0_F@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	add	x2, x19, #16
	mov	x0, x23
	bl	_mad_decode_field
	ldr	w8, [x19, #8]
	cmp	w8, w20
	b.gt	LBB0_3
; %bb.2:
	ldr	w8, [x24]
	cmp	w8, w20
	b.lt	LBB0_5
LBB0_3:
	mov	x0, x22
	mov	w1, #0
	mov	w2, #8
	bl	_memset
Lloh16:
	adrp	x8, _IB_ATTR_LINEARFORWTBL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _IB_ATTR_LINEARFORWTBL@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	add	w8, w20, #63
	cmp	w20, #0
	csel	w8, w8, w20, lt
	asr	w23, w8, #6
	ldr	w4, [x25]
	ldr	w5, [x26]
	mov	x0, x22
	mov	x1, x21
	mov	x3, x23
	bl	_smp_query_via
	cbz	w0, LBB0_5
; %bb.4:
	mov	x0, x21
	bl	_portid2str
	mov	x1, x0
	ldr	x8, [x19]
	sub	w9, w20, w23, lsl #6
	sbfiz	x21, x9, #2, #32
	ldr	w3, [x8, x21]
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x20
	bl	_DEBUG
	ldr	x8, [x19]
	ldr	w0, [x8, x21]
	b	LBB0_6
LBB0_5:
	mov	w0, #-1
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_ATTR_SWITCH_INFO,4,2        ; @IB_ATTR_SWITCH_INFO
	.comm	_timeout,4,2                    ; @timeout
	.comm	_srcport,4,2                    ; @srcport
	.comm	_IB_SW_LINEAR_FDB_CAP_F,4,2     ; @IB_SW_LINEAR_FDB_CAP_F
	.comm	_IB_SW_LINEAR_FDB_TOP_F,4,2     ; @IB_SW_LINEAR_FDB_TOP_F
	.comm	_IB_SW_ENHANCED_PORT0_F,4,2     ; @IB_SW_ENHANCED_PORT0_F
	.comm	_IB_ATTR_LINEARFORWTBL,4,2      ; @IB_ATTR_LINEARFORWTBL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"portid %s: forward lid %d to port %d"

	.no_dead_strip	_switch_lookup
.subsections_via_symbols
