	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function r_socket_http_answer
_r_socket_http_answer:                  ## @r_socket_http_answer
	.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	%rdx, %r14
	movq	%rdi, %r12
	xorl	%r13d, %r13d
	xorl	%esi, %esi
	callq	_r_return_val_if_fail
	movl	$1, %edi
	movl	$32800, %esi                    ## imm = 0x8020
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_21
## %bb.1:
	movq	%rax, %rbx
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movq	%rax, %rsi
	movl	$32768, %edx                    ## imm = 0x8000
	callq	___socket_slurp
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_r_str_casestr
	testq	%rax, %rax
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_3
## %bb.2:
	movq	%rax, %r15
	movl	$2, %r13d
	jmp	LBB0_5
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_r_str_casestr
	testq	%rax, %rax
	je	LBB0_22
## %bb.4:
	movq	%rax, %r15
	movl	$4, %r13d
LBB0_5:
	subl	%r13d, %r14d
	movb	$0, (%r15)
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_r_str_casestr
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	addq	$16, %rax
	movq	%rax, %rdi
	callq	_atoi
	movl	%eax, %ebx
	testl	%ebx, %ebx
	jg	LBB0_10
	jmp	LBB0_9
LBB0_7:
                                        ## kill: def $ebx killed $ebx killed $rbx def $rbx
	subl	%r15d, %ebx
	addl	%r14d, %ebx
	testl	%ebx, %ebx
	jle	LBB0_9
LBB0_10:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	cmpl	%r14d, %ebx
	jle	LBB0_15
## %bb.11:
	leal	2(%rbx), %edi
	callq	_malloc
	movq	%rax, %r13
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	%rax, %r15
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_memcpy
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movslq	%r14d, %rax
	leaq	(,%rax,4), %rsi
	addq	%r13, %rsi
	movl	%ebx, %edx
	subl	%eax, %edx
	movq	%r12, %rdi
	callq	_r_socket_read_block
	testl	%eax, %eax
	jle	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	addl	%eax, %r14d
	cmpl	%ebx, %r14d
	jl	LBB0_12
LBB0_14:
	movslq	%ebx, %rcx
	movq	%r13, %rax
	addq	%rcx, %rax
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_15:
	leal	1(%rbx), %edi
	callq	_malloc
	testq	%rax, %rax
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_16
## %bb.17:
	movq	%rax, %r13
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	%rax, %r15
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movl	%ebx, %eax
	addq	%r13, %rax
LBB0_18:
	movb	$0, (%rax)
	jmp	LBB0_19
LBB0_22:
	xorl	%ebx, %ebx
LBB0_9:
	xorl	%r13d, %r13d
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_19:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_free
	movq	%r12, %rdi
	callq	_r_socket_close
	testq	%r14, %r14
	je	LBB0_21
## %bb.20:
	movl	%ebx, (%r14)
LBB0_21:
	movq	%r13, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	xorl	%r13d, %r13d
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n\n"

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

L_.str.2:                               ## @.str.2
	.asciz	"Content-Length: "

	.no_dead_strip	_r_socket_http_answer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function r_socket_http_answer
_r_socket_http_answer:                  ; @r_socket_http_answer
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x2
	mov	x20, x0
	mov	x1, #0
	bl	_r_return_val_if_fail
	mov	w0, #1
	mov	w1, #32800
	bl	_calloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	mov	x0, x20
	mov	x1, x21
	mov	w2, #32768
	bl	___socket_slurp
	mov	x22, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_r_str_casestr
	cbz	x0, LBB0_4
; %bb.2:
	mov	x24, x0
	mov	w26, #2
	b	LBB0_6
LBB0_3:
	mov	x23, #0
	b	LBB0_20
LBB0_4:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_r_str_casestr
	cbz	x0, LBB0_16
; %bb.5:
	mov	x24, x0
	mov	w26, #4
LBB0_6:
	sub	w25, w22, w26
	strb	wzr, [x24]
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_r_str_casestr
	cbz	x0, LBB0_8
; %bb.7:
	add	x0, x0, #16
	bl	_atoi
	mov	x22, x0
	cmp	w22, #1
	b.ge	LBB0_9
	b	LBB0_17
LBB0_8:
	sub	w8, w21, w24
	add	w22, w25, w8
	cmp	w22, #1
	b.lt	LBB0_17
LBB0_9:
	cmp	w22, w25
	b.le	LBB0_13
; %bb.10:
	add	w0, w22, #2
	bl	_malloc
	mov	x23, x0
	add	x1, x24, w26, uxtw
	mov	x2, x25
	bl	_memcpy
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	add	x1, x23, w25, sxtw #2
	sub	w2, w22, w25
	mov	x0, x20
	bl	_r_socket_read_block
	add	w25, w0, w25
	cmp	w0, #1
	ccmp	w25, w22, #0, ge
	b.lt	LBB0_11
; %bb.12:
	add	x8, x23, w22, sxtw
	b	LBB0_15
LBB0_13:
	add	w0, w22, #1
	bl	_malloc
	mov	x23, x0
	cbz	x0, LBB0_18
; %bb.14:
	add	x1, x24, w26, uxtw
	mov	x0, x23
	mov	x2, x22
	bl	_memcpy
	add	x8, x23, w22, uxtw
LBB0_15:
	strb	wzr, [x8]
	b	LBB0_18
LBB0_16:
	mov	w22, #0
LBB0_17:
	mov	x23, #0
LBB0_18:
	mov	x0, x21
	bl	_free
	mov	x0, x20
	bl	_r_socket_close
	cbz	x19, LBB0_20
; %bb.19:
	str	w22, [x19]
LBB0_20:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n\n"

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

l_.str.2:                               ; @.str.2
	.asciz	"Content-Length: "

	.no_dead_strip	_r_socket_http_answer
.subsections_via_symbols
