	.file	"extr_bgmac.c_bgmac_miiconfig.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	bgmac_miiconfig, @function
bgmac_miiconfig:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rdi
	mov	eax, DWORD PTR [rdi]
	test	DWORD PTR BGMAC_FEAT_FORCE_SPEED_2500[rip], eax
	je	.L2
	test	DWORD PTR BGMAC_FEAT_IDM_MASK[rip], eax
	je	.L8
.L3:
	mov	eax, DWORD PTR SPEED_2500[rip]
.L6:
	mov	DWORD PTR 16[rbp], eax
	mov	rax, QWORD PTR DUPLEX_FULL[rip]
	mov	rdi, rbp
	mov	QWORD PTR 8[rbp], rax
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	bgmac_mac_speed@PLT
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	mov	esi, DWORD PTR BCMA_IOCTL[rip]
	call	bgmac_idm_read@PLT
	or	eax, DWORD PTR BGMAC_BCMA_IOCTL_SW_CLKEN[rip]
	mov	esi, DWORD PTR BCMA_IOCTL[rip]
	mov	rdi, rbp
	mov	edx, eax
	or	edx, 64
	call	bgmac_idm_write@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	mov	esi, DWORD PTR BGMAC_DEV_STATUS[rip]
	call	bgmac_read@PLT
	mov	ecx, DWORD PTR BGMAC_DS_MM_SHIFT[rip]
	and	eax, DWORD PTR BGMAC_DS_MM_MASK[rip]
	sar	eax, cl
	cmp	eax, 1
	jbe	.L9
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	mov	eax, DWORD PTR SPEED_100[rip]
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	bgmac_miiconfig, .-bgmac_miiconfig
	.comm	SPEED_2500,4,4
	.comm	SPEED_100,4,4
	.comm	DUPLEX_FULL,8,8
	.comm	BGMAC_FEAT_IDM_MASK,4,4
	.comm	BGMAC_FEAT_FORCE_SPEED_2500,4,4
	.comm	BGMAC_DS_MM_SHIFT,4,4
	.comm	BGMAC_DS_MM_MASK,4,4
	.comm	BGMAC_DEV_STATUS,4,4
	.comm	BGMAC_BCMA_IOCTL_SW_CLKEN,4,4
	.comm	BCMA_IOCTL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_bgmac.c_bgmac_miiconfig.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	bgmac_miiconfig, %function
bgmac_miiconfig:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r2, .L9
	ldr	r3, [r0]
	ldr	r2, [r2]
	push	{r4, r5, r6, lr}
	tst	r3, r2
	mov	r4, r0
	beq	.L2
	ldr	r2, .L9+4
	ldr	r2, [r2]
	tst	r3, r2
	beq	.L8
.L3:
	ldr	r2, .L9+8
.L6:
	ldr	r3, .L9+12
	ldr	r2, [r2]
	ldr	r3, [r3]
	mov	r0, r4
	str	r2, [r4, #8]
	str	r3, [r4, #4]
	pop	{r4, r5, r6, lr}
	b	bgmac_mac_speed
.L8:
	ldr	r3, .L9+16
	ldr	r5, [r3]
	mov	r1, r5
	bl	bgmac_idm_read
	mov	r2, r0
	ldr	r3, .L9+20
	mov	r1, r5
	ldr	r3, [r3]
	mov	r0, r4
	orr	r2, r2, r3
	orr	r2, r2, #64
	bl	bgmac_idm_write
	b	.L3
.L2:
	ldr	r3, .L9+24
	ldr	r1, [r3]
	bl	bgmac_read
	ldr	r2, .L9+28
	ldr	r3, .L9+32
	ldr	r2, [r2]
	ldr	r3, [r3]
	and	r0, r0, r2
	asr	r0, r0, r3
	cmp	r0, #1
	pophi	{r4, r5, r6, pc}
	ldr	r2, .L9+36
	b	.L6
.L10:
	.align	2
.L9:
	.word	BGMAC_FEAT_FORCE_SPEED_2500
	.word	BGMAC_FEAT_IDM_MASK
	.word	SPEED_2500
	.word	DUPLEX_FULL
	.word	BCMA_IOCTL
	.word	BGMAC_BCMA_IOCTL_SW_CLKEN
	.word	BGMAC_DEV_STATUS
	.word	BGMAC_DS_MM_MASK
	.word	BGMAC_DS_MM_SHIFT
	.word	SPEED_100
	.size	bgmac_miiconfig, .-bgmac_miiconfig
	.comm	SPEED_2500,4,4
	.comm	SPEED_100,4,4
	.comm	DUPLEX_FULL,4,4
	.comm	BGMAC_FEAT_IDM_MASK,4,4
	.comm	BGMAC_FEAT_FORCE_SPEED_2500,4,4
	.comm	BGMAC_DS_MM_SHIFT,4,4
	.comm	BGMAC_DS_MM_MASK,4,4
	.comm	BGMAC_DEV_STATUS,4,4
	.comm	BGMAC_BCMA_IOCTL_SW_CLKEN,4,4
	.comm	BCMA_IOCTL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
