	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_mpi_write_string       ## -- Begin function mbedtls_mpi_write_string
	.p2align	4, 0x90
_mbedtls_mpi_write_string:              ## @mbedtls_mpi_write_string
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	leal	-17(%r12), %eax
	cmpl	$-16, %eax
	ja	LBB0_2
## %bb.1:
	movq	_MBEDTLS_ERR_MPI_BAD_INPUT_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_22
LBB0_2:
	movq	%rcx, %r13
	movq	%rdx, %r15
	movq	%rdi, %r14
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	callq	_mbedtls_mpi_bitlen
	cmpl	$4, %r12d
	setae	%cl
	shrq	%cl, %rax
	cmpl	$16, %r12d
	setae	%cl
	shrq	%cl, %rax
	andq	$-2, %rax
	addq	$4, %rax
	cmpq	%r13, %rax
	jbe	LBB0_4
## %bb.3:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	_MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_22
LBB0_4:
	movq	%r15, -48(%rbp)
	leaq	-80(%rbp), %rdi
	callq	_mbedtls_mpi_init
	cmpl	$-1, (%r14)
	je	LBB0_5
## %bb.6:
	cmpl	$16, %r12d
	jne	LBB0_18
LBB0_7:
	movq	8(%r14), %r10
	testq	%r10, %r10
	je	LBB0_21
## %bb.8:
	xorl	%esi, %esi
	movq	_ciL@GOTPCREL(%rip), %r8
	leaq	L_.str(%rip), %r9
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r11, %r10
	testq	%r11, %r11
	je	LBB0_21
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	movq	(%r8), %rdx
	leaq	-1(%r10), %r11
	testq	%rdx, %rdx
	je	LBB0_17
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	leaq	-8(,%rdx,8), %rcx
	movl	$2, %eax
	subq	%rdx, %rax
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_11 Depth=2
	movl	%edx, %edx
	shrq	$4, %rdx
	movzbl	(%rdx,%r9), %edx
	movq	-48(%rbp), %rsi
	leaq	1(%rsi), %rdi
	movq	%rdi, -48(%rbp)
	movb	%dl, (%rsi)
	andl	$15, %ebx
	movzbl	(%rbx,%r9), %edx
	movq	-48(%rbp), %rsi
	leaq	1(%rsi), %rdi
	movq	%rdi, -48(%rbp)
	movb	%dl, (%rsi)
	movl	$1, %esi
LBB0_16:                                ##   in Loop: Header=BB0_11 Depth=2
	addq	$-8, %rcx
	incq	%rax
	cmpq	$2, %rax
	je	LBB0_17
LBB0_11:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	16(%r14), %rdx
	movq	(%rdx,%r11,8), %rbx
	shrq	%cl, %rbx
	movl	%ebx, %edx
	andl	$255, %edx
	jne	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=2
	testq	%rsi, %rsi
	jne	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=2
	cmpq	%rax, %r10
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=2
	xorl	%esi, %esi
	jmp	LBB0_16
LBB0_5:
	leaq	1(%r15), %rax
	movq	%rax, -48(%rbp)
	movb	$45, (%r15)
	cmpl	$16, %r12d
	je	LBB0_7
LBB0_18:
	leaq	-80(%rbp), %rdi
	movq	%r14, %rsi
	callq	_mbedtls_mpi_copy
	movl	%eax, %edi
	callq	_MBEDTLS_MPI_CHK
	cmpl	$-1, -80(%rbp)
	jne	LBB0_20
## %bb.19:
	movl	$1, -80(%rbp)
LBB0_20:
	leaq	-80(%rbp), %rdi
	leaq	-48(%rbp), %rdx
	movl	%r12d, %esi
	callq	_mpi_write_hlp
	movl	%eax, %edi
	callq	_MBEDTLS_MPI_CHK
