	.file	"935923.c"
	.intel_syntax noprefix
	.text
	.globl	STOP
	.bss
	.align 4
	.type	STOP, @object
	.size	STOP, 4
STOP:
	.zero	4
	.section	.rodata
.LC0:
	.string	"/dev/ttyS0"
.LC1:
	.string	"/dev/ttyS1"
	.align 8
.LC2:
	.string	"Usage:\tserial SerialPort\n\tex: serial /dev/ttyS1"
	.text
	.globl	main
	.type	main, @function
main:
.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, 432
	mov	DWORD PTR -420[rbp], edi
	mov	QWORD PTR -432[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -420[rbp], 1
	jle	.L2
	mov	rax, QWORD PTR -432[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	call	strcmp@PLT
	test	eax, eax
	je	.L3
	mov	rax, QWORD PTR -432[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	call	strcmp@PLT
	test	eax, eax
	je	.L3
.L2:
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	rax, QWORD PTR -432[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	esi, 256
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -408[rbp], eax
	cmp	DWORD PTR -408[rbp], 0
	jns	.L4
	mov	rax, QWORD PTR -432[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, -1
	call	exit@PLT
.L4:
	lea	rdx, -400[rbp]
	mov	eax, DWORD PTR -408[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	tcgetattr@PLT
	lea	rax, -336[rbp]
	mov	QWORD PTR [rax], 0
	mov	QWORD PTR 8[rax], 0
	mov	QWORD PTR 16[rax], 0
	mov	QWORD PTR 24[rax], 0
	mov	QWORD PTR 32[rax], 0
	mov	QWORD PTR 40[rax], 0
	mov	QWORD PTR 48[rax], 0
	mov	DWORD PTR 56[rax], 0
	mov	DWORD PTR -328[rbp], 2239
	mov	DWORD PTR -336[rbp], 260
	mov	DWORD PTR -332[rbp], 0
	mov	DWORD PTR -324[rbp], 2
	mov	BYTE PTR -319[rbp], 0
	mov	BYTE PTR -318[rbp], 0
	mov	BYTE PTR -317[rbp], 0
	mov	BYTE PTR -316[rbp], 0
	mov	BYTE PTR -315[rbp], 4
	mov	BYTE PTR -314[rbp], 0
	mov	BYTE PTR -313[rbp], 1
	mov	BYTE PTR -312[rbp], 0
	mov	BYTE PTR -311[rbp], 0
	mov	BYTE PTR -310[rbp], 0
	mov	BYTE PTR -309[rbp], 0
	mov	BYTE PTR -308[rbp], 0
	mov	BYTE PTR -307[rbp], 0
	mov	BYTE PTR -306[rbp], 0
	mov	BYTE PTR -305[rbp], 0
	mov	BYTE PTR -304[rbp], 0
	mov	BYTE PTR -303[rbp], 0
	mov	eax, DWORD PTR -408[rbp]
	mov	esi, 0
	mov	edi, eax
	call	tcflush@PLT
	lea	rdx, -336[rbp]
	mov	eax, DWORD PTR -408[rbp]
	mov	esi, 0
	mov	edi, eax
	call	tcsetattr@PLT
	jmp	.L5
.L8:
	lea	rcx, -272[rbp]
	mov	eax, DWORD PTR -408[rbp]
	mov	edx, 255
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -404[rbp], eax
	mov	eax, DWORD PTR -404[rbp]
	cdqe
	mov	BYTE PTR -272[rbp+rax], 0
	mov	DWORD PTR -412[rbp], 0
	jmp	.L6
.L7:
	mov	eax, DWORD PTR -412[rbp]
	cdqe
	movzx	eax, BYTE PTR -272[rbp+rax]
	movsx	eax, al
	mov	edi, eax
	call	putchar@PLT
	add	DWORD PTR -412[rbp], 1
.L6:
	mov	eax, DWORD PTR -412[rbp]
	cmp	eax, DWORD PTR -404[rbp]
	jl	.L7
	mov	edi, 10
	call	putchar@PLT
	movzx	eax, BYTE PTR -272[rbp]
	cmp	al, 122
	jne	.L5
	mov	DWORD PTR STOP[rip], 1
.L5:
	mov	eax, DWORD PTR STOP[rip]
	test	eax, eax
	je	.L8
	lea	rdx, -400[rbp]
	mov	eax, DWORD PTR -408[rbp]
	mov	esi, 0
	mov	edi, eax
	call	tcsetattr@PLT
	mov	eax, DWORD PTR -408[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"935923.c"
	.text
	.global	STOP
	.bss
	.align	2
	.type	STOP, %object
	.size	STOP, 4
STOP:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/dev/ttyS0\000"
	.align	2
.LC1:
	.ascii	"/dev/ttyS1\000"
	.align	2
.LC2:
	.ascii	"Usage:\011serial SerialPort\012\011ex: serial /dev/"
	.ascii	"ttyS1\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 400
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #400
	str	r0, [fp, #-400]
	str	r1, [fp, #-404]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-400]
	cmp	r3, #1
	ble	.L2
	ldr	r3, [fp, #-404]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L11+4
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L3
	ldr	r3, [fp, #-404]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L11+8
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L3
.L2:
	ldr	r0, .L11+12
	bl	puts
	mov	r0, #1
	bl	exit
.L3:
	ldr	r3, [fp, #-404]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, #256
	mov	r0, r3
	bl	open
	str	r0, [fp, #-392]
	ldr	r3, [fp, #-392]
	cmp	r3, #0
	bge	.L4
	ldr	r3, [fp, #-404]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	perror
	mvn	r0, #0
	bl	exit
.L4:
	sub	r3, fp, #384
	mov	r1, r3
	ldr	r0, [fp, #-392]
	bl	tcgetattr
	sub	r3, fp, #324
	mov	r0, r3
	mov	r3, #60
	mov	r2, r3
	mov	r1, #0
	bl	memset
	ldr	r3, .L11+16
	str	r3, [fp, #-316]
	mov	r3, #260
	str	r3, [fp, #-324]
	mov	r3, #0
	str	r3, [fp, #-320]
	mov	r3, #2
	str	r3, [fp, #-312]
	mov	r3, #0
	strb	r3, [fp, #-307]
	mov	r3, #0
	strb	r3, [fp, #-306]
	mov	r3, #0
	strb	r3, [fp, #-305]
	mov	r3, #0
	strb	r3, [fp, #-304]
	mov	r3, #4
	strb	r3, [fp, #-303]
	mov	r3, #0
	strb	r3, [fp, #-302]
	mov	r3, #1
	strb	r3, [fp, #-301]
	mov	r3, #0
	strb	r3, [fp, #-300]
	mov	r3, #0
	strb	r3, [fp, #-299]
	mov	r3, #0
	strb	r3, [fp, #-298]
	mov	r3, #0
	strb	r3, [fp, #-297]
	mov	r3, #0
	strb	r3, [fp, #-296]
	mov	r3, #0
	strb	r3, [fp, #-295]
	mov	r3, #0
	strb	r3, [fp, #-294]
	mov	r3, #0
	strb	r3, [fp, #-293]
	mov	r3, #0
	strb	r3, [fp, #-292]
	mov	r3, #0
	strb	r3, [fp, #-291]
	mov	r1, #0
	ldr	r0, [fp, #-392]
	bl	tcflush
	sub	r3, fp, #324
	mov	r2, r3
	mov	r1, #0
	ldr	r0, [fp, #-392]
	bl	tcsetattr
	b	.L5
.L8:
	sub	r3, fp, #264
	mov	r2, #255
	mov	r1, r3
	ldr	r0, [fp, #-392]
	bl	read
	str	r0, [fp, #-388]
	sub	r2, fp, #264
	ldr	r3, [fp, #-388]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	mov	r3, #0
	str	r3, [fp, #-396]
	b	.L6
.L7:
	sub	r2, fp, #264
	ldr	r3, [fp, #-396]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	putchar
	ldr	r3, [fp, #-396]
	add	r3, r3, #1
	str	r3, [fp, #-396]
.L6:
	ldr	r2, [fp, #-396]
	ldr	r3, [fp, #-388]
	cmp	r2, r3
	blt	.L7
	mov	r0, #10
	bl	putchar
	ldrb	r3, [fp, #-264]	@ zero_extendqisi2
	cmp	r3, #122
	bne	.L5
	ldr	r3, .L11+20
	mov	r2, #1
	str	r2, [r3]
.L5:
	ldr	r3, .L11+20
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L8
	sub	r3, fp, #384
	mov	r2, r3
	mov	r1, #0
	ldr	r0, [fp, #-392]
	bl	tcsetattr
	ldr	r0, [fp, #-392]
	bl	close
	mov	r3, #0
	ldr	r2, .L11
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	2239
	.word	STOP
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
