	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__hx509_cert_to_env             ## -- Begin function _hx509_cert_to_env
	.p2align	4, 0x90
__hx509_cert_to_env:                    ## @_hx509_cert_to_env
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r12d
	movl	%edi, %r15d
	movq	$0, -64(%rbp)
	movq	$0, (%rdx)
	movl	%esi, %edi
	callq	__hx509_get_cert
	movq	%rax, %rdi
	callq	__hx509_cert_get_version
	leaq	L_.str(%rip), %rsi
	leaq	-48(%rbp), %rdi
	movl	%eax, %edx
	callq	_asprintf
	movq	-48(%rbp), %rcx
	leaq	L_.str.1(%rip), %rdx
	leaq	-64(%rbp), %rsi
	movl	%r15d, %edi
	callq	_hx509_env_add
	movl	%eax, %ebx
	movq	-48(%rbp), %rdi
	callq	_free
	testl	%ebx, %ebx
	jne	LBB0_4
## %bb.1:
	leaq	-52(%rbp), %rsi
	movl	%r12d, %edi
	callq	_hx509_cert_get_subject
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.2:
	movl	-52(%rbp), %edi
	leaq	-48(%rbp), %rsi
	callq	_hx509_name_to_string
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %ebx
	leaq	-52(%rbp), %rdi
	callq	_hx509_name_free
	jmp	LBB0_4
LBB0_5:
	movq	-48(%rbp), %rcx
	leaq	L_.str.2(%rip), %rdx
	leaq	-64(%rbp), %rsi
	movl	%r15d, %edi
	callq	_hx509_env_add
	movl	%eax, %ebx
	leaq	-52(%rbp), %rdi
	callq	_hx509_name_free
	testl	%ebx, %ebx
	jne	LBB0_4
## %bb.6:
	leaq	-52(%rbp), %rsi
	movl	%r12d, %edi
	callq	_hx509_cert_get_issuer
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.7:
	movl	-52(%rbp), %edi
	leaq	-48(%rbp), %rsi
	callq	_hx509_name_to_string
	movl	%eax, %ebx
	leaq	-52(%rbp), %rdi
	callq	_hx509_name_free
	testl	%ebx, %ebx
	jne	LBB0_4
## %bb.8:
	movq	-48(%rbp), %rcx
	leaq	L_.str.3(%rip), %rdx
	leaq	-64(%rbp), %rsi
	movl	%r15d, %edi
	callq	_hx509_env_add
	movl	%eax, %ebx
	movq	-48(%rbp), %rdi
	callq	_hx509_xfree
	testl	%ebx, %ebx
	je	LBB0_9
LBB0_4:
	leaq	-64(%rbp), %rdi
	callq	_hx509_env_free
LBB0_28:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	leaq	-104(%rbp), %rdx
	movl	%r15d, %edi
	movl	%r12d, %esi
	callq	__hx509_cert_get_eku
	movl	%eax, %ebx
	movq	_HX509_EXTENSION_NOT_FOUND@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_10
