	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_extract_subst_template         ## -- Begin function extract_subst_template
	.p2align	4, 0x90
_extract_subst_template:                ## @extract_subst_template
	.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	_ibufp@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rax
	leaq	1(%rax), %rcx
	movq	%rcx, (%rdx)
	movb	(%rax), %r15b
	movb	1(%rax), %cl
	cmpb	$37, %cl
	jne	LBB0_4
## %bb.1:
	cmpb	%r15b, 2(%rax)
	jne	LBB0_4
## %bb.2:
	addq	$2, %rax
	movq	%rax, (%rdx)
	movq	_rhbuf@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	LBB0_22
## %bb.3:
	leaq	L_.str(%rip), %rax
	movq	_errmsg@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
LBB0_21:
	xorl	%eax, %eax
	jmp	LBB0_22
LBB0_4:
	xorl	%r12d, %r12d
	cmpb	%r15b, %cl
	jne	LBB0_6
LBB0_5:
	movq	_rhbuf@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	movq	_rhbufsz@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leal	1(%r12), %edx
	xorl	%ecx, %ecx
	callq	_REALLOC
	movq	(%rbx), %rax
	movslq	%r12d, %rcx
	movq	_rhbufi@GOTPCREL(%rip), %rdx
	movq	%rcx, (%rdx)
	movb	$0, (%rax,%rcx)
	movq	(%rbx), %rax
LBB0_22:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_rhbuf@GOTPCREL(%rip), %rsi
	xorl	%r13d, %r13d
	jmp	LBB0_9
LBB0_7:                                 ##   in Loop: Header=BB0_9 Depth=1
	movl	%r14d, %r12d
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_9 Depth=1
	movq	(%rdx), %rax
	movl	%r12d, %r13d
	cmpb	%r15b, (%rax)
	je	LBB0_5
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_16 Depth 2
	movq	(%rsi), %rdi
	movq	_rhbufsz@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leal	2(%r13), %r14d
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	callq	_REALLOC
	movq	_rhbuf@GOTPCREL(%rip), %rsi
	movq	_ibufp@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rax
	leaq	1(%rax), %rcx
	movq	%rcx, (%rdx)
	movb	(%rax), %al
	movq	(%rsi), %rcx
	movslq	%r13d, %r12
	movb	%al, (%rcx,%r12)
	incq	%r12
	cmpb	$92, %al
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpb	$10, %al
	jne	LBB0_8
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	(%rdx), %rax
	cmpb	$0, (%rax)
	jne	LBB0_8
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	(%rdx), %rax
	leaq	1(%rax), %rcx
	movq	%rcx, (%rdx)
	movb	(%rax), %al
	movq	(%rsi), %rcx
	movb	%al, (%rcx,%r12)
	cmpb	$10, %al
	jne	LBB0_7
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_isglobal@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_7
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_stdin@GOTPCREL(%rip), %rbx
	movq	_ibuf@GOTPCREL(%rip), %r12
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_16 Depth=2
	movl	(%rbx), %edi
	callq	_clearerr
LBB0_16:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	xorl	%eax, %eax
	callq	_get_tty_line
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	je	LBB0_15
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=2
	jle	LBB0_21
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=2
	movq	(%r12), %rcx
	decl	%eax
	cmpb	$10, (%rcx,%rax)
	jne	LBB0_15
## %bb.19:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	%r14d, %r12d
	movq	_ibufp@GOTPCREL(%rip), %rdx
	movq	_rhbuf@GOTPCREL(%rip), %rsi
	jmp	LBB0_8
LBB0_23:
	decq	%rax
	movq	%rax, (%rdx)
	movl	%r13d, %r12d
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_ibufp,8,3                      ## @ibufp
	.comm	_rhbuf,8,3                      ## @rhbuf
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no previous substitution"

	.comm	_errmsg,8,3                     ## @errmsg
	.comm	_rhbufsz,4,2                    ## @rhbufsz
	.comm	_isglobal,4,2                   ## @isglobal
	.comm	_ibuf,8,3                       ## @ibuf
	.comm	_stdin,4,2                      ## @stdin
	.comm	_rhbufi,8,3                     ## @rhbufi
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_extract_subst_template         ; -- Begin function extract_subst_template
	.p2align	2
