	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_asn1_write_len         ## -- Begin function mbedtls_asn1_write_len
	.p2align	4, 0x90
_mbedtls_asn1_write_len:                ## @mbedtls_asn1_write_len
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	cmpq	$127, %rdx
	ja	LBB0_4
## %bb.1:
	movq	(%rdi), %rax
	movq	%rax, %rcx
	subq	%rsi, %rcx
	testq	%rcx, %rcx
	jle	LBB0_2
## %bb.3:
	leaq	-1(%rax), %rcx
	movq	%rcx, (%rdi)
	movb	%dl, -1(%rax)
	movl	$1, %eax
	popq	%rbp
	retq
LBB0_4:
	cmpq	$255, %rdx
	ja	LBB0_7
## %bb.5:
	movq	(%rdi), %rax
	movq	%rax, %rcx
	subq	%rsi, %rcx
	cmpq	$1, %rcx
	jle	LBB0_2
## %bb.6:
	leaq	-1(%rax), %rcx
	movq	%rcx, (%rdi)
	movb	%dl, -1(%rax)
	movq	(%rdi), %rax
	leaq	-1(%rax), %rcx
	movq	%rcx, (%rdi)
	movb	$-127, -1(%rax)
	movl	$2, %eax
	popq	%rbp
	retq
LBB0_7:
	cmpq	$65535, %rdx                    ## imm = 0xFFFF
	ja	LBB0_10
## %bb.8:
	movq	(%rdi), %rax
	movq	%rax, %rcx
	subq	%rsi, %rcx
	cmpq	$2, %rcx
	jle	LBB0_2
## %bb.9:
	leaq	-1(%rax), %rcx
	movq	%rcx, (%rdi)
	movb	%dl, -1(%rax)
	movq	(%rdi), %rax
	leaq	-1(%rax), %rcx
	movq	%rcx, (%rdi)
	movb	%dh, -1(%rax)
	movq	(%rdi), %rax
	leaq	-1(%rax), %rcx
	movq	%rcx, (%rdi)
	movb	$-126, -1(%rax)
	movl	$3, %eax
	popq	%rbp
	retq
LBB0_10:
	cmpq	$16777215, %rdx                 ## imm = 0xFFFFFF
	ja	LBB0_13
## %bb.11:
	movq	(%rdi), %rax
	movq	%rax, %rcx
	subq	%rsi, %rcx
	cmpq	$3, %rcx
	jle	LBB0_2
## %bb.12:
	leaq	-1(%rax), %rcx
	movq	%rcx, (%rdi)
	movb	%dl, -1(%rax)
	movq	(%rdi), %rax
	leaq	-1(%rax), %rcx
	movq	%rcx, (%rdi)
	movb	%dh, -1(%rax)
	shrq	$16, %rdx
	movq	(%rdi), %rax
	leaq	-1(%rax), %rcx
	movq	%rcx, (%rdi)
	movb	%dl, -1(%rax)
	movq	(%rdi), %rax
	leaq	-1(%rax), %rcx
	movq	%rcx, (%rdi)
	movb	$-125, -1(%rax)
	movl	$4, %eax
	popq	%rbp
	retq
LBB0_13:
	movq	%rdx, %rax
	shrq	$32, %rax
	jne	LBB0_16
## %bb.14:
	movq	(%rdi), %rax
	movq	%rax, %rcx
	subq	%rsi, %rcx
	cmpq	$4, %rcx
	jg	LBB0_15
LBB0_2:
	movq	_MBEDTLS_ERR_ASN1_BUF_TOO_SMALL@GOTPCREL(%rip), %rax
LBB0_17:
	movl	(%rax), %eax
	popq	%rbp
	retq
LBB0_16:
	movq	_MBEDTLS_ERR_ASN1_INVALID_LENGTH@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_15:
	leaq	-1(%rax), %rcx
	movq	%rcx, (%rdi)
	movb	%dl, -1(%rax)
	movq	(%rdi), %rax
	leaq	-1(%rax), %rcx
	movq	%rcx, (%rdi)
	movb	%dh, -1(%rax)
	movq	%rdx, %rax
	shrq	$16, %rax
	movq	(%rdi), %rcx
	leaq	-1(%rcx), %rsi
	movq	%rsi, (%rdi)
	movb	%al, -1(%rcx)
	shrq	$24, %rdx
	movq	(%rdi), %rax
	leaq	-1(%rax), %rcx
	movq	%rcx, (%rdi)
	movb	%dl, -1(%rax)
	movq	(%rdi), %rax
	leaq	-1(%rax), %rcx
	movq	%rcx, (%rdi)
	movb	$-124, -1(%rax)
	movl	$5, %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MBEDTLS_ERR_ASN1_BUF_TOO_SMALL,4,2 ## @MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
	.comm	_MBEDTLS_ERR_ASN1_INVALID_LENGTH,4,2 ## @MBEDTLS_ERR_ASN1_INVALID_LENGTH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_asn1_write_len         ; -- Begin function mbedtls_asn1_write_len
	.p2align	2
