	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_query                          ## -- Begin function query
	.p2align	4, 0x90
_query:                                 ## @query
	.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	%rdx, %rbx
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_context@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	leaq	-56(%rbp), %rsi
	callq	_hx509_query_alloc
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_errx
LBB0_2:
	movl	(%r13), %edi
	leaq	-64(%rbp), %rsi
	callq	_hx509_lock_init
	movl	-64(%rbp), %edi
	leaq	52(%r14), %rsi
	callq	_lock_strings
	movl	(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	leaq	-60(%rbp), %r8
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_hx509_certs_init
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	(%r13), %edi
	leaq	L_.str.2(%rip), %rcx
	movl	$1, %esi
	movl	%eax, %edx
	callq	_hx509_err
LBB0_4:
	testl	%r15d, %r15d
	jle	LBB0_9
## %bb.5:
	incl	%r15d
	leaq	L_.str.3(%rip), %r12
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	addq	$8, %rbx
	decl	%r15d
	cmpl	$1, %r15d
	jle	LBB0_9
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	movl	-60(%rbp), %esi
	movl	-64(%rbp), %edx
	movq	(%rbx), %rcx
	callq	_hx509_certs_append
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	(%rbx), %rdx
	movl	$1, %edi
	movq	%r12, %rsi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_errx
	jmp	LBB0_8
LBB0_9:
	movl	48(%r14), %esi
	testl	%esi, %esi
	je	LBB0_11
## %bb.10:
	movq	-56(%rbp), %rdi
	callq	_hx509_query_match_friendly_name
LBB0_11:
	movq	40(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.12:
	leaq	-44(%rbp), %rbx
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_parse_oid
	movq	-56(%rbp), %rdi
	movq	%rbx, %rsi
	callq	_hx509_query_match_eku
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_errx
LBB0_14:
	leaq	-44(%rbp), %rdi
	callq	_der_free_oid
LBB0_15:
	cmpq	$0, 32(%r14)
	je	LBB0_17
## %bb.16:
	movq	-56(%rbp), %rdi
	movq	_HX509_QUERY_OPTION_PRIVATE_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_hx509_query_match_option
LBB0_17:
	cmpq	$0, 24(%r14)
	je	LBB0_19
## %bb.18:
	movq	-56(%rbp), %rdi
	movq	_HX509_QUERY_OPTION_KU_ENCIPHERMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_hx509_query_match_option
LBB0_19:
	cmpq	$0, 16(%r14)
	je	LBB0_21
## %bb.20:
	movq	-56(%rbp), %rdi
	movq	_HX509_QUERY_OPTION_KU_DIGITALSIGNATURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_hx509_query_match_option
LBB0_21:
	movl	8(%r14), %edx
	testl	%edx, %edx
	je	LBB0_23
## %bb.22:
	movl	(%r13), %edi
	movq	-56(%rbp), %rsi
	callq	_hx509_query_match_expr
LBB0_23:
	movl	(%r13), %edi
	movl	-60(%rbp), %esi
	movq	-56(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	callq	_hx509_certs_find
	movl	%eax, %ebx
	movl	(%r13), %edi
	movq	-56(%rbp), %rsi
	callq	_hx509_query_free
	testl	%ebx, %ebx
	je	LBB0_25
## %bb.24:
	leaq	L_.str.5(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_27
LBB0_25:
	leaq	L_str(%rip), %rdi
	callq	_puts
	cmpq	$0, (%r14)
	je	LBB0_27
## %bb.26:
	movl	(%r13), %edi
	movl	-44(%rbp), %esi
	xorl	%edx, %edx
	callq	_print_certificate
LBB0_27:
	movl	-44(%rbp), %edi
	callq	_hx509_cert_free
	leaq	-60(%rbp), %rdi
	callq	_hx509_certs_free
	movl	-64(%rbp), %edi
	callq	_hx509_lock_free
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_context,4,2                    ## @context
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hx509_query_alloc: %d"

L_.str.1:                               ## @.str.1
	.asciz	"MEMORY:cert-store"

L_.str.2:                               ## @.str.2
	.asciz	"hx509_certs_init: MEMORY"

L_.str.3:                               ## @.str.3
	.asciz	"hx509_certs_append: %s: %d"

L_.str.4:                               ## @.str.4
	.asciz	"hx509_query_match_eku: %d"

	.comm	_HX509_QUERY_OPTION_PRIVATE_KEY,4,2 ## @HX509_QUERY_OPTION_PRIVATE_KEY
	.comm	_HX509_QUERY_OPTION_KU_ENCIPHERMENT,4,2 ## @HX509_QUERY_OPTION_KU_ENCIPHERMENT
	.comm	_HX509_QUERY_OPTION_KU_DIGITALSIGNATURE,4,2 ## @HX509_QUERY_OPTION_KU_DIGITALSIGNATURE
L_.str.5:                               ## @.str.5
	.asciz	"no match found (%d)\n"

L_str:                                  ## @str
	.asciz	"match found"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_query                          ; -- Begin function query
	.p2align	2
_query:                                 ; @query
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _context@GOTPAGE
Lloh1:
	ldr	x22, [x22, _context@GOTPAGEOFF]
	ldr	w0, [x22]
	add	x1, sp, #32
	bl	_hx509_query_alloc
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_2
; %bb.1:
	str	x0, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_2:
	ldr	w0, [x22]
	add	x1, sp, #44
	bl	_hx509_lock_init
	ldr	w0, [sp, #44]
	add	x1, x19, #52
	bl	_lock_strings
	ldr	w0, [x22]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x4, sp, #28
	mov	w2, #0
	mov	x3, #0
	bl	_hx509_certs_init
	cbz	w0, LBB0_4
; %bb.3:
	mov	x2, x0
	ldr	w0, [x22]
Lloh6:
	adrp	x3, l_.str.2@PAGE
Lloh7:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	w1, #1
	bl	_hx509_err
LBB0_4:
	cmp	w21, #1
	b.lt	LBB0_9
; %bb.5:
	add	w23, w21, #1
Lloh8:
	adrp	x21, l_.str.3@PAGE
Lloh9:
	add	x21, x21, l_.str.3@PAGEOFF
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x20, x20, #8
	sub	w23, w23, #1
	cmp	w23, #1
	b.le	LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22]
	ldr	w1, [sp, #28]
	ldr	w2, [sp, #44]
	ldr	x3, [x20]
	bl	_hx509_certs_append
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x20]
	stp	x8, x0, [sp]
	mov	w0, #1
	mov	x1, x21
	bl	_errx
	b	LBB0_6
LBB0_9:
	ldr	w1, [x19, #48]
	cbz	w1, LBB0_11
; %bb.10:
	ldr	x0, [sp, #32]
	bl	_hx509_query_match_friendly_name
LBB0_11:
	ldr	x0, [x19, #40]
	cbz	x0, LBB0_15
; %bb.12:
	add	x2, sp, #24
	mov	x1, #0
	bl	_parse_oid
	ldr	x0, [sp, #32]
	add	x1, sp, #24
	bl	_hx509_query_match_eku
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_14
; %bb.13:
	str	x0, [sp]
Lloh10:
	adrp	x1, l_.str.4@PAGE
Lloh11:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_14:
	add	x0, sp, #24
	bl	_der_free_oid
LBB0_15:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_17
; %bb.16:
	ldr	x0, [sp, #32]
Lloh12:
	adrp	x8, _HX509_QUERY_OPTION_PRIVATE_KEY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _HX509_QUERY_OPTION_PRIVATE_KEY@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_hx509_query_match_option
LBB0_17:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_19
; %bb.18:
	ldr	x0, [sp, #32]
Lloh15:
	adrp	x8, _HX509_QUERY_OPTION_KU_ENCIPHERMENT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _HX509_QUERY_OPTION_KU_ENCIPHERMENT@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_hx509_query_match_option
LBB0_19:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_21
; %bb.20:
	ldr	x0, [sp, #32]
Lloh18:
	adrp	x8, _HX509_QUERY_OPTION_KU_DIGITALSIGNATURE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _HX509_QUERY_OPTION_KU_DIGITALSIGNATURE@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_hx509_query_match_option
LBB0_21:
	ldr	w2, [x19, #8]
	cbz	w2, LBB0_23
; %bb.22:
	ldr	w0, [x22]
	ldr	x1, [sp, #32]
	bl	_hx509_query_match_expr
LBB0_23:
	ldr	w0, [x22]
	ldr	w1, [sp, #28]
	ldr	x2, [sp, #32]
	add	x3, sp, #24
	bl	_hx509_certs_find
	mov	x20, x0
	ldr	w0, [x22]
	ldr	x1, [sp, #32]
	bl	_hx509_query_free
	cbz	w20, LBB0_25
; %bb.24:
	str	x20, [sp]
Lloh21:
	adrp	x0, l_.str.5@PAGE
Lloh22:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_printf
	b	LBB0_27
LBB0_25:
Lloh23:
	adrp	x0, l_str@PAGE
Lloh24:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	ldr	x8, [x19]
	cbz	x8, LBB0_27
; %bb.26:
	ldr	w0, [x22]
	ldr	w1, [sp, #24]
	mov	w2, #0
	bl	_print_certificate
LBB0_27:
	ldr	w0, [sp, #24]
	bl	_hx509_cert_free
	add	x0, sp, #28
	bl	_hx509_certs_free
	ldr	w0, [sp, #44]
	bl	_hx509_lock_free
	mov	x0, x20
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_context,4,2                    ; @context
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hx509_query_alloc: %d"

l_.str.1:                               ; @.str.1
	.asciz	"MEMORY:cert-store"

l_.str.2:                               ; @.str.2
	.asciz	"hx509_certs_init: MEMORY"

l_.str.3:                               ; @.str.3
	.asciz	"hx509_certs_append: %s: %d"

l_.str.4:                               ; @.str.4
	.asciz	"hx509_query_match_eku: %d"

	.comm	_HX509_QUERY_OPTION_PRIVATE_KEY,4,2 ; @HX509_QUERY_OPTION_PRIVATE_KEY
	.comm	_HX509_QUERY_OPTION_KU_ENCIPHERMENT,4,2 ; @HX509_QUERY_OPTION_KU_ENCIPHERMENT
	.comm	_HX509_QUERY_OPTION_KU_DIGITALSIGNATURE,4,2 ; @HX509_QUERY_OPTION_KU_DIGITALSIGNATURE
l_.str.5:                               ; @.str.5
	.asciz	"no match found (%d)\n"

l_str:                                  ; @str
	.asciz	"match found"

.subsections_via_symbols
