	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_knet_open                      ## -- Begin function knet_open
	.p2align	4, 0x90
_knet_open:                             ## @knet_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	cmpb	$114, (%rsi)
	jne	LBB0_1
## %bb.2:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	leaq	L_.str.1(%rip), %rsi
	movl	$6, %edx
	callq	_strncmp
	testl	%eax, %eax
	je	LBB0_3
## %bb.6:
	leaq	L_.str.2(%rip), %rsi
	movl	$7, %edx
	movq	%r14, %rdi
	callq	_strncmp
	testl	%eax, %eax
	je	LBB0_7
## %bb.9:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_open
	cmpl	$-1, %eax
	je	LBB0_10
## %bb.11:
	movl	%eax, %r14d
	movl	$1, %edi
	movl	$12, %esi
	callq	_calloc
	movq	%rax, %rbx
	movq	_KNF_TYPE_LOCAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movl	%r14d, (%rbx)
	movl	$-1, 4(%rbx)
	cmpl	$-1, (%rbx)
	jne	LBB0_15
	jmp	LBB0_13
LBB0_1:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fprintf
	jmp	LBB0_14
LBB0_3:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_kftp_parse_url
	testq	%rax, %rax
	je	LBB0_14
## %bb.4:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_kftp_connect
	cmpl	$-1, %eax
	je	LBB0_13
## %bb.5:
	movq	%rbx, %rdi
	callq	_kftp_connect_file
	cmpl	$-1, (%rbx)
	jne	LBB0_15
	jmp	LBB0_13
LBB0_7:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_khttp_parse_url
	testq	%rax, %rax
	je	LBB0_14
## %bb.8:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_khttp_connect_file
	cmpl	$-1, (%rbx)
	jne	LBB0_15
LBB0_13:
	movq	%rbx, %rdi
	callq	_knet_close
LBB0_14:
	xorl	%ebx, %ebx
LBB0_15:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_10:
	leaq	L_.str.3(%rip), %rdi
	callq	_perror
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[kftp_open] only mode \"r\" is supported.\n"

L_.str.1:                               ## @.str.1
	.asciz	"ftp://"

L_.str.2:                               ## @.str.2
	.asciz	"http://"

	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
L_.str.3:                               ## @.str.3
	.asciz	"open"

	.comm	_KNF_TYPE_LOCAL,4,2             ## @KNF_TYPE_LOCAL
	.comm	_O_BINARY,4,2                   ## @O_BINARY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_knet_open                      ; -- Begin function knet_open
	.p2align	2
_knet_open:                             ; @knet_open
	.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
	ldrb	w8, [x1]
	cmp	w8, #114
	b.ne	LBB0_5
; %bb.1:
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w2, #6
	bl	_strncmp
	cbz	w0, LBB0_6
; %bb.2:
Lloh2:
	adrp	x1, l_.str.2@PAGE
Lloh3:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	w2, #7
	bl	_strncmp
	cbz	w0, LBB0_9
; %bb.3:
Lloh4:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_open
	cmn	w0, #1
	b.eq	LBB0_15
; %bb.4:
	mov	x20, x0
	mov	w0, #1
	mov	w1, #12
	bl	_calloc
	mov	x19, x0
Lloh7:
	adrp	x8, _KNF_TYPE_LOCAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _KNF_TYPE_LOCAL@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x8]
	mov	w8, #-1
	str	w20, [x0]
	stp	w8, w9, [x0, #4]
	b	LBB0_11
LBB0_5:
Lloh10:
	adrp	x8, _stderr@GOTPAGE
Lloh11:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	b	LBB0_13
LBB0_6:
	mov	x0, x19
	mov	x1, x20
	bl	_kftp_parse_url
	mov	x19, x0
	cbz	x0, LBB0_14
; %bb.7:
	mov	x0, x19
	bl	_kftp_connect
	cmn	w0, #1
	b.eq	LBB0_12
; %bb.8:
	mov	x0, x19
	bl	_kftp_connect_file
	b	LBB0_11
LBB0_9:
	mov	x0, x19
	mov	x1, x20
	bl	_khttp_parse_url
	mov	x19, x0
	cbz	x0, LBB0_14
; %bb.10:
	mov	x0, x19
	bl	_khttp_connect_file
LBB0_11:
	ldr	w8, [x19]
	cmn	w8, #1
	b.ne	LBB0_14
LBB0_12:
	mov	x0, x19
	bl	_knet_close
LBB0_13:
	mov	x19, #0
LBB0_14:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_15:
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_perror
	b	LBB0_13
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[kftp_open] only mode \"r\" is supported.\n"

l_.str.1:                               ; @.str.1
	.asciz	"ftp://"

l_.str.2:                               ; @.str.2
	.asciz	"http://"

	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
l_.str.3:                               ; @.str.3
	.asciz	"open"

	.comm	_KNF_TYPE_LOCAL,4,2             ; @KNF_TYPE_LOCAL
	.comm	_O_BINARY,4,2                   ; @O_BINARY
.subsections_via_symbols
