	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tlsv1_server_handshake         ## -- Begin function tlsv1_server_handshake
	.p2align	4, 0x90
_tlsv1_server_handshake:                ## @tlsv1_server_handshake
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	movq	%rdx, %r15
	testq	%rdx, %rdx
	je	LBB0_2
## %bb.3:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_os_malloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r12
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	testq	%r15, %r15
	jle	LBB0_18
## %bb.6:
	leaq	(%rbx,%r15,4), %r13
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	24(%rax), %rdi
	leaq	-64(%rbp), %r8
	leaq	-52(%rbp), %r9
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, -120(%rbp)                ## 8-byte Spill
	movq	%r13, -112(%rbp)                ## 8-byte Spill
	movq	%rdi, -104(%rbp)                ## 8-byte Spill
	jmp	LBB0_7
LBB0_2:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_wpa_printf
	xorl	%r14d, %r14d
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_7 Depth=1
	movslq	-76(%rbp), %rax                 ## 4-byte Folded Reload
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	leaq	(%rbx,%rax,4), %rbx
	movq	-112(%rbp), %r13                ## 8-byte Reload
	cmpq	%r13, %rbx
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	-120(%rbp), %r15                ## 8-byte Reload
	movq	-104(%rbp), %rdi                ## 8-byte Reload
	movq	%r14, %r8
	leaq	-52(%rbp), %r9
	jae	LBB0_18
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_14 Depth 2
	movq	%r15, -64(%rbp)
	movq	%r13, %rdx
	subq	%rbx, %rdx
	shrq	$2, %rdx
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	movq	%r12, %rcx
	movq	%r8, %r14
	callq	_tlsv1_record_receive
	testl	%eax, %eax
	js	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	je	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	%eax, -76(%rbp)                 ## 4-byte Spill
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	-64(%rbp), %rax
	testq	%rax, %rax
	jle	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %r13d
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	leaq	(%r12,%rax,4), %rbx
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rax
	subq	%r12, %rax
	sarq	$2, %rax
	movq	%rax, -64(%rbp)
	movq	%r15, %rdi
	movl	%r13d, %esi
	movq	%r12, %rdx
	movq	%r14, %rcx
	callq	_tlsv1_server_process_handshake
	testq	%rax, %rax
	js	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=2
	movq	-64(%rbp), %rax
	leaq	(%r12,%rax,4), %r12
	cmpq	%rbx, %r12
	jb	LBB0_14
	jmp	LBB0_17
LBB0_4:
	xorl	%r14d, %r14d
	jmp	LBB0_23
LBB0_15:
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	xorl	%r14d, %r14d
	jmp	LBB0_19
LBB0_18:
	movq	%r12, %rdi
	callq	_os_free
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	callq	_tlsv1_server_handshake_write
	movq	%rax, %r14
	xorl	%r12d, %r12d
LBB0_19:
	movq	%r12, %rdi
	callq	_os_free
	cmpq	$0, 16(%r15)
	je	LBB0_23
## %bb.20:
	movq	_FAILED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, (%r15)
	jne	LBB0_22
## %bb.21:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_wpa_printf
	movq	%r14, %rdi
	callq	_os_free
	xorl	%r14d, %r14d
	jmp	LBB0_23
LBB0_22:
	movq	%rax, (%r15)
	movq	%r14, %rdi
	callq	_os_free
	movq	16(%r15), %rsi
	movl	12(%r15), %edx
	movq	%r15, %rdi
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	callq	_tlsv1_server_send_alert
	movq	%rax, %r14
	incl	8(%r15)
LBB0_23:
	movq	%r14, %rax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_wpa_printf
	movq	_TLS_ALERT_LEVEL_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-52(%rbp), %edx
	jmp	LBB0_9
LBB0_11:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	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
LBB0_9:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_tlsv1_server_alert
	xorl	%r14d, %r14d
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TLSv1: No input data to server"

L_.str.1:                               ## @.str.1
	.asciz	"TLSv1: Processing received record failed"

	.comm	_TLS_ALERT_LEVEL_FATAL,4,2      ## @TLS_ALERT_LEVEL_FATAL
L_.str.2:                               ## @.str.2
	.asciz	"TLSv1: Partial processing not yet supported"

	.comm	_TLS_ALERT_INTERNAL_ERROR,4,2   ## @TLS_ALERT_INTERNAL_ERROR
	.comm	_FAILED,8,3                     ## @FAILED
L_.str.3:                               ## @.str.3
	.asciz	"TLSv1: Drop alert loop"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tlsv1_server_handshake         ; -- Begin function tlsv1_server_handshake
	.p2align	2
_tlsv1_server_handshake:                ; @tlsv1_server_handshake
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cbz	x1, LBB0_5
; %bb.1:
	mov	x22, x2
	cbz	x2, LBB0_5
