	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sshkey_generate                ## -- Begin function sshkey_generate
	.p2align	4, 0x90
_sshkey_generate:                       ## @sshkey_generate
	.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
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movq	%rdx, %r12
	movl	%edi, %r14d
	movq	$0, (%rdx)
	movq	_KEY_UNSPEC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_sshkey_new
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r15
	cmpl	$130, %r14d
	jne	LBB0_5
## %bb.8:
	movq	_ED25519_PK_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_malloc
	movq	%rax, 32(%r15)
	movq	_SSH_ERR_ALLOC_FAIL@GOTPCREL(%rip), %rbx
	testq	%rax, %rax
	je	LBB0_6
## %bb.9:
	movq	_ED25519_SK_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_malloc
	movq	%rax, 24(%r15)
	testq	%rax, %rax
	je	LBB0_6
## %bb.10:
	movq	32(%r15), %rdi
	movq	%rax, %rsi
	callq	_crypto_sign_ed25519_keypair
	jmp	LBB0_11
LBB0_1:
	movq	_SSH_ERR_INVALID_ARGUMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_12
LBB0_3:
	movq	_SSH_ERR_ALLOC_FAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_12
LBB0_5:
	movq	_SSH_ERR_INVALID_ARGUMENT@GOTPCREL(%rip), %rbx
LBB0_6:
	movl	(%rbx), %ebx
	testl	%ebx, %ebx
	je	LBB0_11
## %bb.7:
	movq	%r15, %rdi
	callq	_sshkey_free
	jmp	LBB0_12
LBB0_11:
	movl	%r14d, (%r15)
	movq	%r15, (%r12)
	xorl	%ebx, %ebx
LBB0_12:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SSH_ERR_INTERNAL_ERROR,4,2     ## @SSH_ERR_INTERNAL_ERROR
	.comm	_SSH_ERR_INVALID_ARGUMENT,4,2   ## @SSH_ERR_INVALID_ARGUMENT
	.comm	_KEY_UNSPEC,4,2                 ## @KEY_UNSPEC
	.comm	_SSH_ERR_ALLOC_FAIL,4,2         ## @SSH_ERR_ALLOC_FAIL
	.comm	_ED25519_PK_SZ,4,2              ## @ED25519_PK_SZ
	.comm	_ED25519_SK_SZ,4,2              ## @ED25519_SK_SZ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sshkey_generate                ; -- Begin function sshkey_generate
	.p2align	2
_sshkey_generate:                       ; @sshkey_generate
	.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
	cbz	x2, LBB0_6
; %bb.1:
	mov	x19, x2
	mov	x20, x0
	str	xzr, [x2]
Lloh0:
	adrp	x8, _KEY_UNSPEC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KEY_UNSPEC@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_sshkey_new
	cbz	x0, LBB0_7
; %bb.2:
	mov	x21, x0
	cmp	w20, #130
	b.ne	LBB0_8
; %bb.3:
Lloh3:
	adrp	x8, _ED25519_PK_SZ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ED25519_PK_SZ@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_malloc
	str	x0, [x21, #32]
	cbz	x0, LBB0_10
; %bb.4:
Lloh6:
	adrp	x8, _ED25519_SK_SZ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ED25519_SK_SZ@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_malloc
	str	x0, [x21, #24]
	cbz	x0, LBB0_10
; %bb.5:
	mov	x1, x0
	ldr	x0, [x21, #32]
	bl	_crypto_sign_ed25519_keypair
	b	LBB0_11
LBB0_6:
Lloh9:
	adrp	x8, _SSH_ERR_INVALID_ARGUMENT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SSH_ERR_INVALID_ARGUMENT@GOTPAGEOFF]
Lloh11:
	ldr	w22, [x8]
	b	LBB0_12
LBB0_7:
Lloh12:
	adrp	x8, _SSH_ERR_ALLOC_FAIL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SSH_ERR_ALLOC_FAIL@GOTPAGEOFF]
Lloh14:
	ldr	w22, [x8]
	b	LBB0_12
LBB0_8:
Lloh15:
	adrp	x8, _SSH_ERR_INVALID_ARGUMENT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SSH_ERR_INVALID_ARGUMENT@GOTPAGEOFF]
Lloh17:
	ldr	w22, [x8]
	cbz	w22, LBB0_11
LBB0_9:
	mov	x0, x21
	bl	_sshkey_free
	b	LBB0_12
LBB0_10:
Lloh18:
	adrp	x8, _SSH_ERR_ALLOC_FAIL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SSH_ERR_ALLOC_FAIL@GOTPAGEOFF]
Lloh20:
	ldr	w22, [x8]
	cbnz	w22, LBB0_9
LBB0_11:
	mov	w22, #0
	str	w20, [x21]
	str	x21, [x19]
LBB0_12:
	mov	x0, x22
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_SSH_ERR_INTERNAL_ERROR,4,2     ; @SSH_ERR_INTERNAL_ERROR
	.comm	_SSH_ERR_INVALID_ARGUMENT,4,2   ; @SSH_ERR_INVALID_ARGUMENT
	.comm	_KEY_UNSPEC,4,2                 ; @KEY_UNSPEC
	.comm	_SSH_ERR_ALLOC_FAIL,4,2         ; @SSH_ERR_ALLOC_FAIL
	.comm	_ED25519_PK_SZ,4,2              ; @ED25519_PK_SZ
	.comm	_ED25519_SK_SZ,4,2              ; @ED25519_SK_SZ
.subsections_via_symbols
