	.file	"extr_driverscan.h_can_rx.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	can_rx
	.type	can_rx, @function
can_rx:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, edi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	call	CANIF_FROM_CAN_NUM@PLT
	mov	edi, ebp
	mov	r15, rax
	call	BUS_NUM_FROM_CAN_NUM@PLT
	mov	r13d, eax
	mov	eax, DWORD PTR CAN_RF0R_FMP0[rip]
	test	DWORD PTR [r15], eax
	je	.L1
	mov	r12d, r13d
	movsx	rbp, r13d
	lea	r14, 16[rsp]
	mov	rbx, rsp
	sal	r12d, 4
	sal	rbp, 2
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	mov	DWORD PTR 28[rsp], edi
	or	ecx, 1
	mov	rdi, r14
	mov	DWORD PTR 16[rsp], ecx
	mov	DWORD PTR 20[rsp], edx
	mov	DWORD PTR 24[rsp], eax
	call	can_send@PLT
.L4:
	mov	rdi, rbx
	call	safety_rx_hook@PLT
	mov	rdi, rbx
	call	ignition_can_hook@PLT
	mov	edi, DWORD PTR LED_BLUE[rip]
	mov	esi, 1
	mov	rax, QWORD PTR current_board[rip]
	call	[QWORD PTR [rax]]
	mov	rsi, rbx
	lea	rdi, can_rx_q[rip]
	call	can_push@PLT
	test	rax, rax
	sete	al
	movzx	eax, al
	add	DWORD PTR can_send_errs[rip], eax
	mov	eax, DWORD PTR [r15]
	or	eax, DWORD PTR CAN_RF0R_RFOM0[rip]
	mov	DWORD PTR [r15], eax
	test	DWORD PTR CAN_RF0R_FMP0[rip], eax
	je	.L1
.L5:
	mov	rax, QWORD PTR 8[r15]
	mov	rsi, QWORD PTR can_forwarding[rip]
	mov	DWORD PTR pending_can_live[rip], 1
	add	DWORD PTR can_rx_cnt[rip], 1
	mov	edx, DWORD PTR 4[rax]
	mov	ecx, DWORD PTR [rax]
	mov	edi, DWORD PTR 12[rax]
	mov	eax, DWORD PTR 8[rax]
	and	edx, -65521
	mov	DWORD PTR [rsp], ecx
	or	edx, r12d
	mov	DWORD PTR 12[rsp], edi
	mov	DWORD PTR 8[rsp], eax
	mov	DWORD PTR 4[rsp], edx
	mov	esi, DWORD PTR [rsi+rbp]
	cmp	esi, -1
	jne	.L3
	mov	rsi, rbx
	mov	edi, r13d
	call	safety_fwd_hook@PLT
	mov	esi, eax
	cmp	eax, -1
	je	.L4
	mov	ecx, DWORD PTR [rsp]
	mov	edx, DWORD PTR 4[rsp]
	mov	edi, DWORD PTR 12[rsp]
	mov	eax, DWORD PTR 8[rsp]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L14
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	can_rx, .-can_rx
	.comm	pending_can_live,4,4
	.comm	current_board,8,8
	.comm	can_send_errs,4,4
	.comm	can_rx_q,4,4
	.comm	can_rx_cnt,4,4
	.comm	can_forwarding,8,8
	.comm	LED_BLUE,4,4
	.comm	CAN_RF0R_RFOM0,4,4
	.comm	CAN_RF0R_FMP0,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_driverscan.h_can_rx.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	can_rx
	.syntax unified
	.arm
	.fpu softvfp
	.type	can_rx, %function
can_rx:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L15
	sub	sp, sp, #60
	ldr	r3, [r3]
	str	r3, [sp, #52]
	mov	r3,#0
	mov	r4, r0
	bl	CANIF_FROM_CAN_NUM
	mov	fp, r0
	mov	r0, r4
	bl	BUS_NUM_FROM_CAN_NUM
	ldr	r6, .L15+4
	ldr	r3, [fp]
	ldr	r2, [r6]
	str	r0, [sp, #12]
	tst	r2, r3
	beq	.L1
	lsl	r2, r0, #4
	lsl	r3, r0, #2
	ldr	r5, .L15+8
	ldr	r10, .L15+12
	ldr	r9, .L15+16
	ldr	r4, .L15+20
	ldr	r8, .L15+24
	str	r2, [sp, #4]
	str	r3, [sp, #8]
	b	.L5
.L3:
	orr	r2, r0, #1
	add	r0, sp, #36
	str	r2, [sp, #36]
	str	r3, [sp, #40]
	str	lr, [sp, #48]
	str	ip, [sp, #44]
	bl	can_send
.L4:
	add	r0, sp, #20
	bl	safety_rx_hook
	add	r0, sp, #20
	bl	ignition_can_hook
	ldr	r2, .L15+28
	ldr	r3, [r9]
	ldr	r0, [r2]
	ldr	r3, [r3]
	mov	r1, #1
	blx	r3
	add	r1, sp, #20
	ldr	r0, .L15+32
	bl	can_push
	ldr	r2, [r4]
	ldr	r3, [fp]
	cmp	r0, #0
	addeq	r2, r2, #1
	ldr	r0, [r8]
	ldr	r1, [r6]
	orr	r3, r3, r0
	tst	r3, r1
	str	r2, [r4]
	str	r3, [fp]
	beq	.L1
.L5:
	mov	r7, #1
	ldr	r1, [fp, #4]
	ldr	r2, [r5]
	ldm	r1, {r0, r3}
	ldr	ip, [r1, #8]
	ldr	lr, [r1, #12]
	bic	r3, r3, #65280
	ldr	r1, [sp, #4]
	bic	r3, r3, #240
	orr	r3, r3, r1
	ldr	r1, [r10]
	add	r2, r2, #1
	str	r1, [sp]
	ldr	r1, .L15+36
	str	r2, [r5]
	str	r7, [r1]
	ldr	r2, [sp, #8]
	ldr	r1, [sp]
	str	r3, [sp, #24]
	str	r0, [sp, #20]
	str	lr, [sp, #32]
	str	ip, [sp, #28]
	ldr	r1, [r1, r2]
	cmn	r1, #1
	bne	.L3
	add	r1, sp, #20
	ldr	r0, [sp, #12]
	bl	safety_fwd_hook
	cmn	r0, #1
	mov	r1, r0
	beq	.L4
	add	r0, sp, #20
	ldm	r0, {r0, r3, ip, lr}
	b	.L3
.L1:
	ldr	r3, .L15
	ldr	r2, [r3]
	ldr	r3, [sp, #52]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L14
	add	sp, sp, #60
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L14:
	bl	__stack_chk_fail
.L16:
	.align	2
.L15:
	.word	.LC0
	.word	CAN_RF0R_FMP0
	.word	can_rx_cnt
	.word	can_forwarding
	.word	current_board
	.word	can_send_errs
	.word	CAN_RF0R_RFOM0
	.word	LED_BLUE
	.word	can_rx_q
	.word	pending_can_live
	.size	can_rx, .-can_rx
	.comm	pending_can_live,4,4
	.comm	current_board,4,4
	.comm	can_send_errs,4,4
	.comm	can_rx_q,4,4
	.comm	can_rx_cnt,4,4
	.comm	can_forwarding,4,4
	.comm	LED_BLUE,4,4
	.comm	CAN_RF0R_RFOM0,4,4
	.comm	CAN_RF0R_FMP0,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
