	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SCT_validate                   ## -- Begin function SCT_validate
	.p2align	4, 0x90
_SCT_validate:                          ## @SCT_validate
	.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
	movq	%rdi, %r13
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	movq	(%rdi), %rax
	movq	_SCT_VERSION_V1@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.3:
	movq	%rsi, %r12
	movl	16(%rsi), %edi
	movl	16(%r13), %edx
	movl	20(%r13), %esi
	callq	_CTLOG_STORE_get0_log_by_id
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_SCT_CTX_new
	movq	%rax, %r14
	movl	$-1, %r15d
	testq	%rax, %rax
	je	LBB0_18
## %bb.6:
	movq	%rbx, %rdi
	callq	_CTLOG_get0_public_key
	leaq	-48(%rbp), %rdi
	movq	%rax, %rsi
	callq	_X509_PUBKEY_set
	cmpl	$1, %eax
	jne	LBB0_18
## %bb.7:
	movq	-48(%rbp), %rsi
	movq	%r14, %rdi
	callq	_SCT_CTX_set1_pubkey
	cmpl	$1, %eax
	jne	LBB0_18
## %bb.8:
	movq	%r13, %rdi
	callq	_SCT_get_log_entry_type
	movq	_CT_LOG_ENTRY_TYPE_PRECERT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.9:
	movq	8(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_13
## %bb.10:
	callq	_X509_get0_pubkey
	leaq	-56(%rbp), %rdi
	movq	%rax, %rsi
	callq	_X509_PUBKEY_set
	cmpl	$1, %eax
	jne	LBB0_18
## %bb.11:
	movq	-56(%rbp), %rsi
	movq	%r14, %rdi
	callq	_SCT_CTX_set1_issuer_pubkey
	cmpl	$1, %eax
	jne	LBB0_18
LBB0_12:
	movl	4(%r12), %esi
	movq	%r14, %rdi
	callq	_SCT_CTX_set_time
	movl	(%r12), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_SCT_CTX_set1_cert
	cmpl	$1, %eax
	jne	LBB0_13
## %bb.14:
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_SCT_CTX_verify
	cmpl	$1, %eax
	jne	LBB0_15
## %bb.16:
	movq	_SCT_VALIDATION_STATUS_VALID@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_1:
	movq	_SCT_VALIDATION_STATUS_UNKNOWN_VERSION@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movq	_SCT_VALIDATION_STATUS_UNKNOWN_LOG@GOTPCREL(%rip), %rax
LBB0_2:
	movq	(%rax), %rax
	movq	%rax, 8(%r13)
	xorl	%r15d, %r15d
	jmp	LBB0_19
LBB0_13:
	movq	_SCT_VALIDATION_STATUS_UNVERIFIED@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_15:
	movq	_SCT_VALIDATION_STATUS_INVALID@GOTPCREL(%rip), %rax
LBB0_17:
	movq	(%rax), %rax
	movq	%rax, 8(%r13)
	movq	_SCT_VALIDATION_STATUS_VALID@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	cmpq	(%rcx), %rax
	sete	%r15b
LBB0_18:
	movq	-56(%rbp), %rdi
	callq	_X509_PUBKEY_free
	movq	-48(%rbp), %rdi
	callq	_X509_PUBKEY_free
	movq	%r14, %rdi
	callq	_SCT_CTX_free
LBB0_19:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SCT_VERSION_V1,8,3             ## @SCT_VERSION_V1
	.comm	_SCT_VALIDATION_STATUS_UNKNOWN_VERSION,8,3 ## @SCT_VALIDATION_STATUS_UNKNOWN_VERSION
	.comm	_SCT_VALIDATION_STATUS_UNKNOWN_LOG,8,3 ## @SCT_VALIDATION_STATUS_UNKNOWN_LOG
	.comm	_CT_LOG_ENTRY_TYPE_PRECERT,8,3  ## @CT_LOG_ENTRY_TYPE_PRECERT
	.comm	_SCT_VALIDATION_STATUS_UNVERIFIED,8,3 ## @SCT_VALIDATION_STATUS_UNVERIFIED
	.comm	_SCT_VALIDATION_STATUS_VALID,8,3 ## @SCT_VALIDATION_STATUS_VALID
	.comm	_SCT_VALIDATION_STATUS_INVALID,8,3 ## @SCT_VALIDATION_STATUS_INVALID
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SCT_validate                   ; -- Begin function SCT_validate
	.p2align	2
_SCT_validate:                          ; @SCT_validate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x0
	stp	xzr, xzr, [sp]
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _SCT_VERSION_V1@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SCT_VERSION_V1@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.1:
	mov	x21, x1
	ldr	w0, [x1, #16]
	ldp	w2, w1, [x20, #16]
	bl	_CTLOG_STORE_get0_log_by_id
	cbz	x0, LBB0_14
; %bb.2:
	mov	x22, x0
	bl	_SCT_CTX_new
	mov	x19, x0
	cbz	x0, LBB0_12
; %bb.3:
	mov	x0, x22
	bl	_CTLOG_get0_public_key
	mov	x1, x0
	mov	x0, sp
	bl	_X509_PUBKEY_set
	cmp	w0, #1
	b.ne	LBB0_12
; %bb.4:
	ldr	x1, [sp]
	mov	x0, x19
	bl	_SCT_CTX_set1_pubkey
	cmp	w0, #1
	b.ne	LBB0_12
; %bb.5:
	mov	x0, x20
	bl	_SCT_get_log_entry_type
Lloh3:
	adrp	x8, _CT_LOG_ENTRY_TYPE_PRECERT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CT_LOG_ENTRY_TYPE_PRECERT@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
Lloh6:
	adrp	x22, _SCT_VALIDATION_STATUS_VALID@GOTPAGE
Lloh7:
	ldr	x22, [x22, _SCT_VALIDATION_STATUS_VALID@GOTPAGEOFF]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.6:
	ldr	x0, [x21, #8]
	cbz	x0, LBB0_17
; %bb.7:
	bl	_X509_get0_pubkey
	mov	x1, x0
	add	x0, sp, #8
	bl	_X509_PUBKEY_set
	cmp	w0, #1
	b.ne	LBB0_12
; %bb.8:
	ldr	x1, [sp, #8]
	mov	x0, x19
	bl	_SCT_CTX_set1_issuer_pubkey
	cmp	w0, #1
	b.ne	LBB0_12
LBB0_9:
	ldr	w1, [x21, #4]
	mov	x0, x19
	bl	_SCT_CTX_set_time
	ldr	w1, [x21]
	mov	x0, x19
	mov	x2, #0
	bl	_SCT_CTX_set1_cert
	cmp	w0, #1
	b.ne	LBB0_17
; %bb.10:
	mov	x0, x19
	mov	x1, x20
	bl	_SCT_CTX_verify
Lloh8:
	adrp	x8, _SCT_VALIDATION_STATUS_INVALID@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SCT_VALIDATION_STATUS_INVALID@GOTPAGEOFF]
	cmp	w0, #1
	csel	x8, x22, x8, eq
	b	LBB0_18
LBB0_11:
	mov	w21, #0
Lloh10:
	adrp	x8, _SCT_VALIDATION_STATUS_UNKNOWN_VERSION@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SCT_VALIDATION_STATUS_UNKNOWN_VERSION@GOTPAGEOFF]
	b	LBB0_15
LBB0_12:
	mov	w21, #-1
LBB0_13:
	ldr	x0, [sp, #8]
	bl	_X509_PUBKEY_free
	ldr	x0, [sp]
	bl	_X509_PUBKEY_free
	mov	x0, x19
	bl	_SCT_CTX_free
	b	LBB0_16
LBB0_14:
	mov	w21, #0
Lloh12:
	adrp	x8, _SCT_VALIDATION_STATUS_UNKNOWN_LOG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SCT_VALIDATION_STATUS_UNKNOWN_LOG@GOTPAGEOFF]
LBB0_15:
	ldr	x8, [x8]
	str	x8, [x20, #8]
LBB0_16:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_17:
Lloh14:
	adrp	x8, _SCT_VALIDATION_STATUS_UNVERIFIED@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SCT_VALIDATION_STATUS_UNVERIFIED@GOTPAGEOFF]
LBB0_18:
	ldr	x8, [x8]
	str	x8, [x20, #8]
	ldr	x9, [x22]
	cmp	x8, x9
	cset	w21, eq
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_SCT_VERSION_V1,8,3             ; @SCT_VERSION_V1
	.comm	_SCT_VALIDATION_STATUS_UNKNOWN_VERSION,8,3 ; @SCT_VALIDATION_STATUS_UNKNOWN_VERSION
	.comm	_SCT_VALIDATION_STATUS_UNKNOWN_LOG,8,3 ; @SCT_VALIDATION_STATUS_UNKNOWN_LOG
	.comm	_CT_LOG_ENTRY_TYPE_PRECERT,8,3  ; @CT_LOG_ENTRY_TYPE_PRECERT
	.comm	_SCT_VALIDATION_STATUS_UNVERIFIED,8,3 ; @SCT_VALIDATION_STATUS_UNVERIFIED
	.comm	_SCT_VALIDATION_STATUS_VALID,8,3 ; @SCT_VALIDATION_STATUS_VALID
	.comm	_SCT_VALIDATION_STATUS_INVALID,8,3 ; @SCT_VALIDATION_STATUS_INVALID
.subsections_via_symbols
