	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_asn1_write_mpi         ## -- Begin function mbedtls_asn1_write_mpi
	.p2align	4, 0x90
_mbedtls_asn1_write_mpi:                ## @mbedtls_asn1_write_mpi
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	%rdx, %rdi
	callq	_mbedtls_mpi_size
	movq	%rax, %r12
	movq	(%r15), %rsi
	movq	%rsi, %rax
	subq	%r14, %rax
	jb	LBB0_2
## %bb.1:
	cmpq	%r12, %rax
	jae	LBB0_3
LBB0_2:
	movq	_MBEDTLS_ERR_ASN1_BUF_TOO_SMALL@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	jmp	LBB0_8
LBB0_3:
	subq	%r12, %rsi
	movq	%rsi, (%r15)
	movq	%rbx, %rdi
	movq	%r12, %rdx
	callq	_mbedtls_mpi_write_binary
	movl	%eax, %edi
	callq	_MBEDTLS_MPI_CHK
	cmpl	$1, (%rbx)
	jne	LBB0_7
## %bb.4:
	movq	(%r15), %rax
	cmpb	$0, (%rax)
	jns	LBB0_7
## %bb.5:
	movq	%rax, %rcx
	subq	%r14, %rcx
	testq	%rcx, %rcx
	jle	LBB0_2
## %bb.6:
	leaq	-1(%rax), %rcx
	movq	%rcx, (%r15)
	movb	$0, -1(%rax)
	incq	%r12
LBB0_7:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_mbedtls_asn1_write_len
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_MBEDTLS_ASN1_CHK_ADD
	movq	_MBEDTLS_ASN1_INTEGER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_mbedtls_asn1_write_tag
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_MBEDTLS_ASN1_CHK_ADD
LBB0_8:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MBEDTLS_ERR_ASN1_BUF_TOO_SMALL,4,2 ## @MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
	.comm	_MBEDTLS_ASN1_INTEGER,4,2       ## @MBEDTLS_ASN1_INTEGER
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_asn1_write_mpi         ; -- Begin function mbedtls_asn1_write_mpi
	.p2align	2
_mbedtls_asn1_write_mpi:                ; @mbedtls_asn1_write_mpi
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x22, x2
	mov	x20, x1
	mov	x21, x0
	mov	x0, x2
	bl	_mbedtls_mpi_size
	ldr	x8, [x21]
	subs	x9, x8, x20
	b.lo	LBB0_2
; %bb.1:
	mov	x19, x0
	cmp	x9, x0
	b.hs	LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _MBEDTLS_ERR_ASN1_BUF_TOO_SMALL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MBEDTLS_ERR_ASN1_BUF_TOO_SMALL@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	b	LBB0_8
LBB0_3:
	sub	x1, x8, x19
	str	x1, [x21]
	mov	x0, x22
	mov	x2, x19
	bl	_mbedtls_mpi_write_binary
	bl	_MBEDTLS_MPI_CHK
	ldr	w8, [x22]
	cmp	w8, #1
	b.ne	LBB0_7
; %bb.4:
	ldr	x8, [x21]
	ldrsb	w9, [x8]
	tbz	w9, #31, LBB0_7
; %bb.5:
	sub	x9, x8, x20
	cmp	x9, #0
	b.le	LBB0_2
; %bb.6:
	sub	x9, x8, #1
	str	x9, [x21]
	sturb	wzr, [x8, #-1]
	add	x19, x19, #1
LBB0_7:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_mbedtls_asn1_write_len
	mov	x1, x0
	mov	x0, x19
	bl	_MBEDTLS_ASN1_CHK_ADD
Lloh3:
	adrp	x8, _MBEDTLS_ASN1_INTEGER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MBEDTLS_ASN1_INTEGER@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x1, x20
	bl	_mbedtls_asn1_write_tag
	mov	x1, x0
	mov	x0, x19
	bl	_MBEDTLS_ASN1_CHK_ADD
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	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_ASN1_INTEGER,4,2       ; @MBEDTLS_ASN1_INTEGER
.subsections_via_symbols