LBB0_21:
	movq	-48(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	%rcx, -48(%rbp)
	movb	$0, (%rax)
	movq	-48(%rbp), %rax
	subq	%r15, %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	leaq	-80(%rbp), %rdi
	callq	_mbedtls_mpi_free
	xorl	%eax, %eax
LBB0_22:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MBEDTLS_ERR_MPI_BAD_INPUT_DATA,4,2 ## @MBEDTLS_ERR_MPI_BAD_INPUT_DATA
	.comm	_MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL,4,2 ## @MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL
	.comm	_ciL,8,3                        ## @ciL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"0123456789ABCDEF"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_mpi_write_string       ; -- Begin function mbedtls_mpi_write_string
	.p2align	2
_mbedtls_mpi_write_string:              ; @mbedtls_mpi_write_string
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	sub	w8, w1, #17
	cmn	w8, #16
	b.hi	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _MBEDTLS_ERR_MPI_BAD_INPUT_DATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MBEDTLS_ERR_MPI_BAD_INPUT_DATA@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	b	LBB0_20
LBB0_2:
	mov	x19, x4
	mov	x23, x3
	mov	x20, x2
	mov	x22, x1
	mov	x21, x0
	bl	_mbedtls_mpi_bitlen
	cmp	w22, #3
	cset	w8, hi
	lsr	x8, x0, x8
	cmp	w22, #15
	cset	w9, hi
	lsr	x8, x8, x9
	and	x8, x8, #0xfffffffffffffffe
	add	x8, x8, #4
	cmp	x8, x23
	b.ls	LBB0_4
; %bb.3:
	str	x8, [x19]
Lloh3:
	adrp	x8, _MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	b	LBB0_20
LBB0_4:
	str	x20, [sp, #24]
	mov	x0, sp
	bl	_mbedtls_mpi_init
	ldr	w8, [x21]
	cmn	w8, #1
	b.eq	LBB0_15
; %bb.5:
	cmp	w22, #16
	b.ne	LBB0_16
LBB0_6:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_19
; %bb.7:
	mov	x13, #0
Lloh6:
	adrp	x9, _ciL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ciL@GOTPAGEOFF]
	mov	w10, #2
Lloh8:
	adrp	x11, l_.str@PAGE
Lloh9:
	add	x11, x11, l_.str@PAGEOFF
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	mov	x8, x12
	cbz	x12, LBB0_19
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_13 Depth 2
	ldr	x15, [x9]
	sub	x12, x8, #1
	cbz	x15, LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	lsl	x14, x15, #3
	sub	x14, x14, #8
	sub	x15, x10, x15
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_13 Depth=2
	lsr	x13, x17, #4
	ldrb	w13, [x11, x13]
	ldr	x17, [sp, #24]
	add	x0, x17, #1
	str	x0, [sp, #24]
	and	x16, x16, #0xf
	ldrb	w16, [x11, x16]
	strb	w13, [x17]
	ldr	x13, [sp, #24]
	add	x17, x13, #1
	str	x17, [sp, #24]
	strb	w16, [x13]
	mov	w13, #1
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=2
	sub	x14, x14, #8
	add	x15, x15, #1
	cmp	x15, #2
	b.eq	LBB0_8
LBB0_13:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x16, [x21, #16]
	ldr	x16, [x16, x12, lsl #3]
	lsr	x16, x16, x14
	and	w17, w16, #0xff
	cmp	w17, #0
	ccmp	x13, #0, #0, eq
	ccmp	x8, x15, #4, eq
	b.eq	LBB0_11
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=2
	mov	x13, #0
	b	LBB0_12
LBB0_15:
	mov	w8, #45
	mov	x9, x20
	strb	w8, [x9], #1
	str	x9, [sp, #24]
	cmp	w22, #16
	b.eq	LBB0_6
LBB0_16:
	mov	x0, sp
	mov	x1, x21
	bl	_mbedtls_mpi_copy
	bl	_MBEDTLS_MPI_CHK
	ldr	w8, [sp]
	cmn	w8, #1
	b.ne	LBB0_18
; %bb.17:
	mov	w8, #1
	str	w8, [sp]
LBB0_18:
	mov	x0, sp
	add	x2, sp, #24
	mov	x1, x22
	bl	_mpi_write_hlp
	bl	_MBEDTLS_MPI_CHK
LBB0_19:
	ldr	x8, [sp, #24]
	add	x9, x8, #1
	str	x9, [sp, #24]
	strb	wzr, [x8]
	ldr	x8, [sp, #24]
	sub	x8, x8, x20
	str	x8, [x19]
	mov	x0, sp
	bl	_mbedtls_mpi_free
	mov	w0, #0
LBB0_20:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_MBEDTLS_ERR_MPI_BAD_INPUT_DATA,4,2 ; @MBEDTLS_ERR_MPI_BAD_INPUT_DATA
	.comm	_MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL,4,2 ; @MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL
	.comm	_ciL,8,3                        ; @ciL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"0123456789ABCDEF"

.subsections_via_symbols
