	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function replace_encoding_header
_replace_encoding_header:               ## @replace_encoding_header
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	_STRBUF_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	leaq	L_.str(%rip), %r12
	movq	%rdi, %rbx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_starts_with
	testl	%eax, %eax
	jne	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_9
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rax, %rbx
	incq	%rbx
	cmpb	$10, 1(%rax)
	jne	LBB0_1
	jmp	LBB0_9
LBB0_4:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:
	movq	%rax, %r12
	subq	%r15, %rbx
	subq	%r15, %r12
	subq	%rbx, %r12
	incq	%r12
	movq	%r15, %rdi
	callq	_strlen
	leaq	1(%rax), %rcx
	leaq	-40(%rbp), %rdi
	movq	%r15, %rsi
	movq	%rax, %rdx
	callq	_strbuf_attach
	movq	%r14, %rdi
	callq	_is_encoding_utf8
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	-40(%rbp), %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	_strbuf_remove
	jmp	LBB0_8
LBB0_7:
	addq	$9, %rbx
	addq	$-10, %r12
	movq	%r14, %rdi
	callq	_strlen
	leaq	-40(%rbp), %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	movq	%r14, %rcx
	movq	%rax, %r8
	callq	_strbuf_splice
LBB0_8:
	leaq	-40(%rbp), %rdi
	xorl	%esi, %esi
	callq	_strbuf_detach
	movq	%rax, %r15
LBB0_9:
	movq	%r15, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STRBUF_INIT,4,2                ## @STRBUF_INIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"encoding "

	.no_dead_strip	_replace_encoding_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function replace_encoding_header
_replace_encoding_header:               ; @replace_encoding_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _STRBUF_INIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STRBUF_INIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #8]
Lloh3:
	adrp	x22, l_.str@PAGE
Lloh4:
	add	x22, x22, l_.str@PAGEOFF
	mov	x21, x0
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x22
	bl	_starts_with
	cbnz	w0, LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x21
	mov	w1, #10
	bl	_strchr
	cbz	x0, LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x21, x0
	ldrb	w8, [x21, #1]!
	cmp	w8, #10
	b.ne	LBB0_1
	b	LBB0_9
LBB0_4:
	mov	x0, x21
	mov	w1, #10
	bl	_strchr
	cbz	x0, LBB0_9
; %bb.5:
	sub	x21, x21, x20
	add	x8, x20, x21
	sub	x8, x0, x8
	add	x22, x8, #1
	mov	x0, x20
	bl	_strlen
	mov	x2, x0
	add	x3, x0, #1
	add	x0, sp, #8
	mov	x1, x20
	bl	_strbuf_attach
	mov	x0, x19
	bl	_is_encoding_utf8
	cbz	x0, LBB0_7
; %bb.6:
	add	x0, sp, #8
	mov	x1, x21
	mov	x2, x22
	bl	_strbuf_remove
	b	LBB0_8
LBB0_7:
	add	x20, x21, #9
	sub	x21, x22, #10
	mov	x0, x19
	bl	_strlen
	mov	x4, x0
	add	x0, sp, #8
	mov	x1, x20
	mov	x2, x21
	mov	x3, x19
	bl	_strbuf_splice
LBB0_8:
	add	x0, sp, #8
	mov	x1, #0
	bl	_strbuf_detach
	mov	x20, x0
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_STRBUF_INIT,4,2                ; @STRBUF_INIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"encoding "

	.no_dead_strip	_replace_encoding_header
.subsections_via_symbols
