	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function client_hello_select_server_ctx
_client_hello_select_server_ctx:        ## @client_hello_select_server_ctx
	.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
	movl	%edx, %r12d
	movq	%rsi, %r13
	movq	%rdi, %rbx
	movq	_ex_data_idx@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_SSL_get_ex_data
	movq	%rax, %r14
	movq	_TLSEXT_TYPE_server_name@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	leaq	-56(%rbp), %rcx
	movq	%rbx, %rdi
	callq	_SSL_client_hello_get0_ext
	xorl	%r15d, %r15d
	testl	%eax, %eax
	je	LBB0_15
## %bb.1:
	movq	-56(%rbp), %rdx
	cmpq	$3, %rdx
	jb	LBB0_15
## %bb.2:
	movq	-48(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	%rcx, -48(%rbp)
	movzbl	(%rax), %ecx
	shlq	$8, %rcx
	leaq	2(%rax), %rsi
	movq	%rsi, -48(%rbp)
	movzbl	1(%rax), %esi
	leaq	(%rcx,%rsi), %rdi
	addq	$2, %rdi
	cmpq	%rdx, %rdi
	jne	LBB0_15
## %bb.3:
	orq	%rsi, %rcx
	movq	%rcx, -56(%rbp)
	testq	%rcx, %rcx
	je	LBB0_15
## %bb.4:
	leaq	3(%rax), %rdx
	movq	%rdx, -48(%rbp)
	movzbl	2(%rax), %edx
	movq	_TLSEXT_NAMETYPE_host_name@GOTPCREL(%rip), %rsi
	cmpl	%edx, (%rsi)
	jne	LBB0_15
## %bb.5:
	decq	%rcx
	movq	%rcx, -56(%rbp)
	cmpq	$3, %rcx
	jb	LBB0_15
## %bb.6:
	leaq	4(%rax), %rdx
	movq	%rdx, -48(%rbp)
	movzbl	3(%rax), %edx
	shlq	$8, %rdx
	leaq	5(%rax), %rdi
	movq	%rdi, -48(%rbp)
	movzbl	4(%rax), %eax
	leaq	(%rdx,%rax), %rsi
	addq	$2, %rsi
	cmpq	%rcx, %rsi
	ja	LBB0_15
## %bb.7:
	orq	%rax, %rdx
	movq	%rdx, -56(%rbp)
	cmpq	$7, %rdx
	jne	LBB0_12
## %bb.8:
	leaq	L_.str(%rip), %rsi
	movl	$7, %edx
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	leaq	L_.str.1(%rip), %rsi
	movl	$7, %edx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_strncmp
	movq	_SSL_TEST_SERVERNAME_SERVER1@GOTPCREL(%rip), %rcx
	testq	%rax, %rax
	je	LBB0_14
## %bb.11:
	testl	%r12d, %r12d
	je	LBB0_15
	jmp	LBB0_14
LBB0_12:
	testl	%r12d, %r12d
	je	LBB0_15
## %bb.13:
	movq	_SSL_TEST_SERVERNAME_SERVER1@GOTPCREL(%rip), %rcx
	jmp	LBB0_14
LBB0_9:
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_SSL_set_SSL_CTX
	movq	%rbx, %rdi
	movl	$-1, %esi
	callq	_SSL_clear_options
	movq	%r13, %rdi
	callq	_SSL_CTX_get_options
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_SSL_set_options
	movq	_SSL_TEST_SERVERNAME_SERVER2@GOTPCREL(%rip), %rcx
LBB0_14:
	movq	(%rcx), %rax
	movq	%rax, (%r14)
	movl	$1, %r15d
LBB0_15:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ex_data_idx,4,2                ## @ex_data_idx
	.comm	_TLSEXT_TYPE_server_name,4,2    ## @TLSEXT_TYPE_server_name
	.comm	_TLSEXT_NAMETYPE_host_name,4,2  ## @TLSEXT_NAMETYPE_host_name
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"server2"

	.comm	_SSL_TEST_SERVERNAME_SERVER2,8,3 ## @SSL_TEST_SERVERNAME_SERVER2
L_.str.1:                               ## @.str.1
	.asciz	"server1"

	.comm	_SSL_TEST_SERVERNAME_SERVER1,8,3 ## @SSL_TEST_SERVERNAME_SERVER1
	.no_dead_strip	_client_hello_select_server_ctx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function client_hello_select_server_ctx
_client_hello_select_server_ctx:        ; @client_hello_select_server_ctx
	.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, x2
	mov	x22, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _ex_data_idx@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ex_data_idx@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_SSL_get_ex_data
	mov	x19, x0
Lloh3:
	adrp	x8, _TLSEXT_TYPE_server_name@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TLSEXT_TYPE_server_name@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x3, sp
	mov	x0, x21
	bl	_SSL_client_hello_get0_ext
	ldr	x10, [sp]
	cmp	w0, #0
	ccmp	x10, #3, #0, ne
	b.lo	LBB0_6
; %bb.1:
	ldr	x8, [sp, #8]
	add	x9, x8, #1
	str	x9, [sp, #8]
	ldrb	w11, [x8]
	add	x9, x8, #2
	str	x9, [sp, #8]
	ldrb	w9, [x8, #1]
	bfi	x9, x11, #8, #8
	add	x11, x9, #2
	cmp	x11, x10
	b.ne	LBB0_6
; %bb.2:
	str	x9, [sp]
	cbz	x9, LBB0_6
; %bb.3:
	add	x10, x8, #3
	str	x10, [sp, #8]
	ldrb	w10, [x8, #2]
Lloh6:
	adrp	x11, _TLSEXT_NAMETYPE_host_name@GOTPAGE
Lloh7:
	ldr	x11, [x11, _TLSEXT_NAMETYPE_host_name@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x11]
	cmp	w11, w10
	b.ne	LBB0_6
; %bb.4:
	sub	x9, x9, #1
	str	x9, [sp]
	cmp	x9, #3
	b.lo	LBB0_6
; %bb.5:
	add	x10, x8, #4
	str	x10, [sp, #8]
	ldrb	w10, [x8, #3]
	add	x23, x8, #5
	str	x23, [sp, #8]
	ldrb	w8, [x8, #4]
	bfi	x8, x10, #8, #8
	add	x10, x8, #2
	cmp	x10, x9
	b.ls	LBB0_8
LBB0_6:
	mov	w0, #0
LBB0_7:
	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_8:
	str	x8, [sp]
	cmp	x8, #7
	b.ne	LBB0_12
; %bb.9:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	mov	w2, #7
	bl	_strncmp
	cbz	x0, LBB0_14
; %bb.10:
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
	mov	w2, #7
	bl	_strncmp
Lloh13:
	adrp	x8, _SSL_TEST_SERVERNAME_SERVER1@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SSL_TEST_SERVERNAME_SERVER1@GOTPAGEOFF]
	cbz	x0, LBB0_15
; %bb.11:
	cbz	w20, LBB0_6
	b	LBB0_15
LBB0_12:
	cbz	w20, LBB0_6
; %bb.13:
Lloh15:
	adrp	x8, _SSL_TEST_SERVERNAME_SERVER1@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SSL_TEST_SERVERNAME_SERVER1@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:
	mov	x0, x21
	mov	x1, x22
	bl	_SSL_set_SSL_CTX
	mov	x0, x21
	mov	w1, #-1
	bl	_SSL_clear_options
	mov	x0, x22
	bl	_SSL_CTX_get_options
	mov	x1, x0
	mov	x0, x21
	bl	_SSL_set_options
Lloh17:
	adrp	x8, _SSL_TEST_SERVERNAME_SERVER2@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SSL_TEST_SERVERNAME_SERVER2@GOTPAGEOFF]
LBB0_15:
	ldr	x8, [x8]
	str	x8, [x19]
	mov	w0, #1
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_ex_data_idx,4,2                ; @ex_data_idx
	.comm	_TLSEXT_TYPE_server_name,4,2    ; @TLSEXT_TYPE_server_name
	.comm	_TLSEXT_NAMETYPE_host_name,4,2  ; @TLSEXT_NAMETYPE_host_name
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"server2"

	.comm	_SSL_TEST_SERVERNAME_SERVER2,8,3 ; @SSL_TEST_SERVERNAME_SERVER2
l_.str.1:                               ; @.str.1
	.asciz	"server1"

	.comm	_SSL_TEST_SERVERNAME_SERVER1,8,3 ; @SSL_TEST_SERVERNAME_SERVER1
	.no_dead_strip	_client_hello_select_server_ctx
.subsections_via_symbols
