	.file	"599944.c"
	.intel_syntax noprefix
	.text
	.local	oldterminfo
	.comm	oldterminfo,60,32
	.section	.rodata
.LC0:
	.string	"closeserial()"
	.text
	.globl	closeserial
	.type	closeserial, @function
closeserial:
.LFB6:
	.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]
	lea	rdx, oldterminfo[rip]
	mov	esi, 0
	mov	edi, eax
	call	tcsetattr@PLT
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	close@PLT
	test	eax, eax
	jns	.L3
	lea	rdi, .LC0[rip]
	call	perror@PLT
.L3:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	closeserial, .-closeserial
	.section	.rodata
.LC1:
	.string	"openserial(): open()"
.LC2:
	.string	"openserial(): tcgetattr()"
.LC3:
	.string	"openserial(): tcflush()"
.LC4:
	.string	"initserial(): tcsetattr()"
	.text
	.globl	openserial
	.type	openserial, @function
openserial:
.LFB7:
	.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	QWORD PTR -104[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -104[rbp]
	mov	esi, 2
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -84[rbp], eax
	cmp	DWORD PTR -84[rbp], -1
	jne	.L5
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	eax, 0
	jmp	.L10
.L5:
	mov	eax, DWORD PTR -84[rbp]
	lea	rsi, oldterminfo[rip]
	mov	edi, eax
	call	tcgetattr@PLT
	cmp	eax, -1
	jne	.L7
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	eax, 0
	jmp	.L10
.L7:
	mov	rax, QWORD PTR oldterminfo[rip]
	mov	rdx, QWORD PTR oldterminfo[rip+8]
	mov	QWORD PTR -80[rbp], rax
	mov	QWORD PTR -72[rbp], rdx
	mov	rax, QWORD PTR oldterminfo[rip+16]
	mov	rdx, QWORD PTR oldterminfo[rip+24]
	mov	QWORD PTR -64[rbp], rax
	mov	QWORD PTR -56[rbp], rdx
	mov	rax, QWORD PTR oldterminfo[rip+32]
	mov	rdx, QWORD PTR oldterminfo[rip+40]
	mov	QWORD PTR -48[rbp], rax
	mov	QWORD PTR -40[rbp], rdx
	mov	rax, QWORD PTR oldterminfo[rip+48]
	mov	QWORD PTR -32[rbp], rax
	mov	eax, DWORD PTR oldterminfo[rip+56]
	mov	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR -72[rbp]
	or	eax, -2147481600
	mov	DWORD PTR -72[rbp], eax
	mov	DWORD PTR -76[rbp], 0
	mov	eax, DWORD PTR -84[rbp]
	mov	esi, 2
	mov	edi, eax
	call	tcflush@PLT
	cmp	eax, -1
	jne	.L8
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	eax, 0
	jmp	.L10
.L8:
	lea	rdx, -80[rbp]
	mov	eax, DWORD PTR -84[rbp]
	mov	esi, 0
	mov	edi, eax
	call	tcsetattr@PLT
	cmp	eax, -1
	jne	.L9
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	eax, 0
	jmp	.L10
.L9:
	mov	eax, DWORD PTR -84[rbp]
.L10:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	openserial, .-openserial
	.section	.rodata
.LC5:
	.string	"setRTS(): TIOCMGET"
.LC6:
	.string	"setRTS(): TIOCMSET"
	.text
	.globl	setRTS
	.type	setRTS, @function
setRTS:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -24[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdx, -12[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, 21525
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	cmp	eax, -1
	jne	.L13
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	eax, 0
	jmp	.L18
.L13:
	cmp	DWORD PTR -24[rbp], 0
	je	.L15
	mov	eax, DWORD PTR -12[rbp]
	or	eax, 4
	mov	DWORD PTR -12[rbp], eax
	jmp	.L16
.L15:
	mov	eax, DWORD PTR -12[rbp]
	and	eax, -5
	mov	DWORD PTR -12[rbp], eax
.L16:
	lea	rdx, -12[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, 21528
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	cmp	eax, -1
	jne	.L17
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	eax, 0
	jmp	.L18
.L17:
	mov	eax, 1
.L18:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	setRTS, .-setRTS
	.section	.rodata
.LC7:
	.string	"No serial device specified"
.LC8:
	.string	"Error while initializing %s.\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -8[rbp], 0
	cmp	DWORD PTR -20[rbp], 1
	jle	.L21
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	openserial
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], 0
	jne	.L24
	jmp	.L25
.L21:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 26
	mov	esi, 1
	lea	rdi, .LC7[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L23
.L25:
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -8[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L23
.L24:
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, 0
	mov	edi, eax
	call	setRTS
	mov	edi, 1
	call	sleep@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, 1
	mov	edi, eax
	call	setRTS
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	closeserial
	mov	eax, 0
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	main, .-main
	.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	"599944.c"
	.text
	.local	oldterminfo
	.comm	oldterminfo,60,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"closeserial()\000"
	.text
	.align	2
	.global	closeserial
	.syntax unified
	.arm
	.fpu softvfp
	.type	closeserial, %function
closeserial:
	@ 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	r2, .L4
	mov	r1, #0
	ldr	r0, [fp, #-8]
	bl	tcsetattr
	ldr	r0, [fp, #-8]
	bl	close
	mov	r3, r0
	cmp	r3, #0
	bge	.L3
	ldr	r0, .L4+4
	bl	perror
.L3:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	oldterminfo
	.word	.LC0
	.size	closeserial, .-closeserial
	.section	.rodata
	.align	2
.LC1:
	.ascii	"openserial(): open()\000"
	.align	2
.LC2:
	.ascii	"openserial(): tcgetattr()\000"
	.align	2
.LC3:
	.ascii	"openserial(): tcflush()\000"
	.align	2
.LC4:
	.ascii	"initserial(): tcsetattr()\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	openserial
	.syntax unified
	.arm
	.fpu softvfp
	.type	openserial, %function
openserial:
	@ 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]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r1, #2
	ldr	r0, [fp, #-80]
	bl	open
	str	r0, [fp, #-72]
	ldr	r3, [fp, #-72]
	cmn	r3, #1
	bne	.L7
	ldr	r0, .L14+4
	bl	perror
	mov	r3, #0
	b	.L12
.L7:
	ldr	r1, .L14+8
	ldr	r0, [fp, #-72]
	bl	tcgetattr
	mov	r3, r0
	cmn	r3, #1
	bne	.L9
	ldr	r0, .L14+12
	bl	perror
	mov	r3, #0
	b	.L12
.L9:
	ldr	r3, .L14+8
	sub	ip, fp, #68
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1, r2}
	stm	ip, {r0, r1, r2}
	ldr	r3, [fp, #-60]
	orr	r3, r3, #-2147483648
	orr	r3, r3, #2048
	str	r3, [fp, #-60]
	mov	r3, #0
	str	r3, [fp, #-64]
	mov	r1, #2
	ldr	r0, [fp, #-72]
	bl	tcflush
	mov	r3, r0
	cmn	r3, #1
	bne	.L10
	ldr	r0, .L14+16
	bl	perror
	mov	r3, #0
	b	.L12
.L10:
	sub	r3, fp, #68
	mov	r2, r3
	mov	r1, #0
	ldr	r0, [fp, #-72]
	bl	tcsetattr
	mov	r3, r0
	cmn	r3, #1
	bne	.L11
	ldr	r0, .L14+20
	bl	perror
	mov	r3, #0
	b	.L12
.L11:
	ldr	r3, [fp, #-72]
.L12:
	ldr	r2, .L14
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L13
	bl	__stack_chk_fail
.L13:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC5
	.word	.LC1
	.word	oldterminfo
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	openserial, .-openserial
	.section	.rodata
	.align	2
.LC6:
	.ascii	"setRTS(): TIOCMGET\000"
	.align	2
.LC7:
	.ascii	"setRTS(): TIOCMSET\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	setRTS
	.syntax unified
	.arm
	.fpu softvfp
	.type	setRTS, %function
setRTS:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #12
	mov	r2, r3
	ldr	r1, .L24+4
	ldr	r0, [fp, #-16]
	bl	ioctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L17
	ldr	r0, .L24+8
	bl	perror
	mov	r3, #0
	b	.L22
.L17:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L19
	ldr	r3, [fp, #-12]
	orr	r3, r3, #4
	str	r3, [fp, #-12]
	b	.L20
.L19:
	ldr	r3, [fp, #-12]
	bic	r3, r3, #4
	str	r3, [fp, #-12]
.L20:
	sub	r3, fp, #12
	mov	r2, r3
	ldr	r1, .L24+12
	ldr	r0, [fp, #-16]
	bl	ioctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L21
	ldr	r0, .L24+16
	bl	perror
	mov	r3, #0
	b	.L22
.L21:
	mov	r3, #1
.L22:
	ldr	r2, .L24
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC8
	.word	21525
	.word	.LC6
	.word	21528
	.word	.LC7
	.size	setRTS, .-setRTS
	.section	.rodata
	.align	2
.LC9:
	.ascii	"No serial device specified\000"
	.align	2
.LC10:
	.ascii	"Error while initializing %s.\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-16]
	cmp	r3, #1
	ble	.L27
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-12]
	ldr	r0, [fp, #-12]
	bl	openserial
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L30
	b	.L31
.L27:
	ldr	r3, .L32
	ldr	r3, [r3]
	mov	r2, #26
	mov	r1, #1
	ldr	r0, .L32+4
	bl	fwrite
	mov	r3, #1
	b	.L29
.L31:
	ldr	r3, .L32
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	ldr	r1, .L32+8
	mov	r0, r3
	bl	fprintf
	mov	r3, #1
	b	.L29
.L30:
	mov	r1, #0
	ldr	r0, [fp, #-8]
	bl	setRTS
	mov	r0, #1
	bl	sleep
	mov	r1, #1
	ldr	r0, [fp, #-8]
	bl	setRTS
	ldr	r0, [fp, #-8]
	bl	closeserial
	mov	r3, #0
.L29:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L33:
	.align	2
.L32:
	.word	stderr
	.word	.LC9
	.word	.LC10
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
