	.file	"extr_baycom_ser_fdx.c_ser12_interrupt.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ser12_interrupt, @function
ser12_interrupt:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	rdi, rsi
	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, rsi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	netdev_priv@PLT
	test	rax, rax
	je	.L51
	mov	rbx, rax
	mov	rax, QWORD PTR HDLCDRV_MAGIC[rip]
	cmp	QWORD PTR 8[rbx], rax
	je	.L3
.L51:
	mov	eax, DWORD PTR IRQ_NONE[rip]
.L1:
	mov	rcx, QWORD PTR 24[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L53
	add	rsp, 40
	.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
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	edi, DWORD PTR 0[rbp]
	call	IIR@PLT
	mov	edi, eax
	call	inb@PLT
	test	al, 1
	jne	.L51
	lea	r15, 20[rsp]
	mov	BYTE PTR 15[rsp], al
	lea	r14, 8[rbx]
	mov	rdi, r15
	call	ktime_get_ts64@PLT
	mov	edi, DWORD PTR 0[rbp]
	call	MSR@PLT
	mov	edi, eax
	call	inb@PLT
	movzx	edx, BYTE PTR 15[rsp]
	test	al, 8
	mov	r12d, eax
	je	.L6
	movzx	eax, BYTE PTR [rbx]
	test	al, al
	jne	.L54
.L6:
	xor	r13d, r13d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L58:
	cmp	al, 2
	je	.L55
	call	MSR@PLT
	mov	edi, eax
	call	inb@PLT
	mov	r12d, eax
	test	al, 8
	je	.L11
	movzx	eax, BYTE PTR [rbx]
	test	al, al
	jne	.L56
	.p2align 4,,10
	.p2align 3
.L11:
	mov	edi, DWORD PTR 0[rbp]
	call	IIR@PLT
	mov	edi, eax
	call	inb@PLT
	mov	edx, eax
	test	al, 1
	jne	.L57
.L14:
	mov	eax, edx
	mov	edi, DWORD PTR 0[rbp]
	and	eax, 6
	cmp	al, 4
	je	.L7
	cmp	al, 6
	jne	.L58
	call	LSR@PLT
	mov	edi, eax
	call	inb@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L55:
	call	THR@PLT
	xor	edi, edi
	add	r13d, 1
	mov	esi, eax
	call	outb@PLT
	mov	rdi, rbx
	call	baycom_int_freq@PLT
	mov	r9d, DWORD PTR 16[rbx]
	mov	edi, DWORD PTR 0[rbp]
	test	r9d, r9d
	je	.L12
	call	MCR@PLT
	mov	r8d, DWORD PTR 20[rbx]
	xor	edi, edi
	mov	esi, eax
	test	r8d, r8d
	setne	dil
	add	edi, 14
	call	outb@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L7:
	call	RBR@PLT
	mov	edi, eax
	call	inb@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	call	MCR@PLT
	mov	edi, 13
	mov	esi, eax
	call	outb@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L57:
	and	r12d, 16
	mov	rdx, r15
	mov	rsi, rbx
	mov	rdi, rbp
	movzx	ecx, r12b
	call	ser12_rx@PLT
	mov	ecx, DWORD PTR 16[rbx]
	test	ecx, ecx
	je	.L15
	test	r13d, r13d
	je	.L16
	mov	eax, DWORD PTR 24[rbx]
	cmp	eax, 1
	jle	.L59
.L17:
	mov	edx, eax
	and	edx, 1
	cmp	DWORD PTR 20[rbx], edx
	sete	dl
	sar	eax
	movzx	edx, dl
	mov	DWORD PTR 24[rbx], eax
	mov	DWORD PTR 20[rbx], edx
.L19:
	xor	eax, eax
	call	local_irq_enable@PLT
	mov	eax, DWORD PTR 16[rbx]
	test	eax, eax
	je	.L20
	.p2align 4,,10
	.p2align 3
.L22:
	mov	rsi, r14
	mov	rdi, rbp
	call	hdlcdrv_transmitter@PLT
	mov	rsi, r14
	mov	rdi, rbp
	call	hdlcdrv_receiver@PLT
	xor	eax, eax
	call	local_irq_disable@PLT
	mov	eax, DWORD PTR IRQ_HANDLED[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L15:
	xor	eax, eax
	call	local_irq_enable@PLT
	mov	edx, DWORD PTR 16[rbx]
	test	edx, edx
	jne	.L22
	test	r13d, r13d
	je	.L22
.L20:
	mov	rdi, rbp
	mov	rsi, r14
	call	hdlcdrv_arbitrate@PLT
	mov	rdi, r14
	call	hdlcdrv_ptt@PLT
	test	rax, rax
	je	.L22
	mov	esi, DWORD PTR 4[rbx]
	mov	rdi, rbp
	call	ser12_set_divisor@PLT
	mov	DWORD PTR 24[rbx], 1
	mov	DWORD PTR 16[rbx], 1
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L16:
	xor	eax, eax
	call	local_irq_enable@PLT
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L54:
	xor	eax, r12d
	mov	rdi, r14
	movsx	esi, al
	not	esi
	shr	esi, 31
	call	hdlcdrv_setdcd@PLT
	movzx	edx, BYTE PTR 15[rsp]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L56:
	xor	eax, r12d
	mov	rdi, r14
	movsx	esi, al
	not	esi
	shr	esi, 31
	call	hdlcdrv_setdcd@PLT
	jmp	.L11
.L59:
	mov	rdi, r14
	call	hdlcdrv_getbits@PLT
	mov	rdi, r14
	or	eax, 65536
	mov	DWORD PTR 24[rbx], eax
	call	hdlcdrv_ptt@PLT
	test	rax, rax
	je	.L18
	mov	eax, DWORD PTR 24[rbx]
	jmp	.L17
.L18:
	mov	esi, 144
	mov	rdi, rbp
	call	ser12_set_divisor@PLT
	mov	DWORD PTR 16[rbx], 0
	jmp	.L19
.L53:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	ser12_interrupt, .-ser12_interrupt
	.comm	IRQ_NONE,4,4
	.comm	IRQ_HANDLED,4,4
	.comm	HDLCDRV_MAGIC,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_baycom_ser_fdx.c_ser12_interrupt.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ser12_interrupt, %function
ser12_interrupt:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	ldr	r3, .L59
	sub	sp, sp, #12
	mov	r0, r1
	mov	r5, r1
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	bl	netdev_priv
	subs	r6, r0, #0
	beq	.L50
	ldr	r3, .L59+4
	ldr	r2, [r6, #8]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L3
.L50:
	ldr	r3, .L59+8
	ldr	r0, [r3]
.L1:
	ldr	r3, .L59
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L52
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L3:
	ldr	r0, [r5]
	bl	IIR
	bl	inb
	tst	r0, #1
	mov	r4, r0
	bne	.L50
	mov	r0, sp
	bl	ktime_get_ts64
	ldr	r0, [r5]
	bl	MSR
	bl	inb
	tst	r0, #8
	mov	r7, r0
	add	r9, r6, #8
	beq	.L6
	ldrb	r3, [r6]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L53
.L6:
	mov	r8, #0
	b	.L14
.L57:
	cmp	r3, #2
	beq	.L54
	bl	MSR
	bl	inb
	tst	r0, #8
	mov	r7, r0
	beq	.L11
	ldrb	r3, [r6]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L55
.L11:
	ldr	r0, [r5]
	bl	IIR
	bl	inb
	tst	r0, #1
	mov	r4, r0
	bne	.L56
.L14:
	and	r3, r4, #6
	cmp	r3, #4
	ldr	r0, [r5]
	beq	.L7
	cmp	r3, #6
	bne	.L57
	bl	LSR
	bl	inb
	b	.L11
.L54:
	bl	THR
	mov	r1, r0
	mov	r0, #0
	bl	outb
	mov	r0, r6
	bl	baycom_int_freq
	ldr	r3, [r6, #12]
	add	r8, r8, #1
	cmp	r3, #0
	beq	.L12
	ldr	r3, [r6, #16]
	ldr	r0, [r5]
	cmp	r3, #0
	movne	r4, #15
	moveq	r4, #14
	bl	MCR
	mov	r1, r0
	mov	r0, r4
	bl	outb
	b	.L11
.L7:
	bl	RBR
	bl	inb
	b	.L11
.L56:
	and	r3, r7, #16
	mov	r2, sp
	mov	r1, r6
	mov	r0, r5
	bl	ser12_rx
	ldr	r3, [r6, #12]
	cmp	r3, #0
	beq	.L15
	cmp	r8, #0
	beq	.L16
	ldr	r3, [r6, #20]
	cmp	r3, #1
	ble	.L58
.L17:
	ldr	r2, [r6, #16]
	and	r1, r3, #1
	sub	r2, r2, r1
	clz	r2, r2
	asr	r3, r3, #1
	lsr	r2, r2, #5
	str	r2, [r6, #16]
	str	r3, [r6, #20]
.L19:
	bl	local_irq_enable
	ldr	r3, [r6, #12]
	cmp	r3, #0
	bne	.L21
.L20:
	mov	r1, r9
	mov	r0, r5
	bl	hdlcdrv_arbitrate
	mov	r0, r9
	bl	hdlcdrv_ptt
	cmp	r0, #0
	beq	.L21
	mov	r0, r5
	ldr	r1, [r6, #4]
	bl	ser12_set_divisor
	mov	r3, #1
	str	r3, [r6, #20]
	str	r3, [r6, #12]
	b	.L21
.L12:
	ldr	r0, [r5]
	bl	MCR
	mov	r1, r0
	mov	r0, #13
	bl	outb
	b	.L11
.L15:
	bl	local_irq_enable
	ldr	r3, [r6, #12]
	subs	r8, r8, #0
	movne	r8, #1
	cmp	r3, #0
	movne	r8, #0
	cmp	r8, #0
	bne	.L20
.L21:
	mov	r1, r9
	mov	r0, r5
	bl	hdlcdrv_transmitter
	mov	r1, r9
	mov	r0, r5
	bl	hdlcdrv_receiver
	bl	local_irq_disable
	ldr	r3, .L59+12
	ldr	r0, [r3]
	b	.L1
.L16:
	bl	local_irq_enable
	b	.L21
.L53:
	eor	r3, r3, r0
	lsl	r1, r3, #24
	asr	r1, r1, #24
	mvn	r1, r1
	mov	r0, r9
	lsr	r1, r1, #31
	bl	hdlcdrv_setdcd
	b	.L6
.L55:
	eor	r3, r3, r0
	lsl	r1, r3, #24
	asr	r1, r1, #24
	mvn	r1, r1
	mov	r0, r9
	lsr	r1, r1, #31
	bl	hdlcdrv_setdcd
	b	.L11
.L58:
	mov	r0, r9
	bl	hdlcdrv_getbits
	orr	r3, r0, #65536
	str	r3, [r6, #20]
	mov	r0, r9
	bl	hdlcdrv_ptt
	subs	r4, r0, #0
	ldrne	r3, [r6, #20]
	bne	.L17
.L18:
	mov	r1, #144
	mov	r0, r5
	bl	ser12_set_divisor
	str	r4, [r6, #12]
	b	.L19
.L52:
	bl	__stack_chk_fail
.L60:
	.align	2
.L59:
	.word	.LC0
	.word	HDLCDRV_MAGIC
	.word	IRQ_NONE
	.word	IRQ_HANDLED
	.size	ser12_interrupt, .-ser12_interrupt
	.comm	IRQ_NONE,4,4
	.comm	IRQ_HANDLED,4,4
	.comm	HDLCDRV_MAGIC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
