	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function copy_headers_to_buf
_copy_headers_to_buf:                   ## @copy_headers_to_buf
	.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
	movq	%rdi, %r13
	movq	_PARSER_BUF_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_FALSE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	$0, (%rsi)
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	xorl	%r14d, %r14d
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	testq	%r14, %r14
	je	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	leal	(%rbx,%rbx), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	callq	_GetProcessHeap
	leal	(%rbx,%rbx), %ecx
	incl	%ecx
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	_HeapReAlloc
	movq	%rax, %r14
	movl	-60(%rbp), %eax                 ## 4-byte Reload
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testq	%r14, %r14
	jne	LBB0_7
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	leal	1(%rcx), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	%rax, %r14
	testq	%r14, %r14
	je	LBB0_5
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	movslq	%r15d, %rbx
	leaq	(%r14,%rbx), %rsi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, %edx
	subl	%ebx, %edx
	movq	%r13, %rdi
	leaq	-44(%rbp), %rcx
	callq	_IStream_Read
	movl	%eax, %r15d
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	movslq	-44(%rbp), %r15
	addq	%rbx, %r15
	movb	$0, (%r14,%r15)
	cmpl	$0, -44(%rbp)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	jne	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_10:                                ##   in Loop: Header=BB0_1 Depth=1
	testq	%rax, %rax
	jne	LBB0_15
LBB0_11:                                ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movslq	%r12d, %rdi
	addq	%r14, %rdi
	leaq	L_.str(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_17
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	%rax, %rbx
	subl	%r14d, %ebx
	addl	$2, %ebx
	movl	%ebx, %eax
	subl	%r12d, %eax
	cmpl	$2, %eax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=2
	xorl	%eax, %eax
	movl	%ebx, %r12d
	testq	%rax, %rax
	je	LBB0_11
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	%ebx, %esi
	subl	%r15d, %esi
	movq	_STREAM_SEEK_CUR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	xorl	%ecx, %ecx
	callq	_IStream_Seek
	movslq	%ebx, %rax
	movb	$0, (%r14,%rax)
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	jmp	LBB0_1
LBB0_15:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%r14, (%rax)
	movq	_S_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_16:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_E_OUTOFMEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_6:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	_HeapFree
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_PARSER_BUF_SIZE,4,2            ## @PARSER_BUF_SIZE
	.comm	_FALSE,8,3                      ## @FALSE
	.comm	_E_OUTOFMEMORY,4,2              ## @E_OUTOFMEMORY
	.comm	_TRUE,8,3                       ## @TRUE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\r\n"

	.comm	_STREAM_SEEK_CUR,4,2            ## @STREAM_SEEK_CUR
	.comm	_S_OK,4,2                       ## @S_OK
	.no_dead_strip	_copy_headers_to_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function copy_headers_to_buf
_copy_headers_to_buf:                   ; @copy_headers_to_buf
	.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	x21, x0
	mov	w24, #0
	mov	w25, #0
	mov	x19, #0
	str	x1, [sp]                        ; 8-byte Folded Spill
	str	xzr, [x1]
Lloh0:
	adrp	x8, _PARSER_BUF_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PARSER_BUF_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w26, [x8]
Lloh3:
	adrp	x8, _FALSE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh5:
	ldr	x20, [x8]
Lloh6:
	adrp	x27, _TRUE@GOTPAGE
Lloh7:
	ldr	x27, [x27, _TRUE@GOTPAGEOFF]
Lloh8:
	adrp	x22, l_.str@PAGE
Lloh9:
	add	x22, x22, l_.str@PAGEOFF
Lloh10:
	adrp	x28, _STREAM_SEEK_CUR@GOTPAGE
Lloh11:
	ldr	x28, [x28, _STREAM_SEEK_CUR@GOTPAGEOFF]
	cbz	x19, LBB0_2
LBB0_1:
	lsl	w23, w26, #1
	bl	_GetProcessHeap
	mov	w3, #1
	bfi	w3, w26, #1, #31
	mov	w1, #0
	mov	x2, x19
	bl	_HeapReAlloc
	mov	x19, x0
	mov	x26, x23
	cbnz	x19, LBB0_3
	b	LBB0_12
LBB0_2:
	bl	_GetProcessHeap
	add	w2, w26, #1
	mov	w1, #0
	bl	_HeapAlloc
	mov	x19, x0
	cbz	x19, LBB0_12
LBB0_3:
	add	x1, x19, w24, sxtw
	sub	w2, w26, w24
	add	x3, sp, #12
	mov	x0, x21
	bl	_IStream_Read
	mov	x23, x0
	bl	_FAILED
	cbnz	x0, LBB0_13
; %bb.4:
	ldrsw	x8, [sp, #12]
	add	x24, x8, w24, sxtw
	strb	wzr, [x19, x24]
	ldr	w8, [sp, #12]
	ldr	x9, [x27]
	cmp	w8, #0
	csel	x8, x9, x20, eq
	cbz	x8, LBB0_6
	b	LBB0_10
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	sub	w1, w20, w24
	ldr	w2, [x28]
	mov	x0, x21
	mov	x3, #0
	bl	_IStream_Seek
	strb	wzr, [x19, w20, sxtw]
	ldr	x8, [x27]
	cbnz	x8, LBB0_10
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, x19, w25, sxtw
	mov	x1, x22
	bl	_strstr
	cbz	x0, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	sub	w8, w0, w19
	add	w20, w8, #2
	sub	w8, w20, w25
	cmp	w8, #2
	b.eq	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x8, #0
	mov	x25, x20
	cbz	x8, LBB0_6
	b	LBB0_10
LBB0_9:
	mov	x20, #0
	cbnz	x19, LBB0_1
	b	LBB0_2
LBB0_10:
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	str	x19, [x8]
Lloh12:
	adrp	x8, _S_OK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _S_OK@GOTPAGEOFF]
Lloh14:
	ldr	w23, [x8]
LBB0_11:
	mov	x0, x23
	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_12:
Lloh15:
	adrp	x8, _E_OUTOFMEMORY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _E_OUTOFMEMORY@GOTPAGEOFF]
Lloh17:
	ldr	w23, [x8]
LBB0_13:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x19
	bl	_HeapFree
	b	LBB0_11
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_PARSER_BUF_SIZE,4,2            ; @PARSER_BUF_SIZE
	.comm	_FALSE,8,3                      ; @FALSE
	.comm	_E_OUTOFMEMORY,4,2              ; @E_OUTOFMEMORY
	.comm	_TRUE,8,3                       ; @TRUE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\r\n"

	.comm	_STREAM_SEEK_CUR,4,2            ; @STREAM_SEEK_CUR
	.comm	_S_OK,4,2                       ; @S_OK
	.no_dead_strip	_copy_headers_to_buf
.subsections_via_symbols
