	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function test_key_update_in_write
_test_key_update_in_write:              ## @test_key_update_in_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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r15d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	$0, -112(%rbp)
	movq	$0, -104(%rbp)
	movq	$0, -96(%rbp)
	movq	$0, -88(%rbp)
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_bio_s_always_retry
	movl	%eax, %edi
	callq	_BIO_new
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_TEST_ptr
	testl	%eax, %eax
	je	LBB0_17
## %bb.1:
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_TLS_server_method
	movl	%eax, %r12d
	xorl	%eax, %eax
	callq	_TLS_client_method
	movq	_TLS1_3_VERSION@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_cert@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r10d
	movq	_privkey@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	leaq	-104(%rbp), %r8
	leaq	-112(%rbp), %r9
	movl	%r12d, %edi
	movl	%eax, %esi
	xorl	%ecx, %ecx
	pushq	%rbx
	pushq	%r10
	callq	_create_ssl_ctx_pair
	addq	$16, %rsp
	movl	%eax, %edi
	callq	_TEST_true
	testl	%eax, %eax
	je	LBB0_17
## %bb.2:
	movq	-104(%rbp), %rdi
	movq	-112(%rbp), %rsi
	xorl	%r13d, %r13d
	leaq	-88(%rbp), %rdx
	leaq	-96(%rbp), %rcx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_create_ssl_objects
	movl	%eax, %edi
	callq	_TEST_true
	testl	%eax, %eax
	je	LBB0_17
## %bb.3:
	movq	-88(%rbp), %rdi
	movq	-96(%rbp), %rsi
	movq	_SSL_ERROR_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_create_ssl_connection
	movl	%eax, %edi
	callq	_TEST_true
	testl	%eax, %eax
	je	LBB0_16
## %bb.4:
	testl	%r15d, %r15d
	movq	-96(%rbp), %r12
	movq	-88(%rbp), %rax
	movq	%rax, %r15
	cmoveq	%r12, %r15
	cmoveq	%rax, %r12
	movq	_SSL_KEY_UPDATE_REQUESTED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_SSL_key_update
	movl	%eax, %edi
	callq	_TEST_true
	testl	%eax, %eax
	je	LBB0_16
## %bb.5:
	movq	%r15, %rdi
	callq	_SSL_do_handshake
	movl	%eax, %edi
	callq	_TEST_true
	testl	%eax, %eax
	je	LBB0_16
## %bb.6:
	movq	%r12, %rdi
	callq	_SSL_get_wbio
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_TEST_ptr
	testl	%eax, %eax
	je	LBB0_16
## %bb.7:
	movq	%rbx, %rdi
	callq	_BIO_up_ref
	movl	%eax, %edi
	callq	_TEST_true
	testl	%eax, %eax
	je	LBB0_16
## %bb.8:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_SSL_set0_wbio
	leaq	L_.str(%rip), %r14
	movq	%r14, %rdi
	callq	_strlen
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_SSL_write
	movl	%eax, %edi
	movl	$-1, %esi
	callq	_TEST_int_eq
	xorl	%r13d, %r13d
	testl	%eax, %eax
	je	LBB0_20
## %bb.9:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_SSL_get_error
	movq	_SSL_ERROR_WANT_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_TEST_int_eq
	testl	%eax, %eax
	je	LBB0_20
## %bb.10:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_SSL_set0_wbio
	leaq	-80(%rbp), %rsi
	movq	%r12, %rdi
	movl	$20, %edx
	callq	_SSL_read
	movl	%eax, %edi
	movl	$-1, %esi
	callq	_TEST_int_eq
	testl	%eax, %eax
	je	LBB0_21
## %bb.11:
	xorl	%r13d, %r13d
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_SSL_get_error
	movq	_SSL_ERROR_WANT_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_TEST_int_eq
	testl	%eax, %eax
	je	LBB0_22
## %bb.12:
	leaq	L_.str(%rip), %r14
	movq	%r14, %rdi
	callq	_strlen
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_SSL_write
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_strlen
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_TEST_int_eq
	testl	%eax, %eax
	je	LBB0_21
## %bb.13:
	leaq	-80(%rbp), %rsi
	movq	%r15, %rdi
	movl	$20, %edx
	callq	_SSL_read
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	callq	_strlen
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_TEST_int_eq
	testl	%eax, %eax
	je	LBB0_21
## %bb.14:
	leaq	L_.str(%rip), %r14
	movq	%r14, %rdi
	callq	_strlen
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_SSL_write
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_strlen
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_TEST_int_eq
	testl	%eax, %eax
	je	LBB0_21
