	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function io_http_read
_io_http_read:                          ## @io_http_read
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	16(%rdi), %r13
	movq	(%r13), %rax
	cmpq	(%rdi), %rax
	jge	LBB0_8
## %bb.1:
	movq	%rdx, %rbx
	movq	%rsi, %r12
	cmpl	$0, 12(%r13)
	jne	LBB0_3
## %bb.2:
	movq	%r15, %rdi
	callq	_io_http_open_socket
	movq	%rax, %r14
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jne	LBB0_13
LBB0_3:
	movq	%r15, %rdi
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rsi
	callq	_io_http_send_get_request
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_9
## %bb.4:
	movq	%r15, %rdi
	callq	_io_http_read_response
	movq	%rax, %r14
	movq	_VC_CONTAINER_ERROR_EOS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jne	LBB0_10
## %bb.5:
	cmpl	$0, 8(%r13)
	jne	LBB0_10
## %bb.6:
	leaq	L_.str.2(%rip), %rsi
	xorl	%edi, %edi
	callq	_LOG_DEBUG
	movq	%r13, %rdi
	callq	_io_http_close_socket
	movq	%r15, %rdi
	callq	_io_http_open_socket
	movq	%rax, %r14
	cmpq	(%rbx), %rax
	jne	LBB0_10
## %bb.7:
	movl	$1, 8(%r13)
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_io_http_read
	movl	$0, 8(%r13)
	jmp	LBB0_19
LBB0_8:
	movq	_VC_CONTAINER_ERROR_EOS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r15)
	xorl	%r14d, %r14d
	jmp	LBB0_18
LBB0_9:
	movq	%rax, %r14
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_15
LBB0_10:
	cmpq	(%rbx), %r14
	jne	LBB0_14
## %bb.11:
	movl	16(%r13), %edi
	callq	_io_http_get_content_length
	movq	%rax, %rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rcx, %rax
	jbe	LBB0_20
## %bb.12:
	leaq	L_.str.4(%rip), %rsi
	xorl	%edi, %edi
                                        ## kill: def $edx killed $edx killed $rdx
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	_LOG_ERROR
	movq	_VC_CONTAINER_ERROR_CORRUPTED@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	cmpl	$0, 12(%r13)
	jne	LBB0_18
	jmp	LBB0_16
LBB0_13:
	leaq	L_.str(%rip), %rsi
	xorl	%edi, %edi
	xorl	%eax, %eax
	callq	_LOG_ERROR
	jmp	LBB0_18
LBB0_14:
	leaq	L_.str.3(%rip), %rsi
LBB0_15:
	xorl	%edi, %edi
	xorl	%eax, %eax
	callq	_LOG_ERROR
	cmpl	$0, 12(%r13)
	jne	LBB0_18
LBB0_16:
	movq	%r13, %rdi
LBB0_17:
	callq	_io_http_close_socket
LBB0_18:
	movq	%r14, %rax
LBB0_19:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	8(%r15), %rax
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	testq	%rdx, %rdx
	je	LBB0_25
## %bb.21:
	movl	$0, %r14d
	cmpq	%rcx, %rax
	jne	LBB0_26
## %bb.22:
	movq	%rdx, %r13
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdx
	subq	%rbx, %rdx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_io_http_read_from_net
	movq	%rax, %r14
	movq	8(%r15), %rax
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	movq	%r14, %rdx
	movl	$0, %esi
	cmovneq	%rsi, %rdx
	addq	%rdx, %rbx
	cmpq	%rbx, %r13
	jbe	LBB0_26
## %bb.24:                              ##   in Loop: Header=BB0_23 Depth=1
	addq	%rdx, %r12
	cmpq	%rcx, %rax
	je	LBB0_23
	jmp	LBB0_26
LBB0_25:
	xorl	%r14d, %r14d
LBB0_26:
	cmpq	%rcx, %rax
	jne	LBB0_28
## %bb.27:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	%rbx, (%rax)
	movq	%rbx, %r14
LBB0_28:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	cmpl	$0, 12(%rdi)
	jne	LBB0_18
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_VC_CONTAINER_SUCCESS,8,3       ## @VC_CONTAINER_SUCCESS
	.comm	_VC_CONTAINER_ERROR_EOS,8,3     ## @VC_CONTAINER_ERROR_EOS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error opening socket for GET request"

L_.str.1:                               ## @.str.1
	.asciz	"Error sending GET request"

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

L_.str.3:                               ## @.str.3
	.asciz	"Error reading GET response"

L_.str.4:                               ## @.str.4
	.asciz	"received too much data (%i/%i)"

	.comm	_VC_CONTAINER_ERROR_CORRUPTED,8,3 ## @VC_CONTAINER_ERROR_CORRUPTED
	.no_dead_strip	_io_http_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function io_http_read
