	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bsClose
_bsClose:                               ## @bsClose
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	cmpb	$119, (%rdi)
	jne	LBB0_15
## %bb.1:
	movl	4(%rbx), %eax
	movl	8(%rbx), %edi
	cmpl	$7, %eax
	jg	LBB0_11
## %bb.2:
	movl	%eax, %ecx
	negl	%ecx
	andl	$7, %ecx
	je	LBB0_3
## %bb.4:
	negl	%ecx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	addl	%edi, %edi
	decl	%edx
	cmpl	%edx, %ecx
	jne	LBB0_5
## %bb.6:
	movl	%eax, %ecx
	subl	%edx, %ecx
	jmp	LBB0_7
LBB0_3:
	movl	%eax, %ecx
LBB0_7:
	decl	%eax
	cmpl	$7, %eax
	jb	LBB0_10
## %bb.8:
	addl	$-8, %ecx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	shll	$8, %edi
	addl	$8, %ecx
	jne	LBB0_9
LBB0_10:
	movl	$8, 4(%rbx)
	movl	%edi, 8(%rbx)
LBB0_11:
	movl	12(%rbx), %esi
	callq	_putc
	movq	_EOF@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rax
	jne	LBB0_13
## %bb.12:
	xorl	%eax, %eax
	callq	_writeError
LBB0_13:
	movq	_bytesOut@GOTPCREL(%rip), %rax
	incl	(%rax)
	movl	12(%rbx), %edi
	callq	_fflush
	cmpq	(%r14), %rax
	jne	LBB0_15
## %bb.14:
	xorl	%eax, %eax
	callq	_writeError
LBB0_15:
	movl	12(%rbx), %edi
	callq	_fclose
	movq	_EOF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_19
## %bb.16:
	cmpb	$119, (%rbx)
	jne	LBB0_18
## %bb.17:
	xorl	%eax, %eax
	callq	_writeError
	jmp	LBB0_19
LBB0_18:
	xorl	%eax, %eax
	callq	_readError
LBB0_19:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_free                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EOF,8,3                        ## @EOF
	.comm	_bytesOut,4,2                   ## @bytesOut
	.no_dead_strip	_bsClose
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bsClose
_bsClose:                               ; @bsClose
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldrb	w8, [x0]
Lloh0:
	adrp	x20, _EOF@GOTPAGE
Lloh1:
	ldr	x20, [x20, _EOF@GOTPAGEOFF]
	cmp	w8, #119
	b.ne	LBB0_9
; %bb.1:
	ldp	w8, w0, [x19, #4]
	cmp	w8, #7
	b.gt	LBB0_5
; %bb.2:
	sub	w8, w8, #8
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	lsl	w0, w0, #1
	adds	w8, w8, #1
	b.lo	LBB0_3
; %bb.4:
	mov	w8, #8
	stp	w8, w0, [x19, #4]
LBB0_5:
	ldr	w1, [x19, #12]
	bl	_putc
	ldr	x8, [x20]
	cmp	x0, x8
	b.ne	LBB0_7
; %bb.6:
	bl	_writeError
LBB0_7:
Lloh2:
	adrp	x8, _bytesOut@GOTPAGE
Lloh3:
	ldr	x8, [x8, _bytesOut@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	ldr	w0, [x19, #12]
	bl	_fflush
	ldr	x8, [x20]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.8:
	bl	_writeError
LBB0_9:
	ldr	w0, [x19, #12]
	bl	_fclose
	ldr	x8, [x20]
	cmp	x0, x8
	b.ne	LBB0_13
; %bb.10:
	ldrb	w8, [x19]
	cmp	w8, #119
	b.ne	LBB0_12
; %bb.11:
	bl	_writeError
	b	LBB0_13
LBB0_12:
	bl	_readError
LBB0_13:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_free
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_EOF,8,3                        ; @EOF
	.comm	_bytesOut,4,2                   ; @bytesOut
	.no_dead_strip	_bsClose
.subsections_via_symbols
