	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function SubstituteFile
_SubstituteFile:                        ## @SubstituteFile
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rax
	movq	%rdi, %rbx
	movq	$0, -56(%rbp)
	leaq	L_.str(%rip), %rsi
	movq	%rax, %rdi
	callq	_fopen
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_42
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_23
## %bb.2:
	movq	%rax, %rbx
	leaq	_SubstituteFile.szBuffer(%rip), %r15
	movl	$1024, %esi                     ## imm = 0x400
	movq	%r15, %rdi
	movq	%rax, %rdx
	callq	_fgets
	testq	%rax, %rax
	je	LBB0_22
## %bb.3:
	movl	$9217, %r14d                    ## imm = 0x2401
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
                                        ##     Child Loop BB0_14 Depth 2
                                        ##     Child Loop BB0_19 Depth 2
                                        ##     Child Loop BB0_9 Depth 2
	movb	_SubstituteFile.szBuffer(%rip), %al
	movq	%r15, %r12
	movq	%r15, %rbx
	movq	%r15, %r13
	testb	%al, %al
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rbx
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movzbl	%al, %edi
	callq	_isspace
	testq	%rax, %rax
	je	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	movzbl	1(%rbx), %eax
	incq	%rbx
	movq	%rbx, %r12
	movq	%rbx, %r13
	testb	%al, %al
	jne	LBB0_6
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movb	(%rbx), %al
	movq	%rbx, %r12
	testb	%al, %al
	je	LBB0_13
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movzbl	%al, %edi
	callq	_isspace
	testq	%rax, %rax
	jne	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=2
	movzbl	1(%r12), %eax
	incq	%r12
	testb	%al, %al
	jne	LBB0_14
## %bb.16:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %r13
	jmp	LBB0_8
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %r13
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rax
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=2
	incq	%rax
LBB0_9:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movzbl	(%rax), %ecx
	cmpq	$13, %rcx
	ja	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=2
	btq	%rcx, %r14
	jae	LBB0_11
## %bb.21:                              ##   in Loop: Header=BB0_4 Depth=1
	movb	$0, (%r12)
	movb	$0, (%rax)
	leaq	-56(%rbp), %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	callq	_list_insert
	movl	$1024, %esi                     ## imm = 0x400
	movq	%r15, %rdi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_fgets
	testq	%rax, %rax
	jne	LBB0_4
	jmp	LBB0_22
LBB0_17:                                ##   in Loop: Header=BB0_4 Depth=1
	movb	(%r12), %al
	movq	%r12, %r13
	testb	%al, %al
	je	LBB0_8
	.p2align	4, 0x90
LBB0_19:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movzbl	%al, %edi
	callq	_isspace
	testq	%rax, %rax
	je	LBB0_8
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=2
	movzbl	1(%r13), %eax
	incq	%r13
	testb	%al, %al
	jne	LBB0_19
	jmp	LBB0_8
LBB0_22:
	movq	%rbx, %rdi
	callq	_fclose
LBB0_23:
	leaq	_SubstituteFile.szBuffer(%rip), %r15
	movl	$1024, %esi                     ## imm = 0x400
	movq	%r15, %rdi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_fgets
	testq	%rax, %rax
	je	LBB0_41
## %bb.24:
	leaq	_SubstituteFile.szCopy(%rip), %r12
	jmp	LBB0_25
	.p2align	4, 0x90
LBB0_40:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	%r15, %rdi
	callq	_printf
	movl	$1024, %esi                     ## imm = 0x400
	movq	%r15, %rdi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_fgets
	testq	%rax, %rax
	je	LBB0_41
LBB0_25:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_26 Depth 2
                                        ##       Child Loop BB0_34 Depth 3
                                        ##       Child Loop BB0_37 Depth 3
	movq	-56(%rbp), %r14
	jmp	LBB0_26
	.p2align	4, 0x90
LBB0_38:                                ##   in Loop: Header=BB0_26 Depth=2
	movb	$0, (%rbx)
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	$1024, %edx                     ## imm = 0x400
	callq	_memcpy
LBB0_39:                                ##   in Loop: Header=BB0_26 Depth=2
	movq	16(%r14), %r14
LBB0_26:                                ##   Parent Loop BB0_25 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_34 Depth 3
                                        ##       Child Loop BB0_37 Depth 3
	testq	%r14, %r14
	je	LBB0_40
## %bb.27:                              ##   in Loop: Header=BB0_26 Depth=2
	movq	(%r14), %rsi
	movq	%r15, %rdi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_39
## %bb.28:                              ##   in Loop: Header=BB0_26 Depth=2
	movq	%rax, %r13
	movq	%rax, %rdx
	movq	%r12, %rbx
	movq	%r15, %rsi
	subq	%r15, %rdx
	je	LBB0_30
