	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tls_open
_tls_open:                              ## @tls_open
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rdx
	movq	%rdi, %r14
	movq	(%rdi), %r15
	leaq	16(%r15), %rdi
	movl	$0, -32(%rbp)
	movq	$0, -40(%rbp)
	movq	%r14, %rsi
	callq	_ff_tls_open_underlying
	testl	%eax, %eax
	js	LBB0_6
## %bb.1:
	cmpq	$0, 24(%r15)
	je	LBB0_3
## %bb.2:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
LBB0_6:
	movl	%eax, %ebx
LBB0_7:
	movq	%r14, %rdi
	callq	_tls_close
LBB0_8:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_SCHANNEL_CRED_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	movq	_SCH_CRED_MANUAL_CRED_VALIDATION@GOTPCREL(%rip), %rax
	movq	_SCH_CRED_IGNORE_NO_REVOCATION_CHECK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_SCH_CRED_REVOCATION_CHECK_CHAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_SCH_CRED_IGNORE_REVOCATION_OFFLINE@GOTPCREL(%rip), %rdx
	movq	_SCH_CRED_AUTO_CRED_VALIDATION@GOTPCREL(%rip), %rsi
	orl	(%rdx), %ecx
	orl	(%rsi), %eax
	cmpq	$0, 16(%r15)
	cmovel	%ecx, %eax
	movl	%eax, -40(%rbp)
	movq	_UNISP_NAME@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_SECPKG_CRED_OUTBOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	8(%r15), %rax
	leaq	4(%r15), %rbx
	subq	$8, %rsp
	leaq	-40(%rbp), %r8
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	xorl	%r9d, %r9d
	pushq	%rbx
	pushq	%rax
	pushq	$0
	callq	_AcquireCredentialsHandle
	addq	$32, %rsp
	movq	_SEC_E_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.5:
	movq	%r14, %rdi
	callq	_tls_client_handshake
	testl	%eax, %eax
	js	LBB0_6
## %bb.9:
	movl	$1, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_4:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_av_log
	movq	_AVERROR_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TLS Listen Sockets with SChannel is not implemented.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SCHANNEL_CRED_VERSION,4,2      ## @SCHANNEL_CRED_VERSION
	.comm	_SCH_CRED_AUTO_CRED_VALIDATION,4,2 ## @SCH_CRED_AUTO_CRED_VALIDATION
	.comm	_SCH_CRED_REVOCATION_CHECK_CHAIN,4,2 ## @SCH_CRED_REVOCATION_CHECK_CHAIN
	.comm	_SCH_CRED_MANUAL_CRED_VALIDATION,4,2 ## @SCH_CRED_MANUAL_CRED_VALIDATION
	.comm	_SCH_CRED_IGNORE_NO_REVOCATION_CHECK,4,2 ## @SCH_CRED_IGNORE_NO_REVOCATION_CHECK
	.comm	_SCH_CRED_IGNORE_REVOCATION_OFFLINE,4,2 ## @SCH_CRED_IGNORE_REVOCATION_OFFLINE
	.comm	_UNISP_NAME,8,3                 ## @UNISP_NAME
	.comm	_SECPKG_CRED_OUTBOUND,4,2       ## @SECPKG_CRED_OUTBOUND
	.comm	_SEC_E_OK,8,3                   ## @SEC_E_OK
L_.str.1:                               ## @.str.1
	.asciz	"Unable to acquire security credentials (0x%lx)\n"

	.comm	_AVERROR_UNKNOWN,4,2            ## @AVERROR_UNKNOWN
	.no_dead_strip	_tls_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tls_open
