	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_basic_http_header        ## -- Begin function write_basic_http_header
	.p2align	4, 0x90
_write_basic_http_header:               ## @write_basic_http_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	%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	%r9, %r14
	movq	%r8, %r12
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	%edx, %r15d
	movq	%rdi, %rbx
	movl	%esi, -44(%rbp)
	callq	_HTS_DATA
	movq	%rax, %r13
	movq	(%rax), %rcx
	movq	_HTTP_V10@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpq	(%rdx), %rcx
	jl	LBB0_7
## %bb.1:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	leaq	-44(%rbp), %rdi
	callq	_http_get_error_msg_text
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	testl	%r15d, %r15d
	je	LBB0_3
## %bb.2:
	leaq	_write_basic_http_header.date_buff(%rip), %rbx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_gen_http_date
	movq	%rbx, %r9
	movq	_header_pattern@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movl	-44(%rbp), %ecx
	jmp	LBB0_4
LBB0_3:
	movq	_header_pattern@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movl	-44(%rbp), %ebx
	xorl	%eax, %eax
	callq	_cur_http_date
	movl	%ebx, %ecx
	movq	%rax, %r9
LBB0_4:
	testq	%r14, %r14
	leaq	L_.str(%rip), %r10
	cmovneq	%r14, %r10
	movq	_QF_KEEPALIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	8(%r13), %eax
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %r11
	cmoveq	%rax, %r11
	testq	%r12, %r12
	leaq	L_.str.3(%rip), %rax
	cmovneq	%r12, %rax
	subq	$8, %rsp
	leaq	_write_basic_http_header.buff(%rip), %rbx
	movq	%rbx, %rdi
	movl	$1984, %esi                     ## imm = 0x7C0
	movq	%r15, %rdx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	pushq	%rax
	pushq	%r11
	pushq	%r10
	callq	_snprintf
	addq	$32, %rsp
	cltq
	addq	%rax, %rbx
	xorl	%edi, %edi
	cmpl	$1984, %eax                     ## imm = 0x7C0
	setl	%dil
	callq	_assert
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	testl	%edx, %edx
	js	LBB0_6
## %bb.5:
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_sprintf
	cltq
	addq	%rax, %rbx
LBB0_6:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movb	$0, 2(%rbx)
	movw	$2573, (%rbx)                   ## imm = 0xA0D
	addq	$2, %rbx
	leaq	_write_basic_http_header.buff(%rip), %rsi
	subl	%esi, %ebx
	movl	%ebx, %edx
	callq	_write_out
LBB0_7:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HTTP_V10,8,3                   ## @HTTP_V10
.zerofill __DATA,__bss,_write_basic_http_header.buff,2048,4 ## @write_basic_http_header.buff
.zerofill __DATA,__bss,_write_basic_http_header.date_buff,32,4 ## @write_basic_http_header.date_buff
	.comm	_header_pattern,8,3             ## @header_pattern
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"text/html"

	.comm	_QF_KEEPALIVE,4,2               ## @QF_KEEPALIVE
L_.str.1:                               ## @.str.1
	.asciz	"keep-alive"

L_.str.2:                               ## @.str.2
	.asciz	"close"

L_.str.3:                               ## @.str.3
	.space	1

L_.str.4:                               ## @.str.4
	.asciz	"Content-Length: %d\r\n"

L_.str.5:                               ## @.str.5
	.asciz	"\r\n"

	.comm	_B_SZ,4,2                       ## @B_SZ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_basic_http_header        ; -- Begin function write_basic_http_header
	.p2align	2