_io_http_read:                          ; @io_http_read
	.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	x21, x0
	ldr	x19, [x0, #16]
	ldr	x8, [x19]
	ldr	x9, [x0]
	cmp	x8, x9
	b.ge	LBB0_8
; %bb.1:
	mov	x23, x2
	mov	x22, x1
	ldr	w8, [x19, #12]
Lloh0:
	adrp	x25, _VC_CONTAINER_SUCCESS@GOTPAGE
Lloh1:
	ldr	x25, [x25, _VC_CONTAINER_SUCCESS@GOTPAGEOFF]
	cbnz	w8, LBB0_3
; %bb.2:
	mov	x0, x21
	bl	_io_http_open_socket
	ldr	x8, [x25]
	cmp	x0, x8
	b.ne	LBB0_13
LBB0_3:
	mov	x0, x21
	mov	x1, x23
	bl	_io_http_send_get_request
	ldr	x8, [x25]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.4:
	mov	x0, x21
	bl	_io_http_read_response
	mov	x20, x0
Lloh2:
	adrp	x8, _VC_CONTAINER_ERROR_EOS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _VC_CONTAINER_ERROR_EOS@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.5:
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_10
; %bb.6:
Lloh5:
	adrp	x1, l_.str.2@PAGE
Lloh6:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, #0
	bl	_LOG_DEBUG
	mov	x0, x19
	bl	_io_http_close_socket
	mov	x0, x21
	bl	_io_http_open_socket
	mov	x20, x0
	ldr	x8, [x25]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.7:
	mov	w8, #1
	str	w8, [x19, #8]
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	bl	_io_http_read
	str	wzr, [x19, #8]
	b	LBB0_19
LBB0_8:
	mov	x20, #0
Lloh7:
	adrp	x8, _VC_CONTAINER_ERROR_EOS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _VC_CONTAINER_ERROR_EOS@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	str	x8, [x21, #8]
	b	LBB0_18
LBB0_9:
	mov	x20, x0
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_15
LBB0_10:
	ldr	x8, [x25]
	cmp	x20, x8
	b.ne	LBB0_14
; %bb.11:
	ldr	w0, [x19, #16]
	bl	_io_http_get_content_length
	mov	x24, x0
	cmp	x0, x23
	b.ls	LBB0_20
; %bb.12:
	stp	x24, x23, [sp]
Lloh12:
	adrp	x1, l_.str.4@PAGE
Lloh13:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, #0
	bl	_LOG_ERROR
Lloh14:
	adrp	x8, _VC_CONTAINER_ERROR_CORRUPTED@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VC_CONTAINER_ERROR_CORRUPTED@GOTPAGEOFF]
Lloh16:
	ldr	x20, [x8]
	b	LBB0_16
LBB0_13:
	mov	x20, x0
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, #0
	bl	_LOG_ERROR
	b	LBB0_18
LBB0_14:
Lloh19:
	adrp	x1, l_.str.3@PAGE
Lloh20:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_15:
	mov	x0, #0
	bl	_LOG_ERROR
LBB0_16:
	ldr	w8, [x19, #12]
	cbnz	w8, LBB0_18
; %bb.17:
	mov	x0, x19
	bl	_io_http_close_socket
LBB0_18:
	mov	x0, x20
LBB0_19:
	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
LBB0_20:
	mov	x23, #0
	ldr	x8, [x21, #8]
	ldr	x9, [x25]
	mov	x20, #0
	cbz	x24, LBB0_25
; %bb.21:
	cmp	x8, x9
	b.ne	LBB0_25
; %bb.22:
	mov	x23, #0
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	sub	x2, x24, x23
	mov	x0, x21
	mov	x1, x22
	bl	_io_http_read_from_net
	ldr	x8, [x21, #8]
	ldr	x9, [x25]
	cmp	x8, x9
	csel	x10, x0, xzr, eq
	add	x22, x22, x10
	add	x23, x10, x23
	cmp	x24, x23
	ccmp	x8, x9, #0, hi
	b.eq	LBB0_23
; %bb.24:
	mov	x20, x0
LBB0_25:
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.26:
	ldr	x8, [x19]
	add	x8, x8, x23
	str	x8, [x19]
	mov	x20, x23
	b	LBB0_16
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_VC_CONTAINER_SUCCESS,8,3       ; @VC_CONTAINER_SUCCESS
	.comm	_VC_CONTAINER_ERROR_EOS,8,3     ; @VC_CONTAINER_ERROR_EOS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error opening socket for GET request"

l_.str.1:                               ; @.str.1
	.asciz	"Error sending GET request"

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

l_.str.3:                               ; @.str.3
	.asciz	"Error reading GET response"

l_.str.4:                               ; @.str.4
	.asciz	"received too much data (%i/%i)"

	.comm	_VC_CONTAINER_ERROR_CORRUPTED,8,3 ; @VC_CONTAINER_ERROR_CORRUPTED
	.no_dead_strip	_io_http_read
.subsections_via_symbols
