	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$168, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	L_.str(%rip), %rbx
	movq	%rbx, %rdi
	callq	_strlen
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_strncmp
	xorl	%r13d, %r13d
	testl	%eax, %eax
	jne	LBB0_15
## %bb.1:
	addq	$6, %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	(%r14,%rbx), %eax
	testb	%al, %al
	je	LBB0_14
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpb	$47, %al
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	jmp	LBB0_2
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	callq	_strdup
	movq	%rax, %r13
	leal	1(%rbx), %edi
	movl	$1, %esi
	callq	_calloc
	movq	%rax, %r12
	movq	%rax, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_strncpy
	addq	%rbx, %r14
	movq	%r14, %rdi
	callq	_strlen
                                        ## kill: def $eax killed $eax def $rax
	leal	8(%rax), %edi
	movl	$1, %esi
	callq	_calloc
	movq	%rax, %r15
	leaq	L_.str.2(%rip), %rsi
	movq	%rax, %rdi
	movq	%r14, %rdx
	movq	%r13, %r14
	xorl	%eax, %eax
	callq	_sprintf
	leaq	-208(%rbp), %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_socket_connect
	movl	%eax, -208(%rbp)
	movl	$-1, %r13d
	cmpl	$-1, %eax
	je	LBB0_13
## %bb.6:
	leaq	-208(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_kftp_get_response
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_kftp_send_cmd
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_kftp_send_cmd
	leaq	L_.str.5(%rip), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_kftp_send_cmd
	leaq	L_.str.6(%rip), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_kftp_send_cmd
	movq	-200(%rbp), %rdi
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	incq	%rdi
	movzbl	-1(%rdi), %eax
	testb	%al, %al
	je	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpb	$40, %al
	jne	LBB0_7
## %bb.9:
	leaq	-172(%rbp), %rcx
	leaq	-168(%rbp), %r8
	leaq	-164(%rbp), %r9
	leaq	-160(%rbp), %r10
	leaq	-156(%rbp), %rax
	leaq	L_.str.7(%rip), %rsi
	leaq	-176(%rbp), %rbx
	movq	%rbx, %rdx
	pushq	%rax
	pushq	%r10
	callq	_sscanf
	addq	$16, %rsp
	leaq	-192(%rbp), %rdi
	movq	%rbx, %rsi
	movl	$16, %edx
	callq	_memcpy
	movl	-160(%rbp), %eax
	shll	$8, %eax
	movzwl	%ax, %ebx
	addl	-156(%rbp), %ebx
	leaq	-208(%rbp), %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_kftp_send_cmd
	movl	-192(%rbp), %edx
	movl	-188(%rbp), %ecx
	movl	-184(%rbp), %r8d
	movl	-180(%rbp), %r9d
	leaq	L_.str.8(%rip), %rsi
	leaq	-128(%rbp), %rdi
	xorl	%eax, %eax
	callq	_sprintf
	leaq	L_.str.9(%rip), %rsi
	leaq	-138(%rbp), %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_sprintf
	leaq	-128(%rbp), %rdi
	leaq	-138(%rbp), %rsi
	callq	_socket_connect
	movq	%rax, %rbx
	cmpl	$-1, %ebx
	je	LBB0_13
## %bb.10:
	leaq	-208(%rbp), %rdi
	callq	_kftp_get_response
	cmpl	$150, %eax
	je	LBB0_12
## %bb.11:
	movl	%ebx, %edi
	callq	_close
	movl	$-1, %ebx
LBB0_12:
	movl	-208(%rbp), %edi
	callq	_close
	movl	%ebx, %r13d
LBB0_13:
	movq	%r12, %rdi
	callq	_free
	movq	%r14, %rdi
	callq	_free
	movq	%r15, %rdi
	callq	_free
	movq	-200(%rbp), %rdi
	callq	_free
	jmp	LBB0_15
LBB0_14:
	xorl	%r13d, %r13d
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_17
## %bb.16:
	movl	%r13d, %eax
	addq	$168, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ftp://"

L_.str.1:                               ## @.str.1
	.asciz	"21"

L_.str.2:                               ## @.str.2
	.asciz	"RETR %s\r\n"

L_.str.3:                               ## @.str.3
	.asciz	"USER anonymous\r\n"

L_.str.4:                               ## @.str.4
	.asciz	"PASS kopen@\r\n"

L_.str.5:                               ## @.str.5
	.asciz	"TYPE I\r\n"

L_.str.6:                               ## @.str.6
	.asciz	"PASV\r\n"

L_.str.7:                               ## @.str.7
	.asciz	"%d,%d,%d,%d,%d,%d"

L_.str.8:                               ## @.str.8
	.asciz	"%d.%d.%d.%d"

L_.str.9:                               ## @.str.9
	.asciz	"%d"

	.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:
	sub	sp, sp, #240
	.cfi_def_cfa_offset 240
	stp	x22, x21, [sp, #192]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #208]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #224]            ; 16-byte Folded Spill
	add	x29, sp, #224
	.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	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x20, l_.str@PAGE
Lloh4:
	add	x20, x20, l_.str@PAGEOFF
	mov	x0, x20
	bl	_strlen
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_strncmp
	cbz	w0, LBB0_4
LBB0_1:
	mov	w22, #0
LBB0_2:
	ldur	x8, [x29, #-40]
Lloh5:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh6:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.3:
	mov	x0, x22
	ldp	x29, x30, [sp, #224]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #208]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #192]            ; 16-byte Folded Reload
	add	sp, sp, #240
	ret
LBB0_4:
	mov	x21, #0
	add	x22, x19, #6
	ldrb	w8, [x22, x21]
	cbz	w8, LBB0_1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w8, #47
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x21, x21, #1
	ldrb	w8, [x22, x21]
	cbnz	w8, LBB0_5
	b	LBB0_1
LBB0_7:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_strdup
	mov	x19, x0
	add	w0, w21, #1
	mov	w1, #1
	bl	_calloc
	mov	x20, x0
	mov	x1, x22
	mov	x2, x21
	bl	_strncpy
	add	x22, x22, x21
	mov	x0, x22
	bl	_strlen
	add	w0, w0, #8
	mov	w1, #1
	bl	_calloc
	mov	x21, x0
	str	x22, [sp]
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_sprintf
	add	x0, sp, #32
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	mov	x0, x20
	mov	x1, x19
	bl	_socket_connect
	str	w0, [sp, #32]
	cmn	w0, #1
	b.eq	LBB0_15
; %bb.8:
	add	x0, sp, #32
	bl	_kftp_get_response
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	add	x0, sp, #32
	mov	w2, #1
	bl	_kftp_send_cmd
Lloh14:
	adrp	x1, l_.str.4@PAGE
Lloh15:
	add	x1, x1, l_.str.4@PAGEOFF
	add	x0, sp, #32
	mov	w2, #1
	bl	_kftp_send_cmd
Lloh16:
	adrp	x1, l_.str.5@PAGE
Lloh17:
	add	x1, x1, l_.str.5@PAGEOFF
	add	x0, sp, #32
	mov	w2, #1
	bl	_kftp_send_cmd
Lloh18:
	adrp	x1, l_.str.6@PAGE
Lloh19:
	add	x1, x1, l_.str.6@PAGEOFF
	add	x0, sp, #32
	mov	w2, #1
	bl	_kftp_send_cmd
	ldr	x8, [sp, #40]
	add	x0, x8, #1
	ldurb	w8, [x0, #-1]
	cbz	w8, LBB0_15
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w8, #40
	b.eq	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x0, x0, #1
	ldurb	w8, [x0, #-1]
	cbnz	w8, LBB0_9
	b	LBB0_15
LBB0_11:
	add	x8, sp, #68
	add	x3, x8, #4
	add	x4, x8, #8
	add	x5, x8, #12
	add	x6, x8, #16
	add	x7, x8, #20
Lloh20:
	adrp	x1, l_.str.7@PAGE
Lloh21:
	add	x1, x1, l_.str.7@PAGEOFF
	add	x2, sp, #68
	bl	_sscanf
	add	x0, sp, #52
	add	x1, sp, #68
	mov	w2, #16
	bl	_memcpy
	ldp	w8, w9, [sp, #84]
	ubfiz	w8, w8, #8, #8
	add	w22, w8, w9
	add	x0, sp, #32
	mov	x1, x21
	mov	w2, #0
	bl	_kftp_send_cmd
	ldp	w8, w9, [sp, #52]
	ldp	w10, w11, [sp, #60]
	stp	x10, x11, [sp, #16]
	stp	x8, x9, [sp]
Lloh22:
	adrp	x1, l_.str.8@PAGE
Lloh23:
	add	x1, x1, l_.str.8@PAGEOFF
	add	x0, sp, #104
	bl	_sprintf
	str	x22, [sp]
Lloh24:
	adrp	x1, l_.str.9@PAGE
Lloh25:
	add	x1, x1, l_.str.9@PAGEOFF
	add	x0, sp, #94
	bl	_sprintf
	add	x0, sp, #104
	add	x1, sp, #94
	bl	_socket_connect
	mov	x22, x0
	cmn	w22, #1
	b.eq	LBB0_15
; %bb.12:
	add	x0, sp, #32
	bl	_kftp_get_response
	cmp	w0, #150
	b.eq	LBB0_14
; %bb.13:
	mov	x0, x22
	bl	_close
	mov	w22, #-1
LBB0_14:
	ldr	w0, [sp, #32]
	bl	_close
	b	LBB0_16
LBB0_15:
	mov	w22, #-1
LBB0_16:
	mov	x0, x20
	bl	_free
	mov	x0, x19
	bl	_free
	mov	x0, x21
	bl	_free
	ldr	x0, [sp, #40]
	bl	_free
	b	LBB0_2
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ftp://"

l_.str.1:                               ; @.str.1
	.asciz	"21"

l_.str.2:                               ; @.str.2
	.asciz	"RETR %s\r\n"

l_.str.3:                               ; @.str.3
	.asciz	"USER anonymous\r\n"

l_.str.4:                               ; @.str.4
	.asciz	"PASS kopen@\r\n"

l_.str.5:                               ; @.str.5
	.asciz	"TYPE I\r\n"

l_.str.6:                               ; @.str.6
	.asciz	"PASV\r\n"

l_.str.7:                               ; @.str.7
	.asciz	"%d,%d,%d,%d,%d,%d"

l_.str.8:                               ; @.str.8
	.asciz	"%d.%d.%d.%d"

l_.str.9:                               ; @.str.9
	.asciz	"%d"

	.no_dead_strip	_ftp_open
.subsections_via_symbols
