	.file	"extr_synclink_gt.c_async_mode.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	async_mode, @function
async_mode:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	esi, DWORD PTR IRQ_ALL[rip]
	or	esi, DWORD PTR IRQ_MASTER[rip]
	call	slgt_irq_off@PLT
	mov	rdi, rbp
	call	tx_stop@PLT
	mov	rdi, rbp
	call	rx_stop@PLT
	mov	eax, DWORD PTR 0[rbp]
	mov	edx, 16384
	test	DWORD PTR MGSL_INTERFACE_RTS_EN[rip], eax
	je	.L2
	movzx	edx, WORD PTR BIT7[rip]
	or	dh, 64
.L2:
	mov	rax, QWORD PTR 8[rbp]
	cmp	rax, QWORD PTR ASYNC_PARITY_NONE[rip]
	je	.L3
	or	dx, WORD PTR BIT9[rip]
	cmp	rax, QWORD PTR ASYNC_PARITY_ODD[rip]
	je	.L37
.L3:
	mov	eax, DWORD PTR 16[rbp]
	cmp	eax, 7
	je	.L4
.L44:
	cmp	eax, 8
	je	.L5
	cmp	eax, 6
	je	.L38
.L6:
	cmp	DWORD PTR 20[rbp], 1
	je	.L7
	or	dx, WORD PTR BIT3[rip]
.L7:
	mov	eax, DWORD PTR 24[rbp]
	test	DWORD PTR HDLC_FLAG_AUTO_CTS[rip], eax
	je	.L8
	or	dx, WORD PTR BIT0[rip]
.L8:
	mov	esi, DWORD PTR TCR[rip]
	movzx	edx, dx
	mov	rdi, rbp
	call	wr_reg16@PLT
	mov	rax, QWORD PTR 8[rbp]
	cmp	rax, QWORD PTR ASYNC_PARITY_NONE[rip]
	mov	edx, 16384
	je	.L9
	movzx	edx, WORD PTR BIT9[rip]
	or	dh, 64
	cmp	rax, QWORD PTR ASYNC_PARITY_ODD[rip]
	je	.L39
.L9:
	mov	eax, DWORD PTR 16[rbp]
	cmp	eax, 7
	je	.L10
.L43:
	cmp	eax, 8
	je	.L11
	cmp	eax, 6
	je	.L40
.L12:
	mov	eax, DWORD PTR 24[rbp]
	test	DWORD PTR HDLC_FLAG_AUTO_DCD[rip], eax
	je	.L13
	or	dx, WORD PTR BIT0[rip]
.L13:
	mov	esi, DWORD PTR RCR[rip]
	movzx	edx, dx
	mov	rdi, rbp
	call	wr_reg16@PLT
	mov	esi, DWORD PTR CCR[rip]
	mov	edx, 105
	mov	rdi, rbp
	call	wr_reg8@PLT
	mov	rdi, rbp
	call	msc_set_vcr@PLT
	mov	esi, DWORD PTR JCR[rip]
	mov	rdi, rbp
	movzx	ebx, WORD PTR BIT14[rip]
	add	bx, WORD PTR BIT15[rip]
	add	bx, WORD PTR BIT0[rip]
	call	rd_reg32@PLT
	test	WORD PTR BIT8[rip], ax
	je	.L14
	mov	ecx, DWORD PTR 28[rbp]
	mov	esi, ecx
	sal	esi, 4
	test	ecx, ecx
	jne	.L41
.L15:
	mov	rdi, rbp
	call	set_rate@PLT
.L17:
	mov	esi, DWORD PTR SCR[rip]
	movzx	edx, bx
	mov	rdi, rbp
	call	wr_reg16@PLT
	mov	esi, DWORD PTR IRQ_RXBREAK[rip]
	mov	rdi, rbp
	or	esi, DWORD PTR IRQ_RXOVER[rip]
	call	slgt_irq_on@PLT
	cmp	QWORD PTR 32[rbp], 0
	jne	.L42
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L41:
	.cfi_restore_state
	mov	eax, DWORD PTR 4[rbp]
	cmp	eax, esi
	jl	.L16
	cdq
	idiv	esi
	test	edx, edx
	je	.L15
.L16:
	lea	esi, 0[0+rcx*8]
	mov	rdi, rbp
	or	bx, WORD PTR BIT3[rip]
	call	set_rate@PLT
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L39:
	mov	eax, DWORD PTR 16[rbp]
	or	dx, WORD PTR BIT8[rip]
	cmp	eax, 7
	jne	.L43
.L10:
	or	dx, WORD PTR BIT5[rip]
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L37:
	mov	eax, DWORD PTR 16[rbp]
	or	dx, WORD PTR BIT8[rip]
	cmp	eax, 7
	jne	.L44
