	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function check_and_store_certs
_check_and_store_certs:                 ## @check_and_store_certs
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movl	%edi, %ebx
	movq	$8, -88(%rbp)
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_TRACE
	movl	%r15d, %edi
	callq	_CertDuplicateStore
	movq	_CERT_SYSTEM_STORE_CURRENT_USER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-88(%rbp), %rdx
	movl	%r15d, %edi
	callq	_CRYPT_CreateChainEngine
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_15
## %bb.1:
	xorl	%r14d, %r14d
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_CertEnumCertificatesInStore
	testq	%rax, %rax
	je	LBB0_14
## %bb.2:
	xorl	%r14d, %r14d
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	callq	_get_cert_common_name
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	leaq	L_.str.2(%rip), %rdx
	xorl	%eax, %eax
	callq	_TRACE
	movq	%r13, %rsi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	%ebx, %edi
	callq	_CertEnumCertificatesInStore
	testq	%rax, %rax
	je	LBB0_14
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
                                        ##       Child Loop BB0_10 Depth 3
	movq	_CERT_TRUST_IS_UNTRUSTED_ROOT@GOTPCREL(%rip), %r12
	movq	$8, -80(%rbp)
	movq	_CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	xorl	%edx, %edx
	movl	%ebx, %ecx
	leaq	-80(%rbp), %r8
	leaq	-56(%rbp), %rbx
	pushq	%rbx
	pushq	$0
	movq	%rax, %r13
	callq	_CertGetCertificateChain
	addq	$16, %rsp
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	_CERT_TRUST_IS_NOT_VALID_FOR_USAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%r12), %eax
	movq	_CERT_TRUST_INVALID_BASIC_CONSTRAINTS@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_CERT_TRUST_IS_NOT_TIME_VALID@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	-56(%rbp), %rdi
	notl	%eax
	testl	%eax, 16(%rdi)
	je	LBB0_6
## %bb.16:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_get_cert_common_name
	movl	%eax, %r12d
	movq	-56(%rbp), %rax
	movq	_CERT_TRUST_IS_UNTRUSTED_ROOT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	notl	%edi
	andl	16(%rax), %edi
	callq	_trust_status_to_str
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_TRACE
	movq	-56(%rbp), %rdi
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	callq	_CertFreeCertificateChain
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$0, (%rdi)
	jle	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%r12d, %r12d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=2
	incq	%r12
	movslq	(%rdi), %rax
	cmpq	%rax, %r12
	jge	LBB0_12
LBB0_8:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_10 Depth 3
	movq	8(%rdi), %rax
	movq	(%rax,%r12,8), %rax
	cmpl	$0, (%rax)
	jle	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	xorl	%r13d, %r13d
	movq	_CERT_STORE_ADD_NEW@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_3 Depth=1
                                        ##     Parent Loop BB0_8 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	8(%rax), %rax
	movq	(%rax,%r13,8), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	movl	%r15d, %edi
	xorl	%ecx, %ecx
	callq	_CertAddCertificateContextToStore
	cmpq	$1, %rax
	sbbl	$-1, %r14d
	incq	%r13
	movq	-56(%rbp), %rdi
	movq	8(%rdi), %rax
	movq	(%rax,%r12,8), %rax
	movslq	(%rax), %rcx
	cmpq	%rcx, %r13
	jl	LBB0_10
	jmp	LBB0_11
LBB0_14:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_CertFreeCertificateChainEngine
LBB0_15:
	leaq	L_.str.3(%rip), %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_TRACE
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n"

	.comm	_CERT_SYSTEM_STORE_CURRENT_USER,4,2 ## @CERT_SYSTEM_STORE_CURRENT_USER
	.comm	_CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL,4,2 ## @CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL
L_.str.1:                               ## @.str.1
	.asciz	"rejecting %s: %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"chain creation failed"

	.comm	_CERT_TRUST_IS_UNTRUSTED_ROOT,4,2 ## @CERT_TRUST_IS_UNTRUSTED_ROOT
	.comm	_CERT_TRUST_IS_NOT_VALID_FOR_USAGE,4,2 ## @CERT_TRUST_IS_NOT_VALID_FOR_USAGE
	.comm	_CERT_TRUST_INVALID_BASIC_CONSTRAINTS,4,2 ## @CERT_TRUST_INVALID_BASIC_CONSTRAINTS
	.comm	_CERT_TRUST_IS_NOT_TIME_VALID,4,2 ## @CERT_TRUST_IS_NOT_TIME_VALID
	.comm	_CERT_STORE_ADD_NEW,4,2         ## @CERT_STORE_ADD_NEW
L_.str.3:                               ## @.str.3
	.asciz	"Added %d root certificates\n"

	.no_dead_strip	_check_and_store_certs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function check_and_store_certs
