	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function idt_scan_ports
_idt_scan_ports:                        ## @idt_scan_ports
	.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	%rdi, %rbx
	movq	_IDT_NT_PCIELCAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_idt_nt_read
	movq	_PCIELCAP_PORTNUM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	%eax, %esi
	callq	_GET_FIELD
	movq	%rax, (%rbx)
	movq	_portdata_tbl@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%rax,4), %esi
	movq	%rbx, %rdi
	callq	_idt_sw_read
	movq	_SWPORTxSTS_SWPART@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	%eax, %esi
	callq	_GET_FIELD
	movq	%rax, 56(%rbx)
	movq	8(%rbx), %rdi
	movq	_EINVAL@GOTPCREL(%rip), %r14
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	subl	(%r14), %esi
	movl	$8, %edx
	callq	_memset
	movq	16(%rbx), %rdi
	xorl	%esi, %esi
	subl	(%r14), %esi
	movl	$8, %edx
	callq	_memset
	movq	$0, 24(%rbx)
	movq	48(%rbx), %rax
	cmpb	$0, (%rax)
	je	LBB0_1
## %bb.2:
	xorl	%r13d, %r13d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	24(%rbx), %rax
	movq	40(%rbx), %rcx
	movb	%r15b, (%rcx,%rax,2)
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movb	%dl, 1(%rcx,%rax,2)
	movq	8(%rbx), %rcx
	movq	%rax, (%rcx,%r14,8)
	movq	16(%rbx), %rax
	movq	24(%rbx), %rcx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	%rcx, (%rax,%rdx,8)
	incq	24(%rbx)
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%r13
	movq	48(%rbx), %rax
	movzbl	(%rax), %ecx
	cmpq	%rcx, %r13
	jae	LBB0_11
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rax), %rax
	movzbl	(%rax,%r13), %r15d
	movzbl	%r15b, %r14d
	cmpq	%r14, (%rbx)
	je	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_portdata_tbl@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r14,4), %esi
	movq	%rbx, %rdi
	callq	_idt_sw_read
	movl	%eax, %r12d
	movq	_SWPORTxSTS_SWPART@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r12d, %esi
	callq	_GET_FIELD
	movq	%rax, %rcx
	movq	_partdata_tbl@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movzbl	%cl, %ecx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	(%rax,%rcx,4), %esi
	movq	%rbx, %rdi
	callq	_idt_sw_read
	movq	_SWPARTxSTS_STATE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	_ACT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %esi
	callq	_IS_FLD_SET
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_SWPORTxSTS_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_NT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r12d, %esi
	callq	_IS_FLD_SET
	testq	%rax, %rax
	jne	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_SWPORTxSTS_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_USNT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r12d, %esi
	callq	_IS_FLD_SET
	testq	%rax, %rax
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_SWPORTxSTS_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_USNTDMA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r12d, %esi
	callq	_IS_FLD_SET
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_SWPORTxSTS_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_NTDMA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r12d, %esi
	callq	_IS_FLD_SET
	testq	%rax, %rax
	jne	LBB0_9
	jmp	LBB0_10
LBB0_11:
	movq	24(%rbx), %rcx
	xorl	%r15d, %r15d
	jmp	LBB0_12
LBB0_1:
	xorl	%ecx, %ecx
