	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kftp_connect_file              ## -- Begin function kftp_connect_file
	.p2align	4, 0x90
_kftp_connect_file:                     ## @kftp_connect_file
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$64, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movl	(%rdi), %edi
	cmpl	$-1, %edi
	je	LBB0_3
## %bb.1:
	callq	_netclose
	cmpq	$0, 56(%rbx)
	je	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_kftp_get_response
LBB0_3:
	movq	%rbx, %rdi
	callq	_kftp_pasv_prep
	movq	8(%rbx), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_kftp_send_cmd
	movq	16(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	leaq	-72(%rbp), %rdx
	callq	_sscanf
	cmpl	$1, %eax
	jne	LBB0_8
## %bb.4:
	movq	-72(%rbp), %rax
	movq	%rax, 24(%rbx)
	movq	32(%rbx), %rdx
	testq	%rdx, %rdx
	js	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	leaq	-64(%rbp), %r14
	movq	%r14, %rdi
	callq	_sprintf
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	$1, %edx
	callq	_kftp_send_cmd
LBB0_6:
	movq	40(%rbx), %rsi
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_kftp_send_cmd
	movq	%rbx, %rdi
	callq	_kftp_pasv_connect
	movq	%rbx, %rdi
	callq	_kftp_get_response
	cmpl	$150, %eax
	jne	LBB0_9
## %bb.7:
	movl	$1, 48(%rbx)
	jmp	LBB0_11
LBB0_8:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	16(%rbx), %rdx
	leaq	L_.str.1(%rip), %rsi
	callq	_fprintf
	jmp	LBB0_10
LBB0_9:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	16(%rbx), %rdx
	leaq	L_.str.1(%rip), %rsi
	callq	_fprintf
	movl	(%rbx), %edi
	callq	_netclose
	movl	$-1, (%rbx)
LBB0_10:
	movl	$-1, %r14d
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-24(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	movl	%r14d, %eax
	addq	$64, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%*d %lld"

	.comm	_stderr,4,2                     ## @stderr
L_.str.1:                               ## @.str.1
	.asciz	"[kftp_connect_file] %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"REST %lld\r\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kftp_connect_file              ; -- Begin function kftp_connect_file
	.p2align	2
_kftp_connect_file:                     ; @kftp_connect_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	ldr	w0, [x0]
	cmn	w0, #1
	b.eq	LBB0_3
; %bb.1:
	bl	_netclose
	ldr	x8, [x19, #56]
	cbz	x8, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_kftp_get_response
LBB0_3:
	mov	x0, x19
	bl	_kftp_pasv_prep
	ldr	x1, [x19, #8]
	mov	x0, x19
	mov	w2, #1
	bl	_kftp_send_cmd
	ldr	x0, [x19, #16]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, sp
	bl	_sscanf
	cmp	w0, #1
	b.ne	LBB0_8
; %bb.4:
	ldr	x8, [sp]
	str	x8, [x19, #24]
	ldr	x2, [x19, #32]
	tbnz	x2, #63, LBB0_6
; %bb.5:
Lloh5:
	adrp	x1, l_.str.2@PAGE
Lloh6:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x0, sp, #8
	bl	_sprintf
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #1
	bl	_kftp_send_cmd
LBB0_6:
	ldr	x1, [x19, #40]
	mov	x0, x19
	mov	w2, #0
	bl	_kftp_send_cmd
	mov	x0, x19
	bl	_kftp_pasv_connect
	mov	x0, x19
	bl	_kftp_get_response
	cmp	w0, #150
	b.ne	LBB0_9
; %bb.7:
	mov	w0, #0
	mov	w8, #1
	str	w8, [x19, #48]
	b	LBB0_10
LBB0_8:
Lloh7:
	adrp	x8, _stderr@GOTPAGE
Lloh8:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	ldr	x2, [x19, #16]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fprintf
	mov	w0, #-1
	b	LBB0_10
LBB0_9:
Lloh12:
	adrp	x8, _stderr@GOTPAGE
Lloh13:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	ldr	x2, [x19, #16]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fprintf
	ldr	w0, [x19]
	bl	_netclose
	mov	w0, #-1
	str	w0, [x19]
LBB0_10:
	ldur	x8, [x29, #-24]
Lloh17:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh18:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%*d %lld"

	.comm	_stderr,4,2                     ; @stderr
l_.str.1:                               ; @.str.1
	.asciz	"[kftp_connect_file] %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"REST %lld\r\n"

.subsections_via_symbols
