	.file	"extr_serial.c_do_serial_close.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"\nEnd of log\n"
	.text
	.p2align 4
	.type	do_serial_close, @function
do_serial_close:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	ebx, esi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	rsi, QWORD PTR serial_logfp[rip]
	mov	QWORD PTR last_serial_opened[rip], 0
	test	rsi, rsi
	je	.L2
	lea	rdi, .LC0[rip]
	call	fputs_unfiltered@PLT
	mov	rdi, QWORD PTR serial_logfp[rip]
	mov	QWORD PTR serial_current_type[rip], 0
	call	ui_file_delete@PLT
	mov	QWORD PTR serial_logfp[rip], 0
.L2:
	test	rbp, rbp
	je	.L1
	mov	rax, QWORD PTR 0[rbp]
	sub	rax, 1
	mov	QWORD PTR 0[rbp], rax
	test	rax, rax
	jg	.L1
	cmp	QWORD PTR 32[rbp], 0
	je	.L6
	xor	edx, edx
	xor	esi, esi
	mov	rdi, rbp
	call	serial_async@PLT
.L6:
	test	ebx, ebx
	je	.L7
	mov	rax, QWORD PTR 24[rbp]
	mov	rdi, rbp
	call	[QWORD PTR [rax]]
.L7:
	mov	rdi, QWORD PTR 16[rbp]
	test	rdi, rdi
	je	.L8
	call	xfree@PLT
.L8:
	mov	rax, QWORD PTR scb_base[rip]
	cmp	rax, rbp
	je	.L25
	test	rax, rax
	je	.L10
.L11:
	mov	rdx, QWORD PTR 8[rax]
	cmp	rdx, rbp
	je	.L26
	mov	rax, rdx
	test	rax, rax
	jne	.L11
.L10:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	jmp	xfree@PLT
	.p2align 4,,10
	.p2align 3
.L1:
	.cfi_restore_state
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	mov	rdx, QWORD PTR 8[rbp]
	mov	rdi, rbp
	mov	QWORD PTR 8[rax], rdx
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	jmp	xfree@PLT
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	mov	rax, QWORD PTR 8[rbp]
	mov	rdi, rbp
	mov	QWORD PTR scb_base[rip], rax
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	jmp	xfree@PLT
	.cfi_endproc
.LFE0:
	.size	do_serial_close, .-do_serial_close
	.comm	serial_logfp,8,8
	.comm	serial_current_type,8,8
	.comm	scb_base,8,8
	.comm	last_serial_opened,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_serial.c_do_serial_close.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"\012End of log\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	do_serial_close, %function
do_serial_close:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r6, #0
	ldr	r5, .L30
	ldr	r2, .L30+4
	ldr	r3, [r5]
	mov	r4, r0
	cmp	r3, r6
	mov	r7, r1
	str	r6, [r2]
	beq	.L2
	mov	r1, r3
	ldr	r0, .L30+8
	bl	fputs_unfiltered
	ldr	r3, .L30+12
	ldr	r0, [r5]
	str	r6, [r3]
	bl	ui_file_delete
	str	r6, [r5]
.L2:
	cmp	r4, #0
	popeq	{r4, r5, r6, r7, r8, pc}
	ldr	r3, [r4]
	sub	r3, r3, #1
	cmp	r3, #0
	str	r3, [r4]
	popgt	{r4, r5, r6, r7, r8, pc}
	ldr	r3, [r4, #16]
	cmp	r3, #0
	beq	.L6
	mov	r2, #0
	mov	r0, r4
	mov	r1, r2
	bl	serial_async
.L6:
	cmp	r7, #0
	beq	.L7
	ldr	r3, [r4, #12]
	mov	r0, r4
	ldr	r3, [r3]
	blx	r3
.L7:
	ldr	r0, [r4, #8]
	cmp	r0, #0
	beq	.L8
	bl	xfree
.L8:
	ldr	r2, .L30+16
	ldr	r3, [r2]
	cmp	r3, r4
	beq	.L28
	cmp	r3, #0
	beq	.L10
.L11:
	ldr	r2, [r3, #4]
	cmp	r2, r4
	beq	.L29
	mov	r3, r2
	cmp	r3, #0
	bne	.L11
.L10:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	b	xfree
.L29:
	ldr	r2, [r4, #4]
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	str	r2, [r3, #4]
	b	xfree
.L28:
	ldr	r3, [r4, #4]
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	str	r3, [r2]
	b	xfree
.L31:
	.align	2
.L30:
	.word	serial_logfp
	.word	last_serial_opened
	.word	.LC0
	.word	serial_current_type
	.word	scb_base
	.size	do_serial_close, .-do_serial_close
	.comm	serial_logfp,4,4
	.comm	serial_current_type,4,4
	.comm	scb_base,4,4
	.comm	last_serial_opened,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
