	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_ssl_write_record       ## -- Begin function mbedtls_ssl_write_record
	.p2align	4, 0x90
_mbedtls_ssl_write_record:              ## @mbedtls_ssl_write_record
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %r14
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
	callq	_MBEDTLS_SSL_DEBUG_MSG
	movq	8(%rbx), %rax
	movq	_MBEDTLS_SSL_MSG_HANDSHAKE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movq	16(%rbx), %rsi
	movl	(%rsi), %r8d
	movq	_MBEDTLS_SSL_HS_HELLO_REQUEST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	cmpl	%edx, %r8d
	je	LBB0_5
## %bb.3:
	cmpq	$0, 80(%rbx)
	je	LBB0_4
LBB0_5:
	movq	%r14, %r15
	leal	-4(%r14), %ecx
	movzbl	%ch, %edi
	movl	%edi, %r9d
	movzbl	%cl, %edi
	shrl	$16, %ecx
	movzbl	%cl, %ecx
	movl	%ecx, 4(%rsi)
	movl	%r9d, 8(%rsi)
	movl	%edi, 12(%rsi)
	cmpl	%edx, %r8d
	je	LBB0_7
## %bb.6:
	movq	80(%rbx), %rax
	movq	%rbx, %rdi
	movq	%r15, %rdx
	callq	*16(%rax)
	movq	8(%rbx), %rax
	jmp	LBB0_7
LBB0_1:
	movq	%r14, %r15
LBB0_7:
	movq	24(%rbx), %rcx
	movb	%al, (%rcx)
	movl	68(%rbx), %edi
	movl	64(%rbx), %esi
	movq	24(%rbx), %rcx
	movq	56(%rbx), %rax
	movq	(%rax), %rdx
	incq	%rcx
	callq	_mbedtls_ssl_write_version
	movq	32(%rbx), %rax
	movq	%r15, %rcx
	movb	%ch, (%rax)
	movq	32(%rbx), %rax
	movb	%cl, 1(%rax)
	cmpq	$0, 48(%rbx)
	je	LBB0_12
## %bb.8:
	movq	%rbx, %rdi
	callq	_ssl_encrypt_buf
	testl	%eax, %eax
	je	LBB0_11
## %bb.9:
	movl	%eax, %r14d
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_10
LBB0_11:
	movq	(%rbx), %rax
	movq	32(%rbx), %rcx
	movb	%ah, (%rcx)
	movq	32(%rbx), %rcx
	movb	%al, 1(%rcx)
LBB0_12:
	movq	%rbx, %rdi
	callq	_mbedtls_ssl_hdr_len
	addq	(%rbx), %rax
	movq	%rax, 40(%rbx)
	movq	32(%rbx), %rax
	movzwl	(%rax), %eax
	rolw	$8, %ax
	movzwl	%ax, %esi
	movl	$3, %edi
	callq	_MBEDTLS_SSL_DEBUG_MSG
	movq	24(%rbx), %r14
	movq	%rbx, %rdi
	callq	_mbedtls_ssl_hdr_len
	addq	(%rbx), %rax
	leaq	L_.str.4(%rip), %rsi
	movl	$4, %edi
	movq	%r14, %rdx
	movq	%rax, %rcx
	callq	_MBEDTLS_SSL_DEBUG_BUF
	movq	%rbx, %rdi
	callq	_mbedtls_ssl_flush_output
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %r14d
	leaq	L_.str.5(%rip), %rsi
LBB0_10:
	movl	$1, %edi
	movl	%r14d, %edx
	callq	_MBEDTLS_SSL_DEBUG_RET
	jmp	LBB0_15
LBB0_14:
	leaq	L_.str.6(%rip), %rsi
	movl	$2, %edi
	callq	_MBEDTLS_SSL_DEBUG_MSG
	xorl	%r14d, %r14d
	jmp	LBB0_15
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_MBEDTLS_SSL_DEBUG_MSG
	movq	_MBEDTLS_ERR_SSL_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_15:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"=> write record"

	.comm	_MBEDTLS_SSL_MSG_HANDSHAKE,8,3  ## @MBEDTLS_SSL_MSG_HANDSHAKE
	.comm	_MBEDTLS_SSL_HS_HELLO_REQUEST,4,2 ## @MBEDTLS_SSL_HS_HELLO_REQUEST