.L4:
	or	dx, WORD PTR BIT5[rip]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L42:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	jmp	enable_loopback@PLT
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	mov	esi, DWORD PTR 28[rbp]
	sal	esi, 4
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L11:
	movzx	eax, WORD PTR BIT4[rip]
	add	ax, WORD PTR BIT5[rip]
	or	edx, eax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L38:
	or	dx, WORD PTR BIT4[rip]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L40:
	or	dx, WORD PTR BIT4[rip]
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L5:
	movzx	eax, WORD PTR BIT4[rip]
	add	ax, WORD PTR BIT5[rip]
	or	edx, eax
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	async_mode, .-async_mode
	.comm	TCR,4,4
	.comm	SCR,4,4
	.comm	RCR,4,4
	.comm	MGSL_INTERFACE_RTS_EN,4,4
	.comm	JCR,4,4
	.comm	IRQ_RXOVER,4,4
	.comm	IRQ_RXBREAK,4,4
	.comm	IRQ_MASTER,4,4
	.comm	IRQ_ALL,4,4
	.comm	HDLC_FLAG_AUTO_DCD,4,4
	.comm	HDLC_FLAG_AUTO_CTS,4,4
	.comm	CCR,4,4
	.comm	BIT9,2,2
	.comm	BIT8,2,2
	.comm	BIT7,2,2
	.comm	BIT5,2,2
	.comm	BIT4,2,2
	.comm	BIT3,2,2
	.comm	BIT15,2,2
	.comm	BIT14,2,2
	.comm	BIT0,2,2
	.comm	ASYNC_PARITY_ODD,8,8
	.comm	ASYNC_PARITY_NONE,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_synclink_gt.c_async_mode.c"
	.text
	.global	__aeabi_idivmod
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	async_mode, %function
async_mode:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	ldr	r2, .L44
	ldr	r3, .L44+4
	ldr	r1, [r2]
	ldr	r3, [r3]
	ldr	r5, .L44+8
	orr	r1, r1, r3
	bl	slgt_irq_off
	mov	r0, r4
	bl	tx_stop
	mov	r0, r4
	bl	rx_stop
	ldr	r3, .L44+12
	ldr	r2, [r4]
	ldr	r3, [r3]
	ldr	r1, [r5]
	tst	r2, r3
	ldrne	r3, .L44+16
	moveq	r2, #16384
	ldrhne	r2, [r3]
	ldr	r3, [r4, #8]
	orrne	r2, r2, #16384
	cmp	r3, r1
	ldreq	r6, .L44+20
	beq	.L3
	ldr	r0, .L44+24
	ldr	r1, .L44+28
	ldr	r0, [r0]
	ldr	r6, .L44+20
	cmp	r3, r0
	ldrh	r1, [r1]
	ldrheq	r3, [r6]
	orr	r2, r2, r1
	orreq	r2, r2, r3
.L3:
	ldr	r3, [r4, #12]
	cmp	r3, #7
	beq	.L4
	cmp	r3, #8
	beq	.L5
	cmp	r3, #6
	beq	.L42
.L6:
	ldr	r3, [r4, #16]
	ldr	r1, [r4, #20]
	cmp	r3, #1
	ldrne	r3, .L44+32
	ldr	r7, .L44+36
	ldrhne	r3, [r3]
	mov	r0, r4
	orrne	r2, r2, r3
	ldr	r3, .L44+40
	ldr	r3, [r3]
	tst	r1, r3
	ldrhne	r3, [r7]
	orrne	r2, r2, r3
	ldr	r3, .L44+44
	ldr	r1, [r3]
	bl	wr_reg16
	ldr	r2, [r5]
	ldr	r3, [r4, #8]
	cmp	r3, r2
	moveq	r2, #16384
	beq	.L9
	ldr	r1, .L44+24
	ldr	r2, .L44+28
	ldr	r1, [r1]
	ldrh	r2, [r2]
	cmp	r3, r1
	ldrheq	r3, [r6]
	orr	r2, r2, #16384
	orreq	r2, r2, r3
.L9:
	ldr	r3, [r4, #12]
	cmp	r3, #7
	beq	.L10
	cmp	r3, #8
	beq	.L11
	cmp	r3, #6
	beq	.L43
.L12:
	ldr	r3, .L44+48
	ldr	r1, [r4, #20]
	ldr	r3, [r3]
	mov	r0, r4
	tst	r1, r3
	ldrhne	r3, [r7]
	orrne	r2, r2, r3
	ldr	r3, .L44+52
	ldr	r1, [r3]
	bl	wr_reg16
	ldr	r3, .L44+56
	mov	r2, #105
	ldr	r1, [r3]
	mov	r0, r4
	bl	wr_reg8
	mov	r0, r4
	bl	msc_set_vcr
	ldr	r2, .L44+60
	ldr	r3, .L44+64
	ldrh	r5, [r2]
	ldrh	r1, [r3]
	ldr	r3, .L44+68
	ldrh	r2, [r7]
	add	r5, r5, r1
	mov	r0, r4
	ldr	r1, [r3]
	add	r5, r5, r2
	bl	rd_reg32
	ldrh	r3, [r6]
	lsl	r5, r5, #16
	tst	r0, r3
	lsr	r5, r5, #16
	beq	.L14
	ldr	r7, [r4, #24]
	cmp	r7, #0
	lsl	r6, r7, #4
	beq	.L15
	ldr	r0, [r4, #4]
	cmp	r0, r6
	blt	.L16
	mov	r1, r6
	bl	__aeabi_idivmod
	cmp	r1, #0
	bne	.L16
.L15:
	mov	r1, r6
	mov	r0, r4
	bl	set_rate
.L17:
	ldr	r3, .L44+72
	mov	r2, r5
	ldr	r1, [r3]
	mov	r0, r4
	bl	wr_reg16
	ldr	r2, .L44+76
	ldr	r3, .L44+80
	ldr	r1, [r2]
	ldr	r3, [r3]
	mov	r0, r4
	orr	r1, r1, r3
	bl	slgt_irq_on
	ldr	r3, [r4, #28]
	cmp	r3, #0
	popeq	{r4, r5, r6, r7, r8, pc}
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	b	enable_loopback
.L16:
	ldr	r3, .L44+32
	mov	r0, r4
	ldrh	r3, [r3]
	lsl	r1, r7, #3
	orr	r5, r5, r3
	bl	set_rate
	b	.L17
.L14:
	ldr	r6, [r4, #24]
	lsl	r6, r6, #4
	b	.L15
.L42:
	ldr	r3, .L44+84
	ldrh	r3, [r3]
	orr	r2, r2, r3
	b	.L6
.L5:
	ldr	r3, .L44+88
	ldr	r1, .L44+84
	ldrh	r3, [r3]
	ldrh	r1, [r1]
	add	r3, r3, r1
	orr	r2, r3, r2
	lsl	r2, r2, #16
	lsr	r2, r2, #16
	b	.L6
.L4:
	ldr	r3, .L44+88
	ldrh	r3, [r3]
	orr	r2, r2, r3
	b	.L6
.L43:
	ldr	r3, .L44+84
	ldrh	r3, [r3]
	orr	r2, r2, r3
	b	.L12
.L11:
	ldr	r3, .L44+88
	ldr	r1, .L44+84
	ldrh	r3, [r3]
	ldrh	r1, [r1]
	add	r3, r3, r1
	orr	r2, r3, r2
	lsl	r2, r2, #16
	lsr	r2, r2, #16
	b	.L12
.L10:
	ldr	r3, .L44+88
	ldrh	r3, [r3]
	orr	r2, r2, r3
	b	.L12
.L45:
	.align	2
.L44:
	.word	IRQ_ALL
	.word	IRQ_MASTER
	.word	ASYNC_PARITY_NONE
	.word	MGSL_INTERFACE_RTS_EN
	.word	BIT7
	.word	BIT8
	.word	ASYNC_PARITY_ODD
	.word	BIT9
	.word	BIT3
	.word	BIT0
	.word	HDLC_FLAG_AUTO_CTS
	.word	TCR
	.word	HDLC_FLAG_AUTO_DCD
	.word	RCR
	.word	CCR
	.word	BIT15
	.word	BIT14
	.word	JCR
	.word	SCR
	.word	IRQ_RXBREAK
	.word	IRQ_RXOVER
	.word	BIT4
	.word	BIT5
	.size	async_mode, .-async_mode
	.comm	TCR,4,4
	.comm	SCR,4,4
	.comm	RCR,4,4
	.comm	MGSL_INTERFACE_RTS_EN,4,4
	.comm	JCR,4,4
	.comm	IRQ_RXOVER,4,4
	.comm	IRQ_RXBREAK,4,4
	.comm	IRQ_MASTER,4,4
	.comm	IRQ_ALL,4,4
	.comm	HDLC_FLAG_AUTO_DCD,4,4
	.comm	HDLC_FLAG_AUTO_CTS,4,4
	.comm	CCR,4,4
	.comm	BIT9,2,2
	.comm	BIT8,2,2
	.comm	BIT7,2,2
	.comm	BIT5,2,2
	.comm	BIT4,2,2
	.comm	BIT3,2,2
	.comm	BIT15,2,2
	.comm	BIT14,2,2
	.comm	BIT0,2,2
	.comm	ASYNC_PARITY_ODD,4,4
	.comm	ASYNC_PARITY_NONE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
