	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ptls_asn1_read_length          ## -- Begin function ptls_asn1_read_length
	.p2align	4, 0x90
_ptls_asn1_read_length:                 ## @ptls_asn1_read_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$0, (%r8)
	movl	$0, (%rcx)
	movq	%rsi, (%r9)
	cmpq	%rsi, %rdx
	jae	LBB0_17
## %bb.1:
	movq	%r9, %r14
	movq	%rsi, %r15
	movq	32(%rbp), %rbx
	movl	24(%rbp), %r12d
	movq	16(%rbp), %r13
	movl	(%rdi,%rdx,4), %r9d
	incq	%rdx
	movl	%r9d, (%rcx)
	testb	$-128, %r9b
	jne	LBB0_2
## %bb.12:
	movslq	%r9d, %rax
	addq	%rdx, %rax
	movq	%rax, (%r14)
	jmp	LBB0_13
LBB0_2:
	andl	$127, %r9d
	movl	$0, (%rcx)
	leaq	(%rdx,%r9), %rax
	cmpq	%r15, %rax
	jae	LBB0_8
## %bb.3:
	testl	%r9d, %r9d
	je	LBB0_9
## %bb.4:
	cmpq	%r15, %rdx
	jae	LBB0_9
## %bb.5:
	movq	%rbx, %r8
	xorl	%esi, %esi
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	shll	$8, %esi
	movl	%esi, (%rcx)
	orl	(%rdi,%rdx,4), %esi
	incq	%rdx
	movslq	%esi, %rax
	movl	%eax, (%rcx)
	cmpl	%r9d, %ebx
	jae	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	incl	%ebx
	cmpq	%r15, %rdx
	jb	LBB0_6
	jmp	LBB0_11
LBB0_8:
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	movl	%r12d, %ecx
	movq	%rbx, %r8
	callq	_ptls_asn1_error_message
	movq	%rax, %rdx
	movq	_PTLS_ERROR_BER_MALFORMED_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r13)
	testl	%eax, %eax
	jne	LBB0_17
	jmp	LBB0_15
LBB0_9:
	testl	%r9d, %r9d
	je	LBB0_19
## %bb.10:
	movq	%rbx, %r8
	xorl	%eax, %eax
LBB0_11:
	addq	%rdx, %rax
	movq	%rax, (%r14)
	movq	%r8, %rbx
	jmp	LBB0_13
LBB0_19:
	movl	$1, (%r8)
LBB0_13:
	movl	(%r13), %eax
	testl	%eax, %eax
	jne	LBB0_17
LBB0_15:
	cmpq	%r15, (%r14)
	jbe	LBB0_17
## %bb.16:
	leaq	L_.str.1(%rip), %rdi
	movq	%r15, %rsi
	movl	%r12d, %ecx
	movq	%rbx, %r8
	callq	_ptls_asn1_error_message
	movq	_PTLS_ERROR_BER_EXCESSIVE_LENGTH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%r13)
	jmp	LBB0_18
LBB0_17:
	movq	%rdx, %rax
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Incorrect length coding"

	.comm	_PTLS_ERROR_BER_MALFORMED_LENGTH,4,2 ## @PTLS_ERROR_BER_MALFORMED_LENGTH
L_.str.1:                               ## @.str.1
	.asciz	"Length larger than message"

	.comm	_PTLS_ERROR_BER_EXCESSIVE_LENGTH,4,2 ## @PTLS_ERROR_BER_EXCESSIVE_LENGTH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ptls_asn1_read_length          ; -- Begin function ptls_asn1_read_length
	.p2align	2
_ptls_asn1_read_length:                 ; @ptls_asn1_read_length
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	str	wzr, [x4]
	str	wzr, [x3]
	str	x1, [x5]
	cmp	x2, x1
	b.hs	LBB0_12
; %bb.1:
	mov	x20, x7
	mov	x19, x6
	mov	x22, x5
	mov	x21, x1
	ldr	x23, [x29, #16]
	add	x8, x2, #1
	ldr	w9, [x0, x2, lsl #2]
	str	w9, [x3]
	tbnz	w9, #7, LBB0_5
; %bb.2:
	add	x9, x8, w9, sxtw
LBB0_3:
	str	x9, [x22]
LBB0_4:
	ldr	w9, [x19]
	mov	x2, x8
	cbnz	w9, LBB0_12
	b	LBB0_10
LBB0_5:
	and	x9, x9, #0x7f
	str	wzr, [x3]
	add	x10, x8, x9
	cmp	x10, x21
	b.hs	LBB0_9
; %bb.6:
	cmp	w9, #0
	ccmp	x8, x21, #2, ne
	b.lo	LBB0_14
; %bb.7:
	cbz	w9, LBB0_18
; %bb.8:
	mov	x9, #0
	add	x9, x8, xzr
	b	LBB0_3
LBB0_9:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	mov	x2, x8
	mov	x3, x20
	mov	x4, x23
	bl	_ptls_asn1_error_message
	mov	x2, x0
Lloh2:
	adrp	x8, _PTLS_ERROR_BER_MALFORMED_LENGTH@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PTLS_ERROR_BER_MALFORMED_LENGTH@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x8]
	str	w9, [x19]
	cbnz	w9, LBB0_12
LBB0_10:
	ldr	x8, [x22]
	cmp	x8, x21
	b.ls	LBB0_12
; %bb.11:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	mov	x3, x20
	mov	x4, x23
	bl	_ptls_asn1_error_message
Lloh7:
	adrp	x8, _PTLS_ERROR_BER_EXCESSIVE_LENGTH@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PTLS_ERROR_BER_EXCESSIVE_LENGTH@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	w8, [x19]
	b	LBB0_13
LBB0_12:
	mov	x0, x2
LBB0_13:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_14:
	mov	x11, #0
	mov	w10, #0
	add	x8, x0, x8, lsl #2
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	lsl	w10, w10, #8
	str	w10, [x3]
	ldr	w12, [x8, x11, lsl #2]
	orr	w10, w12, w10
	str	w10, [x3]
	add	x12, x11, #1
	cmp	w12, w9
	b.hs	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	add	x11, x2, x11
	add	x13, x11, #2
	mov	x11, x12
	cmp	x13, x21
	b.lo	LBB0_15
LBB0_17:
	sxtw	x9, w10
	add	x8, x2, x12
	add	x8, x8, #1
	add	x9, x8, x9
	b	LBB0_3
LBB0_18:
	mov	w9, #1
	str	w9, [x4]
	b	LBB0_4
	.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	"Incorrect length coding"

	.comm	_PTLS_ERROR_BER_MALFORMED_LENGTH,4,2 ; @PTLS_ERROR_BER_MALFORMED_LENGTH
l_.str.1:                               ; @.str.1
	.asciz	"Length larger than message"

	.comm	_PTLS_ERROR_BER_EXCESSIVE_LENGTH,4,2 ; @PTLS_ERROR_BER_EXCESSIVE_LENGTH
.subsections_via_symbols
