	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tls_construct_cke_rsa
_tls_construct_cke_rsa:                 ## @tls_construct_cke_rsa
	.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	%rdi, %r14
	movq	$0, -64(%rbp)
	movq	32(%rdi), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.3:
	movq	%rsi, %r12
	callq	_X509_get0_pubkey
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_EVP_PKEY_get0_RSA
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	movq	_SSL_MAX_MASTER_KEY_LENGTH@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%rbx, %rdi
	callq	_OPENSSL_malloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r15
	movb	1(%r14), %al
	movb	%al, (%r15)
	movb	(%r14), %al
	movb	%al, 1(%r15)
	movq	%r15, %rdi
	addq	$2, %rdi
	leal	-2(%rbx), %esi
	callq	_RAND_bytes
	testq	%rax, %rax
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	jle	LBB0_7
## %bb.9:
	movq	8(%r14), %rax
	movq	_SSL3_VERSION@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jle	LBB0_12
## %bb.10:
	movq	%r12, %rdi
	callq	_WPACKET_start_sub_packet_u16
	testl	%eax, %eax
	je	LBB0_11
LBB0_12:
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_EVP_PKEY_CTX_new
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_15
## %bb.13:
	movq	%r13, %rdi
	callq	_EVP_PKEY_encrypt_init
	testq	%rax, %rax
	jle	LBB0_15
## %bb.14:
	leaq	-56(%rbp), %rdx
	movq	%r13, %rdi
	xorl	%esi, %esi
	movq	%r15, %rcx
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	callq	_EVP_PKEY_encrypt
	testq	%rax, %rax
	jle	LBB0_15
## %bb.17:
	movq	-56(%rbp), %rsi
	leaq	-64(%rbp), %rdx
	movq	%r12, %rdi
	callq	_WPACKET_allocate_bytes
	testl	%eax, %eax
	je	LBB0_19
## %bb.18:
	movq	-64(%rbp), %rsi
	leaq	-56(%rbp), %rdx
	movq	%r13, %rdi
	movq	%r15, %rcx
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	callq	_EVP_PKEY_encrypt
	testq	%rax, %rax
	jle	LBB0_19
## %bb.20:
	movq	%r13, %rdi
	callq	_EVP_PKEY_CTX_free
	movq	8(%r14), %rax
	cmpq	(%rbx), %rax
	jle	LBB0_22
## %bb.21:
	movq	%r12, %rdi
	callq	_WPACKET_close
	testl	%eax, %eax
	je	LBB0_11
LBB0_22:
	movq	-64(%rbp), %rsi
	movq	-56(%rbp), %rdx
	movq	%r14, %rdi
	movq	%r15, %rcx
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %r8
	callq	_ssl_log_rsa_client_key_exchange
	testl	%eax, %eax
	je	LBB0_23
## %bb.27:
	movq	%r15, 16(%r14)
	movq	%rbx, 24(%r14)
	movl	$1, %eax
	jmp	LBB0_26
LBB0_1:
	movq	_SSL_AD_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ERR_R_INTERNAL_ERROR@GOTPCREL(%rip), %rax
LBB0_2:
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_SSLfatal
	jmp	LBB0_25
LBB0_5:
	movq	_SSL_AD_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ERR_R_MALLOC_FAILURE@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_15:
	movq	_SSL_AD_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ERR_R_EVP_LIB@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_SSLfatal
	jmp	LBB0_24
LBB0_7:
	movq	_SSL_AD_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ERR_R_MALLOC_FAILURE@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_11:
	movq	_SSL_AD_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ERR_R_INTERNAL_ERROR@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_SSLfatal
LBB0_23:
	xorl	%r13d, %r13d
LBB0_24:
	movq	%r15, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_OPENSSL_clear_free
	movq	%r13, %rdi
	callq	_EVP_PKEY_CTX_free
LBB0_25:
	xorl	%eax, %eax
