	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ssl_write_encrypted_pms
_ssl_write_encrypted_pms:               ## @ssl_write_encrypted_pms
	.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
	movq	%rcx, %r12
	movq	_MBEDTLS_SSL_MINOR_VERSION_0@GOTPCREL(%rip), %rax
	movq	(%rdi), %rcx
	xorl	%r14d, %r14d
	cmpq	(%rax), %rcx
	setne	%r14b
	leaq	(%rsi,%r14,2), %r15
	movq	_MBEDTLS_SSL_MAX_CONTENT_LEN@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jbe	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_MBEDTLS_SSL_DEBUG_MSG
	movq	_MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_12
LBB0_2:
	movq	%rdi, %r13
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	24(%rdi), %rax
	addq	(%rax), %r12
	movq	16(%rdi), %rax
	movl	20(%rax), %edi
	movl	12(%rax), %edx
	movl	16(%rax), %esi
	movq	%r12, %rcx
	callq	_mbedtls_ssl_write_version
	movq	16(%r13), %rax
	movl	8(%rax), %edi
	leaq	2(%r12), %rsi
	movl	$46, %edx
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
LBB0_11:
	movl	$1, %edi
	movl	%ebx, %edx
	callq	_MBEDTLS_SSL_DEBUG_RET
LBB0_12:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	24(%r13), %rax
	movl	$48, 8(%rax)
	movq	32(%r13), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.6:
	movq	_MBEDTLS_PK_RSA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mbedtls_pk_can_do
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	addq	%r14, %r14
	movq	32(%r13), %rax
	movq	(%rax), %rdi
	movq	16(%r13), %rax
	movq	24(%r13), %rcx
	movl	8(%rcx), %edx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	addq	8(%r13), %rcx
	addq	%r14, %rcx
	movq	_MBEDTLS_SSL_MAX_CONTENT_LEN@GOTPCREL(%rip), %rsi
	movq	(%rsi), %r9
	subq	%r15, %r9
	movl	8(%rax), %ebx
	movq	%r12, %rsi
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	pushq	%rbx
	pushq	(%rax)
	callq	_mbedtls_pk_encrypt
	addq	$16, %rsp
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_11
LBB0_5:
	leaq	L_.str.2(%rip), %rsi
	movl	$2, %edi
	callq	_MBEDTLS_SSL_DEBUG_MSG
	movq	_MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_12
LBB0_7:
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
	callq	_MBEDTLS_SSL_DEBUG_MSG
	movq	_MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_12
LBB0_9:
	xorl	%ebx, %ebx
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_MBEDTLS_SSL_MINOR_VERSION_0,8,3 ## @MBEDTLS_SSL_MINOR_VERSION_0
	.comm	_MBEDTLS_SSL_MAX_CONTENT_LEN,8,3 ## @MBEDTLS_SSL_MAX_CONTENT_LEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"buffer too small for encrypted pms"

	.comm	_MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL,4,2 ## @MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL
L_.str.1:                               ## @.str.1
	.asciz	"f_rng"

L_.str.2:                               ## @.str.2
	.asciz	"certificate required"

	.comm	_MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE,4,2 ## @MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE
	.comm	_MBEDTLS_PK_RSA,4,2             ## @MBEDTLS_PK_RSA
L_.str.3:                               ## @.str.3
	.asciz	"certificate key type mismatch"

	.comm	_MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH,4,2 ## @MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH
L_.str.4:                               ## @.str.4
	.asciz	"mbedtls_rsa_pkcs1_encrypt"

	.no_dead_strip	_ssl_write_encrypted_pms
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ssl_write_encrypted_pms
_ssl_write_encrypted_pms:               ; @ssl_write_encrypted_pms
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _MBEDTLS_SSL_MINOR_VERSION_0@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MBEDTLS_SSL_MINOR_VERSION_0@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w8, ne
	lsl	x24, x8, #1
Lloh3:
	adrp	x25, _MBEDTLS_SSL_MAX_CONTENT_LEN@GOTPAGE
