	.file	"extr_rtsx_chip.c_rtsx_read_register.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	rtsx_read_register
	.type	rtsx_read_register, @function
rtsx_read_register:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	test	rdx, rdx
	je	.L2
	mov	QWORD PTR [rdx], 0
.L2:
	mov	edx, esi
	mov	esi, DWORD PTR RTSX_HAIMR[rip]
	mov	rdi, r13
	sal	edx, 16
	and	edx, 1073676288
	or	edx, -2147483648
	call	rtsx_writel@PLT
	mov	eax, DWORD PTR MAX_RW_REG_CNT[rip]
	test	eax, eax
	jle	.L6
	xor	ebp, ebp
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L18:
	add	ebp, 1
	cmp	DWORD PTR MAX_RW_REG_CNT[rip], ebp
	jle	.L6
.L5:
	mov	esi, DWORD PTR RTSX_HAIMR[rip]
	mov	rdi, r13
	call	rtsx_readl@PLT
	mov	edi, 31
	mov	ebx, eax
	call	BIT@PLT
	test	eax, ebx
	jne	.L18
	cmp	DWORD PTR MAX_RW_REG_CNT[rip], ebp
	jle	.L6
	test	r12, r12
	je	.L7
	movzx	ebx, bl
	mov	QWORD PTR [r12], rbx
.L7:
	mov	eax, DWORD PTR STATUS_SUCCESS[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	mov	eax, DWORD PTR STATUS_TIMEDOUT[rip]
	add	rsp, 8
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	rtsx_read_register, .-rtsx_read_register
	.comm	STATUS_TIMEDOUT,4,4
	.comm	STATUS_SUCCESS,4,4
	.comm	RTSX_HAIMR,4,4
	.comm	MAX_RW_REG_CNT,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_chip.c_rtsx_read_register.c"
	.text
	.align	2
	.global	rtsx_read_register
	.syntax unified
	.arm
	.fpu softvfp
	.type	rtsx_read_register, %function
rtsx_read_register:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	subs	r7, r2, #0
	movne	r3, #0
	ldr	r2, .L19
	ldr	r8, .L19+4
	and	r2, r2, r1, lsl #16
	ldr	r9, .L19+8
	strne	r3, [r7]
	ldr	r1, [r8]
	orr	r2, r2, #-2147483648
	mov	r6, r0
	bl	rtsx_writel
	ldr	r3, [r9]
	cmp	r3, #0
	ble	.L6
	mov	r5, #0
	b	.L5
.L18:
	add	r5, r5, #1
	cmp	r3, r5
	ble	.L6
.L5:
	ldr	r1, [r8]
	mov	r0, r6
	bl	rtsx_readl
	mov	r4, r0
	mov	r0, #31
	bl	BIT
	tst	r0, r4
	ldr	r3, [r9]
	bne	.L18
	cmp	r3, r5
	ble	.L6
	cmp	r7, #0
	ldr	r3, .L19+12
	andne	r4, r4, #255
	ldr	r0, [r3]
	strne	r4, [r7]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L6:
	ldr	r3, .L19+16
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L20:
	.align	2
.L19:
	.word	1073676288
	.word	RTSX_HAIMR
	.word	MAX_RW_REG_CNT
	.word	STATUS_SUCCESS
	.word	STATUS_TIMEDOUT
	.size	rtsx_read_register, .-rtsx_read_register
	.comm	STATUS_TIMEDOUT,4,4
	.comm	STATUS_SUCCESS,4,4
	.comm	RTSX_HAIMR,4,4
	.comm	MAX_RW_REG_CNT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