LBB0_26:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	_SSL_AD_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_SSL_R_BAD_RSA_ENCRYPT@GOTPCREL(%rip), %rax
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_SSL_AD_INTERNAL_ERROR,4,2      ## @SSL_AD_INTERNAL_ERROR
	.comm	_SSL_F_TLS_CONSTRUCT_CKE_RSA,4,2 ## @SSL_F_TLS_CONSTRUCT_CKE_RSA
	.comm	_ERR_R_INTERNAL_ERROR,4,2       ## @ERR_R_INTERNAL_ERROR
	.comm	_SSL_MAX_MASTER_KEY_LENGTH,8,3  ## @SSL_MAX_MASTER_KEY_LENGTH
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ## @ERR_R_MALLOC_FAILURE
	.comm	_SSL3_VERSION,8,3               ## @SSL3_VERSION
	.comm	_ERR_R_EVP_LIB,4,2              ## @ERR_R_EVP_LIB
	.comm	_SSL_R_BAD_RSA_ENCRYPT,4,2      ## @SSL_R_BAD_RSA_ENCRYPT
	.no_dead_strip	_tls_construct_cke_rsa
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tls_construct_cke_rsa
_tls_construct_cke_rsa:                 ; @tls_construct_cke_rsa
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x21, x0
	str	xzr, [sp, #8]
	ldr	x8, [x0, #32]
	ldr	x0, [x8]
	cbz	x0, LBB0_15
; %bb.1:
	mov	x22, x1
	bl	_X509_get0_pubkey
	mov	x23, x0
	bl	_EVP_PKEY_get0_RSA
	cbz	x0, LBB0_15
; %bb.2:
Lloh0:
	adrp	x8, _SSL_MAX_MASTER_KEY_LENGTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SSL_MAX_MASTER_KEY_LENGTH@GOTPAGEOFF]
Lloh2:
	ldr	x19, [x8]
	mov	x0, x19
	bl	_OPENSSL_malloc
	cbz	x0, LBB0_17
; %bb.3:
	mov	x20, x0
	ldr	w8, [x21]
	lsr	w8, w8, #8
	strb	w8, [x0]
	ldr	w8, [x21]
	strb	w8, [x0, #1]
	add	x0, x0, #2
	sub	w1, w19, #2
	bl	_RAND_bytes
	cmp	x0, #0
	b.le	LBB0_20
; %bb.4:
	ldr	x8, [x21, #8]
Lloh3:
	adrp	x24, _SSL3_VERSION@GOTPAGE
Lloh4:
	ldr	x24, [x24, _SSL3_VERSION@GOTPAGEOFF]
	ldr	x9, [x24]
	cmp	x8, x9
	b.le	LBB0_6
; %bb.5:
	mov	x0, x22
	bl	_WPACKET_start_sub_packet_u16
	cbz	w0, LBB0_21
LBB0_6:
	mov	x0, x23
	mov	x1, #0
	bl	_EVP_PKEY_CTX_new
	mov	x23, x0
	cbz	x0, LBB0_18
; %bb.7:
	mov	x0, x23
	bl	_EVP_PKEY_encrypt_init
	cmp	x0, #1
	b.lt	LBB0_18
; %bb.8:
	mov	x2, sp
	mov	x0, x23
	mov	x1, #0
	mov	x3, x20
	mov	x4, x19
	bl	_EVP_PKEY_encrypt
	cmp	x0, #0
	b.le	LBB0_18
; %bb.9:
	ldr	x1, [sp]
	add	x2, sp, #8
	mov	x0, x22
	bl	_WPACKET_allocate_bytes
	cbz	w0, LBB0_27
; %bb.10:
	ldr	x1, [sp, #8]
	mov	x2, sp
	mov	x0, x23
	mov	x3, x20
	mov	x4, x19
	bl	_EVP_PKEY_encrypt
	cmp	x0, #0
	b.le	LBB0_27
; %bb.11:
	mov	x0, x23
	bl	_EVP_PKEY_CTX_free
	ldr	x8, [x21, #8]
	ldr	x9, [x24]
	cmp	x8, x9
	b.le	LBB0_13
; %bb.12:
	mov	x0, x22
	bl	_WPACKET_close
	cbz	w0, LBB0_21
LBB0_13:
	ldp	x2, x1, [sp]
	mov	x0, x21
	mov	x3, x20
	mov	x4, x19
	bl	_ssl_log_rsa_client_key_exchange
	cbz	w0, LBB0_23
; %bb.14:
	stp	x20, x19, [x21, #16]
	mov	w0, #1
	b	LBB0_26
LBB0_15:
Lloh5:
	adrp	x8, _SSL_AD_INTERNAL_ERROR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SSL_AD_INTERNAL_ERROR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x8, _SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
Lloh11:
	adrp	x8, _ERR_R_INTERNAL_ERROR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ERR_R_INTERNAL_ERROR@GOTPAGEOFF]
LBB0_16:
	ldr	w3, [x8]
	mov	x0, x21
	bl	_SSLfatal
	b	LBB0_25
LBB0_17:
Lloh13:
	adrp	x8, _SSL_AD_INTERNAL_ERROR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SSL_AD_INTERNAL_ERROR@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
Lloh19:
	adrp	x8, _ERR_R_MALLOC_FAILURE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ERR_R_MALLOC_FAILURE@GOTPAGEOFF]
	b	LBB0_16
LBB0_18:
Lloh21:
	adrp	x8, _SSL_AD_INTERNAL_ERROR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SSL_AD_INTERNAL_ERROR@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
Lloh27:
	adrp	x8, _ERR_R_EVP_LIB@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ERR_R_EVP_LIB@GOTPAGEOFF]
LBB0_19:
	ldr	w3, [x8]
	mov	x0, x21
	bl	_SSLfatal
	b	LBB0_24
LBB0_20:
Lloh29:
	adrp	x8, _SSL_AD_INTERNAL_ERROR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _SSL_AD_INTERNAL_ERROR@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
Lloh32:
	adrp	x8, _SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPAGE
Lloh33:
	ldr	x8, [x8, _SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPAGEOFF]
Lloh34:
	ldr	w2, [x8]
Lloh35:
	adrp	x8, _ERR_R_MALLOC_FAILURE@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ERR_R_MALLOC_FAILURE@GOTPAGEOFF]
	b	LBB0_22
LBB0_21:
Lloh37:
	adrp	x8, _SSL_AD_INTERNAL_ERROR@GOTPAGE
Lloh38:
	ldr	x8, [x8, _SSL_AD_INTERNAL_ERROR@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
Lloh40:
	adrp	x8, _SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPAGE
Lloh41:
	ldr	x8, [x8, _SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPAGEOFF]
Lloh42:
	ldr	w2, [x8]
Lloh43:
	adrp	x8, _ERR_R_INTERNAL_ERROR@GOTPAGE
Lloh44:
	ldr	x8, [x8, _ERR_R_INTERNAL_ERROR@GOTPAGEOFF]
LBB0_22:
	ldr	w3, [x8]
	mov	x0, x21
	bl	_SSLfatal
LBB0_23:
	mov	x23, #0
LBB0_24:
	mov	x0, x20
	mov	x1, x19
	bl	_OPENSSL_clear_free
	mov	x0, x23
	bl	_EVP_PKEY_CTX_free
LBB0_25:
	mov	w0, #0
LBB0_26:
	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
	add	sp, sp, #80
	ret
LBB0_27:
Lloh45:
	adrp	x8, _SSL_AD_INTERNAL_ERROR@GOTPAGE
Lloh46:
	ldr	x8, [x8, _SSL_AD_INTERNAL_ERROR@GOTPAGEOFF]
Lloh47:
	ldr	w1, [x8]
Lloh48:
	adrp	x8, _SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPAGE
Lloh49:
	ldr	x8, [x8, _SSL_F_TLS_CONSTRUCT_CKE_RSA@GOTPAGEOFF]
Lloh50:
	ldr	w2, [x8]
Lloh51:
	adrp	x8, _SSL_R_BAD_RSA_ENCRYPT@GOTPAGE
Lloh52:
	ldr	x8, [x8, _SSL_R_BAD_RSA_ENCRYPT@GOTPAGEOFF]
	b	LBB0_19
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.cfi_endproc
                                        ; -- End function
	.comm	_SSL_AD_INTERNAL_ERROR,4,2      ; @SSL_AD_INTERNAL_ERROR
	.comm	_SSL_F_TLS_CONSTRUCT_CKE_RSA,4,2 ; @SSL_F_TLS_CONSTRUCT_CKE_RSA
	.comm	_ERR_R_INTERNAL_ERROR,4,2       ; @ERR_R_INTERNAL_ERROR
	.comm	_SSL_MAX_MASTER_KEY_LENGTH,8,3  ; @SSL_MAX_MASTER_KEY_LENGTH
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ; @ERR_R_MALLOC_FAILURE
	.comm	_SSL3_VERSION,8,3               ; @SSL3_VERSION
	.comm	_ERR_R_EVP_LIB,4,2              ; @ERR_R_EVP_LIB
	.comm	_SSL_R_BAD_RSA_ENCRYPT,4,2      ; @SSL_R_BAD_RSA_ENCRYPT
	.no_dead_strip	_tls_construct_cke_rsa
.subsections_via_symbols
