	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mv88e6xxx_port_set_fid         ## -- Begin function mv88e6xxx_port_set_fid
	.p2align	4, 0x90
_mv88e6xxx_port_set_fid:                ## @mv88e6xxx_port_set_fid
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %rbx
	callq	_mv88e6xxx_num_databases
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_mv88e6xxx_num_databases
	cmpl	%r15d, %eax
	jle	LBB0_1
## %bb.2:
	movq	_MV88E6XXX_PORT_BASE_VLAN@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	leaq	-44(%rbp), %rcx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_mv88e6xxx_port_read
	testl	%eax, %eax
	jne	LBB0_8
## %bb.3:
	movl	$4095, %eax                     ## imm = 0xFFF
	andl	-44(%rbp), %eax
	movl	%r15d, %ecx
	shll	$12, %ecx
	movzwl	%cx, %ecx
	orl	%eax, %ecx
	movl	%ecx, -44(%rbp)
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_mv88e6xxx_port_write
	testl	%eax, %eax
	jne	LBB0_8
## %bb.4:
	decl	%r12d
	cmpl	$16, %r12d
	jae	LBB0_5
LBB0_7:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	callq	_dev_dbg
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_MV88E6XXX_PORT_CTL1@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	leaq	-44(%rbp), %rcx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_mv88e6xxx_port_read
	testl	%eax, %eax
	jne	LBB0_8
## %bb.6:
	sarl	$4, %r12d
	movl	-44(%rbp), %eax
	movl	%r15d, %ecx
	sarl	$4, %ecx
	xorl	%eax, %ecx
	andl	%r12d, %ecx
	xorl	%eax, %ecx
	movl	%ecx, -44(%rbp)
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_mv88e6xxx_port_write
	testl	%eax, %eax
	jne	LBB0_8
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MV88E6XXX_PORT_BASE_VLAN,4,2   ## @MV88E6XXX_PORT_BASE_VLAN
	.comm	_MV88E6XXX_PORT_CTL1,4,2        ## @MV88E6XXX_PORT_CTL1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"p%d: FID set to %u\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mv88e6xxx_port_set_fid         ; -- Begin function mv88e6xxx_port_set_fid
	.p2align	2
_mv88e6xxx_port_set_fid:                ; @mv88e6xxx_port_set_fid
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	bl	_mv88e6xxx_num_databases
	mov	x22, x0
	mov	x0, x21
	bl	_mv88e6xxx_num_databases
	cmp	w0, w19
	b.le	LBB0_5
; %bb.1:
Lloh0:
	adrp	x23, _MV88E6XXX_PORT_BASE_VLAN@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MV88E6XXX_PORT_BASE_VLAN@GOTPAGEOFF]
	ldr	w2, [x23]
	add	x3, sp, #12
	mov	x0, x21
	mov	x1, x20
	bl	_mv88e6xxx_port_read
	cbnz	w0, LBB0_6
; %bb.2:
	ldr	w8, [sp, #12]
	and	w3, w8, #0xfff
	bfi	w3, w19, #12, #4
	str	w3, [sp, #12]
	ldr	w2, [x23]
	mov	x0, x21
	mov	x1, x20
	bl	_mv88e6xxx_port_write
	cbnz	w0, LBB0_6
; %bb.3:
	sub	w23, w22, #1
	cmp	w23, #16
	b.hs	LBB0_7
LBB0_4:
	ldr	w0, [x21]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	mov	x3, x19
	bl	_dev_dbg
	mov	w0, #0
	b	LBB0_6
LBB0_5:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
Lloh7:
	adrp	x22, _MV88E6XXX_PORT_CTL1@GOTPAGE
Lloh8:
	ldr	x22, [x22, _MV88E6XXX_PORT_CTL1@GOTPAGEOFF]
	ldr	w2, [x22]
	add	x3, sp, #12
	mov	x0, x21
	mov	x1, x20
	bl	_mv88e6xxx_port_read
	cbnz	w0, LBB0_6
; %bb.8:
	asr	w8, w23, #4
	ldr	w9, [sp, #12]
	bic	w9, w9, w8
	and	w8, w8, w19, asr #4
	orr	w3, w9, w8
	str	w3, [sp, #12]
	ldr	w2, [x22]
	mov	x0, x21
	mov	x1, x20
	bl	_mv88e6xxx_port_write
	cbnz	w0, LBB0_6
	b	LBB0_4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MV88E6XXX_PORT_BASE_VLAN,4,2   ; @MV88E6XXX_PORT_BASE_VLAN
	.comm	_MV88E6XXX_PORT_CTL1,4,2        ; @MV88E6XXX_PORT_CTL1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"p%d: FID set to %u\n"

.subsections_via_symbols