LBB0_12:
	movq	32(%rbx), %rdi
	movzbl	(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	cmpq	$0, 24(%rbx)
	jne	LBB0_14
## %bb.13:
	movq	32(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_warn
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_14:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IDT_NT_PCIELCAP,4,2            ## @IDT_NT_PCIELCAP
	.comm	_PCIELCAP_PORTNUM,4,2           ## @PCIELCAP_PORTNUM
	.comm	_portdata_tbl,8,3               ## @portdata_tbl
	.comm	_SWPORTxSTS_SWPART,4,2          ## @SWPORTxSTS_SWPART
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_partdata_tbl,8,3               ## @partdata_tbl
	.comm	_SWPARTxSTS_STATE,4,2           ## @SWPARTxSTS_STATE
	.comm	_ACT,4,2                        ## @ACT
	.comm	_SWPORTxSTS_MODE,4,2            ## @SWPORTxSTS_MODE
	.comm	_NT,4,2                         ## @NT
	.comm	_USNT,4,2                       ## @USNT
	.comm	_USNTDMA,4,2                    ## @USNTDMA
	.comm	_NTDMA,4,2                      ## @NTDMA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Local port: %hhu, num of peers: %hhu\n"

L_.str.1:                               ## @.str.1
	.asciz	"No active peer found\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_idt_scan_ports
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function idt_scan_ports
_idt_scan_ports:                        ; @idt_scan_ports
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x8, _IDT_NT_PCIELCAP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IDT_NT_PCIELCAP@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_idt_nt_read
	mov	x1, x0
Lloh3:
	adrp	x8, _PCIELCAP_PORTNUM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCIELCAP_PORTNUM@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_GET_FIELD
	str	x0, [x19]
Lloh6:
	adrp	x8, _portdata_tbl@GOTPAGE
Lloh7:
	ldr	x8, [x8, _portdata_tbl@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	w1, [x8, x0, lsl #2]
	mov	x0, x19
	bl	_idt_sw_read
	mov	x1, x0
Lloh9:
	adrp	x8, _SWPORTxSTS_SWPART@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SWPORTxSTS_SWPART@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_GET_FIELD
	str	x0, [x19, #56]
	ldr	x0, [x19, #8]
Lloh12:
	adrp	x20, _EINVAL@GOTPAGE
Lloh13:
	ldr	x20, [x20, _EINVAL@GOTPAGEOFF]
	ldr	w8, [x20]
	neg	w1, w8
	mov	w2, #8
	bl	_memset
	ldr	x0, [x19, #16]
	ldr	w8, [x20]
	neg	w1, w8
	mov	w2, #8
	bl	_memset
	str	xzr, [x19, #24]
	ldr	x8, [x19, #48]
	ldrb	w9, [x8]
	cbz	w9, LBB0_11
; %bb.1:
	mov	x24, #0
Lloh14:
	adrp	x25, _partdata_tbl@GOTPAGE
Lloh15:
	ldr	x25, [x25, _partdata_tbl@GOTPAGEOFF]
Lloh16:
	adrp	x26, _SWPARTxSTS_STATE@GOTPAGE
Lloh17:
	ldr	x26, [x26, _SWPARTxSTS_STATE@GOTPAGEOFF]
Lloh18:
	adrp	x27, _ACT@GOTPAGE
Lloh19:
	ldr	x27, [x27, _ACT@GOTPAGEOFF]
Lloh20:
	adrp	x28, _SWPORTxSTS_MODE@GOTPAGE
Lloh21:
	ldr	x28, [x28, _SWPORTxSTS_MODE@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #40]
	ldr	x9, [x19, #24]
	add	x8, x8, x9, lsl #1
	strb	w22, [x8]
	strb	w20, [x8, #1]
	ldp	x8, x10, [x19, #8]
	str	x9, [x8, x22, lsl #3]
	ldr	x8, [x19, #24]
	str	x8, [x10, x23, lsl #3]
	ldr	x8, [x19, #24]
	add	x8, x8, #1
	str	x8, [x19, #24]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x24, #1
	ldr	x8, [x19, #48]
	ldrb	w9, [x8]
	cmp	x24, x9
	b.hs	LBB0_10
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x8, #8]
	ldrb	w22, [x8, x24]
	ldr	x8, [x19]
	cmp	x8, x22
	b.eq	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh22:
	adrp	x8, _portdata_tbl@GOTPAGE
Lloh23:
	ldr	x8, [x8, _portdata_tbl@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	ldr	w1, [x8, x22, lsl #2]
	mov	x0, x19
	bl	_idt_sw_read
	mov	x21, x0
Lloh25:
	adrp	x8, _SWPORTxSTS_SWPART@GOTPAGE
Lloh26:
	ldr	x8, [x8, _SWPORTxSTS_SWPART@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_GET_FIELD
	mov	x20, x0
	ldr	x8, [x25]
	and	x23, x0, #0xff
	ldr	w1, [x8, x23, lsl #2]
	mov	x0, x19
	bl	_idt_sw_read
	mov	x1, x0
	ldr	w0, [x26]
	ldr	w2, [x27]
	bl	_IS_FLD_SET
	cbz	x0, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x28]
Lloh28:
	adrp	x8, _NT@GOTPAGE
Lloh29:
	ldr	x8, [x8, _NT@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	mov	x1, x21
	bl	_IS_FLD_SET
	cbnz	x0, LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x28]
Lloh31:
	adrp	x8, _USNT@GOTPAGE
Lloh32:
	ldr	x8, [x8, _USNT@GOTPAGEOFF]
Lloh33:
	ldr	w2, [x8]
	mov	x1, x21
	bl	_IS_FLD_SET
	cbnz	x0, LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x28]
Lloh34:
	adrp	x8, _USNTDMA@GOTPAGE
Lloh35:
	ldr	x8, [x8, _USNTDMA@GOTPAGEOFF]
Lloh36:
	ldr	w2, [x8]
	mov	x1, x21
	bl	_IS_FLD_SET
	cbnz	x0, LBB0_2
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x28]
Lloh37:
	adrp	x8, _NTDMA@GOTPAGE
Lloh38:
	ldr	x8, [x8, _NTDMA@GOTPAGEOFF]
Lloh39:
	ldr	w2, [x8]
	mov	x1, x21
	bl	_IS_FLD_SET
	cbnz	x0, LBB0_2
	b	LBB0_3
LBB0_10:
	ldr	x3, [x19, #24]
	b	LBB0_12
LBB0_11:
	mov	x3, #0
LBB0_12:
	ldr	x0, [x19, #32]
	ldrb	w2, [x19]
Lloh40:
	adrp	x1, l_.str@PAGE
Lloh41:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_14
; %bb.13:
	mov	w0, #0
	b	LBB0_15
LBB0_14:
	ldr	x0, [x19, #32]
Lloh42:
	adrp	x1, l_.str.1@PAGE
Lloh43:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
Lloh44:
	adrp	x8, _ENODEV@GOTPAGE
Lloh45:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_IDT_NT_PCIELCAP,4,2            ; @IDT_NT_PCIELCAP
	.comm	_PCIELCAP_PORTNUM,4,2           ; @PCIELCAP_PORTNUM
	.comm	_portdata_tbl,8,3               ; @portdata_tbl
	.comm	_SWPORTxSTS_SWPART,4,2          ; @SWPORTxSTS_SWPART
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_partdata_tbl,8,3               ; @partdata_tbl
	.comm	_SWPARTxSTS_STATE,4,2           ; @SWPARTxSTS_STATE
	.comm	_ACT,4,2                        ; @ACT
	.comm	_SWPORTxSTS_MODE,4,2            ; @SWPORTxSTS_MODE
	.comm	_NT,4,2                         ; @NT
	.comm	_USNT,4,2                       ; @USNT
	.comm	_USNTDMA,4,2                    ; @USNTDMA
	.comm	_NTDMA,4,2                      ; @NTDMA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Local port: %hhu, num of peers: %hhu\n"

l_.str.1:                               ; @.str.1
	.asciz	"No active peer found\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_idt_scan_ports
.subsections_via_symbols
