	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tls_process_cke_gost
_tls_process_cke_gost:                  ## @tls_process_cke_gost
	.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	%r12
	pushq	%rbx
	subq	$80, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	$32, -104(%rbp)
	movq	24(%rdi), %rax
	movq	(%rax), %rax
	movq	_SSL_aGOST12@GOTPCREL(%rip), %rcx
	testq	%rax, (%rcx)
	je	LBB0_3
## %bb.1:
	movq	16(%r12), %rax
	movq	(%rax), %rax
	movq	_SSL_PKEY_GOST12_512@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rdi
	testq	%rdi, %rdi
	jne	LBB0_7
## %bb.2:
	movq	_SSL_PKEY_GOST12_256@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rdi
	testq	%rdi, %rdi
	jne	LBB0_7
	jmp	LBB0_6
LBB0_3:
	movq	_SSL_aGOST01@GOTPCREL(%rip), %rcx
	testq	%rax, (%rcx)
	je	LBB0_4
## %bb.5:
	movq	16(%r12), %rax
	movq	(%rax), %rax
LBB0_6:
	movq	_SSL_PKEY_GOST01@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rdi
	jmp	LBB0_7
LBB0_4:
	xorl	%edi, %edi
LBB0_7:
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_EVP_PKEY_CTX_new
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_EVP_PKEY_decrypt_init
	testq	%rax, %rax
	jle	LBB0_10
## %bb.11:
	movq	8(%r12), %rax
	movl	(%rax), %edi
	callq	_X509_get0_pubkey
	testq	%rax, %rax
	je	LBB0_14
## %bb.12:
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_EVP_PKEY_derive_set_peer
	testq	%rax, %rax
	jg	LBB0_14
## %bb.13:
	xorl	%eax, %eax
	callq	_ERR_clear_error
LBB0_14:
	leaq	-92(%rbp), %rsi
	movq	%r15, %rdi
	callq	_PACKET_get_1
	testl	%eax, %eax
	je	LBB0_17
## %bb.15:
	movq	_V_ASN1_SEQUENCE@GOTPCREL(%rip), %rax
	movq	_V_ASN1_CONSTRUCTED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	cmpl	%ecx, -92(%rbp)
	jne	LBB0_17
## %bb.16:
	leaq	-88(%rbp), %rsi
	movq	%r15, %rdi
	callq	_PACKET_peek_1
	testl	%eax, %eax
	je	LBB0_17
## %bb.19:
	movl	-88(%rbp), %eax
	cmpl	$129, %eax
	jne	LBB0_22
## %bb.20:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_PACKET_forward
	testl	%eax, %eax
	jne	LBB0_23
## %bb.21:
	movq	_SSL_AD_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_8:
	movq	_SSL_AD_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SSL_F_TLS_PROCESS_CKE_GOST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ERR_R_MALLOC_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	callq	_SSLfatal
	jmp	LBB0_29
LBB0_10:
	movq	_SSL_AD_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SSL_F_TLS_PROCESS_CKE_GOST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ERR_R_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	callq	_SSLfatal
	xorl	%ebx, %ebx
	jmp	LBB0_29
LBB0_22:
	cmpl	$128, %eax
	jae	LBB0_17
LBB0_23:
	leaq	-84(%rbp), %rsi
	movq	%r15, %rdi
	callq	_PACKET_as_length_prefixed_1
	testl	%eax, %eax
	je	LBB0_17
## %bb.24:
	leaq	-84(%rbp), %r15
	movq	%r15, %rdi
	callq	_PACKET_remaining
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_PACKET_data
	leaq	-80(%rbp), %rsi
	leaq	-104(%rbp), %rdx
	movq	%r14, %rdi
	movq	%rax, %rcx
	movq	%rbx, %r8
	callq	_EVP_PKEY_decrypt
	testq	%rax, %rax
	jle	LBB0_17
## %bb.25:
	leaq	-80(%rbp), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movl	$32, %edx
	xorl	%ecx, %ecx
	callq	_ssl_generate_master_secret
	testl	%eax, %eax
	je	LBB0_28
