	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ftp_closefn
_ftp_closefn:                           ## @ftp_closefn
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	cmpl	$-1, (%rdi)
	je	LBB0_3
## %bb.4:
	cmpq	$0, 8(%rbx)
	je	LBB0_1
## %bb.5:
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.6:
	callq	_fetch_close
	movl	$-1, (%rbx)
	movq	$0, 16(%rbx)
	leaq	L_.str(%rip), %rdi
	callq	_DEBUGF
	movq	8(%rbx), %rdi
	callq	_ftp_chkerr
	movl	%eax, %r14d
	movq	8(%rbx), %rdi
	movq	_cached_connection@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	jne	LBB0_9
## %bb.7:
	cmpl	$1, (%rdi)
	jne	LBB0_9
## %bb.8:
	movq	$0, (%rax)
LBB0_9:
	callq	_fetch_close
	movq	%rbx, %rdi
	callq	_free
	movq	_FTP_TRANSFER_COMPLETE@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpl	(%rcx), %r14d
	setne	%al
	negl	%eax
	jmp	LBB0_10
LBB0_1:
	movq	_EBADF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$-1, %eax
	jmp	LBB0_10
LBB0_3:
	xorl	%eax, %eax
LBB0_10:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBADF,4,2                      ## @EBADF
	.comm	_errno,4,2                      ## @errno
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Waiting for final status\n"

	.comm	_cached_connection,8,3          ## @cached_connection
	.comm	_FTP_TRANSFER_COMPLETE,4,2      ## @FTP_TRANSFER_COMPLETE
	.no_dead_strip	_ftp_closefn
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ftp_closefn
_ftp_closefn:                           ; @ftp_closefn
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	cbz	x0, LBB0_8
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0]
	cmn	w8, #1
	b.eq	LBB0_9
; %bb.2:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_8
; %bb.3:
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_8
; %bb.4:
	bl	_fetch_close
	mov	w8, #-1
	str	w8, [x19]
	str	xzr, [x19, #16]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DEBUGF
	ldr	x0, [x19, #8]
	bl	_ftp_chkerr
	mov	x20, x0
	ldr	x0, [x19, #8]
Lloh2:
	adrp	x8, _cached_connection@GOTPAGE
Lloh3:
	ldr	x8, [x8, _cached_connection@GOTPAGEOFF]
	ldr	x9, [x8]
	cmp	x0, x9
	b.ne	LBB0_7
; %bb.5:
	ldr	w9, [x0]
	cmp	w9, #1
	b.ne	LBB0_7
; %bb.6:
	str	xzr, [x8]
LBB0_7:
	bl	_fetch_close
	mov	x0, x19
	bl	_free
Lloh4:
	adrp	x8, _FTP_TRANSFER_COMPLETE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _FTP_TRANSFER_COMPLETE@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w20, w8
	csetm	w0, ne
	b	LBB0_10
LBB0_8:
Lloh7:
	adrp	x8, _EBADF@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EBADF@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _errno@GOTPAGE
Lloh11:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh12:
	str	w8, [x9]
	mov	w0, #-1
	b	LBB0_10
LBB0_9:
	mov	w0, #0
LBB0_10:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotStr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EBADF,4,2                      ; @EBADF
	.comm	_errno,4,2                      ; @errno
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Waiting for final status\n"

	.comm	_cached_connection,8,3          ; @cached_connection
	.comm	_FTP_TRANSFER_COMPLETE,4,2      ; @FTP_TRANSFER_COMPLETE
	.no_dead_strip	_ftp_closefn
.subsections_via_symbols
