	.file	"164752.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Error from tcgetattr: %s\n"
.LC1:
	.string	"Error from tcsetattr: %s\n"
	.text
	.globl	set_interface_attribs
	.type	set_interface_attribs, @function
set_interface_attribs:
.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, 96
	mov	DWORD PTR -84[rbp], edi
	mov	DWORD PTR -88[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdx, -80[rbp]
	mov	eax, DWORD PTR -84[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	tcgetattr@PLT
	test	eax, eax
	jns	.L2
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L5
.L2:
	mov	edx, DWORD PTR -88[rbp]
	lea	rax, -80[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	cfsetospeed@PLT
	mov	edx, DWORD PTR -88[rbp]
	lea	rax, -80[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	cfsetispeed@PLT
	mov	eax, DWORD PTR -72[rbp]
	or	eax, 2176
	mov	DWORD PTR -72[rbp], eax
	mov	eax, DWORD PTR -72[rbp]
	and	eax, -49
	mov	DWORD PTR -72[rbp], eax
	mov	eax, DWORD PTR -72[rbp]
	or	eax, 48
	mov	DWORD PTR -72[rbp], eax
	mov	eax, DWORD PTR -72[rbp]
	and	ah, -2
	mov	DWORD PTR -72[rbp], eax
	mov	eax, DWORD PTR -72[rbp]
	and	eax, -65
	mov	DWORD PTR -72[rbp], eax
	mov	eax, DWORD PTR -72[rbp]
	and	eax, 2147483647
	mov	DWORD PTR -72[rbp], eax
	mov	eax, DWORD PTR -80[rbp]
	and	eax, -1516
	mov	DWORD PTR -80[rbp], eax
	mov	eax, DWORD PTR -68[rbp]
	and	eax, -32844
	mov	DWORD PTR -68[rbp], eax
	mov	eax, DWORD PTR -76[rbp]
	and	eax, -2
	mov	DWORD PTR -76[rbp], eax
	mov	BYTE PTR -57[rbp], 1
	mov	BYTE PTR -58[rbp], 1
	lea	rdx, -80[rbp]
	mov	eax, DWORD PTR -84[rbp]
	mov	esi, 0
	mov	edi, eax
	call	tcsetattr@PLT
	test	eax, eax
	je	.L4
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L5
.L4:
	mov	eax, 0
.L5:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	set_interface_attribs, .-set_interface_attribs
	.section	.rodata
	.align 8
.LC2:
	.string	"*** Reads serial device to stdout. ***"
	.align 8
.LC3:
	.string	"Usage: ./readserial <device> <baud> <buffer_len>"
	.align 8
.LC4:
	.string	"defaults: baud=9600, buffer_len=32"
.LC5:
	.string	"Error opening %s: %s\n"
.LC6:
	.string	"Error from read: %d: %s\n"
.LC7:
	.string	"Timeout from read"
	.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
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 72
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	DWORD PTR -100[rbp], edi
	mov	QWORD PTR -112[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -100[rbp], 1
	jle	.L8
	mov	rax, QWORD PTR -112[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -80[rbp], rax
	mov	rax, QWORD PTR -80[rbp]
	mov	esi, 1052928
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -88[rbp], eax
	cmp	DWORD PTR -88[rbp], 0
	jns	.L10
	jmp	.L29
.L8:
	lea	rdi, .LC2[rip]
	call	puts@PLT
	lea	rdi, .LC3[rip]
	call	puts@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L29:
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -80[rbp]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L28
	jmp	.L30
.L10:
	mov	DWORD PTR -92[rbp], 13
	cmp	DWORD PTR -100[rbp], 2
	jle	.L31
	mov	rax, QWORD PTR -112[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	edx, 10
	mov	esi, 0
	mov	rdi, rax
	call	strtol@PLT
	cmp	rax, 115200
	je	.L13
	cmp	rax, 115200
	jg	.L12
	cmp	rax, 57600
	je	.L14
	cmp	rax, 57600
	jg	.L12
	cmp	rax, 38400
	je	.L15
	cmp	rax, 38400
	jg	.L12
	cmp	rax, 19200
	je	.L16
	cmp	rax, 19200
	jg	.L12
	cmp	rax, 4800
	je	.L17
	cmp	rax, 9600
	je	.L18
	jmp	.L12
.L17:
	mov	DWORD PTR -92[rbp], 12
	jmp	.L12
.L18:
	mov	DWORD PTR -92[rbp], 13
	jmp	.L12
.L16:
	mov	DWORD PTR -92[rbp], 14
	jmp	.L12
.L15:
	mov	DWORD PTR -92[rbp], 15
	jmp	.L12
.L14:
	mov	DWORD PTR -92[rbp], 4097
	jmp	.L12
.L13:
	mov	DWORD PTR -92[rbp], 4098
	jmp	.L12
.L31:
	nop
.L12:
	mov	edx, DWORD PTR -92[rbp]
	mov	eax, DWORD PTR -88[rbp]
	mov	esi, edx
	mov	edi, eax
	call	set_interface_attribs
	cmp	DWORD PTR -100[rbp], 3
	jle	.L19
	mov	rax, QWORD PTR -112[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	mov	edx, 10
	mov	esi, 0
	mov	rdi, rax
	call	strtol@PLT
	mov	DWORD PTR -96[rbp], eax
	cmp	DWORD PTR -96[rbp], 1
	jg	.L27
	mov	DWORD PTR -96[rbp], 2
	jmp	.L27
.L19:
	mov	DWORD PTR -96[rbp], 32
.L27:
	mov	rax, rsp
	mov	rbx, rax
	mov	ecx, DWORD PTR -96[rbp]
	movsx	rax, ecx
	sub	rax, 1
	mov	QWORD PTR -72[rbp], rax
	movsx	rax, ecx
	mov	r12, rax
	mov	r13d, 0
	movsx	rax, ecx
	mov	r14, rax
	mov	r15d, 0
	movsx	rax, ecx
	mov	edx, 16
	sub	rdx, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rsi, rax
	and	rsi, -4096
	mov	rdx, rsp
	sub	rdx, rsi
.L21:
	cmp	rsp, rdx
	je	.L22
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L21
.L22:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L23
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L23:
	mov	rax, rsp
	add	rax, 0
	mov	QWORD PTR -64[rbp], rax
	movsx	rdx, ecx
	mov	rcx, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR -88[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -84[rbp], eax
	cmp	DWORD PTR -84[rbp], 0
	jle	.L24
	mov	rcx, QWORD PTR stdout[rip]
	mov	eax, DWORD PTR -84[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -64[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	jmp	.L25
.L24:
	cmp	DWORD PTR -84[rbp], 0
	jns	.L26
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	eax, DWORD PTR -84[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L25
.L26:
	lea	rdi, .LC7[rip]
	call	puts@PLT
.L25:
	mov	rsp, rbx
	jmp	.L27
.L30:
	call	__stack_chk_fail@PLT
.L28:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.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	"164752.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Error from tcgetattr: %s\012\000"
	.align	2
.LC1:
	.ascii	"Error from tcsetattr: %s\012\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	set_interface_attribs
	.syntax unified
	.arm
	.fpu softvfp
	.type	set_interface_attribs, %function
set_interface_attribs:
	@ args = 0, pretend = 0, frame = 72
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #72
	str	r0, [fp, #-72]
	str	r1, [fp, #-76]
	ldr	r3, .L7
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #68
	mov	r1, r3
	ldr	r0, [fp, #-72]
	bl	tcgetattr
	mov	r3, r0
	cmp	r3, #0
	bge	.L2
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L7+4
	bl	printf
	mvn	r3, #0
	b	.L5
.L2:
	ldr	r2, [fp, #-76]
	sub	r3, fp, #68
	mov	r1, r2
	mov	r0, r3
	bl	cfsetospeed
	ldr	r2, [fp, #-76]
	sub	r3, fp, #68
	mov	r1, r2
	mov	r0, r3
	bl	cfsetispeed
	ldr	r3, [fp, #-60]
	orr	r3, r3, #2176
	str	r3, [fp, #-60]
	ldr	r3, [fp, #-60]
	bic	r3, r3, #48
	str	r3, [fp, #-60]
	ldr	r3, [fp, #-60]
	orr	r3, r3, #48
	str	r3, [fp, #-60]
	ldr	r3, [fp, #-60]
	bic	r3, r3, #256
	str	r3, [fp, #-60]
	ldr	r3, [fp, #-60]
	bic	r3, r3, #64
	str	r3, [fp, #-60]
	ldr	r3, [fp, #-60]
	bic	r3, r3, #-2147483648
	str	r3, [fp, #-60]
	ldr	r3, [fp, #-68]
	bic	r3, r3, #1504
	bic	r3, r3, #11
	str	r3, [fp, #-68]
	ldr	r3, [fp, #-56]
	bic	r3, r3, #32768
	bic	r3, r3, #75
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-64]
	bic	r3, r3, #1
	str	r3, [fp, #-64]
	mov	r3, #1
	strb	r3, [fp, #-45]
	mov	r3, #1
	strb	r3, [fp, #-46]
	sub	r3, fp, #68
	mov	r2, r3
	mov	r1, #0
	ldr	r0, [fp, #-72]
	bl	tcsetattr
	mov	r3, r0
	cmp	r3, #0
	beq	.L4
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L7+8
	bl	printf
	mvn	r3, #0
	b	.L5
.L4:
	mov	r3, #0
.L5:
	ldr	r2, .L7
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L6
	bl	__stack_chk_fail
.L6:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	.LC2
	.word	.LC0
	.word	.LC1
	.size	set_interface_attribs, .-set_interface_attribs
	.section	.rodata
	.align	2
.LC3:
	.ascii	"*** Reads serial device to stdout. ***\000"
	.align	2
.LC4:
	.ascii	"Usage: ./readserial <device> <baud> <buffer_len>\000"
	.align	2
.LC5:
	.ascii	"defaults: baud=9600, buffer_len=32\000"
	.align	2
.LC6:
	.ascii	"Error opening %s: %s\012\000"
	.align	2
.LC7:
	.ascii	"Error from read: %d: %s\012\000"
	.align	2
.LC8:
	.ascii	"Timeout from read\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #44
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L31
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-48]
	cmp	r3, #1
	ble	.L10
	ldr	r3, [fp, #-52]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-36]
	ldr	r1, .L31+4
	ldr	r0, [fp, #-36]
	bl	open
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bge	.L12
	b	.L28
.L10:
	ldr	r0, .L31+8
	bl	puts
	ldr	r0, .L31+12
	bl	puts
	ldr	r0, .L31+16
	bl	puts
	mov	r0, #1
	bl	exit
.L28:
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, [fp, #-36]
	ldr	r0, .L31+20
	bl	printf
	mvn	r3, #0
	ldr	r2, .L31
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L27
	b	.L29
.L12:
	mov	r3, #13
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-48]
	cmp	r3, #2
	ble	.L30
	ldr	r3, [fp, #-52]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r2, #10
	mov	r1, #0
	mov	r0, r3
	bl	strtol
	mov	r3, r0
	ldr	r2, .L31+24
	cmp	r3, r2
	beq	.L15
	ldr	r2, .L31+24
	cmp	r3, r2
	bgt	.L14
	cmp	r3, #57600
	beq	.L16
	cmp	r3, #57600
	bgt	.L14
	cmp	r3, #38400
	beq	.L17
	cmp	r3, #38400
	bgt	.L14
	cmp	r3, #19200
	beq	.L18
	cmp	r3, #19200
	bgt	.L14
	cmp	r3, #4800
	beq	.L19
	cmp	r3, #9600
	beq	.L20
	b	.L14
.L19:
	mov	r3, #12
	str	r3, [fp, #-40]
	b	.L14
.L20:
	mov	r3, #13
	str	r3, [fp, #-40]
	b	.L14
.L18:
	mov	r3, #14
	str	r3, [fp, #-40]
	b	.L14
.L17:
	mov	r3, #15
	str	r3, [fp, #-40]
	b	.L14
.L16:
	ldr	r3, .L31+28
	str	r3, [fp, #-40]
	b	.L14
.L15:
	ldr	r3, .L31+32
	str	r3, [fp, #-40]
	b	.L14
.L30:
	nop
.L14:
	ldr	r1, [fp, #-40]
	ldr	r0, [fp, #-32]
	bl	set_interface_attribs
	ldr	r3, [fp, #-48]
	cmp	r3, #3
	ble	.L21
	ldr	r3, [fp, #-52]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r2, #10
	mov	r1, #0
	mov	r0, r3
	bl	strtol
	str	r0, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmp	r3, #1
	bgt	.L26
	mov	r3, #2
	str	r3, [fp, #-44]
	b	.L26
.L21:
	mov	r3, #32
	str	r3, [fp, #-44]
.L26:
	mov	r3, sp
	mov	r4, r3
	ldr	ip, [fp, #-44]
	sub	r3, ip, #1
	str	r3, [fp, #-28]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, ip
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #0
	str	r3, [fp, #-24]
	mov	r3, ip
	mov	r2, r3
	ldr	r1, [fp, #-24]
	ldr	r0, [fp, #-32]
	bl	read
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	ble	.L23
	ldr	r2, [fp, #-20]
	ldr	r3, .L31+36
	ldr	r3, [r3]
	mov	r1, #1
	ldr	r0, [fp, #-24]
	bl	fwrite
	ldr	r3, .L31+36
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	b	.L24
.L23:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bge	.L25
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, [fp, #-20]
	ldr	r0, .L31+40
	bl	printf
	b	.L24
.L25:
	ldr	r0, .L31+44
	bl	puts
.L24:
	mov	sp, r4
	b	.L26
.L29:
	bl	__stack_chk_fail
.L27:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L32:
	.align	2
.L31:
	.word	.LC9
	.word	1052928
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	115200
	.word	4097
	.word	4098
	.word	stdout
	.word	.LC7
	.word	.LC8
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
