	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar8327_sw_set_ports
_ar8327_sw_set_ports:                   ## @ar8327_sw_set_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	callq	_swdev_to_ar8xxx
	movq	(%rax), %r8
	movq	(%r14), %r10
	movl	$0, (%r8,%r10,4)
	cmpl	$0, 8(%r14)
	jle	LBB0_7
## %bb.1:
	movq	16(%r14), %rdi
	addq	$8, %rdi
	xorl	%edx, %edx
	movq	_SWITCH_PORT_FLAG_TAGGED@GOTPCREL(%rip), %r9
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rdi), %rcx
	movl	$-2, %esi
	roll	%cl, %esi
	andl	%esi, 16(%rax)
	movq	(%r14), %rsi
	movq	8(%rax), %rbx
	movq	%rsi, (%rbx,%rcx,8)
	movq	(%rdi), %rcx
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %esi
                                        ## kill: def $cl killed $cl killed $rcx
	shll	%cl, %esi
	orl	%esi, (%r8,%r10,4)
	incq	%rdx
	movslq	8(%r14), %rcx
	addq	$16, %rdi
	cmpq	%rcx, %rdx
	jge	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	-8(%rdi), %ecx
	movl	(%r9), %esi
	btl	%esi, %ecx
	jae	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r14), %rsi
	movq	8(%rax), %rbx
	movq	(%rdi), %rcx
	cmpq	(%rbx,%rcx,8), %rsi
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %esi
	shll	%cl, %esi
	orl	%esi, 16(%rax)
	jmp	LBB0_6
LBB0_7:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SWITCH_PORT_FLAG_TAGGED,4,2    ## @SWITCH_PORT_FLAG_TAGGED
	.no_dead_strip	_ar8327_sw_set_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_set_ports
_ar8327_sw_set_ports:                   ; @ar8327_sw_set_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
	bl	_swdev_to_ar8xxx
	ldr	x8, [x0]
	ldr	x13, [x19]
	str	wzr, [x8, x13, lsl #2]
	ldr	w9, [x19, #8]
	cmp	w9, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x9, #0
	ldr	x10, [x19, #16]
	add	x10, x10, #8
Lloh0:
	adrp	x11, _SWITCH_PORT_FLAG_TAGGED@GOTPAGE
Lloh1:
	ldr	x11, [x11, _SWITCH_PORT_FLAG_TAGGED@GOTPAGEOFF]
	mov	w12, #1
	lsl	x13, x13, #2
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x14, [x10]
	lsl	w15, w12, w14
	ldr	w16, [x0, #16]
	bic	w15, w16, w15
	str	w15, [x0, #16]
	ldr	x15, [x19]
	ldr	x16, [x0, #8]
	str	x15, [x16, x14, lsl #3]
	ldr	x14, [x10]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	lsl	w14, w12, w14
	ldr	w15, [x8, x13]
	orr	w14, w14, w15
	str	w14, [x8, x13]
	add	x9, x9, #1
	ldrsw	x14, [x19, #8]
	add	x10, x10, #16
	cmp	x9, x14
	b.ge	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w14, [x10, #-8]
	ldr	w15, [x11]
	lsr	w14, w14, w15
	tbz	w14, #0, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x15, [x19]
	ldr	x16, [x0, #8]
	ldr	x14, [x10]
	ldr	x16, [x16, x14, lsl #3]
	cmp	x15, x16
	b.ne	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	lsl	w15, w12, w14
	ldr	w16, [x0, #16]
	orr	w15, w16, w15
	str	w15, [x0, #16]
	b	LBB0_3
LBB0_7:
	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_set_ports
.subsections_via_symbols