Lloh4:
	ldr	x25, [x25, _MBEDTLS_SSL_MAX_CONTENT_LEN@GOTPAGEOFF]
	ldr	x8, [x25]
	add	x26, x24, x1
	cmp	x26, x8
	b.ls	LBB0_2
; %bb.1:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_MBEDTLS_SSL_DEBUG_MSG
Lloh7:
	adrp	x8, _MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL@GOTPAGEOFF]
Lloh9:
	ldr	w23, [x8]
	b	LBB0_5
LBB0_2:
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldp	x9, x8, [x0, #16]
	ldr	x8, [x8]
	add	x22, x8, x3
	ldp	w1, w0, [x9, #16]
	ldr	w2, [x9, #12]
	mov	x3, x22
	bl	_mbedtls_ssl_write_version
	ldr	x8, [x21, #16]
	ldr	x9, [x8]
	ldr	w0, [x8, #8]
	add	x1, x22, #2
	mov	w2, #46
	blr	x9
	cbz	w0, LBB0_6
; %bb.3:
	mov	x23, x0
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_4:
	mov	w0, #1
	mov	x2, x23
	bl	_MBEDTLS_SSL_DEBUG_RET
LBB0_5:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	w8, #48
	ldp	x9, x10, [x21, #24]
	str	w8, [x9, #8]
	ldr	x0, [x10]
	cbz	x0, LBB0_10
; %bb.7:
Lloh12:
	adrp	x8, _MBEDTLS_PK_RSA@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MBEDTLS_PK_RSA@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_mbedtls_pk_can_do
	cbz	w0, LBB0_11
; %bb.8:
	ldp	x9, x8, [x21, #24]
	ldr	x0, [x8]
	ldr	w2, [x9, #8]
	ldp	x8, x9, [x21, #8]
	add	x8, x8, x20
	add	x3, x8, x24
	ldr	x8, [x25]
	sub	x5, x8, x26
	ldr	x6, [x9]
	ldr	w7, [x9, #8]
	mov	x1, x22
	mov	x4, x19
	bl	_mbedtls_pk_encrypt
	mov	x23, x0
	cbz	w0, LBB0_5
; %bb.9:
Lloh15:
	adrp	x1, l_.str.4@PAGE
Lloh16:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_4
LBB0_10:
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #2
	bl	_MBEDTLS_SSL_DEBUG_MSG
Lloh19:
	adrp	x8, _MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE@GOTPAGEOFF]
Lloh21:
	ldr	w23, [x8]
	b	LBB0_5
LBB0_11:
Lloh22:
	adrp	x1, l_.str.3@PAGE
Lloh23:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	bl	_MBEDTLS_SSL_DEBUG_MSG
Lloh24:
	adrp	x8, _MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH@GOTPAGEOFF]
Lloh26:
	ldr	w23, [x8]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_MBEDTLS_SSL_MINOR_VERSION_0,8,3 ; @MBEDTLS_SSL_MINOR_VERSION_0
	.comm	_MBEDTLS_SSL_MAX_CONTENT_LEN,8,3 ; @MBEDTLS_SSL_MAX_CONTENT_LEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"buffer too small for encrypted pms"

	.comm	_MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL,4,2 ; @MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL
l_.str.1:                               ; @.str.1
	.asciz	"f_rng"

l_.str.2:                               ; @.str.2
	.asciz	"certificate required"

	.comm	_MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE,4,2 ; @MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE
	.comm	_MBEDTLS_PK_RSA,4,2             ; @MBEDTLS_PK_RSA
l_.str.3:                               ; @.str.3
	.asciz	"certificate key type mismatch"

	.comm	_MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH,4,2 ; @MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH
l_.str.4:                               ; @.str.4
	.asciz	"mbedtls_rsa_pkcs1_encrypt"

	.no_dead_strip	_ssl_write_encrypted_pms
.subsections_via_symbols
