	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_run_editor                     ## -- Begin function run_editor
	.p2align	4, 0x90
_run_editor:                            ## @run_editor
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%edx, -68(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_PATHSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movq	_tmpdir@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_snprintf
	movq	%r15, %rdi
	callq	_mkstemp
	cmpl	$-1, %eax
	je	LBB0_26
## %bb.1:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	callq	_Fdopen
	testq	%rax, %rax
	je	LBB0_26
## %bb.2:
	movq	%rax, %rbx
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_4
## %bb.3:
	movl	%r14d, %edi
	movl	$256, %esi                      ## imm = 0x100
	callq	_fchmod
	cmpl	$-1, %eax
	je	LBB0_30
LBB0_4:
	testq	%r12, %r12
	js	LBB0_15
## %bb.5:
	je	LBB0_9
## %bb.6:
	incq	%r12
	movq	_EOF@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_getc
	cmpl	(%r14), %eax
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_putc
	decq	%r12
	cmpq	$1, %r12
	jg	LBB0_7
	jmp	LBB0_9
LBB0_15:
	movq	%r13, %rdi
	callq	_getc
	movq	_EOF@GOTPCREL(%rip), %r14
	cmpl	(%r14), %eax
	je	LBB0_9
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_putc
	movq	%r13, %rdi
	callq	_getc
	cmpl	(%r14), %eax
	jne	LBB0_16
LBB0_9:
	movq	%rbx, %rdi
	callq	_fflush
	movq	%rbx, %rdi
	callq	_fileno
	leaq	-64(%rbp), %rsi
	movl	%eax, %edi
	callq	_fstat
	testq	%rax, %rax
	js	LBB0_11
## %bb.10:
	movq	-64(%rbp), %r12
	jmp	LBB0_12
LBB0_11:
	xorl	%r12d, %r12d
LBB0_12:
	movq	%rbx, %rdi
	callq	_ferror
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_Fclose
	testq	%r14, %r14
	je	LBB0_17
## %bb.13:
	leaq	L_.str.2(%rip), %rdi
	movq	%r15, %rsi
	callq	_warnx
LBB0_14:
	movq	%r15, %rdi
	callq	_rm
	jmp	LBB0_27
LBB0_17:
	testq	%rax, %rax
	js	LBB0_32
## %bb.18:
	cmpl	$101, -68(%rbp)                 ## 4-byte Folded Reload
	leaq	L_.str.3(%rip), %rax
	leaq	L_.str.4(%rip), %rdi
	cmoveq	%rax, %rdi
	movq	__PATH_VI@GOTPCREL(%rip), %rbx
	cmoveq	__PATH_EX@GOTPCREL(%rip), %rbx
	callq	_value
	testq	%rax, %rax
	jne	LBB0_20
## %bb.19:
	movq	(%rbx), %rax
LBB0_20:
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$-1, %edx
	movl	$-1, %ecx
	movq	%r15, %r8
	xorl	%r9d, %r9d
	callq	_run_command
	testq	%rax, %rax
	js	LBB0_14
## %bb.21:
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_14
## %bb.22:
	leaq	-64(%rbp), %rsi
	movq	%r15, %rdi
	callq	_stat
	testq	%rax, %rax
	js	LBB0_26
## %bb.23:
	cmpq	-64(%rbp), %r12
	je	LBB0_14
## %bb.24:
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdi
	callq	_Fopen
	testq	%rax, %rax
	je	LBB0_32
## %bb.25:
	movq	%rax, %rbx
	jmp	LBB0_31
LBB0_26:
	leaq	L_.str.2(%rip), %rdi
	movq	%r15, %rsi
	callq	_warn
LBB0_27:
	xorl	%ebx, %ebx
LBB0_28:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_33
## %bb.29:
	movq	%rbx, %rax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_30:
	leaq	L_.str.2(%rip), %rdi
	movq	%r15, %rsi
	callq	_warn
LBB0_31:
	movq	%r15, %rdi
	callq	_rm
	jmp	LBB0_28
LBB0_32:
	leaq	L_.str.2(%rip), %rdi
	movq	%r15, %rsi
	callq	_warn
	jmp	LBB0_14
LBB0_33:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PATHSIZE,4,2                   ## @PATHSIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s/mail.ReXXXXXXXXXX"

	.comm	_tmpdir,8,3                     ## @tmpdir
L_.str.1:                               ## @.str.1
	.asciz	"w"

L_.str.2:                               ## @.str.2
	.asciz	"%s"

	.comm	_EOF,4,2                        ## @EOF
L_.str.3:                               ## @.str.3
	.asciz	"EDITOR"

L_.str.4:                               ## @.str.4
	.asciz	"VISUAL"

	.comm	__PATH_EX,8,3                   ## @_PATH_EX
	.comm	__PATH_VI,8,3                   ## @_PATH_VI
L_.str.5:                               ## @.str.5
	.asciz	"a+"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_run_editor                     ; -- Begin function run_editor
	.p2align	2
_run_editor:                            ; @run_editor
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #16
	mov	x20, x3
	mov	x21, x2
	mov	x24, x1
	mov	x23, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x8, _PATHSIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PATHSIZE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x9, x1
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x1, #15
	and	x9, x9, #0x1fffffff0
	sub	x19, x8, x9
	mov	sp, x19
Lloh8:
	adrp	x8, _tmpdir@GOTPAGE
Lloh9:
	ldr	x8, [x8, _tmpdir@GOTPAGEOFF]
Lloh10:
	ldr	x3, [x8]
Lloh11:
	adrp	x2, l_.str@PAGE
Lloh12:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_snprintf
	mov	x0, x19
	bl	_mkstemp
	cmn	w0, #1
	b.eq	LBB0_23
; %bb.1:
	mov	x25, x0
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_Fdopen
	cbz	x0, LBB0_23
; %bb.2:
	mov	x22, x0
	cbz	w20, LBB0_4
; %bb.3:
	mov	x0, x25
	mov	w1, #256
	bl	_fchmod
	cmn	w0, #1
	b.eq	LBB0_21
LBB0_4:
	tbnz	x24, #63, LBB0_12
; %bb.5:
	cbz	x24, LBB0_9
; %bb.6:
	add	x24, x24, #1
Lloh15:
	adrp	x25, _EOF@GOTPAGE
Lloh16:
	ldr	x25, [x25, _EOF@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_getc
	ldr	w8, [x25]
	cmp	w0, w8
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x1, x22
	bl	_putc
	sub	x24, x24, #1
	cmp	x24, #1
	b.gt	LBB0_7
LBB0_9:
	mov	x0, x22
	bl	_fflush
	mov	x0, x22
	bl	_fileno
	sub	x1, x29, #80
	bl	_fstat
	ldur	x8, [x29, #-80]
	cmp	x0, #0
	csel	x24, xzr, x8, lt
	mov	x0, x22
	bl	_ferror
	mov	x23, x0
	mov	x0, x22
	bl	_Fclose
	cbz	x23, LBB0_15
; %bb.10:
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_warnx
LBB0_11:
	mov	x0, x19
	bl	_rm
	b	LBB0_24
LBB0_12:
	mov	x0, x23
	bl	_getc
Lloh19:
	adrp	x24, _EOF@GOTPAGE
Lloh20:
	ldr	x24, [x24, _EOF@GOTPAGEOFF]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	cmp	w0, w8
	b.eq	LBB0_9
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x1, x22
	bl	_putc
	mov	x0, x23
	bl	_getc
	b	LBB0_13
LBB0_15:
	tbnz	x0, #63, LBB0_27
; %bb.16:
Lloh21:
	adrp	x8, l_.str.4@PAGE
Lloh22:
	add	x8, x8, l_.str.4@PAGEOFF
Lloh23:
	adrp	x9, l_.str.3@PAGE
Lloh24:
	add	x9, x9, l_.str.3@PAGEOFF
	cmp	w21, #101
	csel	x0, x9, x8, eq
Lloh25:
	adrp	x8, __PATH_EX@GOTPAGE
Lloh26:
	ldr	x8, [x8, __PATH_EX@GOTPAGEOFF]
Lloh27:
	adrp	x9, __PATH_VI@GOTPAGE
Lloh28:
	ldr	x9, [x9, __PATH_VI@GOTPAGEOFF]
	csel	x21, x8, x9, eq
	bl	_value
	ldr	x8, [x21]
	cmp	x0, #0
	csel	x0, x8, x0, eq
	mov	w1, #0
	mov	w2, #-1
	mov	w3, #-1
	mov	x4, x19
	mov	x5, #0
	bl	_run_command
	tbnz	x0, #63, LBB0_11
; %bb.17:
	cbnz	w20, LBB0_11
; %bb.18:
	sub	x1, x29, #80
	mov	x0, x19
	bl	_stat
	tbnz	x0, #63, LBB0_23
; %bb.19:
	ldur	x8, [x29, #-80]
	cmp	x24, x8
	b.eq	LBB0_11
; %bb.20:
Lloh29:
	adrp	x1, l_.str.5@PAGE
Lloh30:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_Fopen
	mov	x22, x0
	cbnz	x0, LBB0_22
LBB0_21:
Lloh31:
	adrp	x0, l_.str.2@PAGE
Lloh32:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_warn
LBB0_22:
	mov	x0, x19
	bl	_rm
	b	LBB0_25
LBB0_23:
Lloh33:
	adrp	x0, l_.str.2@PAGE
Lloh34:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_warn
LBB0_24:
	mov	x22, #0
LBB0_25:
	ldur	x8, [x29, #-72]
Lloh35:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh36:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_28
; %bb.26:
	mov	x0, x22
	sub	sp, x29, #64
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_27:
Lloh38:
	adrp	x0, l_.str.2@PAGE
Lloh39:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_warn
	b	LBB0_11
LBB0_28:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_PATHSIZE,4,2                   ; @PATHSIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s/mail.ReXXXXXXXXXX"

	.comm	_tmpdir,8,3                     ; @tmpdir
l_.str.1:                               ; @.str.1
	.asciz	"w"

l_.str.2:                               ; @.str.2
	.asciz	"%s"

	.comm	_EOF,4,2                        ; @EOF
l_.str.3:                               ; @.str.3
	.asciz	"EDITOR"

l_.str.4:                               ; @.str.4
	.asciz	"VISUAL"

	.comm	__PATH_EX,8,3                   ; @_PATH_EX
	.comm	__PATH_VI,8,3                   ; @_PATH_VI
l_.str.5:                               ; @.str.5
	.asciz	"a+"

.subsections_via_symbols