_mbedtls_asn1_write_len:                ; @mbedtls_asn1_write_len
	.cfi_startproc
; %bb.0:
	cmp	x2, #127
	b.hi	LBB0_3
; %bb.1:
	ldr	x8, [x0]
	sub	x9, x8, x1
	cmp	x9, #0
	b.le	LBB0_14
; %bb.2:
	sub	x9, x8, #1
	str	x9, [x0]
	sturb	w2, [x8, #-1]
	mov	w0, #1
	ret
LBB0_3:
	cmp	x2, #255
	b.hi	LBB0_6
; %bb.4:
	ldr	x8, [x0]
	sub	x9, x8, x1
	cmp	x9, #1
	b.le	LBB0_14
; %bb.5:
	sub	x9, x8, #1
	str	x9, [x0]
	sturb	w2, [x8, #-1]
	ldr	x8, [x0]
	sub	x9, x8, #1
	str	x9, [x0]
	mov	w9, #129
	sturb	w9, [x8, #-1]
	mov	w0, #2
	ret
LBB0_6:
	lsr	x8, x2, #16
	cbnz	x8, LBB0_9
; %bb.7:
	ldr	x8, [x0]
	sub	x9, x8, x1
	cmp	x9, #2
	b.le	LBB0_14
; %bb.8:
	sub	x9, x8, #1
	str	x9, [x0]
	sturb	w2, [x8, #-1]
	lsr	x8, x2, #8
	ldr	x9, [x0]
	sub	x10, x9, #1
	str	x10, [x0]
	sturb	w8, [x9, #-1]
	ldr	x8, [x0]
	sub	x9, x8, #1
	str	x9, [x0]
	mov	w9, #130
	sturb	w9, [x8, #-1]
	mov	w0, #3
	ret
LBB0_9:
	lsr	x9, x2, #24
	cbnz	x9, LBB0_12
; %bb.10:
	ldr	x9, [x0]
	sub	x10, x9, x1
	cmp	x10, #3
	b.le	LBB0_14
; %bb.11:
	sub	x10, x9, #1
	str	x10, [x0]
	sturb	w2, [x9, #-1]
	lsr	x9, x2, #8
	ldr	x10, [x0]
	sub	x11, x10, #1
	str	x11, [x0]
	sturb	w9, [x10, #-1]
	ldr	x9, [x0]
	sub	x10, x9, #1
	str	x10, [x0]
	sturb	w8, [x9, #-1]
	ldr	x8, [x0]
	sub	x9, x8, #1
	str	x9, [x0]
	mov	w9, #131
	sturb	w9, [x8, #-1]
	mov	w0, #4
	ret
LBB0_12:
	lsr	x10, x2, #32
	cbnz	x10, LBB0_15
; %bb.13:
	ldr	x10, [x0]
	sub	x11, x10, x1
	cmp	x11, #4
	b.gt	LBB0_16
LBB0_14:
Lloh0:
	adrp	x8, _MBEDTLS_ERR_ASN1_BUF_TOO_SMALL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MBEDTLS_ERR_ASN1_BUF_TOO_SMALL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ret
LBB0_15:
Lloh3:
	adrp	x8, _MBEDTLS_ERR_ASN1_INVALID_LENGTH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MBEDTLS_ERR_ASN1_INVALID_LENGTH@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ret
LBB0_16:
	sub	x11, x10, #1
	str	x11, [x0]
	sturb	w2, [x10, #-1]
	lsr	x10, x2, #8
	ldr	x11, [x0]
	sub	x12, x11, #1
	str	x12, [x0]
	sturb	w10, [x11, #-1]
	ldr	x10, [x0]
	sub	x11, x10, #1
	str	x11, [x0]
	sturb	w8, [x10, #-1]
	ldr	x8, [x0]
	sub	x10, x8, #1
	str	x10, [x0]
	sturb	w9, [x8, #-1]
	ldr	x8, [x0]
	sub	x9, x8, #1
	str	x9, [x0]
	mov	w9, #132
	sturb	w9, [x8, #-1]
	mov	w0, #5
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MBEDTLS_ERR_ASN1_BUF_TOO_SMALL,4,2 ; @MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
	.comm	_MBEDTLS_ERR_ASN1_INVALID_LENGTH,4,2 ; @MBEDTLS_ERR_ASN1_INVALID_LENGTH
.subsections_via_symbols
