	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ssl_derive                     ## -- Begin function ssl_derive
	.p2align	4, 0x90
_ssl_derive:                            ## @ssl_derive
	.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, %r12
	movq	$0, -48(%rbp)
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	movq	%rdx, %rbx
	testq	%rdx, %rdx
	je	LBB0_2
## %bb.3:
	movq	%rsi, %r15
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	xorl	%r13d, %r13d
	movq	%rsi, %rdi
	xorl	%esi, %esi
	callq	_EVP_PKEY_CTX_new
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_EVP_PKEY_derive_init
	testq	%rax, %rax
	jle	LBB0_6
## %bb.4:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_EVP_PKEY_derive_set_peer
	testq	%rax, %rax
	jle	LBB0_6
## %bb.5:
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_EVP_PKEY_derive
	testq	%rax, %rax
	jle	LBB0_6
## %bb.7:
	movq	%r12, %rdi
	callq	_SSL_IS_TLS13
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movq	%r15, %rdi
	callq	_EVP_PKEY_id
	movq	_EVP_PKEY_DH@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_EVP_PKEY_CTX_set_dh_pad
LBB0_10:
	movq	-48(%rbp), %rdi
	callq	_OPENSSL_malloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	movq	%rax, %r15
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_EVP_PKEY_derive
	testq	%rax, %rax
	jle	LBB0_13
## %bb.14:
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_20
## %bb.15:
	movq	%r12, %rdi
	callq	_SSL_IS_TLS13
	testq	%rax, %rax
	je	LBB0_19
## %bb.16:
	cmpl	$0, 20(%r12)
	jne	LBB0_18
## %bb.17:
	movq	%r12, %rdi
	callq	_ssl_handshake_md
	leaq	16(%r12), %r9
	xorl	%r13d, %r13d
	movq	%r12, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_tls13_generate_secret
	testl	%eax, %eax
	je	LBB0_22
LBB0_18:
	movq	-48(%rbp), %rdx
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_tls13_generate_handshake_secret
	xorl	%r13d, %r13d
	testq	%rax, %rax
	setne	%r13b
	jmp	LBB0_22
LBB0_2:
	movq	_SSL_AD_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SSL_F_SSL_DERIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ERR_R_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	callq	_SSLfatal
	xorl	%r13d, %r13d
	jmp	LBB0_23
LBB0_6:
	movq	_SSL_AD_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SSL_F_SSL_DERIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ERR_R_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	callq	_SSLfatal
LBB0_21:
	xorl	%r15d, %r15d
LBB0_22:
	movq	-48(%rbp), %rsi
	movq	%r15, %rdi
	callq	_OPENSSL_clear_free
	movq	%r14, %rdi
	callq	_EVP_PKEY_CTX_free
LBB0_23:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	_SSL_AD_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SSL_F_SSL_DERIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ERR_R_MALLOC_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	callq	_SSLfatal
	xorl	%r13d, %r13d
	jmp	LBB0_21
LBB0_13:
	movq	_SSL_AD_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SSL_F_SSL_DERIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ERR_R_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	callq	_SSLfatal
	xorl	%r13d, %r13d
	jmp	LBB0_22
LBB0_20:
	movq	%r15, (%r12)
	movq	-48(%rbp), %rax
	movq	%rax, 8(%r12)
	movl	$1, %r13d
	jmp	LBB0_21
LBB0_19:
	movq	-48(%rbp), %rdx
	movq	%r12, %rdi
	movq	%r15, %rsi
	xorl	%ecx, %ecx
	callq	_ssl_generate_master_secret
	movl	%eax, %r13d
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_SSL_AD_INTERNAL_ERROR,4,2      ## @SSL_AD_INTERNAL_ERROR
	.comm	_SSL_F_SSL_DERIVE,4,2           ## @SSL_F_SSL_DERIVE
	.comm	_ERR_R_INTERNAL_ERROR,4,2       ## @ERR_R_INTERNAL_ERROR
	.comm	_EVP_PKEY_DH,8,3                ## @EVP_PKEY_DH
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ## @ERR_R_MALLOC_FAILURE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ssl_derive                     ; -- Begin function ssl_derive
	.p2align	2
