	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ftp_read
_ftp_read:                              ## @ftp_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	movq	8(%rdi), %rbx
	leaq	L_.str(%rip), %rsi
	callq	_ff_dlog
	movq	(%rbx), %rax
	movq	_DISCONNECTED@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jne	LBB0_4
## %bb.1:
	movq	8(%rbx), %rax
	cmpq	16(%rbx), %rax
	jge	LBB0_35
## %bb.2:
	movq	%r14, %rdi
	callq	_ftp_connect_data_connection
	testl	%eax, %eax
	js	LBB0_15
## %bb.3:
	movq	(%rbx), %rax
LBB0_4:
	movq	_READY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.5:
	movq	8(%rbx), %rax
	cmpq	16(%rbx), %rax
	jge	LBB0_35
## %bb.6:
	movq	%rbx, %rdi
	callq	_ftp_retrieve
	testl	%eax, %eax
	js	LBB0_15
LBB0_7:
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_37
## %bb.8:
	movq	(%rbx), %rax
	movq	_DOWNLOADING@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_37
## %bb.9:
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%r15d, %edx
	callq	_ffurl_read
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_17
## %bb.10:
	movl	%r13d, %eax
	addq	8(%rbx), %rax
	movq	%rax, 8(%rbx)
	cmpq	16(%rbx), %rax
	jl	LBB0_13
## %bb.11:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_ftp_abort
	testl	%eax, %eax
	js	LBB0_39
## %bb.12:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%rbx)
LBB0_13:
	testl	%r13d, %r13d
	jne	LBB0_36
## %bb.14:
	cmpq	16(%rbx), %rax
	jl	LBB0_18
	jmp	LBB0_36
LBB0_17:
	movq	8(%rbx), %rax
	cmpq	16(%rbx), %rax
	jge	LBB0_36
LBB0_18:
	cmpl	$0, (%r14)
	jne	LBB0_36
## %bb.19:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_AV_LOG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	callq	_av_log
	movq	%r14, %rdi
	callq	_ftp_abort
	testl	%eax, %eax
	js	LBB0_15
## %bb.20:
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_ftp_seek
	testl	%eax, %eax
	js	LBB0_49
## %bb.21:
	movq	(%rbx), %rax
	cmpq	(%r12), %rax
	jne	LBB0_25
## %bb.22:
	movq	8(%rbx), %rax
	cmpq	16(%rbx), %rax
	jge	LBB0_35
## %bb.23:
	movq	%r14, %rdi
	callq	_ftp_connect_data_connection
	testl	%eax, %eax
	js	LBB0_15
## %bb.24:
	movq	(%rbx), %rax
LBB0_25:
	movq	_READY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_28
## %bb.26:
	movq	8(%rbx), %rax
	cmpq	16(%rbx), %rax
	jge	LBB0_35
## %bb.27:
	movq	%rbx, %rdi
	callq	_ftp_retrieve
	testl	%eax, %eax
	js	LBB0_15
LBB0_28:
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	movq	_DOWNLOADING@GOTPCREL(%rip), %rcx
	je	LBB0_37
## %bb.29:
	movq	(%rbx), %rax
	cmpq	(%rcx), %rax
	jne	LBB0_37
## %bb.30:
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%r15d, %edx
	callq	_ffurl_read
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_44
## %bb.31:
	movl	%r13d, %eax
	addq	8(%rbx), %rax
	movq	%rax, 8(%rbx)
	cmpq	16(%rbx), %rax
	jl	LBB0_34
## %bb.32:
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_ftp_abort
	testl	%eax, %eax
	js	LBB0_40
## %bb.33:
	movq	%r15, %rax
	movq	%r15, 8(%rbx)
LBB0_34:
	testl	%r13d, %r13d
	jne	LBB0_36
	jmp	LBB0_45
LBB0_35:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	jmp	LBB0_36
LBB0_37:
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	movq	%r14, %rdi
	callq	_av_log
LBB0_38:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_39:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
LBB0_40:
	movq	%r15, 8(%rbx)
	jmp	LBB0_38
LBB0_44:
	movq	8(%rbx), %rax
LBB0_45:
	cmpq	16(%rbx), %rax
	jge	LBB0_36
