	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_mpi_shrink             ## -- Begin function mbedtls_mpi_shrink
	.p2align	4, 0x90
_mbedtls_mpi_shrink:                    ## @mbedtls_mpi_shrink
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rcx
	cmpq	%rsi, %rcx
	jbe	LBB0_9
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rcx, %rax
	cmpq	$1, %rcx
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%rbx), %rdx
	leaq	-1(%rax), %rcx
	cmpq	$0, -8(%rdx,%rax,8)
	je	LBB0_1
LBB0_3:
	cmpq	%r14, %rax
	cmovaq	%rax, %r14
	movq	_ciL@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	movq	%r14, %rdi
	callq	_mbedtls_calloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r15
	movq	8(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.6:
	movq	(%r12), %rdx
	imulq	%r14, %rdx
	movq	%r15, %rdi
	callq	_memcpy
	movq	8(%rbx), %rdi
	movl	(%rbx), %esi
	callq	_mbedtls_mpi_zeroize
	movq	8(%rbx), %rdi
	callq	_mbedtls_free
LBB0_7:
	movq	%r14, (%rbx)
	movq	%r15, 8(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_9:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mbedtls_mpi_grow               ## TAILCALL
LBB0_4:
	movq	_MBEDTLS_ERR_MPI_ALLOC_FAILED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ciL,8,3                        ## @ciL
	.comm	_MBEDTLS_ERR_MPI_ALLOC_FAILED,4,2 ## @MBEDTLS_ERR_MPI_ALLOC_FAILED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_mpi_shrink             ; -- Begin function mbedtls_mpi_shrink
	.p2align	2
_mbedtls_mpi_shrink:                    ; @mbedtls_mpi_shrink
	.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	x19, x0
	ldr	x8, [x0]
	cmp	x8, x1
	b.ls	LBB0_8
; %bb.1:
	sub	x9, x8, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x8, x9
	cbz	x9, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x9, [x19, #8]
	ldr	x10, [x9, x8, lsl #3]
	sub	x9, x8, #1
	cbz	x10, LBB0_2
LBB0_4:
	add	x9, x8, #1
	cmp	x9, x1
	csinc	x20, x1, x8, ls
Lloh0:
	adrp	x22, _ciL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ciL@GOTPAGEOFF]
	ldr	x1, [x22]
	mov	x0, x20
	bl	_mbedtls_calloc
	cbz	x0, LBB0_9
; %bb.5:
	mov	x21, x0
	ldr	x1, [x19, #8]
	cbz	x1, LBB0_7
; %bb.6:
	ldr	x8, [x22]
	mul	x2, x8, x20
	mov	x0, x21
	bl	_memcpy
	ldr	x0, [x19, #8]
	ldr	w1, [x19]
	bl	_mbedtls_mpi_zeroize
	ldr	x0, [x19, #8]
	bl	_mbedtls_free
LBB0_7:
	mov	w0, #0
	stp	x20, x21, [x19]
	b	LBB0_10
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
	b	_mbedtls_mpi_grow
LBB0_9:
Lloh2:
	adrp	x8, _MBEDTLS_ERR_MPI_ALLOC_FAILED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MBEDTLS_ERR_MPI_ALLOC_FAILED@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
LBB0_10:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_ciL,8,3                        ; @ciL
	.comm	_MBEDTLS_ERR_MPI_ALLOC_FAILED,4,2 ; @MBEDTLS_ERR_MPI_ALLOC_FAILED
.subsections_via_symbols
