	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ssl3_setup_write_buffer        ## -- Begin function ssl3_setup_write_buffer
	.p2align	4, 0x90
_ssl3_setup_write_buffer:               ## @ssl3_setup_write_buffer
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %r15
	movq	%rdi, %r12
	leaq	8(%rdi), %rbx
	movq	%rsi, 8(%rdi)
	testq	%rdx, %rdx
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	jne	LBB0_9
## %bb.1:
	movq	%r12, %rdi
	callq	_SSL_IS_DTLS
	testq	%rax, %rax
	jne	LBB0_2
## %bb.3:
	movq	_SSL3_RT_HEADER_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_4
LBB0_2:
	movq	_DTLS1_RT_HEADER_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	incl	%eax
LBB0_4:
	movslq	%eax, %r14
	movq	%r12, %rdi
	callq	_ssl_get_max_send_fragment
	movq	%rax, %r13
	movq	_SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD@GOTPCREL(%rip), %rax
	addq	(%rax), %r13
	addq	%r14, %r13
	movq	%r12, %rdi
	callq	_ssl_allow_compression
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_SSL3_RT_MAX_COMPRESSED_OVERHEAD@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_6:
	addq	%rax, %r13
	movq	_SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	jne	LBB0_8
## %bb.7:
	addq	%r14, %r13
	movq	_SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD@GOTPCREL(%rip), %rax
	addq	(%rax), %r13
LBB0_8:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
LBB0_9:
	movq	%rbx, %rdi
	callq	_RECORD_LAYER_get_wbuf
	movq	%rax, %rbx
	movl	$1, %eax
	testq	%r15, %r15
	je	LBB0_22
## %bb.10:
	xorl	%r14d, %r14d
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	%r13, %rdi
	callq	_OPENSSL_malloc
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_21
LBB0_17:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	%r12, 8(%rbx)
	movq	%r13, (%rbx)
	movq	-48(%rbp), %r12                 ## 8-byte Reload