_check_and_store_certs:                 ; @check_and_store_certs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	mov	x19, x1
	mov	x20, x0
	mov	w8, #8
	str	x8, [sp, #40]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	mov	x0, x19
	bl	_CertDuplicateStore
Lloh2:
	adrp	x8, _CERT_SYSTEM_STORE_CURRENT_USER@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CERT_SYSTEM_STORE_CURRENT_USER@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	add	x2, sp, #40
	mov	x0, x19
	bl	_CRYPT_CreateChainEngine
	cbz	x0, LBB0_15
; %bb.1:
	mov	x21, x0
	mov	x0, x20
	mov	x1, #0
	bl	_CertEnumCertificatesInStore
	cbz	x0, LBB0_16
; %bb.2:
	mov	x22, x0
	mov	w25, #0
Lloh5:
	adrp	x27, _CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL@GOTPAGE
Lloh6:
	ldr	x27, [x27, _CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL@GOTPAGEOFF]
Lloh7:
	adrp	x28, _CERT_TRUST_IS_UNTRUSTED_ROOT@GOTPAGE
Lloh8:
	ldr	x28, [x28, _CERT_TRUST_IS_UNTRUSTED_ROOT@GOTPAGEOFF]
Lloh9:
	adrp	x23, _CERT_STORE_ADD_NEW@GOTPAGE
Lloh10:
	ldr	x23, [x23, _CERT_STORE_ADD_NEW@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	bl	_get_cert_common_name
                                        ; kill: def $w0 killed $w0 def $x0
Lloh11:
	adrp	x8, l_.str.2@PAGE
Lloh12:
	add	x8, x8, l_.str.2@PAGEOFF
	stp	x0, x8, [sp]
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_CertEnumCertificatesInStore
	mov	x22, x0
	cbz	x0, LBB0_17
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_12 Depth 2
                                        ;       Child Loop BB0_14 Depth 3
	mov	w8, #8
	str	x8, [sp, #32]
	ldr	w5, [x27]
	add	x4, sp, #32
	add	x7, sp, #24
	mov	x0, x21
	mov	x1, x22
	mov	x2, #0
	mov	x3, x20
	mov	x6, #0
	bl	_CertGetCertificateChain
	cbz	w0, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x28]
Lloh15:
	adrp	x9, _CERT_TRUST_IS_NOT_VALID_FOR_USAGE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _CERT_TRUST_IS_NOT_VALID_FOR_USAGE@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh18:
	adrp	x9, _CERT_TRUST_INVALID_BASIC_CONSTRAINTS@GOTPAGE
Lloh19:
	ldr	x9, [x9, _CERT_TRUST_INVALID_BASIC_CONSTRAINTS@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh21:
	adrp	x9, _CERT_TRUST_IS_NOT_TIME_VALID@GOTPAGE
Lloh22:
	ldr	x9, [x9, _CERT_TRUST_IS_NOT_TIME_VALID@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	x0, [sp, #24]
	ldr	w9, [x0, #16]
	bics	wzr, w9, w8
	b.eq	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	bl	_get_cert_common_name
	mov	x24, x0
	ldr	x8, [sp, #24]
	ldr	w8, [x8, #16]
	ldr	w9, [x28]
	bic	w0, w8, w9
	bl	_trust_status_to_str
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x24, x0, [sp]
Lloh24:
	adrp	x0, l_.str.1@PAGE
Lloh25:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
	ldr	x0, [sp, #24]
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	bl	_CertFreeCertificateChain
	b	LBB0_4
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x24, #0
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=2
	add	x24, x24, #1
	ldrsw	x8, [x0]
	cmp	x24, x8
	b.ge	LBB0_8
LBB0_12:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_14 Depth 3
	ldr	x8, [x0, #8]
	ldr	x8, [x8, x24, lsl #3]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
	mov	x26, #0
LBB0_14:                                ;   Parent Loop BB0_5 Depth=1
                                        ;     Parent Loop BB0_12 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	x8, [x8, #8]
	ldr	x8, [x8, x26, lsl #3]
	ldr	w1, [x8]
	ldr	w2, [x23]
	mov	x0, x19
	mov	x3, #0
	bl	_CertAddCertificateContextToStore
	cmp	x0, #0
	cinc	w25, w25, ne
	add	x26, x26, #1
	ldr	x0, [sp, #24]
	ldr	x8, [x0, #8]
	ldr	x8, [x8, x24, lsl #3]
	ldrsw	x9, [x8]
	cmp	x26, x9
	b.lt	LBB0_14
	b	LBB0_11
LBB0_15:
	mov	w25, #0
	b	LBB0_18
LBB0_16:
	mov	w25, #0
LBB0_17:
	mov	x0, x21
	bl	_CertFreeCertificateChainEngine
LBB0_18:
	str	x25, [sp]
Lloh26:
	adrp	x0, l_.str.3@PAGE
Lloh27:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_TRACE
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

	.comm	_CERT_SYSTEM_STORE_CURRENT_USER,4,2 ; @CERT_SYSTEM_STORE_CURRENT_USER
	.comm	_CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL,4,2 ; @CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL
l_.str.1:                               ; @.str.1
	.asciz	"rejecting %s: %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"chain creation failed"

	.comm	_CERT_TRUST_IS_UNTRUSTED_ROOT,4,2 ; @CERT_TRUST_IS_UNTRUSTED_ROOT
	.comm	_CERT_TRUST_IS_NOT_VALID_FOR_USAGE,4,2 ; @CERT_TRUST_IS_NOT_VALID_FOR_USAGE
	.comm	_CERT_TRUST_INVALID_BASIC_CONSTRAINTS,4,2 ; @CERT_TRUST_INVALID_BASIC_CONSTRAINTS
	.comm	_CERT_TRUST_IS_NOT_TIME_VALID,4,2 ; @CERT_TRUST_IS_NOT_TIME_VALID
	.comm	_CERT_STORE_ADD_NEW,4,2         ; @CERT_STORE_ADD_NEW
l_.str.3:                               ; @.str.3
	.asciz	"Added %d root certificates\n"

	.no_dead_strip	_check_and_store_certs
.subsections_via_symbols