_extract_subst_template:                ; @extract_subst_template
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x21, _ibufp@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ibufp@GOTPAGEOFF]
	ldr	x8, [x21]
	add	x9, x8, #1
	str	x9, [x21]
	ldrb	w22, [x8]
	ldrb	w9, [x8, #1]
	cmp	w9, #37
	b.ne	LBB0_4
; %bb.1:
	ldrb	w10, [x8, #2]!
	cmp	w10, w22
	b.ne	LBB0_4
; %bb.2:
	str	x8, [x21]
Lloh2:
	adrp	x8, _rhbuf@GOTPAGE
Lloh3:
	ldr	x8, [x8, _rhbuf@GOTPAGEOFF]
Lloh4:
	ldr	x0, [x8]
	cbnz	x0, LBB0_19
; %bb.3:
Lloh5:
	adrp	x8, _errmsg@GOTPAGE
Lloh6:
	ldr	x8, [x8, _errmsg@GOTPAGEOFF]
Lloh7:
	adrp	x9, l_.str@PAGE
Lloh8:
	add	x9, x9, l_.str@PAGEOFF
Lloh9:
	str	x9, [x8]
	b	LBB0_19
LBB0_4:
Lloh10:
	adrp	x20, _rhbuf@GOTPAGE
Lloh11:
	ldr	x20, [x20, _rhbuf@GOTPAGEOFF]
Lloh12:
	adrp	x23, _rhbufsz@GOTPAGE
Lloh13:
	ldr	x23, [x23, _rhbufsz@GOTPAGEOFF]
	cmp	w9, w22
	b.ne	LBB0_7
; %bb.5:
	mov	w27, #0
LBB0_6:
	ldr	x0, [x20]
	ldr	w1, [x23]
	add	w2, w27, #1
	mov	x3, #0
	bl	_REALLOC
	ldr	x8, [x20]
                                        ; kill: def $w27 killed $w27 killed $x27 def $x27
	sxtw	x9, w27
Lloh14:
	adrp	x10, _rhbufi@GOTPAGE
Lloh15:
	ldr	x10, [x10, _rhbufi@GOTPAGEOFF]
Lloh16:
	str	x9, [x10]
	strb	wzr, [x8, x9]
	ldr	x0, [x20]
	b	LBB0_19
LBB0_7:
	mov	w28, #0
Lloh17:
	adrp	x24, _isglobal@GOTPAGE
Lloh18:
	ldr	x24, [x24, _isglobal@GOTPAGEOFF]
Lloh19:
	adrp	x25, _stdin@GOTPAGE
Lloh20:
	ldr	x25, [x25, _stdin@GOTPAGEOFF]
Lloh21:
	adrp	x26, _ibuf@GOTPAGE
Lloh22:
	ldr	x26, [x26, _ibuf@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	mov	x27, x19
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x21]
	ldrb	w8, [x8]
	mov	x28, x27
	cmp	w8, w22
	b.eq	LBB0_6
LBB0_10:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_15 Depth 2
	ldr	x0, [x20]
	ldr	w1, [x23]
	add	w19, w28, #2
	mov	x2, x19
	mov	x3, #0
	bl	_REALLOC
	ldr	x8, [x21]
	add	x9, x8, #1
	str	x9, [x21]
	ldrb	w8, [x8]
	ldr	x9, [x20]
	sxtw	x10, w28
	add	x27, x10, #1
	strb	w8, [x9, x10]
	cmp	w8, #92
	b.eq	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	cmp	w8, #10
	b.ne	LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x21]
	ldrb	w9, [x8]
	cbnz	w9, LBB0_9
	b	LBB0_20
LBB0_13:                                ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x21]
	add	x9, x8, #1
	str	x9, [x21]
	ldrb	w8, [x8]
	ldr	x9, [x20]
	strb	w8, [x9, x27]
	ldr	w9, [x24]
	cmp	w8, #10
	ccmp	w9, #0, #0, eq
	b.eq	LBB0_15
	b	LBB0_8
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=2
	ldr	w0, [x25]
	bl	_clearerr
LBB0_15:                                ;   Parent Loop BB0_10 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	bl	_get_tty_line
	cbz	w0, LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=2
	subs	w8, w0, #1
	b.lt	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=2
	ldr	x9, [x26]
	ldrb	w8, [x9, w8, uxtw]
	cmp	w8, #10
	b.ne	LBB0_14
	b	LBB0_8
LBB0_18:
	mov	x0, #0
LBB0_19:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_20:
	sub	x8, x8, #1
	str	x8, [x21]
	mov	x27, x28
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotStr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_ibufp,8,3                      ; @ibufp
	.comm	_rhbuf,8,3                      ; @rhbuf
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no previous substitution"

	.comm	_errmsg,8,3                     ; @errmsg
	.comm	_rhbufsz,4,2                    ; @rhbufsz
	.comm	_isglobal,4,2                   ; @isglobal
	.comm	_ibuf,8,3                       ; @ibuf
	.comm	_stdin,4,2                      ; @stdin
	.comm	_rhbufi,8,3                     ; @rhbufi
.subsections_via_symbols
