	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ok_write
_ok_write:                              ## @ok_write
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	testl	%edx, %edx
	jle	LBB0_26
## %bb.1:
	movq	%rdi, %r15
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	callq	_BIO_get_data
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_BIO_next
	testq	%rbx, %rbx
	je	LBB0_25
## %bb.2:
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_25
## %bb.3:
	movq	%r15, %rdi
	callq	_BIO_get_init
	testq	%rax, %rax
	je	LBB0_25
## %bb.4:
	cmpq	$0, 32(%rbx)
	je	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	callq	_sig_out
	testl	%eax, %eax
	je	LBB0_25
LBB0_6:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movl	%r14d, %r12d
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_8 Depth=1
	subl	%r14d, %r12d
	movslq	%r14d, %rax
	addq	%rax, -64(%rbp)                 ## 8-byte Folded Spill
	testl	%r12d, %r12d
	jle	LBB0_28
LBB0_8:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
	movq	%r15, %rdi
	callq	_BIO_clear_retry_flags
	movl	(%rbx), %eax
	movl	4(%rbx), %ecx
	cmpq	$0, 16(%rbx)
	je	LBB0_14
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	%eax, %r15d
	subl	%ecx, %r15d
	testl	%r15d, %r15d
	jle	LBB0_14
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movslq	%ecx, %rsi
	shlq	$2, %rsi
	addq	8(%rbx), %rsi
	movq	%r13, %rdi
	movl	%r15d, %edx
	callq	_BIO_write
	movl	%eax, %r14d
	testl	%eax, %eax
	jle	LBB0_22
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=2
	movl	4(%rbx), %ecx
	addl	%r14d, %ecx
	movl	%ecx, 4(%rbx)
	cmpq	$0, 16(%rbx)
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=2
	subl	%r14d, %r15d
	testl	%r15d, %r15d
	jg	LBB0_10
LBB0_13:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	(%rbx), %eax
LBB0_14:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	$0, 16(%rbx)
	cmpl	%ecx, %eax
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	_OK_BLOCK_BLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movl	$0, 4(%rbx)
LBB0_16:                                ##   in Loop: Header=BB0_8 Depth=1
	testq	%rsi, %rsi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_25
## %bb.17:                              ##   in Loop: Header=BB0_8 Depth=1
	leal	(%rax,%r12), %ecx
	movq	_OK_BLOCK_BLOCK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movq	_OK_BLOCK_SIZE@GOTPCREL(%rip), %rdi
	addl	(%rdi), %edx
	movl	%edx, %r14d
	subl	%eax, %r14d
	cmpl	%edx, %ecx
	cmovlel	%r12d, %r14d
	movslq	%eax, %rdi
	shlq	$2, %rdi
	addq	8(%rbx), %rdi
	movl	%r14d, %edx
	callq	_memcpy
	movl	(%rbx), %eax
	addl	%r14d, %eax
	movl	%eax, (%rbx)
	movq	_OK_BLOCK_BLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_OK_BLOCK_SIZE@GOTPCREL(%rip), %rdx
	addl	(%rdx), %ecx
	cmpl	%ecx, %eax
	jl	LBB0_7
## %bb.18:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%r15, %rdi
	callq	_block_out
	testl	%eax, %eax
	jne	LBB0_7
## %bb.19:
	movq	%r15, %rdi
	callq	_BIO_clear_retry_flags
LBB0_25:
	xorl	%r14d, %r14d
LBB0_26:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_BIO_copy_next_retry
	movq	%r15, %rdi
	callq	_BIO_should_retry
	testl	%eax, %eax
	jne	LBB0_26
## %bb.23:
	movq	$0, 24(%rbx)
	jmp	LBB0_26
LBB0_28:
	movq	%r15, %rdi
	callq	_BIO_clear_retry_flags
	movq	%r15, %rdi
	callq	_BIO_copy_next_retry
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_OK_BLOCK_BLOCK,4,2             ## @OK_BLOCK_BLOCK
	.comm	_OK_BLOCK_SIZE,4,2              ## @OK_BLOCK_SIZE
	.no_dead_strip	_ok_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ok_write
