	.file	"extr_ldc.c_ldc_rx.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"RX state[0x%02lx:0x%02lx] head[0x%04lx] tail[0x%04lx]\n"
	.text
	.p2align 4
	.type	ldc_rx, @function
ldc_rx:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	lea	r13, 40[rsi]
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	rdi, r13
	xor	r12d, r12d
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rsi
	xor	esi, esi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	spin_lock_irqsave@PLT
	mov	edi, DWORD PTR 64[rbp]
	mov	rbx, QWORD PTR 0[rbp]
	lea	rdx, 16[rbp]
	lea	rsi, 8[rbp]
	mov	rcx, rbp
	call	sun4v_ldc_rx_get_state@PLT
	mov	r9, QWORD PTR 16[rbp]
	mov	r8d, DWORD PTR 8[rbp]
	mov	rdx, rbx
	mov	rcx, QWORD PTR 0[rbp]
	mov	edi, DWORD PTR RX[rip]
	lea	rsi, .LC0[rip]
	call	ldcdbg@PLT
	mov	rax, QWORD PTR LDC_MODE_RAW[rip]
	cmp	QWORD PTR 56[rbp], rax
	je	.L26
.L2:
	mov	eax, DWORD PTR 32[rbp]
	test	DWORD PTR LDC_FLAG_RESET[rip], eax
	jne	.L27
	mov	rax, QWORD PTR 0[rbp]
	mov	rdx, QWORD PTR LDC_HS_COMPLETE[rip]
	cmp	QWORD PTR 24[rbp], rdx
	je	.L6
	cmp	rbx, rax
	je	.L9