_write_basic_http_header:               ; @write_basic_http_header
	.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	x22, x5
	mov	x21, x4
	mov	x20, x3
	mov	x26, x2
	mov	x19, x0
	str	w1, [sp, #12]
	bl	_HTS_DATA
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _HTTP_V10@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HTTP_V10@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_8
LBB0_2:
	mov	x24, x0
	add	x0, sp, #12
	bl	_http_get_error_msg_text
	mov	x23, x0
	cbz	w26, LBB0_4
; %bb.3:
Lloh3:
	adrp	x25, _write_basic_http_header.date_buff@PAGE
Lloh4:
	add	x25, x25, _write_basic_http_header.date_buff@PAGEOFF
	mov	x0, x25
	mov	x1, x26
	bl	_gen_http_date
Lloh5:
	adrp	x8, _header_pattern@GOTPAGE
Lloh6:
	ldr	x8, [x8, _header_pattern@GOTPAGEOFF]
Lloh7:
	ldr	x26, [x8]
	ldr	w27, [sp, #12]
	b	LBB0_5
LBB0_4:
Lloh8:
	adrp	x8, _header_pattern@GOTPAGE
Lloh9:
	ldr	x8, [x8, _header_pattern@GOTPAGEOFF]
Lloh10:
	ldr	x26, [x8]
	ldr	w27, [sp, #12]
	bl	_cur_http_date
	mov	x25, x0
LBB0_5:
Lloh11:
	adrp	x8, l_.str@PAGE
Lloh12:
	add	x8, x8, l_.str@PAGEOFF
	cmp	x22, #0
	csel	x6, x8, x22, eq
Lloh13:
	adrp	x8, _QF_KEEPALIVE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _QF_KEEPALIVE@GOTPAGEOFF]
	ldr	w9, [x24, #8]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x10, l_.str.1@PAGE
Lloh17:
	add	x10, x10, l_.str.1@PAGEOFF
Lloh18:
	adrp	x11, l_.str.2@PAGE
Lloh19:
	add	x11, x11, l_.str.2@PAGEOFF
	tst	w8, w9
	csel	x7, x11, x10, eq
Lloh20:
	adrp	x8, l_.str.3@PAGE
Lloh21:
	add	x8, x8, l_.str.3@PAGEOFF
	cmp	x21, #0
	csel	x8, x8, x21, eq
	str	x8, [sp]
Lloh22:
	adrp	x21, _write_basic_http_header.buff@PAGE
Lloh23:
	add	x21, x21, _write_basic_http_header.buff@PAGEOFF
	mov	x0, x21
	mov	w1, #1984
	mov	x2, x26
	mov	x3, x27
	mov	x4, x23
	mov	x5, x25
	bl	_snprintf
	add	x21, x21, w0, sxtw
	cmp	w0, #1984
	cset	w0, lt
	bl	_assert
	tbnz	w20, #31, LBB0_7
; %bb.6:
	str	x20, [sp]
Lloh24:
	adrp	x1, l_.str.4@PAGE
Lloh25:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	bl	_sprintf
	add	x21, x21, w0, sxtw
LBB0_7:
	mov	w8, #2573
	strh	w8, [x21]
	strb	wzr, [x21, #2]!
Lloh26:
	adrp	x1, _write_basic_http_header.buff@PAGE
Lloh27:
	add	x1, x1, _write_basic_http_header.buff@PAGEOFF
	sub	w2, w21, w1
	mov	x0, x19
	bl	_write_out
LBB0_8:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_HTTP_V10,8,3                   ; @HTTP_V10
.zerofill __DATA,__bss,_write_basic_http_header.buff,2048,0 ; @write_basic_http_header.buff
.zerofill __DATA,__bss,_write_basic_http_header.date_buff,32,0 ; @write_basic_http_header.date_buff
	.comm	_header_pattern,8,3             ; @header_pattern
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"text/html"

	.comm	_QF_KEEPALIVE,4,2               ; @QF_KEEPALIVE
l_.str.1:                               ; @.str.1
	.asciz	"keep-alive"

l_.str.2:                               ; @.str.2
	.asciz	"close"

l_.str.3:                               ; @.str.3
	.space	1

l_.str.4:                               ; @.str.4
	.asciz	"Content-Length: %d\r\n"

l_.str.5:                               ; @.str.5
	.asciz	"\r\n"

	.comm	_B_SZ,4,2                       ; @B_SZ
.subsections_via_symbols