_ok_write:                              ; @ok_write
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	cmp	w2, #1
	b.lt	LBB0_22
; %bb.1:
	mov	x22, x1
	mov	x19, x0
	bl	_BIO_get_data
	mov	x21, x0
	mov	x0, x19
	bl	_BIO_next
	mov	w24, #0
	cbz	x21, LBB0_23
; %bb.2:
	mov	x23, x0
	cbz	x0, LBB0_23
; %bb.3:
	mov	x0, x19
	bl	_BIO_get_init
	cbz	x0, LBB0_18
; %bb.4:
	ldr	x8, [x21, #32]
	cbz	x8, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_sig_out
	cbz	w0, LBB0_18
LBB0_6:
Lloh0:
	adrp	x26, _OK_BLOCK_BLOCK@GOTPAGE
Lloh1:
	ldr	x26, [x26, _OK_BLOCK_BLOCK@GOTPAGEOFF]
Lloh2:
	adrp	x27, _OK_BLOCK_SIZE@GOTPAGE
Lloh3:
	ldr	x27, [x27, _OK_BLOCK_SIZE@GOTPAGEOFF]
	mov	x28, x20
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	sub	w28, w28, w24
	add	x22, x22, w24, sxtw
	cmp	w28, #0
	b.le	LBB0_21
LBB0_8:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	mov	x0, x19
	bl	_BIO_clear_retry_flags
	ldp	w8, w9, [x21]
	sub	w25, w8, w9
	ldr	x10, [x21, #16]
	cmp	x10, #0
	ccmp	w25, #1, #8, ne
	b.lt	LBB0_12
LBB0_9:                                 ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x21, #8]
	add	x1, x8, w9, sxtw #2
	mov	x0, x23
	mov	x2, x25
	bl	_BIO_write
	mov	x24, x0
	cmp	w0, #0
	b.le	LBB0_19
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	w8, [x21, #4]
	add	w9, w8, w24
	str	w9, [x21, #4]
	sub	w25, w25, w24
	ldr	x8, [x21, #16]
	cmp	x8, #0
	ccmp	w25, #0, #4, ne
	b.gt	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x21]
LBB0_12:                                ;   in Loop: Header=BB0_8 Depth=1
	str	xzr, [x21, #16]
	cmp	w8, w9
	b.ne	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x26]
	stp	w8, wzr, [x21]
LBB0_14:                                ;   in Loop: Header=BB0_8 Depth=1
	cbz	x22, LBB0_18
; %bb.15:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w9, [x27]
	ldr	w10, [x26]
	add	w9, w10, w9
	sub	w10, w9, w8
	add	w11, w8, w28
	cmp	w11, w9
	csel	w24, w10, w28, gt
	ldr	x9, [x21, #8]
	add	x0, x9, w8, sxtw #2
	mov	x1, x22
	mov	x2, x24
	bl	_memcpy
	ldr	w8, [x21]
	add	w8, w8, w24
	str	w8, [x21]
	ldr	w9, [x27]
	ldr	w10, [x26]
	add	w9, w10, w9
	cmp	w8, w9
	b.lt	LBB0_7
; %bb.16:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x19
	bl	_block_out
	cbnz	w0, LBB0_7
; %bb.17:
	mov	x0, x19
	bl	_BIO_clear_retry_flags
	mov	w24, #0
	b	LBB0_23
LBB0_18:
	mov	w24, #0
	b	LBB0_23
LBB0_19:
	mov	x0, x19
	bl	_BIO_copy_next_retry
	mov	x0, x19
	bl	_BIO_should_retry
	cbnz	w0, LBB0_23
; %bb.20:
	str	xzr, [x21, #24]
	b	LBB0_23
LBB0_21:
	mov	x0, x19
	bl	_BIO_clear_retry_flags
	mov	x0, x19
	bl	_BIO_copy_next_retry
LBB0_22:
	mov	x24, x20
LBB0_23:
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_OK_BLOCK_BLOCK,4,2             ; @OK_BLOCK_BLOCK
	.comm	_OK_BLOCK_SIZE,4,2              ; @OK_BLOCK_SIZE
	.no_dead_strip	_ok_write
.subsections_via_symbols
