	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function add_certificate
_add_certificate:                       ## @add_certificate
	.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	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rax
	movq	%rdi, %r14
	movq	$0, -40(%rbp)
	movq	%rdx, -56(%rbp)
	movq	%rcx, -48(%rbp)
	xorl	%ecx, %ecx
	movl	$0, %r15d
	testq	%rsi, %rsi
	jne	LBB0_2
## %bb.1:
	movq	_HX509_CERTS_UNPROTECT_ALL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r15d
LBB0_2:
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rsi
	leaq	-32(%rbp), %rdi
	movq	%rax, %rdx
	callq	_asprintf
	movq	_context@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-40(%rbp), %rsi
	callq	_hx509_lock_init
	movq	-40(%rbp), %rdi
	movq	-32(%rbp), %rsi
	callq	_hx509_lock_command_string
	movq	-32(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_strlen
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%eax, %edx
	callq	_memset
	movq	-32(%rbp), %rdi
	callq	_free
	movq	-40(%rbp), %rcx
LBB0_4:
	movq	_context@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	leaq	-32(%rbp), %r8
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_hx509_certs_init
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_8
LBB0_6:
	movl	(%rbx), %edi
	movl	-32(%rbp), %esi
	movq	_add_cert@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-56(%rbp), %rcx
	callq	_hx509_certs_iter_f
	movl	%eax, %ebx
	leaq	-32(%rbp), %rdi
	callq	_hx509_certs_free
	testl	%ebx, %ebx
	je	LBB0_10
## %bb.7:
	leaq	L_.str.2(%rip), %rdi
LBB0_8:
	movq	%r14, %rsi
	callq	_st_logf
	movq	_CKR_GENERAL_ERROR@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_CKR_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_HX509_CERTS_UNPROTECT_ALL,4,2  ## @HX509_CERTS_UNPROTECT_ALL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PASS:%s"

	.comm	_context,4,2                    ## @context
L_.str.1:                               ## @.str.1
	.asciz	"failed to open file %s\n"

	.comm	_CKR_GENERAL_ERROR,4,2          ## @CKR_GENERAL_ERROR
	.comm	_add_cert,4,2                   ## @add_cert
L_.str.2:                               ## @.str.2
	.asciz	"failed adding certs from file %s\n"

	.comm	_CKR_OK,4,2                     ## @CKR_OK
	.no_dead_strip	_add_certificate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function add_certificate
_add_certificate:                       ; @add_certificate
	.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	x19, x0
	str	xzr, [sp, #24]
Lloh0:
	adrp	x9, _HX509_CERTS_UNPROTECT_ALL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HX509_CERTS_UNPROTECT_ALL@GOTPAGEOFF]
	stp	x2, x3, [sp, #8]
Lloh2:
	ldr	w9, [x9]
	cmp	x1, #0
	csel	w20, w9, wzr, eq
Lloh3:
	adrp	x22, _context@GOTPAGE
Lloh4:
	ldr	x22, [x22, _context@GOTPAGEOFF]
	cbz	x1, LBB0_2
; %bb.1:
	mov	x8, x1
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, sp
	mov	x2, x8
	bl	_asprintf
	ldr	w0, [x22]
	add	x1, sp, #24
	bl	_hx509_lock_init
	ldr	x0, [sp, #24]
	ldr	x1, [sp]
	bl	_hx509_lock_command_string
	ldr	x21, [sp]
	mov	x0, x21
	bl	_strlen
	mov	x2, x0
	mov	x0, x21
	mov	w1, #0
	bl	_memset
	ldr	x0, [sp]
	bl	_free
	ldr	x3, [sp, #24]
	b	LBB0_3
LBB0_2:
	mov	x3, #0
LBB0_3:
	ldr	w0, [x22]
	mov	x4, sp
	mov	x1, x19
	mov	x2, x20
	bl	_hx509_certs_init
	cbz	w0, LBB0_5
; %bb.4:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_5:
	ldr	w0, [x22]
	ldr	w1, [sp]
Lloh9:
	adrp	x8, _add_cert@GOTPAGE
Lloh10:
	ldr	x8, [x8, _add_cert@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	add	x3, sp, #8
	bl	_hx509_certs_iter_f
	mov	x20, x0
	mov	x0, sp
	bl	_hx509_certs_free
	cbz	w20, LBB0_9
; %bb.6:
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_7:
	mov	x1, x19
	bl	_st_logf
Lloh14:
	adrp	x8, _CKR_GENERAL_ERROR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CKR_GENERAL_ERROR@GOTPAGEOFF]
LBB0_8:
	ldr	w0, [x8]
	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_9:
Lloh16:
	adrp	x8, _CKR_OK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CKR_OK@GOTPAGEOFF]
	b	LBB0_8
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_HX509_CERTS_UNPROTECT_ALL,4,2  ; @HX509_CERTS_UNPROTECT_ALL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PASS:%s"

	.comm	_context,4,2                    ; @context
l_.str.1:                               ; @.str.1
	.asciz	"failed to open file %s\n"

	.comm	_CKR_GENERAL_ERROR,4,2          ; @CKR_GENERAL_ERROR
	.comm	_add_cert,4,2                   ; @add_cert
l_.str.2:                               ; @.str.2
	.asciz	"failed adding certs from file %s\n"

	.comm	_CKR_OK,4,2                     ; @CKR_OK
	.no_dead_strip	_add_certificate
.subsections_via_symbols
