	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_rsa_gen_key            ## -- Begin function mbedtls_rsa_gen_key
	.p2align	4, 0x90
_mbedtls_rsa_gen_key:                   ## @mbedtls_rsa_gen_key
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -104(%rbp)                ## 8-byte Spill
	movq	%rsi, -96(%rbp)                 ## 8-byte Spill
	testq	%rsi, %rsi
	je	LBB0_3
## %bb.1:
	movl	%ecx, %r13d
	cmpl	$128, %ecx
	jb	LBB0_3
## %bb.2:
	movl	%r8d, %r14d
	cmpl	$2, %r8d
	jle	LBB0_3
## %bb.4:
	testb	$1, %r13b
	jne	LBB0_3
## %bb.5:
	movq	%rdi, %r15
	leaq	-44(%rbp), %rdi
	callq	_mbedtls_mpi_init
	leaq	-56(%rbp), %rdi
	callq	_mbedtls_mpi_init
	leaq	-52(%rbp), %rdi
	callq	_mbedtls_mpi_init
	leaq	-48(%rbp), %rdi
	callq	_mbedtls_mpi_init
	leaq	32(%r15), %rdi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movl	%r14d, %esi
	callq	_mbedtls_mpi_lset
	movl	%eax, %edi
	callq	_MBEDTLS_MPI_CHK
	leaq	8(%r15), %r14
	movl	%r13d, -60(%rbp)                ## 4-byte Spill
	shrl	%r13d
	movq	%r15, %rax
	addq	$12, %r15
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	addq	$4, %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	leaq	-44(%rbp), %rdi
	movq	%r14, %rsi
	movl	$1, %edx
	callq	_mbedtls_mpi_sub_int
	movl	%eax, %edi
	callq	_MBEDTLS_MPI_CHK
	leaq	-56(%rbp), %rbx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	$1, %edx
	callq	_mbedtls_mpi_sub_int
	movl	%eax, %edi
	callq	_MBEDTLS_MPI_CHK
	leaq	-52(%rbp), %r12
	movq	%r12, %rdi
	leaq	-44(%rbp), %rsi
	movq	%rbx, %rdx
	callq	_mbedtls_mpi_mul_mpi
	movl	%eax, %edi
	callq	_MBEDTLS_MPI_CHK
	leaq	-48(%rbp), %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	%r12, %rdx
	callq	_mbedtls_mpi_gcd
	movl	%eax, %edi
	callq	_MBEDTLS_MPI_CHK
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	leaq	-48(%rbp), %rdi
	movl	$1, %esi
	callq	_mbedtls_mpi_cmp_int
	testq	%rax, %rax
	je	LBB0_12
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%r13d, %esi
	xorl	%edx, %edx
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rcx
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %r8
	callq	_mbedtls_mpi_gen_prime
	movl	%eax, %edi
	callq	_MBEDTLS_MPI_CHK
	movq	%r15, %rdi
	movl	%r13d, %esi
	xorl	%edx, %edx
	movq	%r12, %rcx
	movq	%rbx, %r8
	callq	_mbedtls_mpi_gen_prime
	movl	%eax, %edi
	callq	_MBEDTLS_MPI_CHK
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_mbedtls_mpi_cmp_mpi
	testq	%rax, %rax
	je	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_mbedtls_mpi_mul_mpi
	movl	%eax, %edi
	callq	_MBEDTLS_MPI_CHK
	movq	%r12, %rdi
	callq	_mbedtls_mpi_bitlen
	cmpl	-60(%rbp), %eax                 ## 4-byte Folded Reload
	jne	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_mbedtls_mpi_cmp_mpi
	testq	%rax, %rax
	jns	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_mbedtls_mpi_swap
	jmp	LBB0_10
LBB0_3:
	movq	_MBEDTLS_ERR_RSA_BAD_INPUT_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_13
LBB0_12:
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	leaq	20(%r13), %r12
	leaq	-52(%rbp), %rdx
	movq	%r12, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_mbedtls_mpi_inv_mod
	movl	%eax, %edi
	callq	_MBEDTLS_MPI_CHK
	leaq	28(%r13), %rdi
	leaq	-44(%rbp), %rdx
	movq	%r12, %rsi
	callq	_mbedtls_mpi_mod_mpi
	movl	%eax, %edi
	callq	_MBEDTLS_MPI_CHK
	leaq	24(%r13), %rdi
	leaq	-56(%rbp), %rbx
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_mbedtls_mpi_mod_mpi
	movl	%eax, %edi
	callq	_MBEDTLS_MPI_CHK
	leaq	16(%r13), %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_mbedtls_mpi_inv_mod
	movl	%eax, %edi
	callq	_MBEDTLS_MPI_CHK
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_mbedtls_mpi_bitlen
	addl	$7, %eax
	sarl	$3, %eax
	movl	%eax, (%r13)
	leaq	-44(%rbp), %rdi
	callq	_mbedtls_mpi_free
	movq	%rbx, %rdi
	callq	_mbedtls_mpi_free
	leaq	-52(%rbp), %rdi
	callq	_mbedtls_mpi_free
	leaq	-48(%rbp), %rdi
	callq	_mbedtls_mpi_free
	xorl	%eax, %eax
