	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__hx509_calculate_path          ## -- Begin function _hx509_calculate_path
	.p2align	4, 0x90
__hx509_calculate_path:                 ## @_hx509_calculate_path
	.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
	movl	%r9d, %r13d
	movl	%ecx, %r15d
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movl	%edi, %r12d
	movq	24(%rbp), %rbx
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	testl	%r8d, %r8d
	jne	LBB0_2
## %bb.1:
	movq	_HX509_VERIFY_MAX_DEPTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
LBB0_2:
	movl	%r12d, %edi
	movq	%rbx, %rsi
	movl	%r13d, %edx
	callq	__hx509_path_append
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_3
LBB0_15:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	%r13d, %edi
	callq	_hx509_cert_ref
	movl	%eax, %r13d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	movl	%r15d, %esi
	movl	%r13d, %edx
	callq	_certificate_is_anchor
	testq	%rax, %rax
	jne	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	-48(%rbp), %rax
	movq	%rax, (%rsp)
	movl	%r12d, %edi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	movl	%r15d, %edx
	movq	%rbx, %rcx
	movl	16(%rbp), %r8d
	movl	%r13d, %r9d
	callq	_find_parent
	movl	%eax, %r14d
	movl	%r13d, %edi
	callq	_hx509_cert_free
	testl	%r14d, %r14d
	jne	LBB0_15
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	-48(%rbp), %edx
	movl	%r12d, %edi
	movq	%rbx, %rsi
	callq	__hx509_path_append
	testl	%eax, %eax
	jne	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	-48(%rbp), %r13d
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, (%rbx)
	jbe	LBB0_4
## %bb.9:
	movl	%r13d, %edi
	callq	_hx509_cert_free
	movq	_HX509_PATH_TOO_LONG@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	leaq	L_.str(%rip), %rcx
	movl	%r12d, %edi
	xorl	%esi, %esi
	callq	_hx509_set_error_string
	movl	(%r14), %r14d
	jmp	LBB0_15
LBB0_10:
	movq	_HX509_CALCULATE_PATH_NO_ANCHOR@GOTPCREL(%rip), %rax
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	testl	%ecx, (%rax)
	je	LBB0_14
## %bb.11:
	movl	(%rbx), %eax
	testl	%eax, %eax
	je	LBB0_14
## %bb.12:
	movq	8(%rbx), %rcx
	decl	%eax
	movl	(%rcx,%rax,4), %edx
	movl	%r12d, %edi
	movl	%r15d, %esi
	callq	_certificate_is_anchor
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	8(%rbx), %rax
	movl	(%rbx), %ecx
	decl	%ecx
	movl	(%rax,%rcx,4), %edi
	callq	_hx509_cert_free
	decl	(%rbx)
LBB0_14:
	movl	%r13d, %edi
	callq	_hx509_cert_free
	xorl	%r14d, %r14d
	jmp	LBB0_15
LBB0_7:
	movl	%eax, %r14d
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_HX509_VERIFY_MAX_DEPTH,4,2     ## @HX509_VERIFY_MAX_DEPTH
	.comm	_HX509_PATH_TOO_LONG,4,2        ## @HX509_PATH_TOO_LONG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Path too long while bulding certificate chain"

	.comm	_HX509_CALCULATE_PATH_NO_ANCHOR,4,2 ## @HX509_CALCULATE_PATH_NO_ANCHOR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__hx509_calculate_path          ; -- Begin function _hx509_calculate_path
	.p2align	2
__hx509_calculate_path:                 ; @_hx509_calculate_path
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x7
	mov	x22, x6
	mov	x24, x5
	mov	x21, x3
	mov	x25, x2
	mov	x23, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _HX509_VERIFY_MAX_DEPTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HX509_VERIFY_MAX_DEPTH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w4, #0
	csel	w27, w8, w4, eq
	mov	x1, x7
	mov	x2, x5
	bl	__hx509_path_append
	mov	x26, x0
	cbz	w0, LBB0_2
LBB0_1:
	mov	x0, x26
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_2:
	mov	x0, x24
	bl	_hx509_cert_ref
	mov	x24, x0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	mov	x2, x24
	bl	_certificate_is_anchor
	cbnz	x0, LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x6, sp, #12
	mov	x0, x20
	mov	x1, x25
	mov	x2, x21
	mov	x3, x19
	mov	x4, x22
	mov	x5, x24
	bl	_find_parent
	mov	x26, x0
	mov	x0, x24
	bl	_hx509_cert_free
	cbnz	w26, LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w2, [sp, #12]
	mov	x0, x20
	mov	x1, x19
	bl	__hx509_path_append
	cbnz	w0, LBB0_13
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w24, [sp, #12]
	ldr	w8, [x19]
	cmp	w8, w27
	b.ls	LBB0_3
; %bb.7:
	mov	x0, x24
	bl	_hx509_cert_free
Lloh3:
	adrp	x19, _HX509_PATH_TOO_LONG@GOTPAGE
Lloh4:
	ldr	x19, [x19, _HX509_PATH_TOO_LONG@GOTPAGEOFF]
	ldr	w2, [x19]
Lloh5:
	adrp	x3, l_.str@PAGE
Lloh6:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x20
	mov	w1, #0
	bl	_hx509_set_error_string
	ldr	w26, [x19]
	b	LBB0_1
LBB0_8:
Lloh7:
	adrp	x8, _HX509_CALCULATE_PATH_NO_ANCHOR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _HX509_CALCULATE_PATH_NO_ANCHOR@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	tst	w8, w23
	b.eq	LBB0_12
; %bb.9:
	ldr	w8, [x19]
	cbz	w8, LBB0_12
; %bb.10:
	ldr	x9, [x19, #8]
	sub	w8, w8, #1
	ldr	w2, [x9, w8, uxtw #2]
	mov	x0, x20
	mov	x1, x21
	bl	_certificate_is_anchor
	cbz	x0, LBB0_12
; %bb.11:
	ldr	x8, [x19, #8]
	ldr	w9, [x19]
	sub	w9, w9, #1
	ldr	w0, [x8, w9, uxtw #2]
	bl	_hx509_cert_free
	ldr	w8, [x19]
	sub	w8, w8, #1
	str	w8, [x19]
LBB0_12:
	mov	x0, x24
	bl	_hx509_cert_free
	mov	w26, #0
	b	LBB0_1
LBB0_13:
	mov	x26, x0
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_HX509_VERIFY_MAX_DEPTH,4,2     ; @HX509_VERIFY_MAX_DEPTH
	.comm	_HX509_PATH_TOO_LONG,4,2        ; @HX509_PATH_TOO_LONG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Path too long while bulding certificate chain"

	.comm	_HX509_CALCULATE_PATH_NO_ANCHOR,4,2 ; @HX509_CALCULATE_PATH_NO_ANCHOR
.subsections_via_symbols
