	.file	"extr_rtsx_pcr.c___rtsx_pci_write_phy_register.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	__rtsx_pci_write_phy_register
	.type	__rtsx_pci_write_phy_register, @function
__rtsx_pci_write_phy_register:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	ebx, edx
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	rtsx_pci_init_cmd@PLT
	mov	r8d, ebx
	mov	ecx, 255
	mov	rdi, rbp
	mov	edx, DWORD PTR PHYDATA0[rip]
	mov	esi, DWORD PTR WRITE_REG_CMD[rip]
	sar	ebx, 8
	call	rtsx_pci_add_cmd@PLT
	mov	r8d, ebx
	mov	ecx, 255
	mov	rdi, rbp
	mov	edx, DWORD PTR PHYDATA1[rip]
	mov	esi, DWORD PTR WRITE_REG_CMD[rip]
	call	rtsx_pci_add_cmd@PLT
	mov	r8d, r12d
	mov	ecx, 255
	mov	rdi, rbp
	mov	edx, DWORD PTR PHYADDR[rip]
	mov	esi, DWORD PTR WRITE_REG_CMD[rip]
	call	rtsx_pci_add_cmd@PLT
	mov	esi, DWORD PTR WRITE_REG_CMD[rip]
	mov	rdi, rbp
	mov	edx, DWORD PTR PHYRWCTL[rip]
	mov	r8d, 129
	mov	ecx, 255
	call	rtsx_pci_add_cmd@PLT
	mov	esi, 100
	mov	rdi, rbp
	call	rtsx_pci_send_cmd@PLT
	test	eax, eax
	js	.L1
	mov	ebx, 100000
	lea	r12, 4[rsp]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L13:
	mov	eax, DWORD PTR 4[rsp]
	and	eax, 128
	je	.L1
	sub	ebx, 1
	je	.L12
.L3:
	mov	esi, DWORD PTR PHYRWCTL[rip]
	mov	rdx, r12
	mov	rdi, rbp
	call	rtsx_pci_read_register@PLT
	test	eax, eax
	jns	.L13
.L1:
	mov	rcx, QWORD PTR 8[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L14
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	mov	eax, DWORD PTR ETIMEDOUT[rip]
	neg	eax
	jmp	.L1
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	__rtsx_pci_write_phy_register, .-__rtsx_pci_write_phy_register
	.comm	WRITE_REG_CMD,4,4
	.comm	PHYRWCTL,4,4
	.comm	PHYDATA1,4,4
	.comm	PHYDATA0,4,4
	.comm	PHYADDR,4,4
	.comm	ETIMEDOUT,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_rtsx_pcr.c___rtsx_pci_write_phy_register.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	__rtsx_pci_write_phy_register
	.syntax unified
	.arm
	.fpu softvfp
	.type	__rtsx_pci_write_phy_register, %function
__rtsx_pci_write_phy_register:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	mov	r4, r2
	mov	r5, r0
	mov	r6, r1
	ldr	r3, .L15
	sub	sp, sp, #20
	ldr	r7, .L15+4
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bl	rtsx_pci_init_cmd
	ldr	r3, .L15+8
	str	r4, [sp]
	ldr	r2, [r3]
	ldr	r1, [r7]
	mov	r3, #255
	mov	r0, r5
	bl	rtsx_pci_add_cmd
	asr	r4, r4, #8
	ldr	r3, .L15+12
	str	r4, [sp]
	ldr	r2, [r3]
	ldr	r1, [r7]
	mov	r3, #255
	mov	r0, r5
	bl	rtsx_pci_add_cmd
	ldr	r3, .L15+16
	str	r6, [sp]
	ldr	r2, [r3]
	ldr	r1, [r7]
	mov	r3, #255
	mov	r0, r5
	bl	rtsx_pci_add_cmd
	mov	r3, #129
	ldr	r6, .L15+20
	str	r3, [sp]
	ldr	r1, [r7]
	mov	r3, #255
	ldr	r2, [r6]
	mov	r0, r5
	bl	rtsx_pci_add_cmd
	mov	r0, r5
	mov	r1, #100
	bl	rtsx_pci_send_cmd
	cmp	r0, #0
	blt	.L1
	ldr	r4, .L15+24
	b	.L3
.L13:
	ldr	r0, [sp, #8]
	ands	r0, r0, #128
	beq	.L1
	subs	r4, r4, #1
	beq	.L12
.L3:
	mov	r0, r5
	ldr	r1, [r6]
	add	r2, sp, #8
	bl	rtsx_pci_read_register
	cmp	r0, #0
	bge	.L13
.L1:
	ldr	r3, .L15
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L14
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L12:
	ldr	r3, .L15+28
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L14:
	bl	__stack_chk_fail
.L16:
	.align	2
.L15:
	.word	.LC0
	.word	WRITE_REG_CMD
	.word	PHYDATA0
	.word	PHYDATA1
	.word	PHYADDR
	.word	PHYRWCTL
	.word	100000
	.word	ETIMEDOUT
	.size	__rtsx_pci_write_phy_register, .-__rtsx_pci_write_phy_register
	.comm	WRITE_REG_CMD,4,4
	.comm	PHYRWCTL,4,4
	.comm	PHYDATA1,4,4
	.comm	PHYDATA0,4,4
	.comm	PHYADDR,4,4
	.comm	ETIMEDOUT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