_ssl_derive:                            ; @ssl_derive
	.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	x20, x0
	str	xzr, [sp, #8]
	cbz	x1, LBB0_15
; %bb.1:
	mov	x23, x2
	cbz	x2, LBB0_15
; %bb.2:
	mov	x22, x3
	mov	x21, x1
	mov	x0, x1
	mov	x1, #0
	bl	_EVP_PKEY_CTX_new
	mov	x19, x0
	bl	_EVP_PKEY_derive_init
	cmp	x0, #1
	b.lt	LBB0_16
; %bb.3:
	mov	x0, x19
	mov	x1, x23
	bl	_EVP_PKEY_derive_set_peer
	cmp	x0, #1
	b.lt	LBB0_16
; %bb.4:
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, #0
	bl	_EVP_PKEY_derive
	cmp	x0, #0
	b.le	LBB0_16
; %bb.5:
	mov	x0, x20
	bl	_SSL_IS_TLS13
	cbz	x0, LBB0_8
; %bb.6:
	mov	x0, x21
	bl	_EVP_PKEY_id
Lloh0:
	adrp	x8, _EVP_PKEY_DH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EVP_PKEY_DH@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.7:
	mov	x0, x19
	mov	w1, #1
	bl	_EVP_PKEY_CTX_set_dh_pad
LBB0_8:
	ldr	x0, [sp, #8]
	bl	_OPENSSL_malloc
	mov	x21, x0
	cbz	x0, LBB0_20
; %bb.9:
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x21
	bl	_EVP_PKEY_derive
	cmp	x0, #0
	b.le	LBB0_21
; %bb.10:
	cbz	w22, LBB0_23
; %bb.11:
	mov	x0, x20
	bl	_SSL_IS_TLS13
	cbz	x0, LBB0_24
; %bb.12:
	ldr	w8, [x20, #20]
	cbnz	w8, LBB0_14
; %bb.13:
	mov	x0, x20
	bl	_ssl_handshake_md
	mov	x1, x0
	add	x5, x20, #16
	mov	x0, x20
	mov	x2, #0
	mov	x3, #0
	mov	w4, #0
	bl	_tls13_generate_secret
	cbz	w0, LBB0_25
LBB0_14:
	ldr	x2, [sp, #8]
	mov	x0, x20
	mov	x1, x21
	bl	_tls13_generate_handshake_secret
	cmp	x0, #0
	cset	w20, ne
	b	LBB0_18
LBB0_15:
Lloh3:
	adrp	x8, _SSL_AD_INTERNAL_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SSL_AD_INTERNAL_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _SSL_F_SSL_DERIVE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SSL_F_SSL_DERIVE@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x8, _ERR_R_INTERNAL_ERROR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ERR_R_INTERNAL_ERROR@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	mov	x0, x20
	bl	_SSLfatal
	mov	w20, #0
	b	LBB0_19
LBB0_16:
Lloh12:
	adrp	x8, _SSL_AD_INTERNAL_ERROR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SSL_AD_INTERNAL_ERROR@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _SSL_F_SSL_DERIVE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SSL_F_SSL_DERIVE@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
Lloh18:
	adrp	x8, _ERR_R_INTERNAL_ERROR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ERR_R_INTERNAL_ERROR@GOTPAGEOFF]
Lloh20:
	ldr	w3, [x8]
	mov	x0, x20
	bl	_SSLfatal
	mov	w20, #0
LBB0_17:
	mov	x21, #0
LBB0_18:
	ldr	x1, [sp, #8]
	mov	x0, x21
	bl	_OPENSSL_clear_free
	mov	x0, x19
	bl	_EVP_PKEY_CTX_free
LBB0_19:
	mov	x0, x20
	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_20:
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_SSL_DERIVE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SSL_F_SSL_DERIVE@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
Lloh27:
	adrp	x8, _ERR_R_MALLOC_FAILURE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ERR_R_MALLOC_FAILURE@GOTPAGEOFF]
	b	LBB0_22
LBB0_21:
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_SSL_DERIVE@GOTPAGE
Lloh33:
	ldr	x8, [x8, _SSL_F_SSL_DERIVE@GOTPAGEOFF]
Lloh34:
	ldr	w2, [x8]
Lloh35:
	adrp	x8, _ERR_R_INTERNAL_ERROR@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ERR_R_INTERNAL_ERROR@GOTPAGEOFF]
LBB0_22:
	ldr	w3, [x8]
	mov	x0, x20
	bl	_SSLfatal
	mov	w20, #0
	b	LBB0_18
LBB0_23:
	ldr	x8, [sp, #8]
	stp	x21, x8, [x20]
	mov	w20, #1
	b	LBB0_17
LBB0_24:
	ldr	x2, [sp, #8]
	mov	x0, x20
	mov	x1, x21
	mov	w3, #0
	bl	_ssl_generate_master_secret
	mov	x20, x0
	b	LBB0_18
LBB0_25:
	mov	w20, #0
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.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
	.cfi_endproc
                                        ; -- End function
	.comm	_SSL_AD_INTERNAL_ERROR,4,2      ; @SSL_AD_INTERNAL_ERROR
	.comm	_SSL_F_SSL_DERIVE,4,2           ; @SSL_F_SSL_DERIVE
	.comm	_ERR_R_INTERNAL_ERROR,4,2       ; @ERR_R_INTERNAL_ERROR
	.comm	_EVP_PKEY_DH,8,3                ; @EVP_PKEY_DH
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ; @ERR_R_MALLOC_FAILURE
.subsections_via_symbols
