	.file	"811430.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"/sys/firmware/acpi/tables/SPCR"
.LC1:
	.string	"/dev/ttyS0"
.LC2:
	.string	"/dev/ttyS1"
.LC3:
	.string	"/dev/ttyS2"
.LC4:
	.string	"/dev/ttyS3"
	.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, 256
	mov	DWORD PTR -244[rbp], edi
	mov	QWORD PTR -256[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	esi, 0
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -236[rbp], eax
	cmp	DWORD PTR -236[rbp], 0
	jns	.L2
	mov	edi, 0
	call	exit@PLT
.L2:
	lea	rcx, -144[rbp]
	mov	eax, DWORD PTR -236[rbp]
	mov	edx, 80
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	cmp	rax, 79
	jg	.L3
	mov	edi, 0
	call	exit@PLT
.L3:
	movzx	eax, BYTE PTR -136[rbp]
	cmp	al, 2
	je	.L4
	mov	edi, 0
	call	exit@PLT
.L4:
	movzx	eax, BYTE PTR -108[rbp]
	test	al, al
	je	.L5
	mov	edi, 0
	call	exit@PLT
.L5:
	movzx	eax, BYTE PTR -104[rbp]
	cmp	al, 1
	je	.L6
	mov	edi, 0
	call	exit@PLT
.L6:
	mov	rax, QWORD PTR -100[rbp]
	mov	QWORD PTR -224[rbp], rax
	movzx	eax, BYTE PTR -86[rbp]
	movsx	eax, al
	mov	DWORD PTR -232[rbp], eax
	lea	rax, -144[rbp]
	add	rax, 10
	mov	QWORD PTR -216[rbp], rax
	cmp	QWORD PTR -224[rbp], 1016
	jne	.L7
	lea	rax, -144[rbp]
	mov	edx, 128
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	strncpy@PLT
	jmp	.L8
.L7:
	cmp	QWORD PTR -224[rbp], 760
	jne	.L9
	lea	rax, -144[rbp]
	mov	edx, 128
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	strncpy@PLT
	jmp	.L8
.L9:
	cmp	QWORD PTR -224[rbp], 1000
	jne	.L10
	lea	rax, -144[rbp]
	mov	edx, 128
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	strncpy@PLT
	jmp	.L8
.L10:
	cmp	QWORD PTR -224[rbp], 744
	jne	.L11
	lea	rax, -144[rbp]
	mov	edx, 128
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	strncpy@PLT
	jmp	.L8
.L11:
	mov	edi, 0
	call	exit@PLT
.L8:
	lea	rax, -144[rbp]
	mov	esi, 258
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -228[rbp], eax
	cmp	DWORD PTR -232[rbp], 3
	jne	.L12
	mov	DWORD PTR -240[rbp], 13
	mov	rax, QWORD PTR -216[rbp]
	mov	DWORD PTR [rax], 808859948
	mov	WORD PTR 4[rax], 48
	jmp	.L13
.L12:
	cmp	DWORD PTR -232[rbp], 4
	jne	.L14
	mov	DWORD PTR -240[rbp], 14
	mov	rax, QWORD PTR -216[rbp]
	mov	DWORD PTR [rax], 842608940
	mov	WORD PTR 4[rax], 12336
	mov	BYTE PTR 6[rax], 0
	jmp	.L13
.L14:
	cmp	DWORD PTR -232[rbp], 6
	jne	.L15
	mov	DWORD PTR -240[rbp], 4097
	mov	rax, QWORD PTR -216[rbp]
	mov	DWORD PTR [rax], 909587756
	mov	WORD PTR 4[rax], 12336
	mov	BYTE PTR 6[rax], 0
	jmp	.L13
.L15:
	cmp	DWORD PTR -232[rbp], 7
	jne	.L16
	mov	DWORD PTR -240[rbp], 4098
	mov	rax, QWORD PTR -216[rbp]
	movabs	rcx, 13563791081025836
	mov	QWORD PTR [rax], rcx
	jmp	.L13
.L16:
	mov	edi, 0
	call	exit@PLT
.L13:
	lea	rdx, -208[rbp]
	mov	eax, DWORD PTR -228[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	tcgetattr@PLT
	cmp	DWORD PTR -240[rbp], 0
	je	.L17
	lea	rax, -208[rbp]
	mov	esi, 4098
	mov	rdi, rax
	call	cfsetospeed@PLT
	lea	rax, -208[rbp]
	mov	esi, 4098
	mov	rdi, rax
	call	cfsetispeed@PLT
.L17:
	lea	rdx, -208[rbp]
	mov	eax, DWORD PTR -228[rbp]
	mov	esi, 0
	mov	edi, eax
	call	tcsetattr@PLT
	mov	eax, DWORD PTR -228[rbp]
	mov	edx, 0
	mov	esi, 21533
	mov	edi, eax
	mov	eax, 0
	call	ioctl@PLT
	lea	rax, -144[rbp]
	mov	rdi, rax
	call	puts@PLT
	mov	eax, 0
	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
.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	"811430.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/sys/firmware/acpi/tables/SPCR\000"
	.align	2
.LC1:
	.ascii	"/dev/ttyS0\000"
	.align	2
.LC2:
	.ascii	"/dev/ttyS1\000"
	.align	2
.LC3:
	.ascii	"/dev/ttyS2\000"
	.align	2
.LC4:
	.ascii	"/dev/ttyS3\000"
	.align	2
.LC5:
	.ascii	",9600\000"
	.align	2
.LC6:
	.ascii	",19200\000"
	.align	2
.LC7:
	.ascii	",57600\000"
	.align	2
.LC8:
	.ascii	",115200\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 = 232
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #232
	str	r0, [fp, #-232]
	str	r1, [fp, #-236]
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r1, #0
	ldr	r0, .L20+4
	bl	open
	str	r0, [fp, #-220]
	ldr	r3, [fp, #-220]
	cmp	r3, #0
	bge	.L2
	mov	r0, #0
	bl	exit
.L2:
	sub	r3, fp, #136
	mov	r2, #80
	mov	r1, r3
	ldr	r0, [fp, #-220]
	bl	read
	mov	r3, r0
	cmp	r3, #79
	bgt	.L3
	mov	r0, #0
	bl	exit
.L3:
	ldrb	r3, [fp, #-128]	@ zero_extendqisi2
	cmp	r3, #2
	beq	.L4
	mov	r0, #0
	bl	exit
.L4:
	ldrb	r3, [fp, #-100]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L5
	mov	r0, #0
	bl	exit
.L5:
	ldrb	r3, [fp, #-96]	@ zero_extendqisi2
	cmp	r3, #1
	beq	.L6
	mov	r0, #0
	bl	exit
.L6:
	ldr	r2, [fp, #-92]
	ldr	r3, [fp, #-88]
	str	r2, [fp, #-204]
	str	r3, [fp, #-200]
	ldrb	r3, [fp, #-78]	@ zero_extendqisi2
	str	r3, [fp, #-216]
	sub	r3, fp, #136
	add	r3, r3, #10
	str	r3, [fp, #-212]
	sub	r3, fp, #204
	ldmia	r3, {r2-r3}
	cmp	r3, #0
	cmpeq	r2, #1016
	bne	.L7
	sub	r3, fp, #136
	mov	r2, #128
	ldr	r1, .L20+8
	mov	r0, r3
	bl	strncpy
	b	.L8
.L7:
	sub	r3, fp, #204
	ldmia	r3, {r2-r3}
	cmp	r3, #0
	cmpeq	r2, #760
	bne	.L9
	sub	r3, fp, #136
	mov	r2, #128
	ldr	r1, .L20+12
	mov	r0, r3
	bl	strncpy
	b	.L8
.L9:
	sub	r3, fp, #204
	ldmia	r3, {r2-r3}
	cmp	r3, #0
	cmpeq	r2, #1000
	bne	.L10
	sub	r3, fp, #136
	mov	r2, #128
	ldr	r1, .L20+16
	mov	r0, r3
	bl	strncpy
	b	.L8
.L10:
	sub	r3, fp, #204
	ldmia	r3, {r2-r3}
	cmp	r3, #0
	cmpeq	r2, #744
	bne	.L11
	sub	r3, fp, #136
	mov	r2, #128
	ldr	r1, .L20+20
	mov	r0, r3
	bl	strncpy
	b	.L8
.L11:
	mov	r0, #0
	bl	exit
.L8:
	sub	r3, fp, #136
	ldr	r1, .L20+24
	mov	r0, r3
	bl	open
	str	r0, [fp, #-208]
	ldr	r3, [fp, #-216]
	cmp	r3, #3
	bne	.L12
	mov	r3, #13
	str	r3, [fp, #-224]
	ldr	r3, [fp, #-212]
	ldr	r2, .L20+28
	mov	r0, r3
	mov	r1, r2
	mov	r3, #6
	mov	r2, r3
	bl	memcpy
	b	.L13
.L12:
	ldr	r3, [fp, #-216]
	cmp	r3, #4
	bne	.L14
	mov	r3, #14
	str	r3, [fp, #-224]
	ldr	r3, [fp, #-212]
	ldr	r2, .L20+32
	mov	r0, r3
	mov	r1, r2
	mov	r3, #7
	mov	r2, r3
	bl	memcpy
	b	.L13
.L14:
	ldr	r3, [fp, #-216]
	cmp	r3, #6
	bne	.L15
	ldr	r3, .L20+36
	str	r3, [fp, #-224]
	ldr	r3, [fp, #-212]
	ldr	r2, .L20+40
	mov	r0, r3
	mov	r1, r2
	mov	r3, #7
	mov	r2, r3
	bl	memcpy
	b	.L13
.L15:
	ldr	r3, [fp, #-216]
	cmp	r3, #7
	bne	.L16
	ldr	r3, .L20+44
	str	r3, [fp, #-224]
	ldr	r3, [fp, #-212]
	ldr	r2, .L20+48
	mov	r0, r3
	mov	r1, r2
	mov	r3, #8
	mov	r2, r3
	bl	memcpy
	b	.L13
.L16:
	mov	r0, #0
	bl	exit
.L13:
	sub	r3, fp, #196
	mov	r1, r3
	ldr	r0, [fp, #-208]
	bl	tcgetattr
	ldr	r3, [fp, #-224]
	cmp	r3, #0
	beq	.L17
	sub	r3, fp, #196
	ldr	r1, .L20+44
	mov	r0, r3
	bl	cfsetospeed
	sub	r3, fp, #196
	ldr	r1, .L20+44
	mov	r0, r3
	bl	cfsetispeed
.L17:
	sub	r3, fp, #196
	mov	r2, r3
	mov	r1, #0
	ldr	r0, [fp, #-208]
	bl	tcsetattr
	mov	r2, #0
	ldr	r1, .L20+52
	ldr	r0, [fp, #-208]
	bl	ioctl
	sub	r3, fp, #136
	mov	r0, r3
	bl	puts
	mov	r3, #0
	ldr	r2, .L20
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC9
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	258
	.word	.LC5
	.word	.LC6
	.word	4097
	.word	.LC7
	.word	4098
	.word	.LC8
	.word	21533
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
