	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_file                     ## -- Begin function write_file
	.p2align	4, 0x90
_write_file:                            ## @write_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	%rcx, %r13
	movq	%rdx, %r15
	movq	%rdi, %r14
	cmpb	$33, (%rdi)
	jne	LBB0_2
## %bb.1:
	leaq	1(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_popen
	jmp	LBB0_3
LBB0_2:
	movq	%rsi, %rbx
	movq	%r14, %rdi
	callq	_strip_escapes
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_fopen
LBB0_3:
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r13, %rdx
	callq	_write_stream
	movq	%rax, %r12
	testq	%rax, %rax
	js	LBB0_7
## %bb.8:
	cmpb	$33, (%r14)
	jne	LBB0_10
LBB0_9:
	movq	%rbx, %rdi
	callq	_pclose
	testl	%eax, %eax
	js	LBB0_12
LBB0_13:
	testq	%r12, %r12
	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	%r12, %rdx
	xorl	%eax, %eax
	callq	_fprintf
LBB0_17:
	subq	%r15, %r13
	incq	%r13
	testq	%r15, %r15
	cmoveq	%r15, %r13
	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	%r14, %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), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rsi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%r14, %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, (%r14)
	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	%r14, %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), %r13
LBB0_18:
	movq	%r13, %rax
	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	"w"

	.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 output file"

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

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

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

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_file                     ; -- Begin function write_file
	.p2align	2
_write_file:                            ; @write_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	x21, x3
	mov	x20, x2
	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	x23, x0
	cbz	x0, LBB0_11
LBB0_2:
	mov	x0, x23
	mov	x1, x20
	mov	x2, x21
	bl	_write_stream
	mov	x22, x0
	tbz	x0, #63, LBB0_4
; %bb.3:
Lloh2:
	adrp	x8, _stderr@GOTPAGE
Lloh3:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh4:
	ldr	w24, [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, x24
	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, x23
	cmp	w8, #33
	b.ne	LBB0_12
; %bb.5:
	bl	_pclose
	tbnz	w0, #31, LBB0_13
LBB0_6:
	tbnz	x22, #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	x22, [sp]
Lloh21:
	adrp	x1, l_.str.5@PAGE
Lloh22:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_fprintf
LBB0_9:
	sub	x8, x21, x20
	cmp	x20, #0
	csinc	x0, xzr, x8, eq
	b	LBB0_16
LBB0_10:
	mov	x22, x1
	mov	x0, x19
	bl	_strip_escapes
	mov	x1, x22
	bl	_fopen
	mov	x23, x0
	cbnz	x0, LBB0_2
LBB0_11:
Lloh23:
	adrp	x8, _stderr@GOTPAGE
Lloh24:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh25:
	ldr	w20, [x8]
Lloh26:
	adrp	x8, _errno@GOTPAGE
Lloh27:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	bl	_strerror
	stp	x19, x0, [sp]
Lloh29:
	adrp	x1, l_.str.1@PAGE
Lloh30:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_fprintf
Lloh31:
	adrp	x8, _errmsg@GOTPAGE
Lloh32:
	ldr	x8, [x8, _errmsg@GOTPAGEOFF]
Lloh33:
	adrp	x9, l_.str.2@PAGE
Lloh34:
	add	x9, x9, l_.str.2@PAGEOFF
	b	LBB0_14
LBB0_12:
	bl	_fclose
	tbz	w0, #31, LBB0_6
LBB0_13:
Lloh35:
	adrp	x8, _stderr@GOTPAGE
Lloh36:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh37:
	ldr	w20, [x8]
Lloh38:
	adrp	x8, _errno@GOTPAGE
Lloh39:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh40:
	ldr	w0, [x8]
	bl	_strerror
	stp	x19, x0, [sp]
Lloh41:
	adrp	x1, l_.str.1@PAGE
Lloh42:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_fprintf
Lloh43:
	adrp	x8, _errmsg@GOTPAGE
Lloh44:
	ldr	x8, [x8, _errmsg@GOTPAGEOFF]
Lloh45:
	adrp	x9, l_.str.4@PAGE
Lloh46:
	add	x9, x9, l_.str.4@PAGEOFF
LBB0_14:
	str	x9, [x8]
LBB0_15:
Lloh47:
	adrp	x8, _ERR@GOTPAGE
Lloh48:
	ldr	x8, [x8, _ERR@GOTPAGEOFF]
Lloh49:
	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 AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"w"

	.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 output file"

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

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

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

.subsections_via_symbols
