	.file	"22296.c"
	.intel_syntax noprefix
	.text
	.local	baudrate
	.comm	baudrate,4,4
	.local	device
	.comm	device,8,8
	.globl	cfmakeraw
	.type	cfmakeraw, @function
cfmakeraw:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	and	eax, -1516
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 4[rax]
	and	eax, -2
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 4[rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 12[rax]
	and	eax, -32844
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 12[rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 8[rax]
	and	eax, -305
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 8[rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 8[rax]
	or	eax, 48
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 8[rax], edx
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cfmakeraw, .-cfmakeraw
	.section	.rodata
.LC0:
	.string	"open error %d %s\n"
	.align 8
.LC1:
	.string	"Error: TIOCGRS485 ioctl not supported."
	.align 8
.LC2:
	.string	"Error: TIOCSRS485 ioctl not supported."
	.text
	.globl	OpenAdrPort
	.type	OpenAdrPort, @function
OpenAdrPort:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 136
	.cfi_offset 3, -24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR device[rip]
	mov	esi, 2306
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -132[rbp], eax
	cmp	DWORD PTR -132[rbp], 0
	jns	.L3
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rbx, rax
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	rdx, rbx
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L7
.L3:
	mov	eax, DWORD PTR -132[rbp]
	mov	edx, 2048
	mov	esi, 4
	mov	edi, eax
	mov	eax, 0
	call	fcntl@PLT
	lea	rdx, -96[rbp]
	mov	eax, DWORD PTR -132[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	tcgetattr@PLT
	mov	edx, DWORD PTR baudrate[rip]
	lea	rax, -96[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	cfsetispeed@PLT
	mov	edx, DWORD PTR baudrate[rip]
	lea	rax, -96[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	cfsetospeed@PLT
	mov	eax, DWORD PTR -88[rbp]
	or	eax, 2176
	mov	DWORD PTR -88[rbp], eax
	mov	eax, DWORD PTR -88[rbp]
	and	ah, -2
	mov	DWORD PTR -88[rbp], eax
	mov	eax, DWORD PTR -88[rbp]
	and	eax, -65
	mov	DWORD PTR -88[rbp], eax
	mov	eax, DWORD PTR -88[rbp]
	and	eax, -49
	mov	DWORD PTR -88[rbp], eax
	mov	eax, DWORD PTR -88[rbp]
	or	eax, 48
	mov	DWORD PTR -88[rbp], eax
	lea	rax, -96[rbp]
	mov	rdi, rax
	call	cfmakeraw
	mov	eax, DWORD PTR -84[rbp]
	and	eax, -28
	mov	DWORD PTR -84[rbp], eax
	lea	rdx, -96[rbp]
	mov	eax, DWORD PTR -132[rbp]
	mov	esi, 0
	mov	edi, eax
	call	tcsetattr@PLT
	lea	rdx, -128[rbp]
	mov	eax, DWORD PTR -132[rbp]
	mov	esi, 21550
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	test	eax, eax
	jns	.L5
	lea	rdi, .LC1[rip]
	call	puts@PLT
.L5:
	mov	eax, DWORD PTR -128[rbp]
	or	eax, 1
	mov	DWORD PTR -128[rbp], eax
	lea	rdx, -128[rbp]
	mov	eax, DWORD PTR -132[rbp]
	mov	esi, 21551
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	test	eax, eax
	jns	.L6
	lea	rdi, .LC2[rip]
	call	puts@PLT
.L6:
	mov	eax, DWORD PTR -132[rbp]
.L7:
	mov	rcx, QWORD PTR -24[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	OpenAdrPort, .-OpenAdrPort
	.globl	closePort
	.type	closePort, @function
closePort:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	DWORD PTR -4[rbp], edi
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	close@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	closePort, .-closePort
	.section	.rodata
	.align 8
.LC3:
	.string	"\nserialport [OPTIONS]: send/receive packages on serial device"
.LC4:
	.string	"  -d <device>"
	.align 8
.LC5:
	.string	"  -b <baudrate>    from 9600 to 115200"
	.align 8
.LC6:
	.string	"  -h               show this help\n"
	.text
	.globl	print_usage
	.type	print_usage, @function
print_usage:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC3[rip]
	call	puts@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	lea	rdi, .LC5[rip]
	call	puts@PLT
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE9:
	.size	print_usage, .-print_usage
	.section	.rodata
	.align 8
.LC7:
	.string	"Option -%c requires an argument.\n"
.LC8:
	.string	"Unknown option `-%c'.\n"
	.align 8
.LC9:
	.string	"Unknown option character `\\x%x'.\n"
.LC10:
	.string	"hd:b:"
.LC11:
	.string	"WARN: Non-option argument %s\n"
.LC12:
	.string	"Device = %s, Baudrate = %d\n"
.LC13:
	.string	"Open Port"
.LC14:
	.string	"Error on open\n"
.LC15:
	.string	"Test PACKETs %d#"
.LC16:
	.string	"Error on write"
.LC17:
	.string	"sent: [%s]\n"
.LC19:
	.string	"Timeout"
.LC20:
	.string	"Too many char!! [%s]\n"
.LC21:
	.string	"received: [%s]\n"
.LC22:
	.string	"Close Port"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 216
	.cfi_offset 3, -24
	mov	DWORD PTR -212[rbp], edi
	mov	QWORD PTR -224[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -196[rbp], 0
	mov	DWORD PTR opterr[rip], 0
	mov	DWORD PTR baudrate[rip], -1
	jmp	.L12
.L28:
	cmp	DWORD PTR -176[rbp], 104
	je	.L13
	cmp	DWORD PTR -176[rbp], 104
	jg	.L53
	cmp	DWORD PTR -176[rbp], 100
	je	.L15
	cmp	DWORD PTR -176[rbp], 100
	jg	.L53
	cmp	DWORD PTR -176[rbp], 63
	je	.L16
	cmp	DWORD PTR -176[rbp], 98
	je	.L17
	jmp	.L14
.L13:
	mov	eax, 0
	call	print_usage
.L15:
	mov	rax, QWORD PTR optarg[rip]
	mov	QWORD PTR device[rip], rax
	jmp	.L12
.L17:
	mov	rax, QWORD PTR optarg[rip]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -184[rbp], eax
	cmp	DWORD PTR -184[rbp], 4800
	jne	.L18
	mov	DWORD PTR baudrate[rip], 12
	jmp	.L12
.L18:
	cmp	DWORD PTR -184[rbp], 9600
	jne	.L20
	mov	DWORD PTR baudrate[rip], 13
	jmp	.L12
.L20:
	cmp	DWORD PTR -184[rbp], 19200
	jne	.L21
	mov	DWORD PTR baudrate[rip], 14
	jmp	.L12
.L21:
	cmp	DWORD PTR -184[rbp], 38400
	jne	.L22
	mov	DWORD PTR baudrate[rip], 15
	jmp	.L12
.L22:
	cmp	DWORD PTR -184[rbp], 57600
	jne	.L23
	mov	DWORD PTR baudrate[rip], 4097
	jmp	.L12
.L23:
	cmp	DWORD PTR -184[rbp], 115200
	jne	.L12
	mov	DWORD PTR baudrate[rip], 4098
	jmp	.L12
.L16:
	mov	eax, DWORD PTR optopt[rip]
	cmp	eax, 99
	jne	.L24
	mov	edx, DWORD PTR optopt[rip]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L25
.L24:
	mov	eax, DWORD PTR optopt[rip]
	mov	edi, eax
	call	isprint@PLT
	test	eax, eax
	je	.L26
	mov	edx, DWORD PTR optopt[rip]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L25
.L26:
	mov	edx, DWORD PTR optopt[rip]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L25:
	mov	eax, 0
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L49
	jmp	.L51
.L14:
.L53:
	nop
.L12:
	mov	rcx, QWORD PTR -224[rbp]
	mov	eax, DWORD PTR -212[rbp]
	lea	rdx, .LC10[rip]
	mov	rsi, rcx
	mov	edi, eax
	call	getopt@PLT
	mov	DWORD PTR -176[rbp], eax
	cmp	DWORD PTR -176[rbp], -1
	jne	.L28
	mov	eax, DWORD PTR baudrate[rip]
	cmp	eax, -1
	je	.L29
	mov	rax, QWORD PTR device[rip]
	test	rax, rax
	jne	.L30
.L29:
	mov	eax, 0
	call	print_usage
.L30:
	mov	eax, DWORD PTR optind[rip]
	mov	DWORD PTR -180[rbp], eax
	jmp	.L31
.L32:
	mov	eax, DWORD PTR -180[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -224[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -180[rbp], 1
.L31:
	mov	eax, DWORD PTR -180[rbp]
	cmp	eax, DWORD PTR -212[rbp]
	jl	.L32
	mov	rax, QWORD PTR device[rip]
	mov	edx, DWORD PTR -184[rbp]
	mov	rsi, rax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
.L48:
	cmp	DWORD PTR -196[rbp], 4
	ja	.L48
	mov	eax, DWORD PTR -196[rbp]
	lea	rdx, 0[0+rax*4]
	lea	rax, .L35[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cdqe
	lea	rdx, .L35[rip]
	add	rax, rdx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L35:
	.long	.L39-.L35
	.long	.L38-.L35
	.long	.L37-.L35
	.long	.L36-.L35
	.long	.L34-.L35
	.text
.L39:
	lea	rdi, .LC13[rip]
	call	puts@PLT
	mov	eax, 0
	call	OpenAdrPort
	mov	DWORD PTR -200[rbp], eax
	cmp	DWORD PTR -200[rbp], 0
	jns	.L40
	lea	rdi, .LC14[rip]
	call	perror@PLT
	jmp	.L33
.L40:
	mov	DWORD PTR -192[rbp], 0
	mov	DWORD PTR -196[rbp], 1
	jmp	.L33
.L38:
	mov	eax, DWORD PTR -192[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -192[rbp], edx
	lea	rcx, -144[rbp]
	mov	edx, eax
	lea	rsi, .LC15[rip]
	mov	rdi, rcx
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -144[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	lea	rcx, -144[rbp]
	mov	eax, DWORD PTR -200[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	rbx, rax
	lea	rax, -144[rbp]
	mov	rdi, rax
	call	strlen@PLT
	cdqe
	cmp	rbx, rax
	jge	.L42
	lea	rdi, .LC16[rip]
	call	perror@PLT
	mov	DWORD PTR -196[rbp], 4
	mov	edi, 5
	call	sleep@PLT
	jmp	.L33
.L42:
	lea	rax, -80[rbp]
	mov	edx, 50
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -196[rbp], 2
	mov	DWORD PTR -188[rbp], 0
	lea	rax, -144[rbp]
	mov	rsi, rax
	lea	rdi, .LC17[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -168[rbp]
	mov	rdi, rax
	call	time@PLT
	jmp	.L33
.L37:
	lea	rax, -160[rbp]
	mov	rdi, rax
	call	time@PLT
	mov	rdx, QWORD PTR -168[rbp]
	mov	rax, QWORD PTR -160[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	difftime@PLT
	movq	rax, xmm0
	mov	QWORD PTR -152[rbp], rax
	movsd	xmm0, QWORD PTR -152[rbp]
	movsd	xmm1, QWORD PTR .LC18[rip]
	comisd	xmm0, xmm1
	jbe	.L44
	lea	rdi, .LC19[rip]
	call	puts@PLT
	mov	DWORD PTR -196[rbp], 4
	mov	edi, 1
	call	sleep@PLT
.L44:
	lea	rcx, -201[rbp]
	mov	eax, DWORD PTR -200[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -172[rbp], eax
	cmp	DWORD PTR -172[rbp], 0
	jle	.L52
	movzx	edx, BYTE PTR -201[rbp]
	mov	eax, DWORD PTR -188[rbp]
	cdqe
	mov	BYTE PTR -80[rbp+rax], dl
	mov	eax, DWORD PTR -172[rbp]
	add	DWORD PTR -188[rbp], eax
	mov	eax, DWORD PTR -188[rbp]
	cmp	eax, 50
	jbe	.L47
	mov	BYTE PTR -31[rbp], 0
	lea	rax, -80[rbp]
	mov	rsi, rax
	lea	rdi, .LC20[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L52
.L47:
	movzx	eax, BYTE PTR -201[rbp]
	cmp	al, 35
	jne	.L52
	mov	DWORD PTR -196[rbp], 3
	jmp	.L52
.L36:
	lea	rax, -80[rbp]
	mov	rsi, rax
	lea	rdi, .LC21[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -196[rbp], 1
	mov	edi, 1000
	call	usleep@PLT
	jmp	.L33
.L34:
	lea	rdi, .LC22[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -200[rbp]
	mov	edi, eax
	call	closePort
	mov	DWORD PTR -196[rbp], 0
	jmp	.L33
.L52:
	nop
.L33:
	jmp	.L48
.L51:
	call	__stack_chk_fail@PLT
.L49:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC18:
	.long	0
	.long	1072693248
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"22296.c"
	.text
	.local	baudrate
	.comm	baudrate,4,4
	.local	device
	.comm	device,4,4
	.align	2
	.global	cfmakeraw
	.syntax unified
	.arm
	.fpu softvfp
	.type	cfmakeraw, %function
cfmakeraw:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	bic	r3, r3, #1504
	bic	r3, r3, #11
	ldr	r2, [fp, #-8]
	str	r3, [r2]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	bic	r2, r3, #1
	ldr	r3, [fp, #-8]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #12]
	bic	r3, r3, #32768
	bic	r3, r3, #75
	ldr	r2, [fp, #-8]
	str	r3, [r2, #12]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #8]
	bic	r2, r3, #304
	ldr	r3, [fp, #-8]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #8]
	orr	r2, r3, #48
	ldr	r3, [fp, #-8]
	str	r2, [r3, #8]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	cfmakeraw, .-cfmakeraw
	.section	.rodata
	.align	2
.LC0:
	.ascii	"open error %d %s\012\000"
	.align	2
.LC1:
	.ascii	"Error: TIOCGRS485 ioctl not supported.\000"
	.align	2
.LC2:
	.ascii	"Error: TIOCSRS485 ioctl not supported.\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	OpenAdrPort
	.syntax unified
	.arm
	.fpu softvfp
	.type	OpenAdrPort, %function
OpenAdrPort:
	@ args = 0, pretend = 0, frame = 104
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #108
	ldr	r3, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, .L9+4
	ldr	r3, [r3]
	ldr	r1, .L9+8
	mov	r0, r3
	bl	open
	str	r0, [fp, #-112]
	ldr	r3, [fp, #-112]
	cmp	r3, #0
	bge	.L3
	bl	__errno_location
	mov	r3, r0
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L9+12
	bl	printf
	mvn	r3, #0
	b	.L7
.L3:
	mov	r2, #2048
	mov	r1, #4
	ldr	r0, [fp, #-112]
	bl	fcntl
	sub	r3, fp, #76
	mov	r1, r3
	ldr	r0, [fp, #-112]
	bl	tcgetattr
	ldr	r3, .L9+16
	ldr	r2, [r3]
	sub	r3, fp, #76
	mov	r1, r2
	mov	r0, r3
	bl	cfsetispeed
	ldr	r3, .L9+16
	ldr	r2, [r3]
	sub	r3, fp, #76
	mov	r1, r2
	mov	r0, r3
	bl	cfsetospeed
	ldr	r3, [fp, #-68]
	orr	r3, r3, #2176
	str	r3, [fp, #-68]
	ldr	r3, [fp, #-68]
	bic	r3, r3, #256
	str	r3, [fp, #-68]
	ldr	r3, [fp, #-68]
	bic	r3, r3, #64
	str	r3, [fp, #-68]
	ldr	r3, [fp, #-68]
	bic	r3, r3, #48
	str	r3, [fp, #-68]
	ldr	r3, [fp, #-68]
	orr	r3, r3, #48
	str	r3, [fp, #-68]
	sub	r3, fp, #76
	mov	r0, r3
	bl	cfmakeraw
	ldr	r3, [fp, #-64]
	bic	r3, r3, #27
	str	r3, [fp, #-64]
	sub	r3, fp, #76
	mov	r2, r3
	mov	r1, #0
	ldr	r0, [fp, #-112]
	bl	tcsetattr
	sub	r3, fp, #108
	mov	r2, r3
	ldr	r1, .L9+20
	ldr	r0, [fp, #-112]
	bl	ioctl
	mov	r3, r0
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L9+24
	bl	puts
.L5:
	ldr	r3, [fp, #-108]
	orr	r3, r3, #1
	str	r3, [fp, #-108]
	sub	r3, fp, #108
	mov	r2, r3
	ldr	r1, .L9+28
	ldr	r0, [fp, #-112]
	bl	ioctl
	mov	r3, r0
	cmp	r3, #0
	bge	.L6
	ldr	r0, .L9+32
	bl	puts
.L6:
	ldr	r3, [fp, #-112]
.L7:
	ldr	r2, .L9
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC3
	.word	device
	.word	2306
	.word	.LC0
	.word	baudrate
	.word	21550
	.word	.LC1
	.word	21551
	.word	.LC2
	.size	OpenAdrPort, .-OpenAdrPort
	.align	2
	.global	closePort
	.syntax unified
	.arm
	.fpu softvfp
	.type	closePort, %function
closePort:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	close
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	closePort, .-closePort
	.section	.rodata
	.align	2
.LC4:
	.ascii	"\012serialport [OPTIONS]: send/receive packages on "
	.ascii	"serial device\000"
	.align	2
.LC5:
	.ascii	"  -d <device>\000"
	.align	2
.LC6:
	.ascii	"  -b <baudrate>    from 9600 to 115200\000"
	.align	2
.LC7:
	.ascii	"  -h               show this help\012\000"
	.text
	.align	2
	.global	print_usage
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_usage, %function
print_usage:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L13
	bl	puts
	ldr	r0, .L13+4
	bl	puts
	ldr	r0, .L13+8
	bl	puts
	ldr	r0, .L13+12
	bl	puts
	mov	r0, #0
	bl	exit
.L14:
	.align	2
.L13:
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	print_usage, .-print_usage
	.section	.rodata
	.align	2
.LC8:
	.ascii	"Option -%c requires an argument.\012\000"
	.align	2
.LC9:
	.ascii	"Unknown option `-%c'.\012\000"
	.align	2
.LC10:
	.ascii	"Unknown option character `\\x%x'.\012\000"
	.align	2
.LC11:
	.ascii	"hd:b:\000"
	.align	2
.LC12:
	.ascii	"WARN: Non-option argument %s\012\000"
	.align	2
.LC13:
	.ascii	"Device = %s, Baudrate = %d\012\000"
	.align	2
.LC14:
	.ascii	"Open Port\000"
	.align	2
.LC15:
	.ascii	"Error on open\012\000"
	.align	2
.LC16:
	.ascii	"Test PACKETs %d#\000"
	.align	2
.LC17:
	.ascii	"Error on write\000"
	.align	2
.LC18:
	.ascii	"sent: [%s]\012\000"
	.global	__aeabi_dcmpgt
	.align	2
.LC19:
	.ascii	"Timeout\000"
	.align	2
.LC20:
	.ascii	"Too many char!! [%s]\012\000"
	.align	2
.LC21:
	.ascii	"received: [%s]\012\000"
	.align	2
.LC22:
	.ascii	"Close Port\000"
	.align	2
.LC23:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 176
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #180
	str	r0, [fp, #-184]
	str	r1, [fp, #-188]
	ldr	r3, .L58
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-160]
	ldr	r3, .L58+4
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L58+8
	mvn	r2, #0
	str	r2, [r3]
	b	.L16
.L32:
	ldr	r3, [fp, #-140]
	cmp	r3, #104
	beq	.L17
	ldr	r3, [fp, #-140]
	cmp	r3, #104
	bgt	.L57
	ldr	r3, [fp, #-140]
	cmp	r3, #100
	beq	.L19
	ldr	r3, [fp, #-140]
	cmp	r3, #100
	bgt	.L57
	ldr	r3, [fp, #-140]
	cmp	r3, #63
	beq	.L20
	ldr	r3, [fp, #-140]
	cmp	r3, #98
	beq	.L21
	b	.L18
.L17:
	bl	print_usage
.L19:
	ldr	r3, .L58+12
	ldr	r3, [r3]
	ldr	r2, .L58+16
	str	r3, [r2]
	b	.L16
.L21:
	ldr	r3, .L58+12
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-148]
	ldr	r3, [fp, #-148]
	cmp	r3, #4800
	bne	.L22
	ldr	r3, .L58+8
	mov	r2, #12
	str	r2, [r3]
	b	.L16
.L22:
	ldr	r3, [fp, #-148]
	cmp	r3, #9600
	bne	.L24
	ldr	r3, .L58+8
	mov	r2, #13
	str	r2, [r3]
	b	.L16
.L24:
	ldr	r3, [fp, #-148]
	cmp	r3, #19200
	bne	.L25
	ldr	r3, .L58+8
	mov	r2, #14
	str	r2, [r3]
	b	.L16
.L25:
	ldr	r3, [fp, #-148]
	cmp	r3, #38400
	bne	.L26
	ldr	r3, .L58+8
	mov	r2, #15
	str	r2, [r3]
	b	.L16
.L26:
	ldr	r3, [fp, #-148]
	cmp	r3, #57600
	bne	.L27
	ldr	r3, .L58+8
	ldr	r2, .L58+20
	str	r2, [r3]
	b	.L16
.L27:
	ldr	r3, [fp, #-148]
	ldr	r2, .L58+24
	cmp	r3, r2
	bne	.L16
	ldr	r3, .L58+8
	ldr	r2, .L58+28
	str	r2, [r3]
	b	.L16
.L20:
	ldr	r3, .L58+32
	ldr	r3, [r3]
	cmp	r3, #99
	bne	.L28
	ldr	r3, .L58+36
	ldr	r3, [r3]
	ldr	r2, .L58+32
	ldr	r2, [r2]
	ldr	r1, .L58+40
	mov	r0, r3
	bl	fprintf
	b	.L29
.L28:
	ldr	r3, .L58+32
	ldr	r3, [r3]
	mov	r0, r3
	bl	isprint
	mov	r3, r0
	cmp	r3, #0
	beq	.L30
	ldr	r3, .L58+36
	ldr	r3, [r3]
	ldr	r2, .L58+32
	ldr	r2, [r2]
	ldr	r1, .L58+44
	mov	r0, r3
	bl	fprintf
	b	.L29
.L30:
	ldr	r3, .L58+36
	ldr	r3, [r3]
	ldr	r2, .L58+32
	ldr	r2, [r2]
	ldr	r1, .L58+48
	mov	r0, r3
	bl	fprintf
.L29:
	mov	r3, #0
	ldr	r2, .L58
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L53
	b	.L55
.L18:
.L57:
	nop
.L16:
	ldr	r2, .L58+52
	ldr	r1, [fp, #-188]
	ldr	r0, [fp, #-184]
	bl	getopt
	str	r0, [fp, #-140]
	ldr	r3, [fp, #-140]
	cmn	r3, #1
	bne	.L32
	ldr	r3, .L58+8
	ldr	r3, [r3]
	cmn	r3, #1
	beq	.L33
	ldr	r3, .L58+16
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L34
.L33:
	bl	print_usage
.L34:
	ldr	r3, .L58+56
	ldr	r3, [r3]
	str	r3, [fp, #-144]
	b	.L35
.L36:
	ldr	r3, [fp, #-144]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-188]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L58+60
	bl	printf
	ldr	r3, [fp, #-144]
	add	r3, r3, #1
	str	r3, [fp, #-144]
.L35:
	ldr	r2, [fp, #-144]
	ldr	r3, [fp, #-184]
	cmp	r2, r3
	blt	.L36
	ldr	r3, .L58+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-148]
	mov	r1, r3
	ldr	r0, .L58+64
	bl	printf
.L52:
	ldr	r3, [fp, #-160]
	cmp	r3, #4
	ldrls	pc, [pc, r3, asl #2]
	b	.L52
.L39:
	.word	.L43
	.word	.L42
	.word	.L41
	.word	.L40
	.word	.L38
.L43:
	ldr	r0, .L58+68
	bl	puts
	bl	OpenAdrPort
	str	r0, [fp, #-164]
	ldr	r3, [fp, #-164]
	cmp	r3, #0
	bge	.L44
	ldr	r0, .L58+72
	bl	perror
	b	.L37
.L44:
	mov	r3, #0
	str	r3, [fp, #-156]
	mov	r3, #1
	str	r3, [fp, #-160]
	b	.L37
.L42:
	ldr	r3, [fp, #-156]
	add	r2, r3, #1
	str	r2, [fp, #-156]
	sub	r0, fp, #120
	mov	r2, r3
	ldr	r1, .L58+76
	bl	sprintf
	sub	r3, fp, #120
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	sub	r3, fp, #120
	mov	r1, r3
	ldr	r0, [fp, #-164]
	bl	write
	mov	r4, r0
	sub	r3, fp, #120
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	cmp	r4, r3
	bge	.L46
	ldr	r0, .L58+80
	bl	perror
	mov	r3, #4
	str	r3, [fp, #-160]
	mov	r0, #5
	bl	sleep
	b	.L37
.L46:
	sub	r3, fp, #68
	mov	r2, #50
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #2
	str	r3, [fp, #-160]
	mov	r3, #0
	str	r3, [fp, #-152]
	sub	r3, fp, #120
	mov	r1, r3
	ldr	r0, .L58+84
	bl	printf
	sub	r3, fp, #172
	mov	r0, r3
	bl	time
	b	.L37
.L41:
	sub	r3, fp, #168
	mov	r0, r3
	bl	time
	ldr	r3, [fp, #-168]
	ldr	r2, [fp, #-172]
	mov	r1, r2
	mov	r0, r3
	bl	difftime
	str	r0, [fp, #-132]
	str	r1, [fp, #-128]
	mov	r2, #0
	ldr	r3, .L58+88
	sub	r1, fp, #132
	ldmia	r1, {r0-r1}
	bl	__aeabi_dcmpgt
	mov	r3, r0
	cmp	r3, #0
	beq	.L48
	ldr	r0, .L58+92
	bl	puts
	mov	r3, #4
	str	r3, [fp, #-160]
	mov	r0, #1
	bl	sleep
.L48:
	sub	r3, fp, #173
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-164]
	bl	read
	str	r0, [fp, #-136]
	ldr	r3, [fp, #-136]
	cmp	r3, #0
	ble	.L56
	ldrb	r1, [fp, #-173]	@ zero_extendqisi2
	sub	r2, fp, #68
	ldr	r3, [fp, #-152]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	ldr	r2, [fp, #-152]
	ldr	r3, [fp, #-136]
	add	r3, r2, r3
	str	r3, [fp, #-152]
	ldr	r3, [fp, #-152]
	cmp	r3, #50
	bls	.L51
	mov	r3, #0
	strb	r3, [fp, #-19]
	sub	r3, fp, #68
	mov	r1, r3
	ldr	r0, .L58+96
	bl	printf
	b	.L56
.L51:
	ldrb	r3, [fp, #-173]	@ zero_extendqisi2
	cmp	r3, #35
	bne	.L56
	mov	r3, #3
	str	r3, [fp, #-160]
	b	.L56
.L40:
	sub	r3, fp, #68
	mov	r1, r3
	ldr	r0, .L58+100
	bl	printf
	mov	r3, #1
	str	r3, [fp, #-160]
	mov	r0, #1000
	bl	usleep
	b	.L37
.L38:
	ldr	r0, .L58+104
	bl	puts
	ldr	r0, [fp, #-164]
	bl	closePort
	mov	r3, #0
	str	r3, [fp, #-160]
	b	.L37
.L56:
	nop
.L37:
	b	.L52
.L55:
	bl	__stack_chk_fail
.L53:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L59:
	.align	2
.L58:
	.word	.LC23
	.word	opterr
	.word	baudrate
	.word	optarg
	.word	device
	.word	4097
	.word	115200
	.word	4098
	.word	optopt
	.word	stderr
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	optind
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	1072693248
	.word	.LC19
	.word	.LC20
	.word	.LC21
	.word	.LC22
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
