	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ftp_open
_ftp_open:                              ## @ftp_open
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	8(%rdi), %r12
	leaq	L_.str(%rip), %rsi
	callq	_ff_dlog
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_ftp_connect
	testl	%eax, %eax
	js	LBB0_8
## %bb.1:
	xorl	%r15d, %r15d
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_ftp_restart
	testq	%rax, %rax
	js	LBB0_9
## %bb.2:
	movq	%r12, %rdi
	callq	_ftp_file_size
	testq	%rax, %rax
	jns	LBB0_5
## %bb.3:
	movq	_AVIO_FLAG_READ@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_5
## %bb.4:
	movl	$1, (%rbx)
LBB0_5:
	xorl	%r15d, %r15d
	cmpl	$1, (%r12)
	je	LBB0_10
## %bb.6:
	movq	_AVIO_FLAG_WRITE@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_10
LBB0_9:
	movl	$1, (%rbx)
	jmp	LBB0_10
LBB0_8:
	movl	%eax, %r15d
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	callq	_av_log
	movq	%rbx, %rdi
	callq	_ftp_close
LBB0_10:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ftp protocol open\n"

	.comm	_AVIO_FLAG_READ,4,2             ## @AVIO_FLAG_READ
	.comm	_AVIO_FLAG_WRITE,4,2            ## @AVIO_FLAG_WRITE
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"FTP open failed\n"

	.no_dead_strip	_ftp_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ftp_open
_ftp_open:                              ; @ftp_open
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	ldr	x21, [x0, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_ff_dlog
	mov	x0, x19
	mov	x1, x22
	bl	_ftp_connect
	tbnz	w0, #31, LBB0_8
; %bb.1:
	mov	x0, x21
	mov	w1, #0
	bl	_ftp_restart
	tbnz	x0, #63, LBB0_7
; %bb.2:
	mov	x0, x21
	bl	_ftp_file_size
	tbz	x0, #63, LBB0_5
; %bb.3:
Lloh2:
	adrp	x8, _AVIO_FLAG_READ@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AVIO_FLAG_READ@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_5
; %bb.4:
	mov	w8, #1
	str	w8, [x19]
LBB0_5:
	ldr	w8, [x21]
	cmp	w8, #1
	b.eq	LBB0_9
; %bb.6:
Lloh5:
	adrp	x8, _AVIO_FLAG_WRITE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AVIO_FLAG_WRITE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_9
LBB0_7:
	mov	w22, #0
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_10
LBB0_8:
	mov	x22, x0
Lloh8:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x2, l_.str.1@PAGE
Lloh12:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_av_log
	mov	x0, x19
	bl	_ftp_close
	b	LBB0_10
LBB0_9:
	mov	w22, #0
LBB0_10:
	mov	x0, x22
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ftp protocol open\n"

	.comm	_AVIO_FLAG_READ,4,2             ; @AVIO_FLAG_READ
	.comm	_AVIO_FLAG_WRITE,4,2            ; @AVIO_FLAG_WRITE
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"FTP open failed\n"

	.no_dead_strip	_ftp_open
.subsections_via_symbols
