	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar8327_sw_get_ports
_ar8327_sw_get_ports:                   ## @ar8327_sw_get_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	callq	_swdev_to_ar8xxx
	movq	(%rax), %rcx
	movq	(%r15), %r8
	movl	(%rcx,%r8,4), %r9d
	movq	$0, 8(%r15)
	movl	(%r14), %r11d
	testl	%r11d, %r11d
	jle	LBB0_8
## %bb.1:
	xorl	%r14d, %r14d
	movq	_SWITCH_PORT_FLAG_TAGGED@GOTPCREL(%rip), %r10
	xorl	%edx, %edx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movzbl	(%r10), %ecx
	movl	$1, %ebx
	shll	%cl, %ebx
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, 4(%rsi,%r14,8)
	movq	%rdi, %r14
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rdx
	cmpq	%rdx, %r11
	je	LBB0_8
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, %ebx
	movl	%edx, %ecx
	shll	%cl, %ebx
	btl	%edx, %r9d
	jae	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%r15), %rsi
	leaq	1(%r14), %rdi
	movq	%rdi, 8(%r15)
	movl	%edx, (%rsi,%r14,8)
	testl	%ebx, 8(%rax)
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%rax), %rcx
	xorl	%ebx, %ebx
	cmpq	%r8, (%rcx,%rdx,8)
	jne	LBB0_5
	jmp	LBB0_6
LBB0_8:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SWITCH_PORT_FLAG_TAGGED,4,2    ## @SWITCH_PORT_FLAG_TAGGED
	.no_dead_strip	_ar8327_sw_get_ports
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar8327_sw_get_ports
_ar8327_sw_get_ports:                   ; @ar8327_sw_get_ports
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
	bl	_swdev_to_ar8xxx
	ldr	x9, [x0]
	ldr	x8, [x19]
	ldr	w9, [x9, x8, lsl #2]
	str	xzr, [x19, #8]
	ldr	w10, [x20]
	cmp	w10, #1
	b.lt	LBB0_9
; %bb.1:
	mov	x12, #0
	mov	x11, #0
	mov	w13, #1
Lloh0:
	adrp	x14, _SWITCH_PORT_FLAG_TAGGED@GOTPAGE
Lloh1:
	ldr	x14, [x14, _SWITCH_PORT_FLAG_TAGGED@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w17, [x14]
	lsl	w17, w13, w17
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x12, x16, x12, lsl #3
	str	w17, [x12, #4]
	mov	x12, x15
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x11, x11, #1
	cmp	x10, x11
	b.eq	LBB0_9
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	lsl	w17, w13, w11
	tst	w17, w9
	b.eq	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x16, [x19, #16]
	add	x15, x12, #1
	str	x15, [x19, #8]
	lsl	x1, x12, #3
	str	w11, [x16, x1]
	ldr	w1, [x0, #8]
	tst	w1, w17
	b.ne	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x17, [x0, #16]
	ldr	x17, [x17, x11, lsl #3]
	cmp	x17, x8
	b.ne	LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w17, #0
	b	LBB0_3
LBB0_9:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_SWITCH_PORT_FLAG_TAGGED,4,2    ; @SWITCH_PORT_FLAG_TAGGED
	.no_dead_strip	_ar8327_sw_get_ports
.subsections_via_symbols
