	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tls_process_client_key_exchange_rsa
_tls_process_client_key_exchange_rsa:   ## @tls_process_client_key_exchange_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	%rdx, %rax
	subq	%rsi, %rax
	cmpq	$7, %rax
	jle	LBB0_1
## %bb.2:
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rsi, %rdi
	callq	_WPA_GET_BE16
	movq	%rax, %r12
	movslq	%r12d, %rax
	leaq	(%r15,%rax,4), %rax
	addq	$8, %rax
	addq	$8, %r15
	movq	%rbx, %r13
	subq	%r15, %r13
	cmpq	%rbx, %rax
	jbe	LBB0_4
## %bb.3:
	shrq	$2, %r13
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%r12d, %edx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_tlsv1_server_log
LBB0_1:
	movq	_TLS_ALERT_LEVEL_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TLS_ALERT_DECODE_ERROR@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_tlsv1_server_alert
LBB0_17:
	movl	$-1, %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	sarq	$2, %r13
	movq	%r13, -48(%rbp)
	movq	_TLS_PRE_MASTER_SECRET_LEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	cmpq	%rdi, %r13
	cmovaq	%r13, %rdi
	callq	_os_malloc
	testq	%rax, %rax
	je	LBB0_15
## %bb.5:
	movq	%rax, %rbx
	movq	8(%r14), %rax
	movl	(%rax), %edi
	leaq	-48(%rbp), %r8
	movq	%r15, %rsi
	movl	%r12d, %edx
	movq	%rbx, %rcx
	callq	_crypto_private_key_decrypt_pkcs1_v15
	testq	%rax, %rax
	movq	%rbx, %r15
	js	LBB0_6
## %bb.7:
	movq	-48(%rbp), %rdx
	movq	_TLS_PRE_MASTER_SECRET_LEN@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rdx
	jne	LBB0_8
## %bb.9:
	movq	%r15, %rdi
	callq	_WPA_GET_BE16
	cmpq	(%r14), %rax
	je	LBB0_13
## %bb.10:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_tlsv1_server_log
	jmp	LBB0_11
LBB0_6:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-48(%rbp), %rcx
	leaq	L_.str.1(%rip), %rsi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_wpa_printf
	movq	_TLS_PRE_MASTER_SECRET_LEN@GOTPCREL(%rip), %rbx
	jmp	LBB0_11
LBB0_8:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_tlsv1_server_log
LBB0_11:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_wpa_printf
	movq	(%rbx), %rsi
	movq	%rsi, -48(%rbp)
	movq	%r15, %rdi
	callq	_os_get_random
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movl	(%r12), %edi
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_wpa_printf
	movq	_TLS_ALERT_LEVEL_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TLS_ALERT_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_tlsv1_server_alert
	movq	%r15, %rdi
	callq	_os_free
	jmp	LBB0_17
LBB0_13:
	movq	-48(%rbp), %rdx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_tlsv1_server_derive_keys
	movq	%r15, %r12
	movl	%eax, %r15d
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	movq	%r13, %rdx
	callq	_os_memset
	movq	%r12, %rdi
	callq	_os_free
	testl	%r15d, %r15d
	je	LBB0_18
## %bb.14:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.6(%rip), %rsi
	xorl	%eax, %eax
	callq	_wpa_printf
LBB0_15:
	movq	_TLS_ALERT_LEVEL_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TLS_ALERT_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_TLS_ALERT_LEVEL_FATAL,4,2      ## @TLS_ALERT_LEVEL_FATAL
	.comm	_TLS_ALERT_DECODE_ERROR,4,2     ## @TLS_ALERT_DECODE_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid ClientKeyExchange format: encr_len=%u left=%u"

	.comm	_TLS_PRE_MASTER_SECRET_LEN,8,3  ## @TLS_PRE_MASTER_SECRET_LEN
	.comm	_TLS_ALERT_INTERNAL_ERROR,4,2   ## @TLS_ALERT_INTERNAL_ERROR
	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
L_.str.1:                               ## @.str.1
	.asciz	"TLSv1: Failed to decrypt PreMasterSecret (encr_len=%u outlen=%lu)"

L_.str.2:                               ## @.str.2
	.asciz	"Unexpected PreMasterSecret length %lu"

L_.str.3:                               ## @.str.3
	.asciz	"Client version in ClientKeyExchange does not match with version in ClientHello"

L_.str.4:                               ## @.str.4
	.asciz	"TLSv1: Using random premaster secret to avoid revealing information about private key"

L_.str.5:                               ## @.str.5
	.asciz	"TLSv1: Failed to get random data"

L_.str.6:                               ## @.str.6
	.asciz	"TLSv1: Failed to derive keys"

	.no_dead_strip	_tls_process_client_key_exchange_rsa
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tls_process_client_key_exchange_rsa
_tls_process_client_key_exchange_rsa:   ; @tls_process_client_key_exchange_rsa
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
	sub	x8, x2, x1
	cmp	x8, #7
	b.le	LBB0_3
; %bb.1:
	mov	x20, x2
	mov	x21, x1
	mov	x0, x1
	bl	_WPA_GET_BE16
	mov	x22, x0
	add	x23, x21, #8
	lsl	x8, x0, #32
	add	x9, x23, x8, asr #30
	sub	x8, x20, x23
	cmp	x9, x20
	b.ls	LBB0_7
