	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar8xxx_sw_get_ports
_ar8xxx_sw_get_ports:                   ## @ar8xxx_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	(%r15), %rcx
	movq	_AR8X16_MAX_VLANS@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jae	LBB0_1
## %bb.2:
	movq	(%rax), %rdx
	movl	(%rdx,%rcx,4), %r8d
	movq	$0, 8(%r15)
	movl	(%r14), %r10d
	testl	%r10d, %r10d
	jle	LBB0_7
## %bb.3:
	xorl	%r11d, %r11d
	movq	_SWITCH_PORT_FLAG_TAGGED@GOTPCREL(%rip), %r9
	xorl	%edx, %edx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incl	%edx
	cmpl	%edx, %r10d
	je	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	movl	%edx, %ecx
	shll	%cl, %edi
	btl	%edx, %r8d
	jae	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	16(%r15), %r14
	leaq	1(%r11), %rsi
	movq	%rsi, 8(%r15)
	movl	%edx, (%r14,%r11,8)
	andl	8(%rax), %edi
	movzbl	(%r9), %ecx
	movl	$1, %ebx
	shll	%cl, %ebx
	testl	%edi, %edi
	cmovel	%edi, %ebx
	movl	%ebx, 4(%r14,%r11,8)
	movq	%rsi, %r11
	jmp	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_7:
	xorl	%eax, %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AR8X16_MAX_VLANS,8,3           ## @AR8X16_MAX_VLANS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SWITCH_PORT_FLAG_TAGGED,4,2    ## @SWITCH_PORT_FLAG_TAGGED
	.no_dead_strip	_ar8xxx_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 ar8xxx_sw_get_ports
_ar8xxx_sw_get_ports:                   ; @ar8xxx_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	x8, [x19]
Lloh0:
	adrp	x9, _AR8X16_MAX_VLANS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AR8X16_MAX_VLANS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.hs	LBB0_6
; %bb.1:
	ldr	x9, [x0]
	ldr	w8, [x9, x8, lsl #2]
	str	xzr, [x19, #8]
	ldr	w9, [x20]
	cmp	w9, #1
	b.lt	LBB0_7
; %bb.2:
	mov	x13, #0
	mov	w10, #0
	mov	w11, #1
Lloh3:
	adrp	x12, _SWITCH_PORT_FLAG_TAGGED@GOTPAGE
Lloh4:
	ldr	x12, [x12, _SWITCH_PORT_FLAG_TAGGED@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w10, w10, #1
	cmp	w9, w10
	b.eq	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	lsl	w14, w11, w10
	tst	w14, w8
	b.eq	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x15, [x19, #16]
	add	x15, x15, x13, lsl #3
	add	x13, x13, #1
	str	x13, [x19, #8]
	str	w10, [x15]
	ldr	w16, [x0, #8]
	ldr	w17, [x12]
	lsl	w17, w11, w17
	tst	w16, w14
	csel	w14, wzr, w17, eq
	str	w14, [x15, #4]
	b	LBB0_3
LBB0_6:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_7:
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_AR8X16_MAX_VLANS,8,3           ; @AR8X16_MAX_VLANS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SWITCH_PORT_FLAG_TAGGED,4,2    ; @SWITCH_PORT_FLAG_TAGGED
	.no_dead_strip	_ar8xxx_sw_get_ports
.subsections_via_symbols
