	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_ssl_prepare_handshake_record ## -- Begin function mbedtls_ssl_prepare_handshake_record
	.p2align	4, 0x90
_mbedtls_ssl_prepare_handshake_record:  ## @mbedtls_ssl_prepare_handshake_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	(%rdi), %r14
	callq	_mbedtls_ssl_hs_hdr_len
	cmpq	%rax, %r14
	jge	LBB0_2
## %bb.1:
	movq	(%rbx), %rsi
	movq	_MBEDTLS_ERR_SSL_INVALID_RECORD@GOTPCREL(%rip), %rbx
	jmp	LBB0_4
LBB0_2:
	movq	%rbx, %rdi
	callq	_mbedtls_ssl_hs_hdr_len
	movq	16(%rbx), %rcx
	movl	4(%rcx), %edx
	movl	8(%rcx), %esi
	shll	$16, %edx
	shll	$8, %esi
	orl	%edx, %esi
	orl	12(%rcx), %esi
	movslq	%esi, %rsi
	addq	%rax, %rsi
	movq	%rsi, 8(%rbx)
	movl	$3, %edi
	callq	_MBEDTLS_SSL_DEBUG_MSG
	movq	(%rbx), %rcx
	xorl	%eax, %eax
	cmpq	8(%rbx), %rcx
	jge	LBB0_5
## %bb.3:
	movq	_MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE@GOTPCREL(%rip), %rbx
	leaq	L_.str.2(%rip), %rsi
LBB0_4:
	movl	$1, %edi
	callq	_MBEDTLS_SSL_DEBUG_MSG
	movl	(%rbx), %eax
LBB0_5:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MBEDTLS_ERR_SSL_INVALID_RECORD,4,2 ## @MBEDTLS_ERR_SSL_INVALID_RECORD
	.section	__TEXT,__cstring,cstring_literals
L_.str.2:                               ## @.str.2
	.asciz	"TLS handshake fragmentation not supported"

	.comm	_MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE,4,2 ## @MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE
	.comm	_MBEDTLS_ERR_SSL_WANT_READ,4,2  ## @MBEDTLS_ERR_SSL_WANT_READ
	.comm	_MBEDTLS_SSL_HS_HELLO_VERIFY_REQUEST,4,2 ## @MBEDTLS_SSL_HS_HELLO_VERIFY_REQUEST
	.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
	.globl	_mbedtls_ssl_prepare_handshake_record ; -- Begin function mbedtls_ssl_prepare_handshake_record
	.p2align	2
_mbedtls_ssl_prepare_handshake_record:  ; @mbedtls_ssl_prepare_handshake_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]
	bl	_mbedtls_ssl_hs_hdr_len
	cmp	x20, x0
	b.ge	LBB0_2
; %bb.1:
	ldr	x1, [x19]
Lloh0:
	adrp	x19, _MBEDTLS_ERR_SSL_INVALID_RECORD@GOTPAGE
Lloh1:
	ldr	x19, [x19, _MBEDTLS_ERR_SSL_INVALID_RECORD@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
	mov	x0, x19
	bl	_mbedtls_ssl_hs_hdr_len
	ldr	x8, [x19, #16]
	ldp	w9, w10, [x8, #4]
	lsl	w10, w10, #8
	orr	w9, w10, w9, lsl #16
	ldr	w8, [x8, #12]
	orr	w8, w9, w8
	add	x1, x0, w8, sxtw
	str	x1, [x19, #8]
	mov	w0, #3
	bl	_MBEDTLS_SSL_DEBUG_MSG
	ldp	x8, x9, [x19]
	cmp	x8, x9
	b.ge	LBB0_5
; %bb.3:
Lloh2:
	adrp	x19, _MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE@GOTPAGE
Lloh3:
	ldr	x19, [x19, _MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE@GOTPAGEOFF]
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_4:
	mov	w0, #1
	bl	_MBEDTLS_SSL_DEBUG_MSG
	ldr	w0, [x19]
	b	LBB0_6
LBB0_5:
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_MBEDTLS_ERR_SSL_INVALID_RECORD,4,2 ; @MBEDTLS_ERR_SSL_INVALID_RECORD
	.section	__TEXT,__cstring,cstring_literals
l_.str.2:                               ; @.str.2
	.asciz	"TLS handshake fragmentation not supported"

	.comm	_MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE,4,2 ; @MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE
	.comm	_MBEDTLS_ERR_SSL_WANT_READ,4,2  ; @MBEDTLS_ERR_SSL_WANT_READ
	.comm	_MBEDTLS_SSL_HS_HELLO_VERIFY_REQUEST,4,2 ; @MBEDTLS_SSL_HS_HELLO_VERIFY_REQUEST
	.comm	_MBEDTLS_SSL_TRANSPORT_DATAGRAM,8,3 ; @MBEDTLS_SSL_TRANSPORT_DATAGRAM
.subsections_via_symbols
