	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dh_gen_key                     ## -- Begin function dh_gen_key
	.p2align	4, 0x90
_dh_gen_key:                            ## @dh_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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	leaq	-32(%rbp), %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_DH_get0_pqg
	testl	%ebx, %ebx
	js	LBB0_5
## %bb.1:
	movq	-32(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.2:
	callq	_BN_num_bits
	testl	%eax, %eax
	jle	LBB0_5
## %bb.3:
	movq	_INT_MAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	sarl	%edx
	cmpl	%ebx, %edx
	jl	LBB0_5
## %bb.4:
	leal	(%rbx,%rbx), %ecx
	cmpl	%eax, %ecx
	jg	LBB0_5
## %bb.6:
	cmpl	$257, %ebx                      ## imm = 0x101
	movl	$256, %edi                      ## imm = 0x100
	cmovgel	%ebx, %edi
	addl	%edi, %edi
	decl	%eax
	movl	%eax, %esi
	callq	_MINIMUM
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_DH_set_length
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movq	%r14, %rdi
	callq	_DH_generate_key
	testq	%rax, %rax
	je	LBB0_7
## %bb.9:
	xorl	%ebx, %ebx
	leaq	-24(%rbp), %rsi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_DH_get0_key
	movq	-24(%rbp), %rsi
	movq	%r14, %rdi
	callq	_dh_pub_is_valid
	testl	%eax, %eax
	jne	LBB0_12
## %bb.10:
	movq	_SSH_ERR_INVALID_FORMAT@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_5:
	movq	_SSH_ERR_INVALID_ARGUMENT@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	movq	_SSH_ERR_LIBCRYPTO_ERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.comm	_SSH_ERR_INVALID_ARGUMENT,4,2   ## @SSH_ERR_INVALID_ARGUMENT
	.comm	_SSH_ERR_LIBCRYPTO_ERROR,4,2    ## @SSH_ERR_LIBCRYPTO_ERROR
	.comm	_SSH_ERR_INVALID_FORMAT,4,2     ## @SSH_ERR_INVALID_FORMAT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dh_gen_key                     ; -- Begin function dh_gen_key
	.p2align	2
_dh_gen_key:                            ; @dh_gen_key
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
	add	x1, sp, #8
	mov	x2, #0
	mov	x3, #0
	bl	_DH_get0_pqg
	tbnz	w20, #31, LBB0_4
; %bb.1:
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_4
; %bb.2:
	bl	_BN_num_bits
	subs	w1, w0, #1
	b.lt	LBB0_4
; %bb.3:
Lloh0:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #0
	cinc	w8, w8, lt
	lsl	w9, w20, #1
	cmp	w20, w8, asr #1
	ccmp	w9, w0, #0, le
	b.le	LBB0_7
LBB0_4:
Lloh3:
	adrp	x8, _SSH_ERR_INVALID_ARGUMENT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SSH_ERR_INVALID_ARGUMENT@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_7:
	mov	w8, #256
	cmp	w20, #256
	csel	w8, w20, w8, gt
	lsl	w0, w8, #1
	bl	_MINIMUM
	mov	x1, x0
	mov	x0, x19
	bl	_DH_set_length
	cbz	w0, LBB0_10
; %bb.8:
	mov	x0, x19
	bl	_DH_generate_key
	cbz	x0, LBB0_10
; %bb.9:
	mov	x1, sp
	mov	x0, x19
	mov	x2, #0
	bl	_DH_get0_key
	ldr	x1, [sp]
	mov	x0, x19
	bl	_dh_pub_is_valid
Lloh5:
	adrp	x8, _SSH_ERR_INVALID_FORMAT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SSH_ERR_INVALID_FORMAT@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w0, #0
	csel	w0, w8, wzr, eq
	b	LBB0_6
LBB0_10:
Lloh8:
	adrp	x8, _SSH_ERR_LIBCRYPTO_ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SSH_ERR_LIBCRYPTO_ERROR@GOTPAGEOFF]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.comm	_SSH_ERR_INVALID_ARGUMENT,4,2   ; @SSH_ERR_INVALID_ARGUMENT
	.comm	_SSH_ERR_LIBCRYPTO_ERROR,4,2    ; @SSH_ERR_LIBCRYPTO_ERROR
	.comm	_SSH_ERR_INVALID_FORMAT,4,2     ; @SSH_ERR_INVALID_FORMAT
.subsections_via_symbols