## %bb.26:
	movq	_EVP_PKEY_CTRL_PEER_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	$-1, %esi
	movl	$-1, %edx
	movl	$2, %r8d
	xorl	%r9d, %r9d
	callq	_EVP_PKEY_CTX_ctrl
	movl	$1, %ebx
	testq	%rax, %rax
	jle	LBB0_28
## %bb.27:
	movl	$1, (%r12)
	jmp	LBB0_28
LBB0_17:
	movq	_SSL_AD_DECODE_ERROR@GOTPCREL(%rip), %rax
LBB0_18:
	movl	(%rax), %esi
	movq	_SSL_F_TLS_PROCESS_CKE_GOST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_SSL_R_DECRYPTION_FAILED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	callq	_SSLfatal
	xorl	%ebx, %ebx
LBB0_28:
	movq	%r14, %rdi
	callq	_EVP_PKEY_CTX_free
LBB0_29:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_31
## %bb.30:
	movl	%ebx, %eax
	addq	$80, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_31:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SSL_aGOST12,8,3                ## @SSL_aGOST12
	.comm	_SSL_PKEY_GOST12_512,8,3        ## @SSL_PKEY_GOST12_512
	.comm	_SSL_PKEY_GOST12_256,8,3        ## @SSL_PKEY_GOST12_256
	.comm	_SSL_PKEY_GOST01,8,3            ## @SSL_PKEY_GOST01
	.comm	_SSL_aGOST01,8,3                ## @SSL_aGOST01
	.comm	_SSL_AD_INTERNAL_ERROR,4,2      ## @SSL_AD_INTERNAL_ERROR
	.comm	_SSL_F_TLS_PROCESS_CKE_GOST,4,2 ## @SSL_F_TLS_PROCESS_CKE_GOST
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ## @ERR_R_MALLOC_FAILURE
	.comm	_ERR_R_INTERNAL_ERROR,4,2       ## @ERR_R_INTERNAL_ERROR
	.comm	_V_ASN1_SEQUENCE,4,2            ## @V_ASN1_SEQUENCE
	.comm	_V_ASN1_CONSTRUCTED,4,2         ## @V_ASN1_CONSTRUCTED
	.comm	_SSL_AD_DECODE_ERROR,4,2        ## @SSL_AD_DECODE_ERROR
	.comm	_SSL_R_DECRYPTION_FAILED,4,2    ## @SSL_R_DECRYPTION_FAILED
	.comm	_EVP_PKEY_CTRL_PEER_KEY,4,2     ## @EVP_PKEY_CTRL_PEER_KEY
	.no_dead_strip	_tls_process_cke_gost
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tls_process_cke_gost
_tls_process_cke_gost:                  ; @tls_process_cke_gost
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	mov	w8, #32
	str	x8, [sp, #16]
	ldr	x8, [x0, #24]
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _SSL_aGOST12@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SSL_aGOST12@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	tst	x9, x8
	b.eq	LBB0_3
; %bb.1:
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
Lloh6:
	adrp	x9, _SSL_PKEY_GOST12_512@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SSL_PKEY_GOST12_512@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	ldr	x0, [x8, x9, lsl #3]
	cbnz	x0, LBB0_7
; %bb.2:
Lloh9:
	adrp	x9, _SSL_PKEY_GOST12_256@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SSL_PKEY_GOST12_256@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	ldr	x0, [x8, x9, lsl #3]
	cbnz	x0, LBB0_7
	b	LBB0_5
LBB0_3:
Lloh12:
	adrp	x9, _SSL_aGOST01@GOTPAGE
Lloh13:
	ldr	x9, [x9, _SSL_aGOST01@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	tst	x9, x8
	b.eq	LBB0_6
; %bb.4:
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
LBB0_5:
Lloh15:
	adrp	x9, _SSL_PKEY_GOST01@GOTPAGE
Lloh16:
	ldr	x9, [x9, _SSL_PKEY_GOST01@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	ldr	x0, [x8, x9, lsl #3]
	b	LBB0_7
LBB0_6:
	mov	x0, #0
LBB0_7:
	mov	x1, #0
	bl	_EVP_PKEY_CTX_new
	cbz	x0, LBB0_18
; %bb.8:
	mov	x20, x0
	bl	_EVP_PKEY_decrypt_init
	cmp	x0, #0
	b.le	LBB0_19
; %bb.9:
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	bl	_X509_get0_pubkey
	cbz	x0, LBB0_12
; %bb.10:
	mov	x1, x0
	mov	x0, x20
	bl	_EVP_PKEY_derive_set_peer
	cmp	x0, #0
	b.gt	LBB0_12
; %bb.11:
	bl	_ERR_clear_error
LBB0_12:
	add	x1, sp, #12
	mov	x0, x21
	bl	_PACKET_get_1
	cbz	w0, LBB0_27
; %bb.13:
	ldr	w8, [sp, #12]
Lloh18:
	adrp	x9, _V_ASN1_SEQUENCE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _V_ASN1_SEQUENCE@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	adrp	x10, _V_ASN1_CONSTRUCTED@GOTPAGE
Lloh22:
	ldr	x10, [x10, _V_ASN1_CONSTRUCTED@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	orr	w9, w10, w9
	cmp	w8, w9
	b.ne	LBB0_27
; %bb.14:
	add	x1, sp, #8
	mov	x0, x21
	bl	_PACKET_peek_1
	cbz	w0, LBB0_27
; %bb.15:
	ldr	w8, [sp, #8]
	cmp	w8, #129
	b.ne	LBB0_21
; %bb.16:
	mov	x0, x21
	mov	w1, #1
	bl	_PACKET_forward
	cbnz	w0, LBB0_22
; %bb.17:
Lloh24:
	adrp	x8, _SSL_AD_INTERNAL_ERROR@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SSL_AD_INTERNAL_ERROR@GOTPAGEOFF]
	b	LBB0_28
LBB0_18:
Lloh26:
	adrp	x8, _SSL_AD_INTERNAL_ERROR@GOTPAGE
Lloh27:
	ldr	x8, [x8, _SSL_AD_INTERNAL_ERROR@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
Lloh29:
	adrp	x8, _SSL_F_TLS_PROCESS_CKE_GOST@GOTPAGE
Lloh30:
	ldr	x8, [x8, _SSL_F_TLS_PROCESS_CKE_GOST@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
Lloh32:
	adrp	x8, _ERR_R_MALLOC_FAILURE@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ERR_R_MALLOC_FAILURE@GOTPAGEOFF]
	b	LBB0_20
LBB0_19:
Lloh34:
	adrp	x8, _SSL_AD_INTERNAL_ERROR@GOTPAGE
Lloh35:
	ldr	x8, [x8, _SSL_AD_INTERNAL_ERROR@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
Lloh37:
	adrp	x8, _SSL_F_TLS_PROCESS_CKE_GOST@GOTPAGE
Lloh38:
	ldr	x8, [x8, _SSL_F_TLS_PROCESS_CKE_GOST@GOTPAGEOFF]
Lloh39:
	ldr	w2, [x8]
Lloh40:
	adrp	x8, _ERR_R_INTERNAL_ERROR@GOTPAGE
Lloh41:
	ldr	x8, [x8, _ERR_R_INTERNAL_ERROR@GOTPAGEOFF]
LBB0_20:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_SSLfatal
	mov	w21, #0
	b	LBB0_31
LBB0_21:
	cmp	w8, #128
	b.hs	LBB0_27
LBB0_22:
	add	x1, sp, #4
	mov	x0, x21
	bl	_PACKET_as_length_prefixed_1
	cbz	w0, LBB0_27
; %bb.23:
	add	x0, sp, #4
	bl	_PACKET_remaining
	mov	x21, x0
	add	x0, sp, #4
	bl	_PACKET_data
	mov	x3, x0
	add	x1, sp, #24
	add	x2, sp, #16
	mov	x0, x20
	mov	x4, x21
	bl	_EVP_PKEY_decrypt
	cmp	x0, #0
	b.le	LBB0_27
; %bb.24:
	add	x1, sp, #24
	mov	x0, x19
	mov	w2, #32
	mov	w3, #0
	bl	_ssl_generate_master_secret
	cbz	w0, LBB0_29
; %bb.25:
Lloh42:
	adrp	x8, _EVP_PKEY_CTRL_PEER_KEY@GOTPAGE
Lloh43:
	ldr	x8, [x8, _EVP_PKEY_CTRL_PEER_KEY@GOTPAGEOFF]
Lloh44:
	ldr	w3, [x8]
	mov	x0, x20
	mov	w1, #-1
	mov	w2, #-1
	mov	w4, #2
	mov	x5, #0
	bl	_EVP_PKEY_CTX_ctrl
	mov	w21, #1
	cmp	x0, #1
	b.lt	LBB0_30
; %bb.26:
	str	w21, [x19]
	b	LBB0_30
LBB0_27:
Lloh45:
	adrp	x8, _SSL_AD_DECODE_ERROR@GOTPAGE
Lloh46:
	ldr	x8, [x8, _SSL_AD_DECODE_ERROR@GOTPAGEOFF]
LBB0_28:
	ldr	w1, [x8]
Lloh47:
	adrp	x8, _SSL_F_TLS_PROCESS_CKE_GOST@GOTPAGE
Lloh48:
	ldr	x8, [x8, _SSL_F_TLS_PROCESS_CKE_GOST@GOTPAGEOFF]
Lloh49:
	ldr	w2, [x8]
Lloh50:
	adrp	x8, _SSL_R_DECRYPTION_FAILED@GOTPAGE
Lloh51:
	ldr	x8, [x8, _SSL_R_DECRYPTION_FAILED@GOTPAGEOFF]
Lloh52:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_SSLfatal
LBB0_29:
	mov	w21, #0
LBB0_30:
	mov	x0, x20
	bl	_EVP_PKEY_CTX_free
LBB0_31:
	ldur	x8, [x29, #-40]
Lloh53:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh54:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh55:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_33
; %bb.32:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_33:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.cfi_endproc
                                        ; -- End function
	.comm	_SSL_aGOST12,8,3                ; @SSL_aGOST12
	.comm	_SSL_PKEY_GOST12_512,8,3        ; @SSL_PKEY_GOST12_512
	.comm	_SSL_PKEY_GOST12_256,8,3        ; @SSL_PKEY_GOST12_256
	.comm	_SSL_PKEY_GOST01,8,3            ; @SSL_PKEY_GOST01
	.comm	_SSL_aGOST01,8,3                ; @SSL_aGOST01
	.comm	_SSL_AD_INTERNAL_ERROR,4,2      ; @SSL_AD_INTERNAL_ERROR
	.comm	_SSL_F_TLS_PROCESS_CKE_GOST,4,2 ; @SSL_F_TLS_PROCESS_CKE_GOST
	.comm	_ERR_R_MALLOC_FAILURE,4,2       ; @ERR_R_MALLOC_FAILURE
	.comm	_ERR_R_INTERNAL_ERROR,4,2       ; @ERR_R_INTERNAL_ERROR
	.comm	_V_ASN1_SEQUENCE,4,2            ; @V_ASN1_SEQUENCE
	.comm	_V_ASN1_CONSTRUCTED,4,2         ; @V_ASN1_CONSTRUCTED
	.comm	_SSL_AD_DECODE_ERROR,4,2        ; @SSL_AD_DECODE_ERROR
	.comm	_SSL_R_DECRYPTION_FAILED,4,2    ; @SSL_R_DECRYPTION_FAILED
	.comm	_EVP_PKEY_CTRL_PEER_KEY,4,2     ; @EVP_PKEY_CTRL_PEER_KEY
	.no_dead_strip	_tls_process_cke_gost
.subsections_via_symbols