.L4:
	mov	rdi, r13
	xor	esi, esi
	call	spin_unlock_irqrestore@PLT
	mov	esi, r12d
	mov	rdi, rbp
	call	send_events@PLT
	mov	eax, DWORD PTR IRQ_HANDLED[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
.L31:
	.cfi_restore_state
	cmp	eax, 128
	je	.L28
	mov	rdi, rbp
	call	ldc_abort@PLT
.L14:
	test	eax, eax
	js	.L4
	mov	ecx, DWORD PTR LDC_PACKET_SIZE[rip]
	movsx	rdi, DWORD PTR 8[rbp]
.L15:
	movsx	rsi, ecx
	imul	ecx, DWORD PTR 36[rbp]
	add	rsi, rdi
	mov	eax, esi
	movsx	rcx, ecx
	cmp	rcx, rsi
	jne	.L16
	xor	eax, eax
	xor	esi, esi
.L16:
	mov	DWORD PTR 8[rbp], eax
	mov	rdi, rbp
	call	__set_rx_head@PLT
	test	eax, eax
	js	.L29
	mov	rax, QWORD PTR LDC_HS_COMPLETE[rip]
	cmp	QWORD PTR 24[rbp], rax
	je	.L30
.L9:
	movsx	rdi, DWORD PTR 8[rbp]
	mov	rax, rdi
	cmp	rdi, QWORD PTR 16[rbp]
	je	.L4
	mov	ecx, DWORD PTR LDC_PACKET_SIZE[rip]
	cdq
	idiv	ecx
	mov	rdx, QWORD PTR 48[rbp]
	cdqe
	lea	rsi, [rdx+rax*4]
	mov	eax, DWORD PTR [rsi]
	cmp	eax, 129
	je	.L10
	cmp	eax, 130
	jne	.L31
	mov	rdi, rbp
	call	process_control_frame@PLT
	test	eax, eax
	jle	.L14
	mov	ecx, DWORD PTR LDC_PACKET_SIZE[rip]
	movsx	rdi, DWORD PTR 8[rbp]
	or	r12d, eax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L28:
	mov	rdi, rbp
	call	process_error_frame@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L10:
	or	r12d, DWORD PTR LDC_EVENT_DATA_READY[rip]
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L26:
	mov	rax, QWORD PTR LDC_CHANNEL_UP[rip]
	cmp	QWORD PTR 0[rbp], rax
	jne	.L2
	mov	rax, QWORD PTR LDC_HS_COMPLETE[rip]
	mov	esi, DWORD PTR LDC_STATE_CONNECTED[rip]
	mov	rdi, rbp
	mov	QWORD PTR 24[rbp], rax
	call	ldc_set_state@PLT
	mov	r12d, DWORD PTR LDC_EVENT_UP[rip]
	mov	rbx, QWORD PTR 0[rbp]
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L30:
	mov	rax, QWORD PTR 0[rbp]
.L6:
	cmp	rbx, rax
	je	.L7
	cmp	QWORD PTR LDC_CHANNEL_UP[rip], rax
	mov	edx, DWORD PTR LDC_EVENT_RESET[rip]
	jne	.L8
	mov	edx, DWORD PTR LDC_EVENT_UP[rip]
.L8:
	or	r12d, edx
.L7:
	movsx	rax, DWORD PTR 8[rbp]
	cmp	rax, QWORD PTR 16[rbp]
	je	.L4
	or	r12d, DWORD PTR LDC_EVENT_DATA_READY[rip]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L27:
	mov	rsi, QWORD PTR 16[rbp]
	mov	rdi, rbp
	call	__set_rx_head@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L29:
	mov	rdi, rbp
	call	ldc_abort@PLT
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	ldc_rx, .-ldc_rx
	.comm	RX,4,4
	.comm	LDC_STATE_CONNECTED,4,4
	.comm	LDC_PACKET_SIZE,4,4
	.comm	LDC_MODE_RAW,8,8
	.comm	LDC_HS_COMPLETE,8,8
	.comm	LDC_FLAG_RESET,4,4
	.comm	LDC_EVENT_UP,4,4
	.comm	LDC_EVENT_RESET,4,4
	.comm	LDC_EVENT_DATA_READY,4,4
	.comm	LDC_CHANNEL_UP,8,8
	.comm	IRQ_HANDLED,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_ldc.c_ldc_rx.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"RX state[0x%02lx:0x%02lx] head[0x%04lx] tail[0x%04l"
	.ascii	"x]\012\000"
	.global	__aeabi_idiv
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ldc_rx, %function
ldc_rx:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r1
	add	r9, r1, #24
	sub	sp, sp, #12
	mov	r1, #0
	mov	r0, r9
	bl	spin_lock_irqsave
	mov	r2, r4
	mov	r3, r4
	ldr	r10, [r2], #8
	add	r1, r4, #4
	ldr	r0, [r4, #36]
	bl	sun4v_ldc_rx_get_state
	ldr	r0, [r4, #8]
	ldr	r3, [r4, #4]
	ldr	r1, .L32
	str	r0, [sp, #4]
	str	r3, [sp]
	mov	r2, r10
	ldr	r3, [r4]
	ldr	r0, [r1]
	ldr	r1, .L32+4
	bl	ldcdbg
	ldr	r3, .L32+8
	ldr	r2, [r4, #32]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L26
.L20:
	mov	r7, #0
.L2:
	ldr	r3, .L32+12
	ldr	r2, [r4, #16]
	ldr	r3, [r3]
	tst	r2, r3
	bne	.L27
	ldr	r8, .L32+16
	ldr	r1, [r4, #12]
	ldr	r2, [r8]
	ldr	r3, [r4]
	cmp	r1, r2
	beq	.L6
	cmp	r10, r3
	bne	.L4
	ldr	r6, .L32+20
	b	.L9
.L31:
	cmp	r2, #128
	beq	.L28
	mov	r0, r4
	bl	ldc_abort
.L14:
	cmp	r0, #0
	blt	.L4
	ldr	fp, [r6]
	ldr	r5, [r4, #4]
.L15:
	ldr	r2, [r4, #20]
	add	r1, fp, r5
	mul	r3, r2, fp
	cmp	r3, r1
	moveq	r3, #0
	movne	r3, r1
	moveq	r1, r3
	mov	r0, r4
	str	r3, [r4, #4]
	bl	__set_rx_head
	cmp	r0, #0
	blt	.L29
	ldr	r2, [r4, #12]
	ldr	r3, [r8]
	cmp	r2, r3
	beq	.L30
.L9:
	ldr	r5, [r4, #4]
	ldr	r3, [r4, #8]
	cmp	r5, r3
	beq	.L4
	ldr	fp, [r6]
	mov	r0, r5
	mov	r1, fp
	bl	__aeabi_idiv
	ldr	r1, [r4, #28]
	ldr	r2, [r1, r0, lsl #2]
	add	r1, r1, r0, lsl #2
	cmp	r2, #129
	beq	.L10
	cmp	r2, #130
	bne	.L31
	mov	r0, r4
	bl	process_control_frame
	cmp	r0, #0
	ble	.L14
	ldr	fp, [r6]
	ldr	r5, [r4, #4]
	orr	r7, r7, r0
	b	.L15
.L27:
	mov	r0, r4
	ldr	r1, [r4, #8]
	bl	__set_rx_head
.L4:
	mov	r0, r9
	mov	r1, #0
	bl	spin_unlock_irqrestore
	mov	r1, r7
	mov	r0, r4
	bl	send_events
	ldr	r3, .L32+24
	ldr	r0, [r3]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L10:
	ldr	r3, .L32+28
	ldr	r2, [r3]
	orr	r7, r7, r2
	b	.L15
.L28:
	mov	r0, r4
	bl	process_error_frame
	b	.L14
.L26:
	ldr	r3, .L32+32
	ldr	r2, [r4]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L20
	ldr	r3, .L32+16
	ldr	r2, .L32+36
	ldr	r3, [r3]
	mov	r0, r4
	str	r3, [r4, #12]
	ldr	r1, [r2]
	bl	ldc_set_state
	ldr	r3, .L32+40
	ldr	r10, [r4]
	ldr	r7, [r3]
	b	.L2
.L30:
	ldr	r3, [r4]
.L6:
	cmp	r10, r3
	beq	.L7
	ldr	r1, .L32+32
	ldr	r2, .L32+44
	ldr	r1, [r1]
	ldr	r2, [r2]
	cmp	r1, r3
	ldreq	r3, .L32+40
	ldreq	r2, [r3]
	orr	r7, r7, r2
.L7:
	ldmib	r4, {r2, r3}
	cmp	r2, r3
	ldrne	r3, .L32+28
	ldrne	r3, [r3]
	orrne	r7, r7, r3
	b	.L4
.L29:
	mov	r0, r4
	bl	ldc_abort
	b	.L4
.L33:
	.align	2
.L32:
	.word	RX
	.word	.LC0
	.word	LDC_MODE_RAW
	.word	LDC_FLAG_RESET
	.word	LDC_HS_COMPLETE
	.word	LDC_PACKET_SIZE
	.word	IRQ_HANDLED
	.word	LDC_EVENT_DATA_READY
	.word	LDC_CHANNEL_UP
	.word	LDC_STATE_CONNECTED
	.word	LDC_EVENT_UP
	.word	LDC_EVENT_RESET
	.size	ldc_rx, .-ldc_rx
	.comm	RX,4,4
	.comm	LDC_STATE_CONNECTED,4,4
	.comm	LDC_PACKET_SIZE,4,4
	.comm	LDC_MODE_RAW,4,4
	.comm	LDC_HS_COMPLETE,4,4
	.comm	LDC_FLAG_RESET,4,4
	.comm	LDC_EVENT_UP,4,4
	.comm	LDC_EVENT_RESET,4,4
	.comm	LDC_EVENT_DATA_READY,4,4
	.comm	LDC_CHANNEL_UP,4,4
	.comm	IRQ_HANDLED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
