	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_serial_close
_do_serial_close:                       ## @do_serial_close
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_last_serial_opened@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_serial_logfp@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_fputs_unfiltered
	movq	_serial_current_type@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	(%r15), %rdi
	callq	_ui_file_delete
	movq	$0, (%r15)
LBB0_2:
	testq	%rbx, %rbx
	je	LBB0_16
## %bb.3:
	movq	(%rbx), %rax
	leaq	-1(%rax), %rcx
	movq	%rcx, (%rbx)
	cmpq	$1, %rax
	jle	LBB0_4
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	cmpq	$0, 32(%rbx)
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_serial_async
LBB0_6:
	testl	%r14d, %r14d
	je	LBB0_8
## %bb.7:
	movq	24(%rbx), %rax
	movq	%rbx, %rdi
	callq	*(%rax)
LBB0_8:
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.9:
	callq	_xfree
LBB0_10:
	movq	_scb_base@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	cmpq	%rbx, %rcx
	je	LBB0_14
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	testq	%rcx, %rcx
	je	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%rcx, %rax
	movq	8(%rcx), %rcx
	cmpq	%rbx, %rcx
	jne	LBB0_11
## %bb.13:
	addq	$8, %rax
LBB0_14:
	movq	8(%rbx), %rcx
	movq	%rcx, (%rax)
LBB0_15:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_xfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_last_serial_opened,8,3         ## @last_serial_opened
	.comm	_serial_logfp,8,3               ## @serial_logfp
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\nEnd of log\n"

	.comm	_serial_current_type,8,3        ## @serial_current_type
	.comm	_scb_base,8,3                   ## @scb_base
	.no_dead_strip	_do_serial_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_serial_close
_do_serial_close:                       ; @do_serial_close
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _last_serial_opened@GOTPAGE
Lloh1:
	ldr	x8, [x8, _last_serial_opened@GOTPAGEOFF]
Lloh2:
	str	xzr, [x8]
Lloh3:
	adrp	x21, _serial_logfp@GOTPAGE
Lloh4:
	ldr	x21, [x21, _serial_logfp@GOTPAGEOFF]
	ldr	x1, [x21]
	cbz	x1, LBB0_2
; %bb.1:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_fputs_unfiltered
Lloh7:
	adrp	x8, _serial_current_type@GOTPAGE
Lloh8:
	ldr	x8, [x8, _serial_current_type@GOTPAGEOFF]
Lloh9:
	str	xzr, [x8]
	ldr	x0, [x21]
	bl	_ui_file_delete
	str	xzr, [x21]
LBB0_2:
	cbz	x19, LBB0_4
; %bb.3:
	ldr	x8, [x19]
	subs	x8, x8, #1
	str	x8, [x19]
	b.le	LBB0_5
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_7
; %bb.6:
	mov	x0, x19
	mov	x1, #0
	mov	x2, #0
	bl	_serial_async
LBB0_7:
	cbz	w20, LBB0_9
; %bb.8:
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
LBB0_9:
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_11
; %bb.10:
	bl	_xfree
LBB0_11:
Lloh10:
	adrp	x8, _scb_base@GOTPAGE
Lloh11:
	ldr	x8, [x8, _scb_base@GOTPAGEOFF]
	ldr	x9, [x8]
	cmp	x9, x19
	b.eq	LBB0_15
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	cbz	x9, LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x8, x9
	ldr	x9, [x9, #8]
	cmp	x9, x19
	b.ne	LBB0_12
; %bb.14:
	add	x8, x8, #8
LBB0_15:
	ldr	x9, [x19, #8]
	str	x9, [x8]
LBB0_16:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_xfree
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_last_serial_opened,8,3         ; @last_serial_opened
	.comm	_serial_logfp,8,3               ; @serial_logfp
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\nEnd of log\n"

	.comm	_serial_current_type,8,3        ; @serial_current_type
	.comm	_scb_base,8,3                   ; @scb_base
	.no_dead_strip	_do_serial_close
.subsections_via_symbols