L_.str.1:                               ## @.str.1
	.asciz	"should never happen"

	.comm	_MBEDTLS_ERR_SSL_INTERNAL_ERROR,4,2 ## @MBEDTLS_ERR_SSL_INTERNAL_ERROR
L_.str.2:                               ## @.str.2
	.asciz	"ssl_encrypt_buf"

L_.str.4:                               ## @.str.4
	.asciz	"output record sent to network"

L_.str.5:                               ## @.str.5
	.asciz	"mbedtls_ssl_flush_output"

L_.str.6:                               ## @.str.6
	.asciz	"<= write record"

	.comm	_MBEDTLS_ERR_SSL_HW_ACCEL_FAILED,4,2 ## @MBEDTLS_ERR_SSL_HW_ACCEL_FAILED
	.comm	_MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH,4,2 ## @MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH
	.comm	_MBEDTLS_SSL_COMPRESS_DEFLATE,8,3 ## @MBEDTLS_SSL_COMPRESS_DEFLATE
	.comm	_MBEDTLS_SSL_MSG_CHANGE_CIPHER_SPEC,8,3 ## @MBEDTLS_SSL_MSG_CHANGE_CIPHER_SPEC
	.comm	_MBEDTLS_SSL_RETRANS_SENDING,8,3 ## @MBEDTLS_SSL_RETRANS_SENDING
	.comm	_MBEDTLS_SSL_TRANSPORT_DATAGRAM,8,3 ## @MBEDTLS_SSL_TRANSPORT_DATAGRAM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function mbedtls_ssl_write_record
lCPI0_0:
	.long	4294967280                      ; 0xfffffff0
	.long	4294967288                      ; 0xfffffff8
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_mbedtls_ssl_write_record
	.p2align	2
