	.file	"165086.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"/dev/ttyUSB0"
	.align 8
.LC1:
	.string	"Error! Could not open ttyUSB0!"
	.align 8
.LC2:
	.string	"ERROR! Could not set attributes!"
.LC3:
	.string	"T"
.LC4:
	.string	"Z"
.LC5:
	.string	"T0.0"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 112
	mov	DWORD PTR -100[rbp], edi
	mov	QWORD PTR -112[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	esi, 1052930
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -84[rbp], eax
	cmp	DWORD PTR -84[rbp], 0
	jns	.L2
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 30
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
.L2:
	lea	rdx, -80[rbp]
	mov	eax, DWORD PTR -84[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	tcgetattr@PLT
	lea	rax, -80[rbp]
	mov	rdi, rax
	call	cfmakeraw@PLT
	lea	rax, -80[rbp]
	mov	esi, 13
	mov	rdi, rax
	call	cfsetspeed@PLT
	mov	eax, DWORD PTR -80[rbp]
	or	eax, 27
	mov	DWORD PTR -80[rbp], eax
	mov	eax, DWORD PTR -76[rbp]
	or	eax, 27
	mov	DWORD PTR -76[rbp], eax
	lea	rdx, -80[rbp]
	mov	eax, DWORD PTR -84[rbp]
	mov	esi, 0
	mov	edi, eax
	call	tcsetattr@PLT
	test	eax, eax
	jns	.L3
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 32
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
.L3:
	mov	eax, DWORD PTR -84[rbp]
	mov	esi, 0
	mov	edi, eax
	call	tcflush@PLT
	mov	eax, DWORD PTR -84[rbp]
	lea	rsi, .LC3[rip]
	mov	edi, eax
	call	balance_write
	mov	eax, DWORD PTR -84[rbp]
	lea	rsi, .LC4[rip]
	mov	edi, eax
	call	balance_write
	mov	eax, DWORD PTR -84[rbp]
	mov	edi, eax
	call	balance_read
	mov	eax, DWORD PTR -84[rbp]
	lea	rsi, .LC5[rip]
	mov	edi, eax
	call	balance_write
	mov	eax, DWORD PTR -84[rbp]
	mov	edi, eax
	call	balance_read
	mov	eax, DWORD PTR -84[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	serial_write
	.type	serial_write, @function
serial_write:
.LFB1:
	.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	QWORD PTR -16[rbp], rsi
	mov	rcx, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR -4[rbp]
	mov	edx, 8
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	serial_write, .-serial_write
	.globl	serial_read
	.type	serial_read, @function
serial_read:
.LFB2:
	.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	QWORD PTR -16[rbp], rsi
	mov	rcx, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR -4[rbp]
	mov	edx, 32
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	serial_read, .-serial_read
	.globl	print_buffer
	.type	print_buffer, @function
print_buffer:
.LFB3:
	.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	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	print_buffer, .-print_buffer
	.globl	balance_write
	.type	balance_write, @function
balance_write:
.LFB4:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -52[rbp], 0
	mov	rax, QWORD PTR -80[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rcx, QWORD PTR -80[rbp]
	lea	rax, -48[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
	lea	rax, -48[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	lea	rax, -48[rbp]
	add	rax, rdx
	mov	WORD PTR [rax], 2573
	mov	BYTE PTR 2[rax], 0
	lea	rdx, -48[rbp]
	mov	eax, DWORD PTR -68[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	serial_write
	mov	DWORD PTR -52[rbp], eax
	mov	edi, 1
	call	sleep@PLT
	mov	eax, DWORD PTR -52[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	balance_write, .-balance_write
	.section	.rodata
.LC6:
	.string	"P"
	.text
	.globl	balance_read
	.type	balance_read, @function
balance_read:
.LFB5:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	DWORD PTR -68[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -52[rbp], 0
	mov	eax, DWORD PTR -68[rbp]
	lea	rsi, .LC6[rip]
	mov	edi, eax
	call	balance_write
	lea	rdx, -48[rbp]
	mov	eax, DWORD PTR -68[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	serial_read
	mov	DWORD PTR -52[rbp], eax
	lea	rax, -48[rbp]
	mov	rdi, rax
	call	print_buffer
	mov	edi, 5
	call	sleep@PLT
	mov	eax, DWORD PTR -52[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	balance_read, .-balance_read
	.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	"165086.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/dev/ttyUSB0\000"
	.align	2
.LC1:
	.ascii	"Error! Could not open ttyUSB0!\000"
	.align	2
.LC2:
	.ascii	"ERROR! Could not set attributes!\000"
	.align	2
.LC3:
	.ascii	"T\000"
	.align	2
.LC4:
	.ascii	"Z\000"
	.align	2
.LC5:
	.ascii	"T0.0\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 80
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #80
	str	r0, [fp, #-80]
	str	r1, [fp, #-84]
	ldr	r3, .L6
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L6+4
	ldr	r0, .L6+8
	bl	open
	str	r0, [fp, #-72]
	ldr	r3, [fp, #-72]
	cmp	r3, #0
	bge	.L2
	ldr	r3, .L6+12
	ldr	r3, [r3]
	mov	r2, #30
	mov	r1, #1
	ldr	r0, .L6+16
	bl	fwrite
.L2:
	sub	r3, fp, #68
	mov	r1, r3
	ldr	r0, [fp, #-72]
	bl	tcgetattr
	sub	r3, fp, #68
	mov	r0, r3
	bl	cfmakeraw
	sub	r3, fp, #68
	mov	r1, #13
	mov	r0, r3
	bl	cfsetspeed
	ldr	r3, [fp, #-68]
	orr	r3, r3, #27
	str	r3, [fp, #-68]
	ldr	r3, [fp, #-64]
	orr	r3, r3, #27
	str	r3, [fp, #-64]
	sub	r3, fp, #68
	mov	r2, r3
	mov	r1, #0
	ldr	r0, [fp, #-72]
	bl	tcsetattr
	mov	r3, r0
	cmp	r3, #0
	bge	.L3
	ldr	r3, .L6+12
	ldr	r3, [r3]
	mov	r2, #32
	mov	r1, #1
	ldr	r0, .L6+20
	bl	fwrite
.L3:
	mov	r1, #0
	ldr	r0, [fp, #-72]
	bl	tcflush
	ldr	r1, .L6+24
	ldr	r0, [fp, #-72]
	bl	balance_write
	ldr	r1, .L6+28
	ldr	r0, [fp, #-72]
	bl	balance_write
	ldr	r0, [fp, #-72]
	bl	balance_read
	ldr	r1, .L6+32
	ldr	r0, [fp, #-72]
	bl	balance_write
	ldr	r0, [fp, #-72]
	bl	balance_read
	ldr	r0, [fp, #-72]
	bl	close
	mov	r3, #0
	ldr	r2, .L6
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L5
	bl	__stack_chk_fail
.L5:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC6
	.word	1052930
	.word	.LC0
	.word	stderr
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.align	2
	.global	serial_write
	.syntax unified
	.arm
	.fpu softvfp
	.type	serial_write, %function
serial_write:
	@ 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]
	str	r1, [fp, #-12]
	mov	r2, #4
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-8]
	bl	write
	mov	r3, r0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	serial_write, .-serial_write
	.align	2
	.global	serial_read
	.syntax unified
	.arm
	.fpu softvfp
	.type	serial_read, %function
serial_read:
	@ 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]
	str	r1, [fp, #-12]
	mov	r2, #32
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-8]
	bl	read
	mov	r3, r0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	serial_read, .-serial_read
	.align	2
	.global	print_buffer
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_buffer, %function
print_buffer:
	@ 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	puts
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	print_buffer, .-print_buffer
	.section	.rodata
	.align	2
.LC7:
	.ascii	"\015\012\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	balance_write
	.syntax unified
	.arm
	.fpu softvfp
	.type	balance_write, %function
balance_write:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-44]
	ldr	r0, [fp, #-52]
	bl	strlen
	mov	r2, r0
	sub	r3, fp, #40
	ldr	r1, [fp, #-52]
	mov	r0, r3
	bl	strncpy
	sub	r3, fp, #40
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #40
	add	r3, r3, r2
	ldr	r2, .L16+4
	mov	r0, r3
	mov	r1, r2
	mov	r3, #3
	mov	r2, r3
	bl	memcpy
	sub	r3, fp, #40
	mov	r1, r3
	ldr	r0, [fp, #-48]
	bl	serial_write
	str	r0, [fp, #-44]
	mov	r0, #1
	bl	sleep
	ldr	r3, [fp, #-44]
	ldr	r2, .L16
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC8
	.word	.LC7
	.size	balance_write, .-balance_write
	.section	.rodata
	.align	2
.LC9:
	.ascii	"P\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	balance_read
	.syntax unified
	.arm
	.fpu softvfp
	.type	balance_read, %function
balance_read:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-48]
	ldr	r3, .L21
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-44]
	ldr	r1, .L21+4
	ldr	r0, [fp, #-48]
	bl	balance_write
	sub	r3, fp, #40
	mov	r1, r3
	ldr	r0, [fp, #-48]
	bl	serial_read
	str	r0, [fp, #-44]
	sub	r3, fp, #40
	mov	r0, r3
	bl	print_buffer
	mov	r0, #5
	bl	sleep
	ldr	r3, [fp, #-44]
	ldr	r2, .L21
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L20
	bl	__stack_chk_fail
.L20:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	.LC10
	.word	.LC9
	.size	balance_read, .-balance_read
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