## %bb.15:
	leaq	-80(%rbp), %rsi
	movq	%r15, %rdi
	movl	$20, %edx
	callq	_SSL_read
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	callq	_strlen
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_TEST_int_eq
	xorl	%r13d, %r13d
	testl	%eax, %eax
	setne	%r13b
	jmp	LBB0_22
LBB0_16:
	xorl	%r13d, %r13d
LBB0_17:
	xorl	%ebx, %ebx
LBB0_18:
	movq	-88(%rbp), %rdi
	callq	_SSL_free
	movq	-96(%rbp), %rdi
	callq	_SSL_free
	movq	-104(%rbp), %rdi
	callq	_SSL_CTX_free
	movq	-112(%rbp), %rdi
	callq	_SSL_CTX_free
	movq	%r14, %rdi
	callq	_BIO_free
	movq	%rbx, %rdi
	callq	_BIO_free
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_24
## %bb.19:
	movl	%r13d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	xorl	%r14d, %r14d
	jmp	LBB0_18
LBB0_21:
	xorl	%r13d, %r13d
LBB0_22:
	xorl	%r14d, %r14d
	jmp	LBB0_17
LBB0_24:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"A test message"

	.comm	_TLS1_3_VERSION,4,2             ## @TLS1_3_VERSION
	.comm	_cert,4,2                       ## @cert
	.comm	_privkey,4,2                    ## @privkey
	.comm	_SSL_ERROR_NONE,4,2             ## @SSL_ERROR_NONE
	.comm	_SSL_KEY_UPDATE_REQUESTED,4,2   ## @SSL_KEY_UPDATE_REQUESTED
	.comm	_SSL_ERROR_WANT_WRITE,4,2       ## @SSL_ERROR_WANT_WRITE
	.comm	_SSL_ERROR_WANT_READ,4,2        ## @SSL_ERROR_WANT_READ
	.no_dead_strip	_test_key_update_in_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function test_key_update_in_write