_mbedtls_ssl_write_record:              ; @mbedtls_ssl_write_record
	.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
	mov	x19, x0
	ldr	x20, [x0]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #2
	bl	_MBEDTLS_SSL_DEBUG_MSG
	ldr	x8, [x19, #8]
Lloh2:
	adrp	x9, _MBEDTLS_SSL_MSG_HANDSHAKE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MBEDTLS_SSL_MSG_HANDSHAKE@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.1:
	ldr	x1, [x19, #16]
	ldr	w9, [x1]
Lloh5:
	adrp	x10, _MBEDTLS_SSL_HS_HELLO_REQUEST@GOTPAGE
Lloh6:
	ldr	x10, [x10, _MBEDTLS_SSL_HS_HELLO_REQUEST@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	cmp	w9, w10
	b.eq	LBB0_3
; %bb.2:
	ldr	x11, [x19, #80]
	cbz	x11, LBB0_13
LBB0_3:
	sub	w11, w20, #4
	dup.2s	v0, w11
Lloh8:
	adrp	x12, lCPI0_0@PAGE
Lloh9:
	ldr	d1, [x12, lCPI0_0@PAGEOFF]
	ushl.2s	v0, v0, v1
	movi	d1, #0x0000ff000000ff
	and.8b	v0, v0, v1
	stur	d0, [x1, #4]
	and	w11, w11, #0xff
	str	w11, [x1, #12]
	cmp	w9, w10
	b.eq	LBB0_5
; %bb.4:
	ldr	x8, [x19, #80]
	ldr	x8, [x8, #16]
	mov	x0, x19
	mov	x2, x20
	blr	x8
	ldr	x8, [x19, #8]
LBB0_5:
	ldr	x9, [x19, #24]
	strb	w8, [x9]
	ldp	w1, w0, [x19, #64]
	ldr	x8, [x19, #56]
	ldr	x2, [x8]
	ldr	x8, [x19, #24]
	add	x3, x8, #1
	bl	_mbedtls_ssl_write_version
	lsr	x8, x20, #8
	ldr	x9, [x19, #32]
	strb	w8, [x9]
	ldr	x8, [x19, #32]
	strb	w20, [x8, #1]
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_9
; %bb.6:
	mov	x0, x19
	bl	_ssl_encrypt_buf
	cbz	w0, LBB0_8
; %bb.7:
	mov	x20, x0
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_8:
	ldr	x8, [x19]
	lsr	x9, x8, #8
	ldr	x10, [x19, #32]
	strb	w9, [x10]
	ldr	x9, [x19, #32]
	strb	w8, [x9, #1]
LBB0_9:
	mov	x0, x19
	bl	_mbedtls_ssl_hdr_len
	ldr	x8, [x19]
	add	x8, x8, x0
	str	x8, [x19, #40]
	ldr	x8, [x19, #32]
	ldrh	w8, [x8]
	rev16	w1, w8
	mov	w0, #3
	bl	_MBEDTLS_SSL_DEBUG_MSG
	ldr	x20, [x19, #24]
	mov	x0, x19
	bl	_mbedtls_ssl_hdr_len
	ldr	x8, [x19]
	add	x3, x8, x0
Lloh12:
	adrp	x1, l_.str.4@PAGE
Lloh13:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #4
	mov	x2, x20
	bl	_MBEDTLS_SSL_DEBUG_BUF
	mov	x0, x19
	bl	_mbedtls_ssl_flush_output
	mov	x20, x0
	cbz	w0, LBB0_12
; %bb.10:
Lloh14:
	adrp	x1, l_.str.5@PAGE
Lloh15:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_11:
	mov	w0, #1
	mov	x2, x20
	bl	_MBEDTLS_SSL_DEBUG_RET
	b	LBB0_14
LBB0_12:
Lloh16:
	adrp	x1, l_.str.6@PAGE
Lloh17:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #2
	bl	_MBEDTLS_SSL_DEBUG_MSG
	b	LBB0_14
LBB0_13:
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_MBEDTLS_SSL_DEBUG_MSG
Lloh20:
	adrp	x8, _MBEDTLS_ERR_SSL_INTERNAL_ERROR@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MBEDTLS_ERR_SSL_INTERNAL_ERROR@GOTPAGEOFF]
Lloh22:
	ldr	w20, [x8]
LBB0_14:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdr	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"=> write record"

	.comm	_MBEDTLS_SSL_MSG_HANDSHAKE,8,3  ; @MBEDTLS_SSL_MSG_HANDSHAKE
	.comm	_MBEDTLS_SSL_HS_HELLO_REQUEST,4,2 ; @MBEDTLS_SSL_HS_HELLO_REQUEST
l_.str.1:                               ; @.str.1
	.asciz	"should never happen"

	.comm	_MBEDTLS_ERR_SSL_INTERNAL_ERROR,4,2 ; @MBEDTLS_ERR_SSL_INTERNAL_ERROR
l_.str.2:                               ; @.str.2
	.asciz	"ssl_encrypt_buf"

l_.str.4:                               ; @.str.4
	.asciz	"output record sent to network"

l_.str.5:                               ; @.str.5
	.asciz	"mbedtls_ssl_flush_output"

l_.str.6:                               ; @.str.6
	.asciz	"<= write record"

	.comm	_MBEDTLS_ERR_SSL_HW_ACCEL_FAILED,4,2 ; @MBEDTLS_ERR_SSL_HW_ACCEL_FAILED
	.comm	_MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH,4,2 ; @MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH
	.comm	_MBEDTLS_SSL_COMPRESS_DEFLATE,8,3 ; @MBEDTLS_SSL_COMPRESS_DEFLATE
	.comm	_MBEDTLS_SSL_MSG_CHANGE_CIPHER_SPEC,8,3 ; @MBEDTLS_SSL_MSG_CHANGE_CIPHER_SPEC
	.comm	_MBEDTLS_SSL_RETRANS_SENDING,8,3 ; @MBEDTLS_SSL_RETRANS_SENDING
	.comm	_MBEDTLS_SSL_TRANSPORT_DATAGRAM,8,3 ; @MBEDTLS_SSL_TRANSPORT_DATAGRAM
.subsections_via_symbols
