	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ptls_asn1_get_expected_type_and_length ## -- Begin function ptls_asn1_get_expected_type_and_length
	.p2align	4, 0x90
_ptls_asn1_get_expected_type_and_length: ## @ptls_asn1_get_expected_type_and_length
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	32(%rbp), %r14
	movq	24(%rbp), %r12
	movl	$0, -36(%rbp)
	cmpq	%rcx, (%rdi,%rdx,8)
	jne	LBB0_1
## %bb.2:
	movq	%r9, %r15
	movq	16(%rbp), %r9
	incq	%rdx
	subq	$8, %rsp
	leaq	-36(%rbp), %rax
	movq	%rbx, %rsi
	movq	%r8, %rcx
	movq	%rax, %r8
	pushq	%r14
	pushq	$0
	pushq	%r12
	callq	_ptls_asn1_read_length
	addq	$32, %rsp
	movl	-36(%rbp), %ecx
	testq	%r15, %r15
	je	LBB0_4
## %bb.3:
	movl	%ecx, (%r15)
	jmp	LBB0_7
LBB0_1:
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	movq	%r14, %r8
	callq	_ptls_asn1_error_message
	movq	_PTLS_ERROR_INCORRECT_ASN1_SYNTAX@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
LBB0_4:
	testl	%ecx, %ecx
	je	LBB0_7
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	xorl	%ecx, %ecx
	movq	%r14, %r8
	callq	_ptls_asn1_error_message
	movq	_PTLS_ERROR_DER_INDEFINITE_LENGTH@GOTPCREL(%rip), %rcx
LBB0_6:
	movl	(%rcx), %ecx
	movl	%ecx, (%r12)
LBB0_7:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unexpected type"

	.comm	_PTLS_ERROR_INCORRECT_ASN1_SYNTAX,4,2 ## @PTLS_ERROR_INCORRECT_ASN1_SYNTAX
L_.str.1:                               ## @.str.1
	.asciz	"Incorrect length for DER"

	.comm	_PTLS_ERROR_DER_INDEFINITE_LENGTH,4,2 ## @PTLS_ERROR_DER_INDEFINITE_LENGTH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ptls_asn1_get_expected_type_and_length ; -- Begin function ptls_asn1_get_expected_type_and_length
	.p2align	2
_ptls_asn1_get_expected_type_and_length: ; @ptls_asn1_get_expected_type_and_length
	.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	x19, x7
	mov	x21, x1
	ldr	x20, [x29, #16]
	str	wzr, [sp, #12]
	ldr	x9, [x0, x2, lsl #3]
	cmp	x9, x3
	b.ne	LBB0_3
; %bb.1:
	mov	x22, x5
	mov	x8, x4
	add	x2, x2, #1
	str	x20, [sp]
	add	x4, sp, #12
	mov	x1, x21
	mov	x3, x8
	mov	x5, x6
	mov	x6, x19
	mov	w7, #0
	bl	_ptls_asn1_read_length
	mov	x2, x0
	ldr	w8, [sp, #12]
	cbz	x22, LBB0_4
; %bb.2:
	str	w8, [x22]
	b	LBB0_6
LBB0_3:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	mov	w3, #0
	mov	x4, x20
	bl	_ptls_asn1_error_message
Lloh2:
	adrp	x8, _PTLS_ERROR_INCORRECT_ASN1_SYNTAX@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PTLS_ERROR_INCORRECT_ASN1_SYNTAX@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x19]
	b	LBB0_7
LBB0_4:
	cbz	w8, LBB0_6
; %bb.5:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	mov	w3, #0
	mov	x4, x20
	bl	_ptls_asn1_error_message
	mov	x2, x0
Lloh7:
	adrp	x8, _PTLS_ERROR_DER_INDEFINITE_LENGTH@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PTLS_ERROR_DER_INDEFINITE_LENGTH@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_6:
	mov	x0, x2
LBB0_7:
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unexpected type"

	.comm	_PTLS_ERROR_INCORRECT_ASN1_SYNTAX,4,2 ; @PTLS_ERROR_INCORRECT_ASN1_SYNTAX
l_.str.1:                               ; @.str.1
	.asciz	"Incorrect length for DER"

	.comm	_PTLS_ERROR_DER_INDEFINITE_LENGTH,4,2 ; @PTLS_ERROR_DER_INDEFINITE_LENGTH
.subsections_via_symbols