## %bb.46:
	cmpl	$0, (%r14)
	jne	LBB0_36
## %bb.47:
	movq	%rax, %rbx
	movq	_AV_LOG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	callq	_av_log
	movq	%r14, %rdi
	callq	_ftp_abort
	testl	%eax, %eax
	js	LBB0_15
## %bb.48:
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ftp_seek
	testl	%eax, %eax
	jns	LBB0_36
LBB0_49:
	movl	%eax, %r13d
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%r14, %rdi
	callq	_av_log
	jmp	LBB0_36
LBB0_15:
	movl	%eax, %r13d
LBB0_36:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ftp protocol read %d bytes\n"

	.comm	_DISCONNECTED,8,3               ## @DISCONNECTED
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.comm	_READY,8,3                      ## @READY
	.comm	_DOWNLOADING,8,3                ## @DOWNLOADING
	.comm	_EIO,4,2                        ## @EIO
	.comm	_AV_LOG_INFO,4,2                ## @AV_LOG_INFO
L_.str.1:                               ## @.str.1
	.asciz	"Reconnect to FTP server.\n"

	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
L_.str.2:                               ## @.str.2
	.asciz	"Position cannot be restored.\n"

	.comm	_AV_LOG_DEBUG,4,2               ## @AV_LOG_DEBUG
L_.str.3:                               ## @.str.3
	.asciz	"FTP read failed\n"

	.no_dead_strip	_ftp_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ftp_read