LBB0_18:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%r14
	addq	$16, %rbx
	cmpq	%r14, %r15
	je	LBB0_19
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rdi
	cmpq	%r13, (%rbx)
	jne	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	testq	%rdi, %rdi
	jne	LBB0_18
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_11 Depth=1
	callq	_OPENSSL_free
	movq	$0, 8(%rbx)
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	16(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_20
## %bb.15:                              ##   in Loop: Header=BB0_11 Depth=1
	callq	_BIO_get_ktls_send
	testl	%eax, %eax
	je	LBB0_20
## %bb.16:                              ##   in Loop: Header=BB0_11 Depth=1
	xorl	%r12d, %r12d
	jmp	LBB0_17
LBB0_19:
	movl	$1, %eax
	jmp	LBB0_22
LBB0_21:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, 8(%rdi)
	movq	_SSL_AD_NO_ALERT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SSL_F_SSL3_SETUP_WRITE_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ERR_R_MALLOC_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_SSLfatal
	xorl	%eax, %eax
LBB0_22:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DTLS1_RT_HEADER_LENGTH,4,2     ## @DTLS1_RT_HEADER_LENGTH
	.comm	_SSL3_RT_HEADER_LENGTH,4,2      ## @SSL3_RT_HEADER_LENGTH
	.comm	_SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD,8,3 ## @SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD
	.comm	_SSL3_RT_MAX_COMPRESSED_OVERHEAD,8,3 ## @SSL3_RT_MAX_COMPRESSED_OVERHEAD
	.comm	_SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS,4,2 ## @SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
	.comm	_SSL_AD_NO_ALERT,4,2            ## @SSL_AD_NO_ALERT
	.comm	_SSL_F_SSL3_SETUP_WRITE_BUFFER,4,2 ## @SSL_F_SSL3_SETUP_WRITE_BUFFER
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ## @ERR_R_MALLOC_FAILURE
	.comm	_SSL3_ALIGN_PAYLOAD,4,2         ## @SSL3_ALIGN_PAYLOAD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ssl3_setup_write_buffer        ; -- Begin function ssl3_setup_write_buffer
	.p2align	2
_ssl3_setup_write_buffer:               ; @ssl3_setup_write_buffer
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	mov	x22, x0
	str	x1, [x22, #8]!
	cbnz	x2, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_SSL_IS_DTLS
Lloh0:
	adrp	x8, _DTLS1_RT_HEADER_LENGTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DTLS1_RT_HEADER_LENGTH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _SSL3_RT_HEADER_LENGTH@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SSL3_RT_HEADER_LENGTH@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	x0, #0
	csinc	w8, w9, w8, eq
	sxtw	x23, w8
	mov	x0, x19
	bl	_ssl_get_max_send_fragment
Lloh6:
	adrp	x24, _SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD@GOTPAGE
Lloh7:
	ldr	x24, [x24, _SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD@GOTPAGEOFF]
	ldr	x8, [x24]
	add	x8, x8, x0
	add	x21, x8, x23
	mov	x0, x19
	bl	_ssl_allow_compression
Lloh8:
	adrp	x8, _SSL3_RT_MAX_COMPRESSED_OVERHEAD@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SSL3_RT_MAX_COMPRESSED_OVERHEAD@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x0, #0
	csel	x8, xzr, x8, eq
	add	x21, x21, x8
	ldr	w8, [x19]
Lloh11:
	adrp	x9, _SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS@GOTPAGE
Lloh12:
	ldr	x9, [x9, _SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_3
; %bb.2:
	ldr	x8, [x24]
	add	x9, x21, x23
	add	x21, x9, x8
LBB0_3:
	mov	x0, x22
	bl	_RECORD_LAYER_get_wbuf
	cbz	x20, LBB0_14
; %bb.4:
	mov	x22, x0
	mov	x24, #0
	b	LBB0_8
LBB0_5:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x21
	bl	_OPENSSL_malloc
	mov	x23, x0
	cbz	x0, LBB0_16
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x22
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	stp	x21, x23, [x22]
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x24, x24, #1
	add	x22, x22, #16
	cmp	x20, x24
	b.eq	LBB0_14
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x8, x0, [x22]
	cmp	x8, x21
	b.ne	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	cbnz	x0, LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x0, [x19, #16]
	cbnz	x0, LBB0_12
	b	LBB0_5
LBB0_11:                                ;   in Loop: Header=BB0_8 Depth=1
	bl	_OPENSSL_free
	str	xzr, [x22, #8]
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_5
LBB0_12:                                ;   in Loop: Header=BB0_8 Depth=1
	bl	_BIO_get_ktls_send
	cbz	w0, LBB0_5
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x23, #0
	b	LBB0_6
LBB0_14:
	mov	w0, #1
LBB0_15:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_16:
	str	x24, [x19, #8]
Lloh14:
	adrp	x8, _SSL_AD_NO_ALERT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SSL_AD_NO_ALERT@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x8, _SSL_F_SSL3_SETUP_WRITE_BUFFER@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SSL_F_SSL3_SETUP_WRITE_BUFFER@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
Lloh20:
	adrp	x8, _ERR_R_MALLOC_FAILURE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ERR_R_MALLOC_FAILURE@GOTPAGEOFF]
Lloh22:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_SSLfatal
	mov	w0, #0
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_DTLS1_RT_HEADER_LENGTH,4,2     ; @DTLS1_RT_HEADER_LENGTH
	.comm	_SSL3_RT_HEADER_LENGTH,4,2      ; @SSL3_RT_HEADER_LENGTH
	.comm	_SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD,8,3 ; @SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD
	.comm	_SSL3_RT_MAX_COMPRESSED_OVERHEAD,8,3 ; @SSL3_RT_MAX_COMPRESSED_OVERHEAD
	.comm	_SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS,4,2 ; @SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
	.comm	_SSL_AD_NO_ALERT,4,2            ; @SSL_AD_NO_ALERT
	.comm	_SSL_F_SSL3_SETUP_WRITE_BUFFER,4,2 ; @SSL_F_SSL3_SETUP_WRITE_BUFFER
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ; @ERR_R_MALLOC_FAILURE
	.comm	_SSL3_ALIGN_PAYLOAD,4,2         ; @SSL3_ALIGN_PAYLOAD
.subsections_via_symbols