; %bb.2:
	lsr	x8, x8, #2
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	stp	x22, x8, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_tlsv1_server_log
LBB0_3:
Lloh2:
	adrp	x8, _TLS_ALERT_LEVEL_FATAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TLS_ALERT_LEVEL_FATAL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x8, _TLS_ALERT_DECODE_ERROR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TLS_ALERT_DECODE_ERROR@GOTPAGEOFF]
LBB0_4:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_tlsv1_server_alert
LBB0_5:
	mov	w0, #-1
LBB0_6:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_7:
	asr	x21, x8, #2
	str	x21, [sp, #24]
Lloh7:
	adrp	x24, _TLS_PRE_MASTER_SECRET_LEN@GOTPAGE
Lloh8:
	ldr	x24, [x24, _TLS_PRE_MASTER_SECRET_LEN@GOTPAGEOFF]
	ldr	x8, [x24]
	cmp	x21, x8
	csel	x0, x21, x8, hi
	bl	_os_malloc
	cbz	x0, LBB0_19
; %bb.8:
	mov	x20, x0
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	add	x4, sp, #24
	mov	x1, x23
	mov	x2, x22
	mov	x3, x20
	bl	_crypto_private_key_decrypt_pkcs1_v15
Lloh9:
	adrp	x23, _MSG_DEBUG@GOTPAGE
Lloh10:
	ldr	x23, [x23, _MSG_DEBUG@GOTPAGEOFF]
	tbnz	x0, #63, LBB0_12
; %bb.9:
	ldr	x8, [sp, #24]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.10:
	mov	x0, x20
	bl	_WPA_GET_BE16
	ldr	x8, [x19]
	cmp	x0, x8
	b.eq	LBB0_17
; %bb.11:
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_14
LBB0_12:
	ldr	w0, [x23]
	ldr	x8, [sp, #24]
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	stp	x22, x8, [sp]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_wpa_printf
	b	LBB0_15
LBB0_13:
	str	x8, [sp]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_14:
	mov	x0, x19
	bl	_tlsv1_server_log
LBB0_15:
	ldr	w0, [x23]
Lloh17:
	adrp	x1, l_.str.4@PAGE
Lloh18:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_wpa_printf
	ldr	x1, [x24]
	str	x1, [sp, #24]
	mov	x0, x20
	bl	_os_get_random
	cbz	x0, LBB0_17
; %bb.16:
	ldr	w0, [x23]
Lloh19:
	adrp	x1, l_.str.5@PAGE
Lloh20:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_wpa_printf
Lloh21:
	adrp	x8, _TLS_ALERT_LEVEL_FATAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _TLS_ALERT_LEVEL_FATAL@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _TLS_ALERT_INTERNAL_ERROR@GOTPAGE
Lloh25:
	ldr	x8, [x8, _TLS_ALERT_INTERNAL_ERROR@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_tlsv1_server_alert
	mov	x0, x20
	bl	_os_free
	b	LBB0_5
LBB0_17:
	ldr	x2, [sp, #24]
	mov	x0, x19
	mov	x1, x20
	bl	_tlsv1_server_derive_keys
	mov	x22, x0
	mov	x0, x20
	mov	w1, #0
	mov	x2, x21
	bl	_os_memset
	mov	x0, x20
	bl	_os_free
	cbz	w22, LBB0_20
; %bb.18:
	ldr	w0, [x23]
Lloh27:
	adrp	x1, l_.str.6@PAGE
Lloh28:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_wpa_printf
LBB0_19:
Lloh29:
	adrp	x8, _TLS_ALERT_LEVEL_FATAL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _TLS_ALERT_LEVEL_FATAL@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
Lloh32:
	adrp	x8, _TLS_ALERT_INTERNAL_ERROR@GOTPAGE
Lloh33:
	ldr	x8, [x8, _TLS_ALERT_INTERNAL_ERROR@GOTPAGEOFF]
	b	LBB0_4
LBB0_20:
	mov	w0, #0
	b	LBB0_6
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_TLS_ALERT_LEVEL_FATAL,4,2      ; @TLS_ALERT_LEVEL_FATAL
	.comm	_TLS_ALERT_DECODE_ERROR,4,2     ; @TLS_ALERT_DECODE_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid ClientKeyExchange format: encr_len=%u left=%u"

	.comm	_TLS_PRE_MASTER_SECRET_LEN,8,3  ; @TLS_PRE_MASTER_SECRET_LEN
	.comm	_TLS_ALERT_INTERNAL_ERROR,4,2   ; @TLS_ALERT_INTERNAL_ERROR
	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
l_.str.1:                               ; @.str.1
	.asciz	"TLSv1: Failed to decrypt PreMasterSecret (encr_len=%u outlen=%lu)"

l_.str.2:                               ; @.str.2
	.asciz	"Unexpected PreMasterSecret length %lu"

l_.str.3:                               ; @.str.3
	.asciz	"Client version in ClientKeyExchange does not match with version in ClientHello"

l_.str.4:                               ; @.str.4
	.asciz	"TLSv1: Using random premaster secret to avoid revealing information about private key"

l_.str.5:                               ; @.str.5
	.asciz	"TLSv1: Failed to get random data"

l_.str.6:                               ; @.str.6
	.asciz	"TLSv1: Failed to derive keys"

	.no_dead_strip	_tls_process_client_key_exchange_rsa
.subsections_via_symbols
