	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cc_choose
_cc_choose:                             ## @cc_choose
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movl	%edx, %ebx
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_br_ssl_client_get_server_curve
	movq	_BR_KEYTYPE_KEYX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%r15)
	je	LBB0_4
## %bb.1:
	movq	24(%r15), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_4
## %bb.2:
	movq	8(%r15), %rax
	movq	_BR_KEYTYPE_RSA@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	setne	%dl
	shll	$16, %edx
	addl	$65536, %edx                    ## imm = 0x10000
	testl	%ebx, %edx
	je	LBB0_4
## %bb.3:
	movq	_BR_AUTH_ECDH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r14)
	movl	$-1, (%r14)
	movl	20(%r15), %eax
	movl	%eax, 8(%r14)
	movl	16(%r15), %eax
	movl	%eax, 4(%r14)
LBB0_4:
	sarl	$8, %ebx
	movl	%ebx, %edi
	callq	_br_ssl_choose_hash
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movq	_BR_KEYTYPE_SIGN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%r15)
	je	LBB0_7
## %bb.6:
	movq	_BR_AUTH_ECDSA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 12(%r14)
	movl	%eax, (%r14)
	movl	20(%r15), %eax
	movl	%eax, 8(%r14)
	movl	16(%r15), %eax
	movl	%eax, 4(%r14)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memset                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BR_KEYTYPE_KEYX,4,2            ## @BR_KEYTYPE_KEYX
	.comm	_BR_KEYTYPE_RSA,8,3             ## @BR_KEYTYPE_RSA
	.comm	_BR_AUTH_ECDH,4,2               ## @BR_AUTH_ECDH
	.comm	_BR_KEYTYPE_SIGN,4,2            ## @BR_KEYTYPE_SIGN
	.comm	_BR_AUTH_ECDSA,4,2              ## @BR_AUTH_ECDSA
	.no_dead_strip	_cc_choose
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cc_choose
_cc_choose:                             ; @cc_choose
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x3
	mov	x21, x2
	mov	x20, x0
	mov	x0, x1
	bl	_br_ssl_client_get_server_curve
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _BR_KEYTYPE_KEYX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BR_KEYTYPE_KEYX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.1:
	ldr	x8, [x20, #24]
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_4
; %bb.2:
	ldr	x8, [x20, #8]
Lloh3:
	adrp	x9, _BR_KEYTYPE_RSA@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BR_KEYTYPE_RSA@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	mov	w8, #131072
	mov	w9, #65536
	csel	w8, w9, w8, eq
	tst	w8, w21
	b.eq	LBB0_4
; %bb.3:
Lloh6:
	adrp	x8, _BR_AUTH_ECDH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BR_AUTH_ECDH@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x19, #12]
	mov	w8, #-1
	str	w8, [x19]
	ldr	d0, [x20, #16]
	stur	d0, [x19, #4]
LBB0_4:
	asr	w0, w21, #8
	bl	_br_ssl_choose_hash
	cbz	w0, LBB0_7
; %bb.5:
	ldr	w8, [x20]
Lloh9:
	adrp	x9, _BR_KEYTYPE_SIGN@GOTPAGE
Lloh10:
	ldr	x9, [x9, _BR_KEYTYPE_SIGN@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
Lloh12:
	adrp	x8, _BR_AUTH_ECDSA@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BR_AUTH_ECDSA@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x19, #12]
	str	w0, [x19]
	ldr	d0, [x20, #16]
	stur	d0, [x19, #4]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #16
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_memset
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_BR_KEYTYPE_KEYX,4,2            ; @BR_KEYTYPE_KEYX
	.comm	_BR_KEYTYPE_RSA,8,3             ; @BR_KEYTYPE_RSA
	.comm	_BR_AUTH_ECDH,4,2               ; @BR_AUTH_ECDH
	.comm	_BR_KEYTYPE_SIGN,4,2            ; @BR_KEYTYPE_SIGN
	.comm	_BR_AUTH_ECDSA,4,2              ; @BR_AUTH_ECDSA
	.no_dead_strip	_cc_choose
.subsections_via_symbols
