	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt7530_port_bridge_join
_mt7530_port_bridge_join:               ## @mt7530_port_bridge_join
	.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	%rdx, -64(%rbp)                 ## 8-byte Spill
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	(%rdi), %r12
	movq	_MT7530_CPU_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	_MT7530_NUM_PORTS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	jle	LBB0_9
## %bb.1:
	movl	%r14d, %r15d
	movl	$8, %r13d
	xorl	%r14d, %r14d
	jmp	LBB0_2
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_BIT
	movl	%eax, %edi
	callq	_PCR_MATRIX
	movq	8(%r12), %rcx
	orl	%eax, -8(%rcx,%r13)
	movl	%r14d, %edi
	callq	_BIT
	orl	%eax, -48(%rbp)                 ## 4-byte Folded Spill
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	movq	_MT7530_NUM_PORTS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$16, %r13
	cmpq	%rax, %r14
	jge	LBB0_9
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_dsa_is_user_port
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	%r14, %r15
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_dsa_to_port
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rcx, (%rax)
	jne	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r12), %rax
	cmpq	$0, (%rax,%r13)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r14d, %edi
	callq	_MT7530_PCR_P
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	%r15d, %edi
	callq	_BIT
	movl	%eax, %edi
	callq	_PCR_MATRIX
	movq	%r12, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	%eax, %edx
	callq	_mt7530_set
	jmp	LBB0_7
LBB0_9:
	movq	8(%r12), %rax
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movslq	%edi, %rbx
	shlq	$4, %rbx
	cmpq	$0, 8(%rax,%rbx)
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	je	LBB0_11
## %bb.10:
	callq	_MT7530_PCR_P
	movl	%eax, %r14d
	movq	_PCR_MATRIX_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	%r13d, %edi
	callq	_PCR_MATRIX
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_mt7530_rmw
LBB0_11:
	movl	%r13d, %edi
	callq	_PCR_MATRIX
	movq	8(%r12), %rcx
	orl	%eax, (%rcx,%rbx)
	movq	%r12, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MT7530_CPU_PORT,4,2            ## @MT7530_CPU_PORT
	.comm	_MT7530_NUM_PORTS,4,2           ## @MT7530_NUM_PORTS
	.comm	_PCR_MATRIX_MASK,4,2            ## @PCR_MATRIX_MASK
	.no_dead_strip	_mt7530_port_bridge_join
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt7530_port_bridge_join
_mt7530_port_bridge_join:               ; @mt7530_port_bridge_join
	.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	x22, x2
	mov	x21, x1
	mov	x23, x0
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _MT7530_CPU_PORT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT7530_CPU_PORT@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_BIT
	mov	x20, x0
	mov	x0, x19
	bl	_mutex_lock
Lloh3:
	adrp	x27, _MT7530_NUM_PORTS@GOTPAGE
Lloh4:
	ldr	x27, [x27, _MT7530_NUM_PORTS@GOTPAGEOFF]
	ldr	w8, [x27]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.1:
	mov	x24, #0
	mov	w25, w21
	mov	w28, #8
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	bl	_BIT
	bl	_PCR_MATRIX
	ldr	x8, [x19, #8]
	add	x8, x8, x28
	ldur	w9, [x8, #-8]
	orr	w9, w9, w0
	stur	w9, [x8, #-8]
	mov	x0, x24
	bl	_BIT
	orr	w20, w0, w20
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x27]
	add	x28, x28, #16
	cmp	x24, x8
	b.ge	LBB0_9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	mov	x1, x24
	bl	_dsa_is_user_port
	cbz	x0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	x25, x24
	b.eq	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x23
	mov	x1, x24
	bl	_dsa_to_port
	ldr	x8, [x0]
	cmp	x8, x22
	b.ne	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #8]
	ldr	x8, [x8, x28]
	cbz	x8, LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x24
	bl	_MT7530_PCR_P
	mov	x26, x0
	mov	x0, x25
	bl	_BIT
	bl	_PCR_MATRIX
	mov	x2, x0
	mov	x0, x19
	mov	x1, x26
	bl	_mt7530_set
	b	LBB0_2
LBB0_9:
	ldr	x8, [x19, #8]
	sxtw	x23, w21
	add	x8, x8, w21, sxtw #4
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_11
; %bb.10:
	mov	x0, x21
	bl	_MT7530_PCR_P
	mov	x21, x0
Lloh5:
	adrp	x8, _PCR_MATRIX_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PCR_MATRIX_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w22, [x8]
	mov	x0, x20
	bl	_PCR_MATRIX
	mov	x3, x0
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_mt7530_rmw
LBB0_11:
	mov	x0, x20
	bl	_PCR_MATRIX
	ldr	x8, [x19, #8]
	lsl	x9, x23, #4
	ldr	w10, [x8, x9]
	orr	w10, w10, w0
	str	w10, [x8, x9]
	mov	x0, x19
	bl	_mutex_unlock
	mov	w0, #0
	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	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_MT7530_CPU_PORT,4,2            ; @MT7530_CPU_PORT
	.comm	_MT7530_NUM_PORTS,4,2           ; @MT7530_NUM_PORTS
	.comm	_PCR_MATRIX_MASK,4,2            ; @PCR_MATRIX_MASK
	.no_dead_strip	_mt7530_port_bridge_join
.subsections_via_symbols
