	.file	"extr_ldc.c_read_raw.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	read_raw, @function
read_raw:
.LFB0:
	.cfi_startproc
	endbr64
	cmp	DWORD PTR LDC_PACKET_SIZE[rip], edx
	jbe	.L2
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	lea	rcx, 8[rdi]
	lea	rdx, 4[rdi]
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	mov	rsi, rbp
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	edi, DWORD PTR 24[rdi]
	call	sun4v_ldc_rx_get_state@PLT
	test	rax, rax
	jne	.L14
	mov	rax, QWORD PTR 8[rbp]
	cmp	rax, QWORD PTR LDC_CHANNEL_DOWN[rip]
	je	.L12
	cmp	rax, QWORD PTR LDC_CHANNEL_RESETTING[rip]
	je	.L12
	mov	edx, DWORD PTR 0[rbp]
	xor	eax, eax
	cmp	edx, DWORD PTR 4[rbp]
	je	.L1
	mov	r8d, DWORD PTR LDC_PACKET_SIZE[rip]
	mov	eax, edx
	xor	edx, edx
	mov	rdi, r12
	div	r8d
	mov	rdx, QWORD PTR 16[rbp]
	lea	rsi, [rdx+rax*4]
	mov	edx, r8d
	call	memcpy@PLT
	mov	esi, DWORD PTR 0[rbp]
	mov	rdi, rbp
	call	rx_advance@PLT
	mov	rdi, rbp
	mov	DWORD PTR 0[rbp], eax
	mov	rsi, rax
	call	__set_rx_head@PLT
	mov	r8d, eax
	mov	eax, DWORD PTR LDC_PACKET_SIZE[rip]
	test	r8d, r8d
	js	.L12
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	eax, DWORD PTR ECONNRESET[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	add	rsp, 8
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	pop	rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_restore 12
	.cfi_def_cfa_offset 8
	jmp	LDC_ABORT@PLT
	.cfi_endproc
.LFE0:
	.size	read_raw, .-read_raw
	.comm	LDC_PACKET_SIZE,4,4
	.comm	LDC_CHANNEL_RESETTING,8,8
	.comm	LDC_CHANNEL_DOWN,8,8
	.comm	EINVAL,4,4
	.comm	ECONNRESET,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_read_raw.c"
	.text
	.global	__aeabi_uidiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_raw, %function
read_raw:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r6, .L13
	ldr	r3, [r6]
	cmp	r3, r2
	bls	.L2
	ldr	r3, .L13+4
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	add	r3, r0, #8
	add	r2, r0, #4
	mov	r4, r0
	mov	r5, r1
	mov	r1, r0
	ldr	r0, [r0, #16]
	bl	sun4v_ldc_rx_get_state
	subs	r3, r0, #0
	bne	.L12
	ldr	r1, .L13+8
	ldr	r2, [r4, #8]
	ldr	r1, [r1]
	cmp	r2, r1
	beq	.L10
	ldr	r1, .L13+12
	ldr	r1, [r1]
	cmp	r2, r1
	beq	.L10
	ldm	r4, {r0, r2}
	cmp	r0, r2
	beq	.L8
	ldr	r7, [r6]
	mov	r1, r7
	bl	__aeabi_uidiv
	mov	r1, r0
	ldr	r3, [r4, #12]
	mov	r2, r7
	add	r1, r3, r1, lsl #2
	mov	r0, r5
	bl	memcpy
	ldr	r1, [r4]
	mov	r0, r4
	bl	rx_advance
	mov	r1, r0
	mov	r0, r4
	str	r1, [r4]
	bl	__set_rx_head
	cmp	r0, #0
	blt	.L10
	ldr	r0, [r6]
	pop	{r4, r5, r6, r7, r8, pc}
.L10:
	ldr	r3, .L13+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L8:
	mov	r0, r3
	pop	{r4, r5, r6, r7, r8, pc}
.L12:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	b	LDC_ABORT
.L14:
	.align	2
.L13:
	.word	LDC_PACKET_SIZE
	.word	EINVAL
	.word	LDC_CHANNEL_DOWN
	.word	LDC_CHANNEL_RESETTING
	.word	ECONNRESET
	.size	read_raw, .-read_raw
	.comm	LDC_PACKET_SIZE,4,4
	.comm	LDC_CHANNEL_RESETTING,4,4
	.comm	LDC_CHANNEL_DOWN,4,4
	.comm	EINVAL,4,4
	.comm	ECONNRESET,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