_tls_open:                              ; @tls_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x2, x1
	mov	x19, x0
	ldr	x21, [x0]
	add	x0, x21, #16
	str	wzr, [sp, #24]
	str	xzr, [sp, #16]
	mov	x1, x19
	bl	_ff_tls_open_underlying
	tbnz	w0, #31, LBB0_3
; %bb.1:
	ldr	x8, [x21, #24]
	cbz	x8, LBB0_6
; %bb.2:
Lloh0:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_AVERROR
LBB0_3:
	mov	x20, x0
LBB0_4:
	mov	x0, x19
	bl	_tls_close
LBB0_5:
	mov	x0, x20
	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
	add	sp, sp, #80
	ret
LBB0_6:
Lloh8:
	adrp	x8, _SCHANNEL_CRED_VERSION@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SCHANNEL_CRED_VERSION@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	x9, [x21, #16]
Lloh11:
	adrp	x10, _SCH_CRED_MANUAL_CRED_VALIDATION@GOTPAGE
Lloh12:
	ldr	x10, [x10, _SCH_CRED_MANUAL_CRED_VALIDATION@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
Lloh14:
	adrp	x11, _SCH_CRED_IGNORE_NO_REVOCATION_CHECK@GOTPAGE
Lloh15:
	ldr	x11, [x11, _SCH_CRED_IGNORE_NO_REVOCATION_CHECK@GOTPAGEOFF]
Lloh16:
	ldr	w11, [x11]
	orr	w10, w11, w10
Lloh17:
	adrp	x11, _SCH_CRED_REVOCATION_CHECK_CHAIN@GOTPAGE
Lloh18:
	ldr	x11, [x11, _SCH_CRED_REVOCATION_CHECK_CHAIN@GOTPAGEOFF]
Lloh19:
	ldr	w11, [x11]
Lloh20:
	adrp	x12, _SCH_CRED_IGNORE_REVOCATION_OFFLINE@GOTPAGE
Lloh21:
	ldr	x12, [x12, _SCH_CRED_IGNORE_REVOCATION_OFFLINE@GOTPAGEOFF]
Lloh22:
	ldr	w12, [x12]
	orr	w10, w10, w12
Lloh23:
	adrp	x12, _SCH_CRED_AUTO_CRED_VALIDATION@GOTPAGE
Lloh24:
	ldr	x12, [x12, _SCH_CRED_AUTO_CRED_VALIDATION@GOTPAGEOFF]
Lloh25:
	ldr	w12, [x12]
	orr	w11, w11, w12
	cmp	x9, #0
	csel	w9, w10, w11, eq
	stp	w9, w8, [sp, #16]
Lloh26:
	adrp	x8, _UNISP_NAME@GOTPAGE
Lloh27:
	ldr	x8, [x8, _UNISP_NAME@GOTPAGEOFF]
Lloh28:
	ldr	x1, [x8]
Lloh29:
	adrp	x8, _SECPKG_CRED_OUTBOUND@GOTPAGE
Lloh30:
	ldr	x8, [x8, _SECPKG_CRED_OUTBOUND@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	add	x7, x21, #8
	add	x8, x21, #4
	str	x8, [sp]
	add	x4, sp, #16
	mov	x0, #0
	mov	x3, #0
	mov	x5, #0
	mov	x6, #0
	bl	_AcquireCredentialsHandle
Lloh32:
	adrp	x8, _SEC_E_OK@GOTPAGE
Lloh33:
	ldr	x8, [x8, _SEC_E_OK@GOTPAGEOFF]
Lloh34:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.7:
	mov	x0, x19
	bl	_tls_client_handshake
	tbnz	w0, #31, LBB0_3
; %bb.8:
	mov	w20, #0
	mov	w8, #1
	str	w8, [x21]
	b	LBB0_5
LBB0_9:
Lloh35:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh36:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	str	x0, [sp]
Lloh38:
	adrp	x2, l_.str.1@PAGE
Lloh39:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_av_log
Lloh40:
	adrp	x8, _AVERROR_UNKNOWN@GOTPAGE
Lloh41:
	ldr	x8, [x8, _AVERROR_UNKNOWN@GOTPAGEOFF]
Lloh42:
	ldr	w20, [x8]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TLS Listen Sockets with SChannel is not implemented.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SCHANNEL_CRED_VERSION,4,2      ; @SCHANNEL_CRED_VERSION
	.comm	_SCH_CRED_AUTO_CRED_VALIDATION,4,2 ; @SCH_CRED_AUTO_CRED_VALIDATION
	.comm	_SCH_CRED_REVOCATION_CHECK_CHAIN,4,2 ; @SCH_CRED_REVOCATION_CHECK_CHAIN
	.comm	_SCH_CRED_MANUAL_CRED_VALIDATION,4,2 ; @SCH_CRED_MANUAL_CRED_VALIDATION
	.comm	_SCH_CRED_IGNORE_NO_REVOCATION_CHECK,4,2 ; @SCH_CRED_IGNORE_NO_REVOCATION_CHECK
	.comm	_SCH_CRED_IGNORE_REVOCATION_OFFLINE,4,2 ; @SCH_CRED_IGNORE_REVOCATION_OFFLINE
	.comm	_UNISP_NAME,8,3                 ; @UNISP_NAME
	.comm	_SECPKG_CRED_OUTBOUND,4,2       ; @SECPKG_CRED_OUTBOUND
	.comm	_SEC_E_OK,8,3                   ; @SEC_E_OK
l_.str.1:                               ; @.str.1
	.asciz	"Unable to acquire security credentials (0x%lx)\n"

	.comm	_AVERROR_UNKNOWN,4,2            ; @AVERROR_UNKNOWN
	.no_dead_strip	_tls_open
.subsections_via_symbols