_test_key_update_in_write:              ; @test_key_update_in_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	stp	xzr, xzr, [sp, #16]
	stp	xzr, xzr, [sp]
	bl	_bio_s_always_retry
	bl	_BIO_new
	mov	x19, x0
	bl	_TEST_ptr
	cbz	w0, LBB0_16
; %bb.1:
	bl	_TLS_server_method
	mov	x21, x0
	bl	_TLS_client_method
	mov	x1, x0
Lloh3:
	adrp	x8, _TLS1_3_VERSION@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TLS1_3_VERSION@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _cert@GOTPAGE
Lloh7:
	ldr	x8, [x8, _cert@GOTPAGEOFF]
Lloh8:
	ldr	w6, [x8]
Lloh9:
	adrp	x8, _privkey@GOTPAGE
Lloh10:
	ldr	x8, [x8, _privkey@GOTPAGEOFF]
Lloh11:
	ldr	w7, [x8]
	add	x4, sp, #16
	add	x5, sp, #24
	mov	x0, x21
	mov	w3, #0
	bl	_create_ssl_ctx_pair
	bl	_TEST_true
	cbz	w0, LBB0_16
; %bb.2:
	ldp	x0, x1, [sp, #16]
	mov	x2, sp
	add	x3, sp, #8
	mov	x4, #0
	mov	x5, #0
	bl	_create_ssl_objects
	bl	_TEST_true
	cbz	w0, LBB0_16
; %bb.3:
	ldp	x0, x1, [sp]
Lloh12:
	adrp	x8, _SSL_ERROR_NONE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SSL_ERROR_NONE@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	bl	_create_ssl_connection
	bl	_TEST_true
	cbz	w0, LBB0_16
; %bb.4:
	ldp	x9, x8, [sp]
	cmp	w20, #0
	csel	x20, x8, x9, eq
	csel	x21, x9, x8, eq
Lloh15:
	adrp	x8, _SSL_KEY_UPDATE_REQUESTED@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SSL_KEY_UPDATE_REQUESTED@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_SSL_key_update
	bl	_TEST_true
	cbz	w0, LBB0_16
; %bb.5:
	mov	x0, x20
	bl	_SSL_do_handshake
	bl	_TEST_true
	cbz	w0, LBB0_16
; %bb.6:
	mov	x0, x21
	bl	_SSL_get_wbio
	mov	x22, x0
	bl	_TEST_ptr
	cbz	w0, LBB0_16
; %bb.7:
	mov	x0, x22
	bl	_BIO_up_ref
	bl	_TEST_true
	cbz	w0, LBB0_16
; %bb.8:
	mov	x0, x21
	mov	x1, x19
	bl	_SSL_set0_wbio
Lloh18:
	adrp	x19, l_.str@PAGE
Lloh19:
	add	x19, x19, l_.str@PAGEOFF
	mov	x0, x19
	bl	_strlen
	mov	x2, x0
	mov	x0, x21
	mov	x1, x19
	bl	_SSL_write
	mov	w1, #-1
	bl	_TEST_int_eq
	cbz	w0, LBB0_20
; %bb.9:
	mov	x0, x21
	mov	w1, #0
	bl	_SSL_get_error
Lloh20:
	adrp	x8, _SSL_ERROR_WANT_WRITE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SSL_ERROR_WANT_WRITE@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	bl	_TEST_int_eq
	cbz	w0, LBB0_20
; %bb.10:
	mov	x0, x21
	mov	x1, x22
	bl	_SSL_set0_wbio
	add	x1, sp, #36
	mov	x0, x21
	mov	w2, #20
	bl	_SSL_read
	mov	w1, #-1
	bl	_TEST_int_eq
	cbz	w0, LBB0_21
; %bb.11:
	mov	x0, x21
	mov	w1, #0
	bl	_SSL_get_error
Lloh23:
	adrp	x8, _SSL_ERROR_WANT_READ@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SSL_ERROR_WANT_READ@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	bl	_TEST_int_eq
	cbz	w0, LBB0_21
; %bb.12:
Lloh26:
	adrp	x19, l_.str@PAGE
Lloh27:
	add	x19, x19, l_.str@PAGEOFF
	mov	x0, x19
	bl	_strlen
	mov	x2, x0
	mov	x0, x21
	mov	x1, x19
	bl	_SSL_write
	mov	x22, x0
	mov	x0, x19
	bl	_strlen
	mov	x1, x0
	mov	x0, x22
	bl	_TEST_int_eq
	cbz	w0, LBB0_21
; %bb.13:
	add	x1, sp, #36
	mov	x0, x20
	mov	w2, #20
	bl	_SSL_read
	mov	x19, x0
Lloh28:
	adrp	x0, l_.str@PAGE
Lloh29:
	add	x0, x0, l_.str@PAGEOFF
	bl	_strlen
	mov	x1, x0
	mov	x0, x19
	bl	_TEST_int_eq
	cbz	w0, LBB0_21
; %bb.14:
Lloh30:
	adrp	x19, l_.str@PAGE
Lloh31:
	add	x19, x19, l_.str@PAGEOFF
	mov	x0, x19
	bl	_strlen
	mov	x2, x0
	mov	x0, x21
	mov	x1, x19
	bl	_SSL_write
	mov	x21, x0
	mov	x0, x19
	bl	_strlen
	mov	x1, x0
	mov	x0, x21
	bl	_TEST_int_eq
	cbz	w0, LBB0_21
; %bb.15:
	add	x1, sp, #36
	mov	x0, x20
	mov	w2, #20
	bl	_SSL_read
	mov	x19, x0
Lloh32:
	adrp	x0, l_.str@PAGE
Lloh33:
	add	x0, x0, l_.str@PAGEOFF
	bl	_strlen
	mov	x1, x0
	mov	x0, x19
	bl	_TEST_int_eq
	mov	x19, #0
	mov	x22, #0
	cmp	w0, #0
	cset	w20, ne
	b	LBB0_18
LBB0_16:
	mov	w20, #0
LBB0_17:
	mov	x22, #0
LBB0_18:
	ldr	x0, [sp]
	bl	_SSL_free
	ldr	x0, [sp, #8]
	bl	_SSL_free
	ldr	x0, [sp, #16]
	bl	_SSL_CTX_free
	ldr	x0, [sp, #24]
	bl	_SSL_CTX_free
	mov	x0, x19
	bl	_BIO_free
	mov	x0, x22
	bl	_BIO_free
	ldur	x8, [x29, #-40]
Lloh34:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh35:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.19:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_20:
	mov	w20, #0
	mov	x19, #0
	b	LBB0_18
LBB0_21:
	mov	w20, #0
	mov	x19, #0
	b	LBB0_17
LBB0_22:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"A test message"

	.comm	_TLS1_3_VERSION,4,2             ; @TLS1_3_VERSION
	.comm	_cert,4,2                       ; @cert
	.comm	_privkey,4,2                    ; @privkey
	.comm	_SSL_ERROR_NONE,4,2             ; @SSL_ERROR_NONE
	.comm	_SSL_KEY_UPDATE_REQUESTED,4,2   ; @SSL_KEY_UPDATE_REQUESTED
	.comm	_SSL_ERROR_WANT_WRITE,4,2       ; @SSL_ERROR_WANT_WRITE
	.comm	_SSL_ERROR_WANT_READ,4,2        ; @SSL_ERROR_WANT_READ
	.no_dead_strip	_test_key_update_in_write
.subsections_via_symbols