_ftp_read:                              ; @ftp_read
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	x20, [x0, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_ff_dlog
	ldr	x8, [x20]
Lloh2:
	adrp	x25, _DISCONNECTED@GOTPAGE
Lloh3:
	ldr	x25, [x25, _DISCONNECTED@GOTPAGEOFF]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.1:
	ldp	x8, x9, [x20, #8]
	cmp	x8, x9
	b.ge	LBB0_33
; %bb.2:
	mov	x0, x19
	bl	_ftp_connect_data_connection
	tbnz	w0, #31, LBB0_43
; %bb.3:
	ldr	x8, [x20]
LBB0_4:
Lloh4:
	adrp	x26, _READY@GOTPAGE
Lloh5:
	ldr	x26, [x26, _READY@GOTPAGEOFF]
	ldr	x9, [x26]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.5:
	ldp	x8, x9, [x20, #8]
	cmp	x8, x9
	b.ge	LBB0_33
; %bb.6:
	mov	x0, x20
	bl	_ftp_retrieve
	tbnz	w0, #31, LBB0_43
LBB0_7:
	ldr	x0, [x20, #24]
	cbz	x0, LBB0_34
; %bb.8:
	ldr	x8, [x20]
Lloh6:
	adrp	x27, _DOWNLOADING@GOTPAGE
Lloh7:
	ldr	x27, [x27, _DOWNLOADING@GOTPAGEOFF]
	ldr	x9, [x27]
	cmp	x8, x9
	b.ne	LBB0_34
; %bb.9:
	mov	x1, x22
	mov	x2, x21
	bl	_ffurl_read
	mov	x23, x0
	tbnz	w0, #31, LBB0_14
; %bb.10:
	ldp	x8, x9, [x20, #8]
	add	x24, x8, w23, uxtw
	str	x24, [x20, #8]
	cmp	x24, x9
	b.lt	LBB0_13
; %bb.11:
	mov	x0, x19
	bl	_ftp_abort
	tbnz	w0, #31, LBB0_36
; %bb.12:
	str	x24, [x20, #8]
LBB0_13:
	cbnz	w23, LBB0_44
	b	LBB0_15
LBB0_14:
	ldr	x24, [x20, #8]
LBB0_15:
	ldr	x8, [x20, #16]
	cmp	x24, x8
	b.ge	LBB0_44
; %bb.16:
	ldr	w8, [x19]
	cbnz	w8, LBB0_44
; %bb.17:
Lloh8:
	adrp	x28, _AV_LOG_INFO@GOTPAGE
Lloh9:
	ldr	x28, [x28, _AV_LOG_INFO@GOTPAGEOFF]
	ldr	w1, [x28]
Lloh10:
	adrp	x2, l_.str.1@PAGE
Lloh11:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_av_log
	mov	x0, x19
	bl	_ftp_abort
	tbnz	w0, #31, LBB0_43
; %bb.18:
Lloh12:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x24
	bl	_ftp_seek
	tbnz	w0, #31, LBB0_42
; %bb.19:
	ldr	x8, [x20]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_23
; %bb.20:
	ldp	x8, x9, [x20, #8]
	cmp	x8, x9
	b.ge	LBB0_33
; %bb.21:
	mov	x0, x19
	bl	_ftp_connect_data_connection
	tbnz	w0, #31, LBB0_43
; %bb.22:
	ldr	x8, [x20]
LBB0_23:
	ldr	x9, [x26]
	cmp	x8, x9
	b.ne	LBB0_26
; %bb.24:
	ldp	x8, x9, [x20, #8]
	cmp	x8, x9
	b.ge	LBB0_33
; %bb.25:
	mov	x0, x20
	bl	_ftp_retrieve
	tbnz	w0, #31, LBB0_43
LBB0_26:
	ldr	x0, [x20, #24]
	cbz	x0, LBB0_34
; %bb.27:
	ldr	x8, [x20]
	ldr	x9, [x27]
	cmp	x8, x9
	b.ne	LBB0_34
; %bb.28:
	mov	x1, x22
	mov	x2, x21
	bl	_ffurl_read
	mov	x23, x0
	tbnz	w0, #31, LBB0_37
; %bb.29:
	ldp	x8, x9, [x20, #8]
	add	x24, x8, w23, uxtw
	str	x24, [x20, #8]
	cmp	x24, x9
	b.lt	LBB0_32
; %bb.30:
	mov	x0, x19
	bl	_ftp_abort
	tbnz	w0, #31, LBB0_36
; %bb.31:
	str	x24, [x20, #8]
LBB0_32:
	cbnz	w23, LBB0_44
	b	LBB0_38
LBB0_33:
Lloh15:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh17:
	ldr	w23, [x8]
	b	LBB0_44
LBB0_34:
Lloh18:
	adrp	x8, _AV_LOG_DEBUG@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x2, l_.str.3@PAGE
Lloh22:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_av_log
LBB0_35:
Lloh23:
	adrp	x8, _EIO@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_AVERROR
LBB0_36:
	str	x24, [x20, #8]
	b	LBB0_35
LBB0_37:
	ldr	x24, [x20, #8]
LBB0_38:
	ldr	x8, [x20, #16]
	cmp	x24, x8
	b.ge	LBB0_44
; %bb.39:
	ldr	w8, [x19]
	cbnz	w8, LBB0_44
; %bb.40:
	ldr	w1, [x28]
Lloh26:
	adrp	x2, l_.str.1@PAGE
Lloh27:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_av_log
	mov	x0, x19
	bl	_ftp_abort
	tbnz	w0, #31, LBB0_43
; %bb.41:
Lloh28:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh29:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x24
	bl	_ftp_seek
	tbz	w0, #31, LBB0_44
LBB0_42:
	mov	x23, x0
Lloh31:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh32:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
Lloh34:
	adrp	x2, l_.str.2@PAGE
Lloh35:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_av_log
	b	LBB0_44
LBB0_43:
	mov	x23, x0
LBB0_44:
	mov	x0, x23
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ftp protocol read %d bytes\n"

	.comm	_DISCONNECTED,8,3               ; @DISCONNECTED
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_READY,8,3                      ; @READY
	.comm	_DOWNLOADING,8,3                ; @DOWNLOADING
	.comm	_EIO,4,2                        ; @EIO
	.comm	_AV_LOG_INFO,4,2                ; @AV_LOG_INFO
l_.str.1:                               ; @.str.1
	.asciz	"Reconnect to FTP server.\n"

	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
l_.str.2:                               ; @.str.2
	.asciz	"Position cannot be restored.\n"

	.comm	_AV_LOG_DEBUG,4,2               ; @AV_LOG_DEBUG
l_.str.3:                               ; @.str.3
	.asciz	"FTP read failed\n"

	.no_dead_strip	_ftp_read
.subsections_via_symbols
