	.file	"extr_rtd520.c_rtd_counter_insn_config.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rtd_counter_insn_config, @function
rtd_counter_insn_config:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbp, QWORD PTR 8[rdi]
	mov	rbx, rcx
	mov	edi, DWORD PTR 4[rdx]
	call	CR_CHAN@PLT
	mov	esi, DWORD PTR [rbx]
	mov	edi, eax
	cmp	esi, 130
	je	.L2
	ja	.L3
	cmp	esi, 128
	je	.L4
	cmp	esi, 129
	jne	.L6
	cmp	edi, 2
	ja	.L6
	mov	eax, edi
	lea	rdx, CSWTCH.7[rip]
	mov	r14d, DWORD PTR 4[rbx]
	cmp	DWORD PTR [rdx+rax*4], r14d
	jnb	.L20
.L6:
	mov	eax, DWORD PTR EINVAL[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	neg	eax
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	cmp	esi, 131
	jne	.L6
	mov	rax, QWORD PTR 8[rbp]
	mov	eax, DWORD PTR [rax+rdi*4]
	test	eax, eax
	mov	DWORD PTR 4[rbx], eax
	mov	eax, 0
	cmove	eax, DWORD PTR RTD_CLOCK_BASE[rip]
	mov	DWORD PTR 8[rbx], eax
.L11:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, DWORD PTR [r12]
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rdx, QWORD PTR 0[rbp]
	mov	eax, DWORD PTR [rdx+rdi*4]
	mov	DWORD PTR 8[rbx], eax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L4:
	xor	eax, eax
	test	edi, edi
	mov	r14d, DWORD PTR 8[rbx]
	setne	al
	add	eax, 3
	cmp	eax, r14d
	jb	.L6
	mov	rax, QWORD PTR 0[rbp]
	mov	edx, edi
	mov	rbx, QWORD PTR 0[r13]
	mov	DWORD PTR [rax+rdx*4], r14d
	call	LAS0_8254_GATE_SEL@PLT
	mov	edi, r14d
	lea	rsi, [rbx+rax]
	call	writeb@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L20:
	mov	rdx, QWORD PTR 8[rbp]
	mov	rbx, QWORD PTR 0[r13]
	mov	DWORD PTR [rdx+rax*4], r14d
	call	LAS0_8254_CLK_SEL@PLT
	mov	edi, r14d
	lea	rsi, [rbx+rax]
	call	writeb@PLT
	jmp	.L11
	.cfi_endproc
.LFE0:
	.size	rtd_counter_insn_config, .-rtd_counter_insn_config
	.section	.rodata
	.align 8
	.type	CSWTCH.7, @object
	.size	CSWTCH.7, 12
CSWTCH.7:
	.long	3
	.long	5
	.long	4
	.comm	RTD_CLOCK_BASE,4,4
	.comm	EINVAL,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_rtd520.c_rtd_counter_insn_config.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rtd_counter_insn_config, %function
rtd_counter_insn_config:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r0
	mov	r4, r3
	ldr	r0, [r2, #4]
	mov	r6, r2
	ldr	r7, [r5, #4]
	bl	CR_CHAN
	ldr	r1, [r4]
	sub	r1, r1, #128
	cmp	r1, #3
	ldrls	pc, [pc, r1, asl #2]
	b	.L2
.L4:
	.word	.L7
	.word	.L6
	.word	.L5
	.word	.L3
.L6:
	cmp	r0, #2
	bhi	.L2
	ldr	r3, .L21
	ldr	r4, [r4, #4]
	ldr	r3, [r3, r0, lsl #2]
	cmp	r3, r4
	bcs	.L20
.L2:
	ldr	r3, .L21+4
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L3:
	ldr	r3, [r7, #4]
	ldr	r3, [r3, r0, lsl #2]
	cmp	r3, #0
	str	r3, [r4, #4]
	movne	r3, #0
	ldreq	r3, .L21+8
	ldreq	r3, [r3]
	str	r3, [r4, #8]
.L11:
	ldr	r0, [r6]
	pop	{r4, r5, r6, r7, r8, pc}
.L7:
	cmp	r0, #0
	moveq	r3, #3
	movne	r3, #4
	ldr	r4, [r4, #8]
	cmp	r3, r4
	bcc	.L2
	ldr	r3, [r7]
	ldr	r5, [r5]
	str	r4, [r3, r0, lsl #2]
	bl	LAS0_8254_GATE_SEL
	mov	r1, r0
	mov	r0, r4
	add	r1, r5, r1
	bl	writeb
	b	.L11
.L5:
	ldr	r3, [r7]
	ldr	r3, [r3, r0, lsl #2]
	str	r3, [r4, #8]
	ldr	r0, [r6]
	pop	{r4, r5, r6, r7, r8, pc}
.L20:
	ldr	r3, [r7, #4]
	ldr	r5, [r5]
	str	r4, [r3, r0, lsl #2]
	bl	LAS0_8254_CLK_SEL
	mov	r1, r0
	mov	r0, r4
	add	r1, r5, r1
	bl	writeb
	b	.L11
.L22:
	.align	2
.L21:
	.word	.LANCHOR0
	.word	EINVAL
	.word	RTD_CLOCK_BASE
	.size	rtd_counter_insn_config, .-rtd_counter_insn_config
	.comm	RTD_CLOCK_BASE,4,4
	.comm	EINVAL,4,4
	.section	.rodata
	.align	2
	.set	.LANCHOR0,. + 0
	.type	CSWTCH.7, %object
	.size	CSWTCH.7, 12
CSWTCH.7:
	.word	3
	.word	5
	.word	4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