## %bb.29:                              ##   in Loop: Header=BB0_26 Depth=2
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_memcpy
	movq	%r12, %rbx
	subq	%r15, %rbx
	addq	%r13, %rbx
	movq	%r13, %rsi
LBB0_30:                                ##   in Loop: Header=BB0_26 Depth=2
	movq	8(%r14), %rax
	testq	%rax, %rax
	je	LBB0_31
## %bb.32:                              ##   in Loop: Header=BB0_26 Depth=2
	movb	(%rax), %cl
	movq	%rsi, %r13
	testb	%cl, %cl
	je	LBB0_35
## %bb.33:                              ##   in Loop: Header=BB0_26 Depth=2
	incq	%rax
	.p2align	4, 0x90
LBB0_34:                                ##   Parent Loop BB0_25 Depth=1
                                        ##     Parent Loop BB0_26 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movb	%cl, (%rbx)
	incq	%rbx
	movzbl	(%rax), %ecx
	incq	%rax
	testb	%cl, %cl
	jne	LBB0_34
	jmp	LBB0_35
	.p2align	4, 0x90
LBB0_31:                                ##   in Loop: Header=BB0_26 Depth=2
	movq	%rsi, %r13
LBB0_35:                                ##   in Loop: Header=BB0_26 Depth=2
	movq	(%r14), %rdi
	callq	_strlen
	movslq	%eax, %rcx
	movb	(%r13,%rcx), %al
	testb	%al, %al
	je	LBB0_38
## %bb.36:                              ##   in Loop: Header=BB0_26 Depth=2
	addq	%r13, %rcx
	incq	%rcx
	.p2align	4, 0x90
LBB0_37:                                ##   Parent Loop BB0_25 Depth=1
                                        ##     Parent Loop BB0_26 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movb	%al, (%rbx)
	incq	%rbx
	movzbl	(%rcx), %eax
	incq	%rcx
	testb	%al, %al
	jne	LBB0_37
	jmp	LBB0_38
LBB0_41:
	leaq	-56(%rbp), %rdi
	callq	_list_free
LBB0_42:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_fclose
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_SubstituteFile.szBuffer,1024,4 ## @SubstituteFile.szBuffer
.zerofill __DATA,__bss,_SubstituteFile.szCopy,1024,4 ## @SubstituteFile.szCopy
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rt"

	.comm	_stderr,4,2                     ## @stderr
	.no_dead_strip	_SubstituteFile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function SubstituteFile
