	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bio_to_mem                     ## -- Begin function bio_to_mem
	.p2align	4, 0x90
_bio_to_mem:                            ## @bio_to_mem
	.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	$1048, %rsp                     ## imm = 0x418
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -1088(%rbp)               ## 8-byte Spill
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	xorl	%eax, %eax
	callq	_BIO_s_mem
	movl	%eax, %edi
	callq	_BIO_new
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%r14, -1080(%rbp)               ## 8-byte Spill
	leaq	-1072(%rbp), %r14
	movl	$-1, %r13d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$1024, %ebx                     ## imm = 0x400
	movl	$1024, %edx                     ## imm = 0x400
	cmovll	%ebx, %edx
	cmpl	$-1, %ebx
	movl	$1024, %eax                     ## imm = 0x400
	cmovel	%eax, %edx
	movq	-1088(%rbp), %rdi               ## 8-byte Reload
	movq	%r14, %rsi
	callq	_BIO_read
	testl	%eax, %eax
	js	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, %r15d
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_BIO_write
	cmpl	%r15d, %eax
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	subl	%r15d, %ebx
	jne	LBB0_3
LBB0_7:
	movq	%r12, %rdi
	movq	-1080(%rbp), %rsi               ## 8-byte Reload
	callq	_BIO_get_mem_data
	movl	%eax, %r13d
	movq	_BIO_FLAGS_MEM_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_BIO_set_flags
LBB0_8:
	movq	%r12, %rdi
	callq	_BIO_free
	jmp	LBB0_9
LBB0_1:
	movl	$-1, %r13d
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	movl	%r13d, %eax
	addq	$1048, %rsp                     ## imm = 0x418
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_BIO_FLAGS_MEM_RDONLY,4,2       ## @BIO_FLAGS_MEM_RDONLY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bio_to_mem                     ; -- Begin function bio_to_mem
	.p2align	2
_bio_to_mem:                            ; @bio_to_mem
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #1040
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	bl	_BIO_s_mem
	bl	_BIO_new
	cbz	x0, LBB0_7
; %bb.1:
	mov	x19, x0
	mov	w25, #1024
	mov	w23, #-1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w22, #1024
	ccmp	w22, w23, #4, lt
	csel	w2, w22, w25, ne
	add	x1, sp, #8
	mov	x0, x21
	bl	_BIO_read
	tbnz	w0, #31, LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x24, x0
	cbz	w0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x1, sp, #8
	mov	x0, x19
	mov	x2, x24
	bl	_BIO_write
	cmp	w0, w24
	b.ne	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	subs	w22, w22, w24
	b.ne	LBB0_2
LBB0_6:
	mov	x0, x19
	mov	x1, x20
	bl	_BIO_get_mem_data
	mov	x23, x0
Lloh3:
	adrp	x8, _BIO_FLAGS_MEM_RDONLY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BIO_FLAGS_MEM_RDONLY@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_BIO_set_flags
	b	LBB0_9
LBB0_7:
	mov	w23, #-1
	b	LBB0_10
LBB0_8:
	mov	w23, #-1
LBB0_9:
	mov	x0, x19
	bl	_BIO_free
LBB0_10:
	ldur	x8, [x29, #-72]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	mov	x0, x23
	add	sp, sp, #1040
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_BIO_FLAGS_MEM_RDONLY,4,2       ; @BIO_FLAGS_MEM_RDONLY
.subsections_via_symbols
