	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_read_file                      ## -- Begin function read_file
	.p2align	4, 0x90
_read_file:                             ## @read_file
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	cmpb	$33, (%rdi)
	jne	LBB0_2
## %bb.1:
	leaq	1(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_popen
	jmp	LBB0_3
LBB0_2:
	movq	%r12, %rdi
	callq	_strip_escapes
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_fopen
LBB0_3:
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_read_stream
	movq	%rax, %r15
	testq	%rax, %rax
	js	LBB0_7
## %bb.8:
	cmpb	$33, (%r12)
	jne	LBB0_10
LBB0_9:
	movq	%rbx, %rdi
	callq	_pclose
	testl	%eax, %eax
	js	LBB0_12
LBB0_13:
	testq	%r15, %r15
	js	LBB0_14
## %bb.15:
	movq	_scripted@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_17
## %bb.16:
	movq	_stdout@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_fprintf
LBB0_17:
	movq	_current_addr@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	subq	%r14, %rax
	jmp	LBB0_18
LBB0_4:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movq	%r12, %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_fprintf
	leaq	L_.str.2(%rip), %rax
	jmp	LBB0_5
LBB0_7:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rsi
	movl	%r13d, %edi
	movq	%r12, %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_fprintf
	leaq	L_.str.3(%rip), %rax
	movq	_errmsg@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	cmpb	$33, (%r12)
	je	LBB0_9
LBB0_10:
	movq	%rbx, %rdi
	callq	_fclose
	testl	%eax, %eax
	jns	LBB0_13
LBB0_12:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movq	%r12, %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_fprintf
	leaq	L_.str.4(%rip), %rax
LBB0_5:
	movq	_errmsg@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
LBB0_14:
	movq	_ERR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"r"

	.comm	_stderr,4,2                     ## @stderr
L_.str.1:                               ## @.str.1
	.asciz	"%s: %s\n"

	.comm	_errno,4,2                      ## @errno
L_.str.2:                               ## @.str.2
	.asciz	"cannot open input file"

	.comm	_errmsg,8,3                     ## @errmsg
	.comm	_ERR,8,3                        ## @ERR
L_.str.3:                               ## @.str.3
	.asciz	"error reading input file"

L_.str.4:                               ## @.str.4
	.asciz	"cannot close input file"

	.comm	_scripted,4,2                   ## @scripted
	.comm	_stdout,4,2                     ## @stdout
L_.str.5:                               ## @.str.5
	.asciz	"%lu\n"

	.comm	_current_addr,8,3               ## @current_addr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_read_file                      ; -- Begin function read_file
	.p2align	2
_read_file:                             ; @read_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x19, x0
	ldrb	w8, [x0]
	cmp	w8, #33
	b.ne	LBB0_10
; %bb.1:
	add	x0, x19, #1
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_popen
	mov	x22, x0
	cbz	x0, LBB0_11
LBB0_2:
	mov	x0, x22
	mov	x1, x20
	bl	_read_stream
	mov	x21, x0
	tbz	x0, #63, LBB0_4
; %bb.3:
Lloh2:
	adrp	x8, _stderr@GOTPAGE
Lloh3:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh4:
	ldr	w23, [x8]
Lloh5:
	adrp	x8, _errno@GOTPAGE
Lloh6:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_strerror
	stp	x19, x0, [sp]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
	bl	_fprintf
Lloh10:
	adrp	x8, _errmsg@GOTPAGE
Lloh11:
	ldr	x8, [x8, _errmsg@GOTPAGEOFF]
Lloh12:
	adrp	x9, l_.str.3@PAGE
Lloh13:
	add	x9, x9, l_.str.3@PAGEOFF
Lloh14:
	str	x9, [x8]
LBB0_4:
	ldrb	w8, [x19]
	mov	x0, x22
	cmp	w8, #33
	b.ne	LBB0_12
; %bb.5:
	bl	_pclose
	tbnz	w0, #31, LBB0_13
LBB0_6:
	tbnz	x21, #63, LBB0_15
; %bb.7:
Lloh15:
	adrp	x8, _scripted@GOTPAGE
Lloh16:
	ldr	x8, [x8, _scripted@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cbnz	w8, LBB0_9
; %bb.8:
Lloh18:
	adrp	x8, _stdout@GOTPAGE
Lloh19:
	ldr	x8, [x8, _stdout@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	str	x21, [sp]
Lloh21:
	adrp	x1, l_.str.5@PAGE
Lloh22:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_fprintf
LBB0_9:
Lloh23:
	adrp	x8, _current_addr@GOTPAGE
Lloh24:
	ldr	x8, [x8, _current_addr@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	sub	x0, x8, x20
	b	LBB0_16
LBB0_10:
	mov	x0, x19
	bl	_strip_escapes
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	mov	x22, x0
	cbnz	x0, LBB0_2
LBB0_11:
Lloh28:
	adrp	x8, _stderr@GOTPAGE
Lloh29:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh30:
	ldr	w20, [x8]
Lloh31:
	adrp	x8, _errno@GOTPAGE
Lloh32:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	bl	_strerror
	stp	x19, x0, [sp]
Lloh34:
	adrp	x1, l_.str.1@PAGE
Lloh35:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_fprintf
Lloh36:
	adrp	x8, _errmsg@GOTPAGE
Lloh37:
	ldr	x8, [x8, _errmsg@GOTPAGEOFF]
Lloh38:
	adrp	x9, l_.str.2@PAGE
Lloh39:
	add	x9, x9, l_.str.2@PAGEOFF
	b	LBB0_14
LBB0_12:
	bl	_fclose
	tbz	w0, #31, LBB0_6
LBB0_13:
Lloh40:
	adrp	x8, _stderr@GOTPAGE
Lloh41:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh42:
	ldr	w20, [x8]
Lloh43:
	adrp	x8, _errno@GOTPAGE
Lloh44:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh45:
	ldr	w0, [x8]
	bl	_strerror
	stp	x19, x0, [sp]
Lloh46:
	adrp	x1, l_.str.1@PAGE
Lloh47:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_fprintf
Lloh48:
	adrp	x8, _errmsg@GOTPAGE
Lloh49:
	ldr	x8, [x8, _errmsg@GOTPAGEOFF]
Lloh50:
	adrp	x9, l_.str.4@PAGE
Lloh51:
	add	x9, x9, l_.str.4@PAGEOFF
LBB0_14:
	str	x9, [x8]
LBB0_15:
Lloh52:
	adrp	x8, _ERR@GOTPAGE
Lloh53:
	ldr	x8, [x8, _ERR@GOTPAGEOFF]
Lloh54:
	ldr	x0, [x8]
LBB0_16:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotStr	Lloh10, Lloh11, Lloh14
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGot	Lloh48, Lloh49
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"r"

	.comm	_stderr,4,2                     ; @stderr
l_.str.1:                               ; @.str.1
	.asciz	"%s: %s\n"

	.comm	_errno,4,2                      ; @errno
l_.str.2:                               ; @.str.2
	.asciz	"cannot open input file"

	.comm	_errmsg,8,3                     ; @errmsg
	.comm	_ERR,8,3                        ; @ERR
l_.str.3:                               ; @.str.3
	.asciz	"error reading input file"

l_.str.4:                               ; @.str.4
	.asciz	"cannot close input file"

	.comm	_scripted,4,2                   ; @scripted
	.comm	_stdout,4,2                     ; @stdout
l_.str.5:                               ; @.str.5
	.asciz	"%lu\n"

	.comm	_current_addr,8,3               ; @current_addr
.subsections_via_symbols
