	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_search_and_replace             ## -- Begin function search_and_replace
	.p2align	4, 0x90
_search_and_replace:                    ## @search_and_replace
	.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	%esi, %r13d
	movq	%rdi, %rbx
	movq	_current_addr@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	movq	_first_addr@GOTPCREL(%rip), %rax
	movslq	(%rax), %rdi
	movq	_second_addr@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jge	LBB0_1
LBB0_18:
	movq	_GLB@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_19
LBB0_20:
	movq	_GPR@GOTPCREL(%rip), %rax
	movq	_GLS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_GNP@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	testl	%r13d, %ecx
	je	LBB0_21
## %bb.22:
	movq	%rsi, %rdi
	movl	%r13d, %edx
	callq	_display_lines
	movq	_ERR@GOTPCREL(%rip), %rcx
	sarq	$63, %rax
	andl	(%rcx), %eax
	jmp	LBB0_23
LBB0_1:
	movl	%edx, %r14d
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, (%r15)
	callq	_get_addressed_line_node
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movl	%r13d, %edx
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	movl	%r14d, %ecx
	callq	_substitute_matching_text
	testl	%eax, %eax
	js	LBB0_16
## %bb.2:
	movl	%eax, %r14d
	movq	_rbuf@GOTPCREL(%rip), %rbx
	xorl	%r12d, %r12d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r15), %rdi
	movq	%rdi, %rsi
	callq	_delete_lines
	testq	%rax, %rax
	js	LBB0_16
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rbx), %rbx
	movl	%r14d, %r13d
	addq	%rbx, %r13
	xorl	%eax, %eax
	callq	_SPL1
	xorl	%r14d, %r14d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=2
	movq	(%r15), %rdi
	callq	_get_addressed_line_node
	movq	%rax, (%r14)
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=2
	cmpq	%r13, %rbx
	je	LBB0_13
LBB0_7:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	callq	_put_sbuf_line
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=2
	movq	%rax, %rbx
	testq	%r14, %r14
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=2
	movq	_UADD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r15), %rdx
	movq	%rdx, %rsi
	callq	_push_undo_stack
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_12
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_first_addr@GOTPCREL(%rip), %rcx
	movq	_second_addr@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	callq	_SPL0
	incl	-44(%rbp)                       ## 4-byte Folded Spill
	movq	(%r15), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	movq	_first_addr@GOTPCREL(%rip), %rcx
	movq	_second_addr@GOTPCREL(%rip), %rax
	movq	_rbuf@GOTPCREL(%rip), %rbx
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	movslq	(%rax), %rax
	movslq	(%rcx), %rcx
	subq	%rcx, %rax
	cmpq	%rax, %r12
	jge	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	incq	%r12
	movq	(%r15), %rdi
	incq	%rdi
	movq	%rdi, (%r15)
	callq	_get_addressed_line_node
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	movl	%r13d, %edx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	callq	_substitute_matching_text
	movl	%eax, %r14d
	testl	%eax, %eax
	jns	LBB0_3
	jmp	LBB0_16
LBB0_8:
	xorl	%eax, %eax
	callq	_SPL0
	jmp	LBB0_16
LBB0_19:
	leaq	L_.str(%rip), %rax
	movq	_errmsg@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
LBB0_16:
	movq	_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_23:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	xorl	%eax, %eax
	jmp	LBB0_23
LBB0_17:
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%rsi, (%r15)
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_20
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_current_addr,8,3               ## @current_addr
	.comm	_first_addr,4,2                 ## @first_addr
	.comm	_second_addr,4,2                ## @second_addr
	.comm	_ERR,4,2                        ## @ERR
	.comm	_rbuf,8,3                       ## @rbuf
	.comm	_UADD,4,2                       ## @UADD
	.comm	_GLB,4,2                        ## @GLB
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no match"

	.comm	_errmsg,8,3                     ## @errmsg
	.comm	_GPR,4,2                        ## @GPR
	.comm	_GLS,4,2                        ## @GLS
	.comm	_GNP,4,2                        ## @GNP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_search_and_replace             ; -- Begin function search_and_replace
	.p2align	2
_search_and_replace:                    ; @search_and_replace
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x24, _current_addr@GOTPAGE
Lloh1:
	ldr	x24, [x24, _current_addr@GOTPAGEOFF]
Lloh2:
	adrp	x25, _first_addr@GOTPAGE
Lloh3:
	ldr	x25, [x25, _first_addr@GOTPAGEOFF]
	ldr	x22, [x24]
	ldrsw	x0, [x25]
Lloh4:
	adrp	x26, _second_addr@GOTPAGE