_SubstituteFile:                        ; @SubstituteFile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x8, x1
	mov	x20, x0
	str	xzr, [sp, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x8
	bl	_fopen
	mov	x19, x0
	cbz	x0, LBB0_41
; %bb.1:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_fopen
	cbz	x0, LBB0_24
; %bb.2:
	mov	x20, x0
Lloh4:
	adrp	x21, _SubstituteFile.szBuffer@PAGE
Lloh5:
	add	x21, x21, _SubstituteFile.szBuffer@PAGEOFF
	mov	x0, x21
	mov	w1, #1024
	mov	x2, x20
	bl	_fgets
	cbz	x0, LBB0_23
; %bb.3:
	mov	w24, #1
	mov	w25, #9217
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	strb	wzr, [x26]
	strb	wzr, [x8]
	add	x0, sp, #8
	mov	x1, x22
	mov	x2, x23
	bl	_list_insert
	mov	x0, x21
	mov	w1, #1024
	mov	x2, x20
	bl	_fgets
	cbz	x0, LBB0_23
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;     Child Loop BB0_12 Depth 2
                                        ;     Child Loop BB0_17 Depth 2
                                        ;     Child Loop BB0_21 Depth 2
	ldrb	w8, [x21]
	cbz	w8, LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x22, x21
LBB0_7:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	and	w0, w8, #0xff
	bl	_isspace
	cbz	x0, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	ldrb	w8, [x22, #1]!
	mov	x26, x22
	mov	x23, x22
	cbnz	w8, LBB0_7
	b	LBB0_20
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x26, x21
	mov	x22, x21
	mov	x23, x21
	b	LBB0_20
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	ldrb	w8, [x22]
	cbz	w8, LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x26, x22
LBB0_12:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	and	w0, w8, #0xff
	bl	_isspace
	cbnz	x0, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
	ldrb	w8, [x26, #1]!
	cbnz	w8, LBB0_12
	b	LBB0_19
LBB0_14:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x26, x22
	mov	x23, x22
	b	LBB0_20
LBB0_15:                                ;   in Loop: Header=BB0_5 Depth=1
	ldrb	w8, [x26]
	cbz	w8, LBB0_19
; %bb.16:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x23, x26
LBB0_17:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	and	w0, w8, #0xff
	bl	_isspace
	cbz	x0, LBB0_20
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=2
	ldrb	w8, [x23, #1]!
	cbnz	w8, LBB0_17
	b	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x23, x26
LBB0_20:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x8, x23
LBB0_21:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldrb	w9, [x8]
	cmp	w9, #13
	lsl	w9, w24, w9
	and	w9, w9, w25
	ccmp	w9, #0, #4, ls
	b.ne	LBB0_4
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=2
	add	x8, x8, #1
	b	LBB0_21
LBB0_23:
	mov	x0, x20
	bl	_fclose
LBB0_24:
Lloh6:
	adrp	x20, _SubstituteFile.szBuffer@PAGE
Lloh7:
	add	x20, x20, _SubstituteFile.szBuffer@PAGEOFF
	mov	x0, x20
	mov	w1, #1024
	mov	x2, x19
	bl	_fgets
	cbz	x0, LBB0_40
; %bb.25:
Lloh8:
	adrp	x21, _SubstituteFile.szCopy@PAGE
Lloh9:
	add	x21, x21, _SubstituteFile.szCopy@PAGEOFF
	sub	x23, x21, x20
	b	LBB0_27
LBB0_26:                                ;   in Loop: Header=BB0_27 Depth=1
	mov	x0, x20
	bl	_printf
	mov	x0, x20
	mov	w1, #1024
	mov	x2, x19
	bl	_fgets
	cbz	x0, LBB0_40
LBB0_27:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_30 Depth 2
                                        ;       Child Loop BB0_36 Depth 3
                                        ;       Child Loop BB0_39 Depth 3
	ldr	x24, [sp, #8]
	cbnz	x24, LBB0_30
	b	LBB0_26
LBB0_28:                                ;   in Loop: Header=BB0_30 Depth=2
	strb	wzr, [x25]
	mov	x0, x20
	mov	x1, x21
	mov	w2, #1024
	bl	_memcpy
LBB0_29:                                ;   in Loop: Header=BB0_30 Depth=2
	ldr	x24, [x24, #16]
	cbz	x24, LBB0_26
LBB0_30:                                ;   Parent Loop BB0_27 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_36 Depth 3
                                        ;       Child Loop BB0_39 Depth 3
	ldr	x1, [x24]
	mov	x0, x20
	bl	_strstr
	cbz	x0, LBB0_29
; %bb.31:                               ;   in Loop: Header=BB0_30 Depth=2
	mov	x22, x0
	subs	x2, x0, x20
	b.eq	LBB0_33
; %bb.32:                               ;   in Loop: Header=BB0_30 Depth=2
	mov	x0, x21
	mov	x1, x20
	bl	_memcpy
	add	x25, x23, x22
	ldr	x9, [x24, #8]
	cbnz	x9, LBB0_34
	b	LBB0_37
LBB0_33:                                ;   in Loop: Header=BB0_30 Depth=2
	mov	x25, x21
	mov	x22, x20
	ldr	x9, [x24, #8]
	cbz	x9, LBB0_37
LBB0_34:                                ;   in Loop: Header=BB0_30 Depth=2
	ldrb	w8, [x9]
	cbz	w8, LBB0_37
; %bb.35:                               ;   in Loop: Header=BB0_30 Depth=2
	add	x9, x9, #1
LBB0_36:                                ;   Parent Loop BB0_27 Depth=1
                                        ;     Parent Loop BB0_30 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	strb	w8, [x25], #1
	ldrb	w8, [x9], #1
	cbnz	w8, LBB0_36
LBB0_37:                                ;   in Loop: Header=BB0_30 Depth=2
	ldr	x0, [x24]
	bl	_strlen
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x9, w0
	ldrb	w8, [x22, x9]
	cbz	w8, LBB0_28
; %bb.38:                               ;   in Loop: Header=BB0_30 Depth=2
	add	x9, x22, x9
	add	x9, x9, #1
LBB0_39:                                ;   Parent Loop BB0_27 Depth=1
                                        ;     Parent Loop BB0_30 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	strb	w8, [x25], #1
	ldrb	w8, [x9], #1
	cbnz	w8, LBB0_39
	b	LBB0_28
LBB0_40:
	add	x0, sp, #8
	bl	_list_free
LBB0_41:
	mov	x0, x19
	bl	_fclose
	mov	w0, #0
	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
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_SubstituteFile.szBuffer,1024,0 ; @SubstituteFile.szBuffer
.zerofill __DATA,__bss,_SubstituteFile.szCopy,1024,0 ; @SubstituteFile.szCopy
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rt"

	.comm	_stderr,4,2                     ; @stderr
	.no_dead_strip	_SubstituteFile
.subsections_via_symbols