; %bb.2:
	mov	x20, x3
	mov	x23, x1
	mov	x19, x0
	mov	x0, x22
	bl	_os_malloc
	cbz	x0, LBB0_13
; %bb.3:
	mov	x21, x0
	str	x20, [sp, #8]                   ; 8-byte Folded Spill
	cmp	x22, #1
	b.lt	LBB0_14
; %bb.4:
	add	x28, x23, x22, lsl #2
	add	x24, x19, #24
	b	LBB0_7
LBB0_5:
Lloh0:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_wpa_printf
	mov	x22, #0
	b	LBB0_23
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x23, x23, w25, sxtw #2
	cmp	x23, x28
	b.hs	LBB0_14
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	str	x22, [sp, #16]
	sub	x8, x28, x23
	lsr	x2, x8, #2
	add	x4, sp, #16
	add	x5, sp, #28
	mov	x0, x24
	mov	x1, x23
                                        ; kill: def $w2 killed $w2 killed $x2
	mov	x3, x21
	bl	_tlsv1_record_receive
	tbnz	w0, #31, LBB0_15
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x25, x0
	cbz	w0, LBB0_16
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [sp, #16]
	cmp	x8, #1
	b.lt	LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w26, [x23]
	add	x20, x21, x8, lsl #2
	mov	x27, x21
LBB0_11:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	sub	x8, x20, x27
	asr	x8, x8, #2
	str	x8, [sp, #16]
	add	x3, sp, #16
	mov	x0, x19
	mov	x1, x26
	mov	x2, x27
	bl	_tlsv1_server_process_handshake
	tbnz	x0, #63, LBB0_18
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=2
	ldr	x8, [sp, #16]
	add	x27, x27, x8, lsl #2
	cmp	x27, x20
	b.lo	LBB0_11
	b	LBB0_6
LBB0_13:
	mov	x22, #0
	b	LBB0_23
LBB0_14:
	mov	x0, x21
	bl	_os_free
	mov	x0, x19
	ldr	x20, [sp, #8]                   ; 8-byte Folded Reload
	mov	x1, x20
	bl	_tlsv1_server_handshake_write
	mov	x22, x0
	mov	x21, #0
	b	LBB0_19
LBB0_15:
Lloh5:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_wpa_printf
Lloh10:
	adrp	x8, _TLS_ALERT_LEVEL_FATAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TLS_ALERT_LEVEL_FATAL@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	ldr	w2, [sp, #28]
	b	LBB0_17
LBB0_16:
Lloh13:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_wpa_printf
Lloh18:
	adrp	x8, _TLS_ALERT_LEVEL_FATAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _TLS_ALERT_LEVEL_FATAL@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x8, _TLS_ALERT_INTERNAL_ERROR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _TLS_ALERT_INTERNAL_ERROR@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
LBB0_17:
	mov	x0, x19
	bl	_tlsv1_server_alert
LBB0_18:
	mov	x22, #0
	ldr	x20, [sp, #8]                   ; 8-byte Folded Reload
LBB0_19:
	mov	x0, x21
	bl	_os_free
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_23
; %bb.20:
	ldr	x9, [x19]
Lloh24:
	adrp	x8, _FAILED@GOTPAGE
Lloh25:
	ldr	x8, [x8, _FAILED@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.21:
Lloh27:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
Lloh30:
	adrp	x1, l_.str.3@PAGE
Lloh31:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_wpa_printf
	mov	x0, x22
	bl	_os_free
	mov	x22, #0
	b	LBB0_23
LBB0_22:
	str	x8, [x19]
	mov	x0, x22
	bl	_os_free
	ldr	x1, [x19, #16]
	ldr	w2, [x19, #12]
	mov	x0, x19
	mov	x3, x20
	bl	_tlsv1_server_send_alert
	mov	x22, x0
	ldr	w8, [x19, #8]
	add	w8, w8, #1
	str	w8, [x19, #8]
LBB0_23:
	mov	x0, x22
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TLSv1: No input data to server"

l_.str.1:                               ; @.str.1
	.asciz	"TLSv1: Processing received record failed"

	.comm	_TLS_ALERT_LEVEL_FATAL,4,2      ; @TLS_ALERT_LEVEL_FATAL
l_.str.2:                               ; @.str.2
	.asciz	"TLSv1: Partial processing not yet supported"

	.comm	_TLS_ALERT_INTERNAL_ERROR,4,2   ; @TLS_ALERT_INTERNAL_ERROR
	.comm	_FAILED,8,3                     ; @FAILED
l_.str.3:                               ; @.str.3
	.asciz	"TLSv1: Drop alert loop"

.subsections_via_symbols
