	.file	"extr_bcm.c_bcm_sendmsg.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	bcm_sendmsg, @function
bcm_sendmsg:
.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	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rcx
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	r13, QWORD PTR [rsi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	mov	rdi, r13
	call	bcm_sk@PLT
	mov	r12d, DWORD PTR ENOTCONN[rip]
	mov	edx, DWORD PTR 12[rax]
	neg	r12d
	test	edx, edx
	je	.L1
	mov	r8, QWORD PTR MHSIZ[rip]
	cmp	r8, rbx
	ja	.L4
	mov	r15, rax
	mov	rax, rbx
	xor	edx, edx
	sub	rax, r8
	div	QWORD PTR CFSIZ[rip]
	test	rdx, rdx
	jne	.L4
	mov	r14d, DWORD PTR [r15]
	test	r14d, r14d
	jne	.L6
	mov	rax, QWORD PTR 8[rbp]
	test	rax, rax
	je	.L6
	mov	rdi, QWORD PTR AF_CAN[rip]
	cmp	QWORD PTR [rax], rdi
	jne	.L4
	mov	r14d, DWORD PTR 8[rax]
	test	r14d, r14d
	je	.L6
	lea	rdi, init_net[rip]
	mov	esi, r14d
	call	dev_get_by_index@PLT
	mov	rdi, rax
	test	rax, rax
	je	.L32
	mov	rax, QWORD PTR ARPHRD_CAN[rip]
	cmp	QWORD PTR [rdi], rax
	je	.L8
	call	dev_put@PLT
.L32:
	mov	r12d, DWORD PTR ENODEV[rip]
	neg	r12d
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L34
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
	jmp	.L1
.L8:
	call	dev_put@PLT
	mov	r8, QWORD PTR MHSIZ[rip]
	.p2align 4,,10
	.p2align 3
.L6:
	lea	rax, 28[rsp]
	mov	esi, DWORD PTR 0[rbp]
	mov	rdx, r8
	mov	rdi, rax
	mov	QWORD PTR 8[rsp], rax
	call	memcpy_fromiovec@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L1
	mov	rdi, r13
	call	lock_sock@PLT
	mov	eax, DWORD PTR 28[rsp]
	add	eax, -128
	cmp	eax, 6
	ja	.L9
	lea	rdx, .L11[rip]
	movsx	rax, DWORD PTR [rdx+rax*4]
	add	rax, rdx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L11:
	.long	.L17-.L11
	.long	.L16-.L11
	.long	.L15-.L11
	.long	.L14-.L11
	.long	.L13-.L11
	.long	.L12-.L11
	.long	.L10-.L11
	.text
	.p2align 4,,10
	.p2align 3
.L12:
	mov	eax, DWORD PTR RX_STATUS[rip]
	mov	rsi, QWORD PTR 8[rsp]
	lea	rdi, 4[r15]
	mov	edx, r14d
	mov	DWORD PTR 28[rsp], eax
	call	bcm_read_op@PLT
	mov	r12d, eax
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rdi, r13
	call	release_sock@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rdi, QWORD PTR 8[rsp]
	mov	rcx, r13
	mov	edx, r14d
	mov	rsi, rbp
	call	bcm_rx_setup@PLT
	mov	r12d, eax
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L14:
	mov	esi, DWORD PTR 36[rsp]
	lea	rdi, 8[r15]
	mov	edx, r14d
	call	bcm_delete_tx_op@PLT
	test	eax, eax
	je	.L9
.L31:
	mov	r12d, DWORD PTR MHSIZ[rip]
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L15:
	mov	eax, DWORD PTR TX_STATUS[rip]
	mov	rsi, QWORD PTR 8[rsp]
	lea	rdi, 8[r15]
	mov	edx, r14d
	mov	DWORD PTR 28[rsp], eax
	call	bcm_read_op@PLT
	mov	r12d, eax
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L16:
	cmp	DWORD PTR 32[rsp], 1
	je	.L35
.L9:
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L17:
	mov	rdi, QWORD PTR 8[rsp]
	mov	rcx, r13
	mov	edx, r14d
	mov	rsi, rbp
	call	bcm_tx_setup@PLT
	mov	r12d, eax
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L10:
	mov	esi, DWORD PTR 36[rsp]
	lea	rdi, 4[r15]
	mov	edx, r14d
	call	bcm_delete_rx_op@PLT
	test	eax, eax
	je	.L9
	jmp	.L31
.L35:
	mov	rax, QWORD PTR MHSIZ[rip]
	add	rax, QWORD PTR CFSIZ[rip]
	cmp	rax, rbx
	jne	.L9
	mov	rdx, r13
	mov	esi, r14d
	mov	rdi, rbp
	call	bcm_tx_send@PLT
	mov	r12d, eax
	jmp	.L18
.L34:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	bcm_sendmsg, .-bcm_sendmsg
	.comm	init_net,4,4
	.comm	TX_STATUS,4,4
	.comm	RX_STATUS,4,4
	.comm	MHSIZ,8,8
	.comm	ENOTCONN,4,4
	.comm	ENODEV,4,4
	.comm	EINVAL,4,4
	.comm	CFSIZ,8,8
	.comm	ARPHRD_CAN,8,8
	.comm	AF_CAN,8,8
	.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_bcm.c_bcm_sendmsg.c"
	.text
	.global	__aeabi_uidivmod
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	bcm_sendmsg, %function
bcm_sendmsg:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r5, [r1]
	mov	r7, r3
	ldr	r3, .L36
	sub	sp, sp, #20
	mov	r0, r5
	mov	r8, r2
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bl	bcm_sk
	ldr	r1, [r0, #12]
	cmp	r1, #0
	beq	.L34
	ldr	r9, .L36+4
	ldr	r4, [r9]
	cmp	r4, r7
	bhi	.L4
	ldr	r10, .L36+8
	mov	r6, r0
	ldr	r1, [r10]
	sub	r0, r7, r4
	bl	__aeabi_uidivmod
	cmp	r1, #0
	bne	.L4
	ldr	fp, [r6]
	cmp	fp, #0
	bne	.L6
	ldr	fp, [r8, #4]
	cmp	fp, #0
	beq	.L6
	ldr	r3, .L36+12
	ldr	r2, [fp]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L4
	ldr	fp, [fp, #4]
	cmp	fp, #0
	beq	.L6
	mov	r1, fp
	ldr	r0, .L36+16
	bl	dev_get_by_index
	subs	r3, r0, #0
	beq	.L32
	ldr	r1, .L36+20
	ldr	r2, [r3]
	ldr	r3, [r1]
	cmp	r2, r3
	beq	.L8
	bl	dev_put
.L32:
	ldr	r3, .L36+24
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L1
.L4:
	ldr	r3, .L36+28
	ldr	r0, [r3]
	rsb	r4, r0, #0
.L1:
	ldr	r3, .L36
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L35
	mov	r0, r4
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L8:
	bl	dev_put
	ldr	r4, [r9]
.L6:
	mov	r2, r4
	mov	r0, sp
	ldr	r1, [r8]
	bl	memcpy_fromiovec
	subs	r4, r0, #0
	blt	.L1
	mov	r0, r5
	bl	lock_sock
	ldr	r3, [sp]
	sub	r3, r3, #128
	cmp	r3, #6
	ldrls	pc, [pc, r3, asl #2]
	b	.L9
.L11:
	.word	.L17
	.word	.L16
	.word	.L15
	.word	.L14
	.word	.L13
	.word	.L12
	.word	.L10
.L34:
	ldr	r3, .L36+32
	ldr	r0, [r3]
	rsb	r4, r0, #0
	b	.L1
.L10:
	mov	r2, fp
	ldr	r1, [sp, #8]
	add	r0, r6, #4
	bl	bcm_delete_rx_op
	cmp	r0, #0
	beq	.L9
.L31:
	ldr	r4, [r9]
.L18:
	mov	r0, r5
	bl	release_sock
	b	.L1
.L12:
	ldr	r3, .L36+36
	mov	r2, fp
	ldr	r3, [r3]
	mov	r1, sp
	add	r0, r6, #4
	str	r3, [sp]
	bl	bcm_read_op
	mov	r4, r0
	b	.L18
.L13:
	mov	r2, fp
	mov	r1, r8
	mov	r0, sp
	mov	r3, r5
	bl	bcm_rx_setup
	mov	r4, r0
	b	.L18
.L14:
	mov	r2, fp
	ldr	r1, [sp, #8]
	add	r0, r6, #8
	bl	bcm_delete_tx_op
	cmp	r0, #0
	bne	.L31
.L9:
	ldr	r3, .L36+28
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L18
.L15:
	ldr	r3, .L36+40
	mov	r2, fp
	ldr	r3, [r3]
	mov	r1, sp
	add	r0, r6, #8
	str	r3, [sp]
	bl	bcm_read_op
	mov	r4, r0
	b	.L18
.L17:
	mov	r2, fp
	mov	r1, r8
	mov	r0, sp
	mov	r3, r5
	bl	bcm_tx_setup
	mov	r4, r0
	b	.L18
.L16:
	ldr	r3, [sp, #4]
	cmp	r3, #1
	bne	.L9
	ldr	r3, [r10]
	ldr	r2, [r9]
	add	r3, r3, r2
	cmp	r3, r7
	bne	.L9
	mov	r1, fp
	mov	r0, r8
	mov	r2, r5
	bl	bcm_tx_send
	mov	r4, r0
	b	.L18
.L35:
	bl	__stack_chk_fail
.L37:
	.align	2
.L36:
	.word	.LC0
	.word	MHSIZ
	.word	CFSIZ
	.word	AF_CAN
	.word	init_net
	.word	ARPHRD_CAN
	.word	ENODEV
	.word	EINVAL
	.word	ENOTCONN
	.word	RX_STATUS
	.word	TX_STATUS
	.size	bcm_sendmsg, .-bcm_sendmsg
	.comm	init_net,4,4
	.comm	TX_STATUS,4,4
	.comm	RX_STATUS,4,4
	.comm	MHSIZ,4,4
	.comm	ENOTCONN,4,4
	.comm	ENODEV,4,4
	.comm	EINVAL,4,4
	.comm	CFSIZ,4,4
	.comm	ARPHRD_CAN,4,4
	.comm	AF_CAN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
