	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rsa_generate_private_key
_rsa_generate_private_key:              ## @rsa_generate_private_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %r12
	movl	%edi, %r14d
	xorl	%eax, %eax
	callq	_RSA_new
	movq	%rax, 8(%r13)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_BN_new
	movq	%rax, %rbx
	movq	%rax, %rdi
	movl	$65537, %esi                    ## imm = 0x10001
	callq	_BN_set_word
	movq	(%r12), %rax
	testq	%rax, %rax
	movl	$2048, %esi                     ## imm = 0x800
	cmovneq	%rax, %rsi
	movq	8(%r13), %rdi
	movq	%rbx, %rdx
	xorl	%ecx, %ecx
	callq	_RSA_generate_key_ex
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_BN_free
	cmpl	$1, %r12d
	jne	LBB0_1
## %bb.3:
	movq	_ASN1_OID_ID_PKCS1_SHA1WITHRSAENCRYPTION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r13)
	jmp	LBB0_4
LBB0_1:
	movq	_HX509_PARSING_KEY_FAILED@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	leaq	L_.str(%rip), %rcx
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	_hx509_set_error_string
	movl	(%rbx), %r15d
LBB0_4:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HX509_PARSING_KEY_FAILED,4,2   ## @HX509_PARSING_KEY_FAILED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to generate RSA key"

	.comm	_ASN1_OID_ID_PKCS1_SHA1WITHRSAENCRYPTION,4,2 ## @ASN1_OID_ID_PKCS1_SHA1WITHRSAENCRYPTION
	.no_dead_strip	_rsa_generate_private_key
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rsa_generate_private_key
_rsa_generate_private_key:              ; @rsa_generate_private_key
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_RSA_new
	str	x0, [x20, #8]
	cbz	x0, LBB0_3
; %bb.1:
	bl	_BN_new
	mov	x22, x0
	mov	w1, #65537
	bl	_BN_set_word
	ldr	x8, [x21]
	mov	w9, #2048
	cmp	x8, #0
	csel	x1, x9, x8, eq
	ldr	x0, [x20, #8]
	mov	x2, x22
	mov	x3, #0
	bl	_RSA_generate_key_ex
	mov	x21, x0
	mov	x0, x22
	bl	_BN_free
	cmp	w21, #1
	b.ne	LBB0_3
; %bb.2:
	mov	w0, #0
Lloh0:
	adrp	x8, _ASN1_OID_ID_PKCS1_SHA1WITHRSAENCRYPTION@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ASN1_OID_ID_PKCS1_SHA1WITHRSAENCRYPTION@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x20]
	b	LBB0_4
LBB0_3:
Lloh3:
	adrp	x20, _HX509_PARSING_KEY_FAILED@GOTPAGE
Lloh4:
	ldr	x20, [x20, _HX509_PARSING_KEY_FAILED@GOTPAGEOFF]
	ldr	w2, [x20]
Lloh5:
	adrp	x3, l_.str@PAGE
Lloh6:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	mov	w1, #0
	bl	_hx509_set_error_string
	ldr	w0, [x20]
LBB0_4:
	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 AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_HX509_PARSING_KEY_FAILED,4,2   ; @HX509_PARSING_KEY_FAILED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to generate RSA key"

	.comm	_ASN1_OID_ID_PKCS1_SHA1WITHRSAENCRYPTION,4,2 ; @ASN1_OID_ID_PKCS1_SHA1WITHRSAENCRYPTION
	.no_dead_strip	_rsa_generate_private_key
.subsections_via_symbols