LBB0_20:
	movl	%r12d, %edi
	callq	__hx509_get_cert
	movq	$0, -80(%rbp)
	movl	4(%rax), %ecx
	movl	%ecx, -68(%rbp)
	movl	(%rax), %eax
	leal	7(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$3, %ecx
	movl	%ecx, -72(%rbp)
	xorl	%eax, %eax
	callq	_hx509_signature_sha1
	leaq	-72(%rbp), %rcx
	leaq	-88(%rbp), %r9
	movl	%r15d, %edi
	xorl	%esi, %esi
	movl	%eax, %edx
	xorl	%r8d, %r8d
	callq	__hx509_create_signature
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.21:
	movl	-88(%rbp), %esi
	movl	-84(%rbp), %edi
	leaq	-48(%rbp), %rdx
	callq	_hex_encode
	movl	%eax, %ebx
	leaq	-88(%rbp), %rdi
	callq	_der_free_octet_string
	testl	%ebx, %ebx
	js	LBB0_22
## %bb.23:
	movq	-48(%rbp), %rcx
	leaq	L_.str.7(%rip), %rdx
	leaq	-80(%rbp), %rsi
	movl	%r15d, %edi
	callq	_hx509_env_add
	movl	%eax, %ebx
	movq	-48(%rbp), %rdi
	callq	_free
	testl	%ebx, %ebx
	jne	LBB0_4
## %bb.24:
	movq	-80(%rbp), %rcx
	leaq	L_.str.8(%rip), %rdx
	leaq	-64(%rbp), %rsi
	movl	%r15d, %edi
	callq	_hx509_env_add_binding
	testl	%eax, %eax
	je	LBB0_26
## %bb.25:
	movl	%eax, %ebx
	leaq	-80(%rbp), %rdi
	callq	_hx509_env_free
	jmp	LBB0_4
LBB0_10:
	testl	%ebx, %ebx
	jne	LBB0_4
## %bb.11:
	movq	$0, -72(%rbp)
	cmpq	$0, -104(%rbp)
	je	LBB0_19
## %bb.12:
	xorl	%eax, %eax
	xorl	%r13d, %r13d
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	-96(%rbp), %rdi
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	addq	%rax, %rdi
	movl	$46, %esi
	leaq	-48(%rbp), %rdx
	callq	_der_print_heim_oid
	testl	%eax, %eax
	jne	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	-48(%rbp), %rdx
	movl	%r15d, %edi
	leaq	-72(%rbp), %rsi
	leaq	L_.str.4(%rip), %rcx
	callq	_hx509_env_add
	movl	%eax, %ebx
	movq	-48(%rbp), %rdi
	callq	_free
	testl	%ebx, %ebx
	jne	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_14 Depth=1
	incq	%r13
	movq	-112(%rbp), %rax                ## 8-byte Reload
	addq	$4, %rax
	cmpq	-104(%rbp), %r13
	jb	LBB0_14
LBB0_19:
	leaq	-104(%rbp), %rdi
	callq	_free_ExtKeyUsage
	movq	-72(%rbp), %rcx
	leaq	L_.str.5(%rip), %rdx
	leaq	-64(%rbp), %rsi
	movl	%r15d, %edi
	callq	_hx509_env_add_binding
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
	jmp	LBB0_20
LBB0_22:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	L_.str.6(%rip), %rcx
	movl	%r15d, %edi
	xorl	%esi, %esi
	movl	%ebx, %edx
	callq	_hx509_set_error_string
	jmp	LBB0_4
LBB0_15:
	movl	%eax, %ebx
LBB0_17:
	leaq	-104(%rbp), %rdi
	callq	_free_ExtKeyUsage
LBB0_18:
	leaq	-72(%rbp), %rdi
	callq	_hx509_env_free
	jmp	LBB0_4
LBB0_26:
	movq	-64(%rbp), %rcx
	leaq	L_.str.9(%rip), %rdx
	movl	%r15d, %edi
	movq	%r14, %rsi
	callq	_hx509_env_add_binding
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.27:
	xorl	%ebx, %ebx
	jmp	LBB0_28
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d"

L_.str.1:                               ## @.str.1
	.asciz	"version"

L_.str.2:                               ## @.str.2
	.asciz	"subject"

L_.str.3:                               ## @.str.3
	.asciz	"issuer"

	.comm	_HX509_EXTENSION_NOT_FOUND,4,2  ## @HX509_EXTENSION_NOT_FOUND
L_.str.4:                               ## @.str.4
	.asciz	"oid-name-here"

L_.str.5:                               ## @.str.5
	.asciz	"eku"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.6:                               ## @.str.6
	.asciz	"Out of memory"

L_.str.7:                               ## @.str.7
	.asciz	"sha1"

L_.str.8:                               ## @.str.8
	.asciz	"hash"

L_.str.9:                               ## @.str.9
	.asciz	"certificate"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__hx509_cert_to_env             ; -- Begin function _hx509_cert_to_env
	.p2align	2
__hx509_cert_to_env:                    ; @_hx509_cert_to_env
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	str	xzr, [sp, #24]
	str	xzr, [x2]
	mov	x0, x1
	bl	__hx509_get_cert
	bl	__hx509_cert_get_version
	mov	x2, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #32
	bl	_asprintf
	ldr	x3, [sp, #32]
Lloh2:
	adrp	x2, l_.str.1@PAGE
Lloh3:
	add	x2, x2, l_.str.1@PAGEOFF
	add	x1, sp, #24
	mov	x0, x19
	bl	_hx509_env_add
	mov	x22, x0
	ldr	x0, [sp, #32]
	bl	_free
	cbnz	w22, LBB0_8
; %bb.1:
	add	x1, sp, #44
	mov	x0, x21
	bl	_hx509_cert_get_subject
	mov	x22, x0
	cbnz	w0, LBB0_8
; %bb.2:
	ldr	w0, [sp, #44]
	add	x1, sp, #32
	bl	_hx509_name_to_string
	cbz	w0, LBB0_4
; %bb.3:
	mov	x22, x0
	add	x0, sp, #44
	bl	_hx509_name_free
	b	LBB0_8
LBB0_4:
	ldr	x3, [sp, #32]
Lloh4:
	adrp	x2, l_.str.2@PAGE
Lloh5:
	add	x2, x2, l_.str.2@PAGEOFF
	add	x1, sp, #24
	mov	x0, x19
	bl	_hx509_env_add
	mov	x22, x0
	add	x0, sp, #44
	bl	_hx509_name_free
	cbnz	w22, LBB0_8
; %bb.5:
	add	x1, sp, #44
	mov	x0, x21
	bl	_hx509_cert_get_issuer
	mov	x22, x0
	cbnz	w0, LBB0_8
; %bb.6:
	ldr	w0, [sp, #44]
	add	x1, sp, #32
	bl	_hx509_name_to_string
	mov	x22, x0
	add	x0, sp, #44
	bl	_hx509_name_free
	cbnz	w22, LBB0_8
; %bb.7:
	ldr	x3, [sp, #32]
Lloh6:
	adrp	x2, l_.str.3@PAGE
Lloh7:
	add	x2, x2, l_.str.3@PAGEOFF
	add	x1, sp, #24
	mov	x0, x19
	bl	_hx509_env_add
	mov	x22, x0
	ldr	x0, [sp, #32]
	bl	_hx509_xfree
	cbz	w22, LBB0_10
LBB0_8:
	add	x0, sp, #24
	bl	_hx509_env_free
LBB0_9:
	mov	x0, x22
	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
	add	sp, sp, #144
	ret
LBB0_10:
	add	x2, sp, #48
	mov	x0, x19
	mov	x1, x21
	bl	__hx509_cert_get_eku
Lloh8:
	adrp	x8, _HX509_EXTENSION_NOT_FOUND@GOTPAGE
Lloh9:
	ldr	x8, [x8, _HX509_EXTENSION_NOT_FOUND@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_16
LBB0_11:
	mov	x0, x21
	bl	__hx509_get_cert
	str	xzr, [sp]
	ldr	w8, [x0, #4]
	str	w8, [sp, #20]
	ldr	w8, [x0]
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #3
	str	w8, [sp, #16]
	bl	_hx509_signature_sha1
	mov	x2, x0
	add	x3, sp, #16
	add	x5, sp, #8
	mov	x0, x19
	mov	x1, #0
	mov	x4, #0
	bl	__hx509_create_signature
	mov	x22, x0
	cbnz	w0, LBB0_8
; %bb.12:
	ldp	w1, w0, [sp, #8]
	add	x2, sp, #32
	bl	_hex_encode
	mov	x21, x0
	add	x0, sp, #8
	bl	_der_free_octet_string
	tbnz	w21, #31, LBB0_23
; %bb.13:
	ldr	x3, [sp, #32]
Lloh11:
	adrp	x2, l_.str.7@PAGE
Lloh12:
	add	x2, x2, l_.str.7@PAGEOFF
	mov	x1, sp
	mov	x0, x19
	bl	_hx509_env_add
	mov	x22, x0
	ldr	x0, [sp, #32]
	bl	_free
	cbnz	w22, LBB0_8
; %bb.14:
	ldr	x3, [sp]
Lloh13:
	adrp	x2, l_.str.8@PAGE
Lloh14:
	add	x2, x2, l_.str.8@PAGEOFF
	add	x1, sp, #24
	mov	x0, x19
	bl	_hx509_env_add_binding
	cbz	w0, LBB0_27
; %bb.15:
	mov	x22, x0
	mov	x0, sp
	bl	_hx509_env_free
	b	LBB0_8
LBB0_16:
	mov	x22, x0
	cbnz	w0, LBB0_8
; %bb.17:
	str	xzr, [sp, #16]
	ldr	x8, [sp, #48]
	cbz	x8, LBB0_22
; %bb.18:
	mov	x24, #0
	mov	x25, #0
Lloh15:
	adrp	x23, l_.str.4@PAGE
Lloh16:
	add	x23, x23, l_.str.4@PAGEOFF
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [sp, #56]
	add	x0, x8, x24
	add	x2, sp, #32
	mov	w1, #46
	bl	_der_print_heim_oid
	cbnz	w0, LBB0_24
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
	ldr	x2, [sp, #32]
	add	x1, sp, #16
	mov	x0, x19
	mov	x3, x23
	bl	_hx509_env_add
	mov	x22, x0
	ldr	x0, [sp, #32]
	bl	_free
	cbnz	w22, LBB0_25
; %bb.21:                               ;   in Loop: Header=BB0_19 Depth=1
	add	x25, x25, #1
	ldr	x8, [sp, #48]
	add	x24, x24, #4
	cmp	x25, x8
	b.lo	LBB0_19
LBB0_22:
	add	x0, sp, #48
	bl	_free_ExtKeyUsage
	ldr	x3, [sp, #16]
Lloh17:
	adrp	x2, l_.str.5@PAGE
Lloh18:
	add	x2, x2, l_.str.5@PAGEOFF
	add	x1, sp, #24
	mov	x0, x19
	bl	_hx509_env_add_binding
	mov	x22, x0
	cbnz	w0, LBB0_26
	b	LBB0_11
LBB0_23:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w22, [x8]
Lloh22:
	adrp	x3, l_.str.6@PAGE
Lloh23:
	add	x3, x3, l_.str.6@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	mov	x2, x22
	bl	_hx509_set_error_string
	b	LBB0_8
LBB0_24:
	mov	x22, x0
LBB0_25:
	add	x0, sp, #48
	bl	_free_ExtKeyUsage
LBB0_26:
	add	x0, sp, #16
	bl	_hx509_env_free
	b	LBB0_8
LBB0_27:
	ldr	x3, [sp, #24]
Lloh24:
	adrp	x2, l_.str.9@PAGE
Lloh25:
	add	x2, x2, l_.str.9@PAGEOFF
	mov	x0, x19
	mov	x1, x20
	bl	_hx509_env_add_binding
	mov	x22, x0
	cbnz	w0, LBB0_8
	b	LBB0_9
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d"

l_.str.1:                               ; @.str.1
	.asciz	"version"

l_.str.2:                               ; @.str.2
	.asciz	"subject"

l_.str.3:                               ; @.str.3
	.asciz	"issuer"

	.comm	_HX509_EXTENSION_NOT_FOUND,4,2  ; @HX509_EXTENSION_NOT_FOUND
l_.str.4:                               ; @.str.4
	.asciz	"oid-name-here"

l_.str.5:                               ; @.str.5
	.asciz	"eku"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.6:                               ; @.str.6
	.asciz	"Out of memory"

l_.str.7:                               ; @.str.7
	.asciz	"sha1"

l_.str.8:                               ; @.str.8
	.asciz	"hash"

l_.str.9:                               ; @.str.9
	.asciz	"certificate"

.subsections_via_symbols