Lloh5:
	ldr	x26, [x26, _second_addr@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w8, w0
	b.ge	LBB0_4
LBB0_1:
Lloh6:
	adrp	x8, _GLB@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GLB@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_18
LBB0_2:
Lloh9:
	adrp	x8, _GPR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GPR@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _GLS@GOTPAGE
Lloh13:
	ldr	x9, [x9, _GLS@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh15:
	adrp	x9, _GNP@GOTPAGE
Lloh16:
	ldr	x9, [x9, _GNP@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w8, w9
	tst	w8, w19
	b.eq	LBB0_21
; %bb.3:
	mov	x0, x22
	mov	x1, x22
	mov	x2, x19
	bl	_display_lines
Lloh18:
	adrp	x8, _ERR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ERR@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	asr	x9, x0, #63
	and	w0, w9, w8
	b	LBB0_20
LBB0_4:
	mov	x20, x2
	str	x0, [x24]
	bl	_get_addressed_line_node
	mov	x1, x0
	mov	x0, x21
	mov	x2, x19
	mov	x3, x20
	bl	_substitute_matching_text
	tbnz	w0, #31, LBB0_19
; %bb.5:
	mov	x23, x0
	mov	x28, #0
	str	wzr, [sp, #12]                  ; 4-byte Folded Spill
Lloh21:
	adrp	x27, _UADD@GOTPAGE
Lloh22:
	ldr	x27, [x27, _UADD@GOTPAGEOFF]
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	cbz	w23, LBB0_15
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [x24]
	mov	x1, x0
	bl	_delete_lines
	tbnz	x0, #63, LBB0_19
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x26, x25
Lloh23:
	adrp	x8, _rbuf@GOTPAGE
Lloh24:
	ldr	x8, [x8, _rbuf@GOTPAGEOFF]
Lloh25:
	ldr	x22, [x8]
	add	x25, x22, w23, uxtw
	bl	_SPL1
	mov	x23, #0
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=2
	ldr	x0, [x24]
	bl	_get_addressed_line_node
	str	x0, [x23]
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=2
	cmp	x22, x25
	b.eq	LBB0_14
LBB0_11:                                ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x22
	bl	_put_sbuf_line
	cbz	x0, LBB0_17
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=2
	mov	x22, x0
	cbnz	x23, LBB0_9
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=2
	ldr	w0, [x27]
	ldr	x1, [x24]
	mov	x2, x1
	bl	_push_undo_stack
	mov	x23, x0
	cbnz	x0, LBB0_10
	b	LBB0_17
LBB0_14:                                ;   in Loop: Header=BB0_6 Depth=1
	bl	_SPL0
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	add	w8, w8, #1
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	ldr	x22, [x24]
	mov	x25, x26
Lloh26:
	adrp	x26, _second_addr@GOTPAGE
Lloh27:
	ldr	x26, [x26, _second_addr@GOTPAGEOFF]
LBB0_15:                                ;   in Loop: Header=BB0_6 Depth=1
	ldrsw	x8, [x26]
	ldrsw	x9, [x25]
	sub	x8, x8, x9
	cmp	x28, x8
	b.ge	LBB0_22
; %bb.16:                               ;   in Loop: Header=BB0_6 Depth=1
	add	x28, x28, #1
	ldr	x8, [x24]
	add	x0, x8, #1
	str	x0, [x24]
	bl	_get_addressed_line_node
	mov	x1, x0
	mov	x0, x21
	mov	x2, x19
	mov	x3, x20
	bl	_substitute_matching_text
	mov	x23, x0
	tbz	w0, #31, LBB0_6
	b	LBB0_19
LBB0_17:
	bl	_SPL0
	b	LBB0_19
LBB0_18:
Lloh28:
	adrp	x8, _errmsg@GOTPAGE
Lloh29:
	ldr	x8, [x8, _errmsg@GOTPAGEOFF]
Lloh30:
	adrp	x9, l_.str@PAGE
Lloh31:
	add	x9, x9, l_.str@PAGEOFF
Lloh32:
	str	x9, [x8]
LBB0_19:
Lloh33:
	adrp	x8, _ERR@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ERR@GOTPAGEOFF]
Lloh35:
	ldr	w0, [x8]
LBB0_20:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_21:
	mov	w0, #0
	b	LBB0_20
LBB0_22:
	str	x22, [x24]
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cbnz	w8, LBB0_2
	b	LBB0_1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotStr	Lloh28, Lloh29, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_current_addr,8,3               ; @current_addr
	.comm	_first_addr,4,2                 ; @first_addr
	.comm	_second_addr,4,2                ; @second_addr
	.comm	_ERR,4,2                        ; @ERR
	.comm	_rbuf,8,3                       ; @rbuf
	.comm	_UADD,4,2                       ; @UADD
	.comm	_GLB,4,2                        ; @GLB
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no match"

	.comm	_errmsg,8,3                     ; @errmsg
	.comm	_GPR,4,2                        ; @GPR
	.comm	_GLS,4,2                        ; @GLS
	.comm	_GNP,4,2                        ; @GNP
.subsections_via_symbols