LBB0_13:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MBEDTLS_ERR_RSA_BAD_INPUT_DATA,4,2 ## @MBEDTLS_ERR_RSA_BAD_INPUT_DATA
	.comm	_MBEDTLS_ERR_RSA_KEY_GEN_FAILED,4,2 ## @MBEDTLS_ERR_RSA_KEY_GEN_FAILED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_rsa_gen_key            ; -- Begin function mbedtls_rsa_gen_key
	.p2align	2
_mbedtls_rsa_gen_key:                   ; @mbedtls_rsa_gen_key
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cbz	x1, LBB0_11
; %bb.1:
	mov	x20, x3
	cmp	w3, #128
	b.lo	LBB0_11
; %bb.2:
	mov	x23, x4
	cmp	w4, #2
	b.le	LBB0_11
; %bb.3:
	tbnz	w20, #0, LBB0_11
; %bb.4:
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	add	x0, sp, #12
	bl	_mbedtls_mpi_init
	add	x0, sp, #8
	bl	_mbedtls_mpi_init
	add	x0, sp, #4
	bl	_mbedtls_mpi_init
	mov	x0, sp
	bl	_mbedtls_mpi_init
	add	x26, x19, #32
	mov	x0, x26
	mov	x1, x23
	bl	_mbedtls_mpi_lset
	bl	_MBEDTLS_MPI_CHK
	add	x24, x19, #8
	lsr	w27, w20, #1
	add	x25, x19, #12
	add	x23, x19, #4
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x0, sp, #12
	mov	x1, x24
	mov	w2, #1
	bl	_mbedtls_mpi_sub_int
	bl	_MBEDTLS_MPI_CHK
	add	x0, sp, #8
	mov	x1, x25
	mov	w2, #1
	bl	_mbedtls_mpi_sub_int
	bl	_MBEDTLS_MPI_CHK
	add	x0, sp, #4
	add	x1, sp, #12
	add	x2, sp, #8
	bl	_mbedtls_mpi_mul_mpi
	bl	_MBEDTLS_MPI_CHK
	mov	x0, sp
	add	x2, sp, #4
	mov	x1, x26
	bl	_mbedtls_mpi_gcd
	bl	_MBEDTLS_MPI_CHK
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, sp
	mov	w1, #1
	bl	_mbedtls_mpi_cmp_int
	cbz	x0, LBB0_12
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	mov	x1, x27
	mov	w2, #0
	mov	x3, x22
	mov	x4, x21
	bl	_mbedtls_mpi_gen_prime
	bl	_MBEDTLS_MPI_CHK
	mov	x0, x25
	mov	x1, x27
	mov	w2, #0
	mov	x3, x22
	mov	x4, x21
	bl	_mbedtls_mpi_gen_prime
	bl	_MBEDTLS_MPI_CHK
	mov	x0, x24
	mov	x1, x25
	bl	_mbedtls_mpi_cmp_mpi
	cbz	x0, LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x23
	mov	x1, x24
	mov	x2, x25
	bl	_mbedtls_mpi_mul_mpi
	bl	_MBEDTLS_MPI_CHK
	mov	x0, x23
	bl	_mbedtls_mpi_bitlen
	cmp	w0, w20
	b.ne	LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x24
	mov	x1, x25
	bl	_mbedtls_mpi_cmp_mpi
	tbz	x0, #63, LBB0_5
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x24
	mov	x1, x25
	bl	_mbedtls_mpi_swap
	b	LBB0_5
LBB0_11:
Lloh0:
	adrp	x8, _MBEDTLS_ERR_RSA_BAD_INPUT_DATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MBEDTLS_ERR_RSA_BAD_INPUT_DATA@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	b	LBB0_13
LBB0_12:
	add	x20, x19, #20
	add	x2, sp, #4
	mov	x0, x20
	mov	x1, x26
	bl	_mbedtls_mpi_inv_mod
	bl	_MBEDTLS_MPI_CHK
	add	x0, x19, #28
	add	x2, sp, #12
	mov	x1, x20
	bl	_mbedtls_mpi_mod_mpi
	bl	_MBEDTLS_MPI_CHK
	add	x0, x19, #24
	add	x2, sp, #8
	mov	x1, x20
	bl	_mbedtls_mpi_mod_mpi
	bl	_MBEDTLS_MPI_CHK
	add	x0, x19, #16
	mov	x1, x25
	mov	x2, x24
	bl	_mbedtls_mpi_inv_mod
	bl	_MBEDTLS_MPI_CHK
	mov	x0, x23
	bl	_mbedtls_mpi_bitlen
	add	w8, w0, #7
	asr	w8, w8, #3
	str	w8, [x19]
	add	x0, sp, #12
	bl	_mbedtls_mpi_free
	add	x0, sp, #8
	bl	_mbedtls_mpi_free
	add	x0, sp, #4
	bl	_mbedtls_mpi_free
	mov	x0, sp
	bl	_mbedtls_mpi_free
	mov	w0, #0
LBB0_13:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MBEDTLS_ERR_RSA_BAD_INPUT_DATA,4,2 ; @MBEDTLS_ERR_RSA_BAD_INPUT_DATA
	.comm	_MBEDTLS_ERR_RSA_KEY_GEN_FAILED,4,2 ; @MBEDTLS_ERR_RSA_KEY_GEN_FAILED
.subsections_via_symbols
