	.file	"819893.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"\nUsage: %s [options] tty\n\n"
	.align 8
.LC1:
	.string	"Options: -c <count>  (ascii count)\n"
	.align 8
.LC2:
	.string	"         -?         (show this help)\n"
.LC3:
	.string	"\nExample:\n"
.LC4:
	.string	"uart-loopback /dev/ttyS1\n"
	.text
	.globl	print_usage
	.type	print_usage, @function
print_usage:
.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	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -8[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 35
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 37
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 10
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 25
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rsi, rax
	mov	edi, 10
	call	fputc@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	print_usage, .-print_usage
	.section	.rodata
.LC5:
	.string	"c:?"
.LC6:
	.string	"count=%d\n"
.LC7:
	.string	"uart port used: %s\n"
.LC8:
	.string	"can't get port settings"
.LC9:
	.string	"can't set port settings"
.LC10:
	.string	"write error!"
.LC11:
	.string	"read timeout error!"
.LC12:
	.string	"read error!"
	.align 8
.LC13:
	.string	"read data error: wrote 0x%x read 0x%x\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 288
	mov	DWORD PTR -276[rbp], edi
	mov	QWORD PTR -288[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -240[rbp], 0
	mov	DWORD PTR -256[rbp], 26
	jmp	.L3
.L5:
	cmp	DWORD PTR -252[rbp], 99
	jne	.L4
	mov	rax, QWORD PTR optarg[rip]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -256[rbp], eax
	jmp	.L3
.L4:
	mov	rax, QWORD PTR -288[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	print_usage
	nop
.L3:
	mov	rcx, QWORD PTR -288[rbp]
	mov	eax, DWORD PTR -276[rbp]
	lea	rdx, .LC5[rip]
	mov	rsi, rcx
	mov	edi, eax
	call	getopt@PLT
	mov	DWORD PTR -252[rbp], eax
	cmp	DWORD PTR -252[rbp], -1
	jne	.L5
	mov	edx, DWORD PTR optind[rip]
	mov	eax, DWORD PTR -276[rbp]
	sub	eax, edx
	cmp	eax, 1
	je	.L6
	mov	rax, QWORD PTR -288[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	print_usage
.L6:
	mov	eax, DWORD PTR optind[rip]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -288[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -232[rbp], rax
	mov	eax, DWORD PTR -256[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -232[rbp]
	mov	esi, 258
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -248[rbp], eax
	cmp	DWORD PTR -248[rbp], 0
	jns	.L7
	mov	rax, QWORD PTR -232[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	mov	rax, QWORD PTR -232[rbp]
	mov	rsi, rax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -248[rbp]
	mov	esi, 0
	mov	edi, eax
	call	tcflush@PLT
	lea	rdx, -208[rbp]
	mov	eax, DWORD PTR -248[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	tcgetattr@PLT
	test	eax, eax
	jns	.L8
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L17
.L8:
	lea	rax, -208[rbp]
	mov	rdi, rax
	call	cfmakeraw@PLT
	mov	eax, DWORD PTR -200[rbp]
	or	ah, 8
	mov	DWORD PTR -200[rbp], eax
	mov	eax, DWORD PTR -200[rbp]
	and	eax, 2147483647
	mov	DWORD PTR -200[rbp], eax
	lea	rdx, -208[rbp]
	mov	eax, DWORD PTR -248[rbp]
	mov	esi, 0
	mov	edi, eax
	call	tcsetattr@PLT
	test	eax, eax
	jns	.L10
	lea	rdi, .LC9[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L17
.L10:
	mov	BYTE PTR -257[rbp], 65
	jmp	.L11
.L16:
	lea	rcx, -257[rbp]
	mov	eax, DWORD PTR -248[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -244[rbp], eax
	cmp	DWORD PTR -244[rbp], 1
	je	.L12
	lea	rdi, .LC10[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	mov	eax, DWORD PTR -248[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	esi, eax
	movsx	rax, esi
	mov	rdi, QWORD PTR -144[rbp+rax*8]
	mov	eax, DWORD PTR -248[rbp]
	cdq
	shr	edx, 26
	add	eax, edx
	and	eax, 63
	sub	eax, edx
	mov	edx, 1
	mov	ecx, eax
	sal	rdx, cl
	mov	rax, rdx
	or	rdi, rax
	mov	rdx, rdi
	movsx	rax, esi
	mov	QWORD PTR -144[rbp+rax*8], rdx
	mov	QWORD PTR -216[rbp], 0
	mov	QWORD PTR -224[rbp], 10
	mov	eax, DWORD PTR -248[rbp]
	lea	edi, 1[rax]
	lea	rdx, -224[rbp]
	lea	rax, -144[rbp]
	mov	r8, rdx
	mov	ecx, 0
	mov	edx, 0
	mov	rsi, rax
	call	select@PLT
	mov	DWORD PTR -244[rbp], eax
	cmp	DWORD PTR -244[rbp], 0
	jne	.L13
	lea	rdi, .LC11[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L13:
	lea	rcx, -10[rbp]
	mov	eax, DWORD PTR -248[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -244[rbp], eax
	cmp	DWORD PTR -244[rbp], 1
	je	.L14
	lea	rdi, .LC12[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L14:
	movzx	edx, BYTE PTR -10[rbp]
	movzx	eax, BYTE PTR -257[rbp]
	cmp	dl, al
	je	.L15
	movzx	eax, BYTE PTR -10[rbp]
	movsx	edx, al
	movzx	eax, BYTE PTR -257[rbp]
	movsx	eax, al
	mov	esi, eax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L15:
	movzx	eax, BYTE PTR -10[rbp]
	movsx	eax, al
	mov	edi, eax
	call	putchar@PLT
	movzx	eax, BYTE PTR -257[rbp]
	add	eax, 1
	mov	BYTE PTR -257[rbp], al
.L11:
	mov	eax, DWORD PTR -256[rbp]
	lea	edx, 64[rax]
	movzx	eax, BYTE PTR -257[rbp]
	movsx	eax, al
	cmp	edx, eax
	jge	.L16
	mov	edi, 10
	call	putchar@PLT
	mov	eax, DWORD PTR -248[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.L17:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"819893.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\012Usage: %s [options] tty\012\012\000"
	.align	2
.LC1:
	.ascii	"Options: -c <count>  (ascii count)\012\000"
	.align	2
.LC2:
	.ascii	"         -?         (show this help)\012\000"
	.align	2
.LC3:
	.ascii	"\012Example:\012\000"
	.align	2
.LC4:
	.ascii	"uart-loopback /dev/ttyS1\012\000"
	.text
	.align	2
	.global	print_usage
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_usage, %function
print_usage:
	@ 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	r3, .L2
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	ldr	r1, .L2+4
	mov	r0, r3
	bl	fprintf
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r2, #35
	mov	r1, #1
	ldr	r0, .L2+8
	bl	fwrite
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r2, #37
	mov	r1, #1
	ldr	r0, .L2+12
	bl	fwrite
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r2, #10
	mov	r1, #1
	ldr	r0, .L2+16
	bl	fwrite
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r2, #25
	mov	r1, #1
	ldr	r0, .L2+20
	bl	fwrite
	ldr	r3, .L2
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, #10
	bl	fputc
	mov	r0, #1
	bl	exit
.L3:
	.align	2
.L2:
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	print_usage, .-print_usage
	.section	.rodata
	.align	2
.LC5:
	.ascii	"c:?\000"
	.align	2
.LC6:
	.ascii	"count=%d\012\000"
	.align	2
.LC7:
	.ascii	"uart port used: %s\012\000"
	.align	2
.LC8:
	.ascii	"can't get port settings\000"
	.align	2
.LC9:
	.ascii	"can't set port settings\000"
	.align	2
.LC10:
	.ascii	"write error!\000"
	.align	2
.LC11:
	.ascii	"read timeout error!\000"
	.align	2
.LC12:
	.ascii	"read error!\000"
	.align	2
.LC13:
	.ascii	"read data error: wrote 0x%x read 0x%x\012\000"
	.align	2
.LC14:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 240
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #248
	str	r0, [fp, #-240]
	str	r1, [fp, #-244]
	ldr	r3, .L21
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-228]
	mov	r3, #26
	str	r3, [fp, #-232]
	b	.L5
.L7:
	ldr	r3, [fp, #-224]
	cmp	r3, #99
	bne	.L6
	ldr	r3, .L21+4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-232]
	b	.L5
.L6:
	ldr	r3, [fp, #-244]
	ldr	r3, [r3]
	mov	r0, r3
	bl	print_usage
	nop
.L5:
	ldr	r2, .L21+8
	ldr	r1, [fp, #-244]
	ldr	r0, [fp, #-240]
	bl	getopt
	str	r0, [fp, #-224]
	ldr	r3, [fp, #-224]
	cmn	r3, #1
	bne	.L7
	ldr	r3, .L21+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-240]
	sub	r3, r2, r3
	cmp	r3, #1
	beq	.L8
	ldr	r3, [fp, #-244]
	ldr	r3, [r3]
	mov	r0, r3
	bl	print_usage
.L8:
	ldr	r3, .L21+12
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-244]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-220]
	ldr	r1, [fp, #-232]
	ldr	r0, .L21+16
	bl	printf
	ldr	r1, .L21+20
	ldr	r0, [fp, #-220]
	bl	open
	str	r0, [fp, #-216]
	ldr	r3, [fp, #-216]
	cmp	r3, #0
	bge	.L9
	ldr	r0, [fp, #-220]
	bl	perror
	mov	r0, #1
	bl	exit
.L9:
	ldr	r1, [fp, #-220]
	ldr	r0, .L21+24
	bl	printf
	mov	r1, #0
	ldr	r0, [fp, #-216]
	bl	tcflush
	sub	r3, fp, #200
	mov	r1, r3
	ldr	r0, [fp, #-216]
	bl	tcgetattr
	mov	r3, r0
	cmp	r3, #0
	bge	.L10
	ldr	r0, .L21+28
	bl	perror
	mvn	r3, #0
	b	.L19
.L10:
	sub	r3, fp, #200
	mov	r0, r3
	bl	cfmakeraw
	ldr	r3, [fp, #-192]
	orr	r3, r3, #2048
	str	r3, [fp, #-192]
	ldr	r3, [fp, #-192]
	bic	r3, r3, #-2147483648
	str	r3, [fp, #-192]
	sub	r3, fp, #200
	mov	r2, r3
	mov	r1, #0
	ldr	r0, [fp, #-216]
	bl	tcsetattr
	mov	r3, r0
	cmp	r3, #0
	bge	.L12
	ldr	r0, .L21+32
	bl	perror
	mvn	r3, #0
	b	.L19
.L12:
	mov	r3, #65
	strb	r3, [fp, #-233]
	b	.L13
.L18:
	sub	r3, fp, #233
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-216]
	bl	write
	str	r0, [fp, #-212]
	ldr	r3, [fp, #-212]
	cmp	r3, #1
	beq	.L14
	ldr	r0, .L21+36
	bl	puts
	mov	r0, #1
	bl	exit
.L14:
	ldr	r3, [fp, #-216]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	lsl	r3, r2, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r1, [r3, #-136]
	ldr	r3, [fp, #-216]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	orr	r1, r1, r3
	lsl	r3, r2, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	str	r1, [r3, #-136]
	mov	r3, #0
	str	r3, [fp, #-204]
	mov	r3, #10
	str	r3, [fp, #-208]
	ldr	r3, [fp, #-216]
	add	r0, r3, #1
	sub	r1, fp, #140
	sub	r3, fp, #208
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #0
	bl	select
	str	r0, [fp, #-212]
	ldr	r3, [fp, #-212]
	cmp	r3, #0
	bne	.L15
	ldr	r0, .L21+40
	bl	puts
	mov	r0, #1
	bl	exit
.L15:
	sub	r3, fp, #12
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-216]
	bl	read
	str	r0, [fp, #-212]
	ldr	r3, [fp, #-212]
	cmp	r3, #1
	beq	.L16
	ldr	r0, .L21+44
	bl	puts
	mov	r0, #1
	bl	exit
.L16:
	ldrb	r2, [fp, #-12]	@ zero_extendqisi2
	ldrb	r3, [fp, #-233]	@ zero_extendqisi2
	cmp	r2, r3
	beq	.L17
	ldrb	r3, [fp, #-233]	@ zero_extendqisi2
	mov	r1, r3
	ldrb	r3, [fp, #-12]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r0, .L21+48
	bl	printf
	mov	r0, #1
	bl	exit
.L17:
	ldrb	r3, [fp, #-12]	@ zero_extendqisi2
	mov	r0, r3
	bl	putchar
	ldrb	r3, [fp, #-233]	@ zero_extendqisi2
	add	r3, r3, #1
	and	r3, r3, #255
	strb	r3, [fp, #-233]
.L13:
	ldr	r3, [fp, #-232]
	add	r3, r3, #64
	ldrb	r2, [fp, #-233]	@ zero_extendqisi2
	cmp	r3, r2
	bge	.L18
	mov	r0, #10
	bl	putchar
	ldr	r0, [fp, #-216]
	bl	close
	mov	r3, #0
.L19:
	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	.LC14
	.word	optarg
	.word	.LC5
	.word	optind
	.word	.LC6
	.word	258
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
