	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_crypto_dh_init                 ## -- Begin function crypto_dh_init
	.p2align	4, 0x90
_crypto_dh_init:                        ## @crypto_dh_init
	.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
	movq	%r8, %r12
	movq	%rcx, %r13
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movl	%edi, -48(%rbp)
	xorl	%eax, %eax
	callq	_TEST_FAIL
	movl	$-1, %r15d
	testq	%rax, %rax
	je	LBB0_1
LBB0_11:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	$4, %edi
	callq	_os_malloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.2:
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_wc_InitDhKey
	leaq	-44(%rbp), %rdi
	callq	_wc_InitRng
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	callq	_os_free
	jmp	LBB0_11
LBB0_4:
	leaq	-48(%rbp), %rcx
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	movl	$1, %r8d
	callq	_wc_DhSetKey
	movl	$-1, %r15d
	testq	%rax, %rax
	jne	LBB0_10
## %bb.5:
	leaq	-44(%rbp), %rsi
	leaq	-72(%rbp), %rcx
	leaq	-64(%rbp), %r9
	movq	%r12, %rdi
	movq	%r13, %rdx
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	callq	_wc_DhGenerateKeyPair
	testq	%rax, %rax
	jne	LBB0_10
## %bb.6:
	movq	-72(%rbp), %rdx
	movq	%rbx, %r14
	cmpq	%rbx, %rdx
	jae	LBB0_8
## %bb.7:
	movq	%r14, %r15
	subq	%rdx, %r15
	leaq	(,%r15,4), %rdi
	addq	%r13, %rdi
	movq	%r13, %rsi
	callq	_os_memmove
	movq	%r13, %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_os_memset
LBB0_8:
	movq	-64(%rbp), %rdx
	xorl	%r15d, %r15d
	cmpq	%r14, %rdx
	jae	LBB0_10
## %bb.9:
	subq	%rdx, %rbx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	leaq	(%r14,%rbx,4), %rdi
	movq	%r14, %rsi
	callq	_os_memmove
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_os_memset
LBB0_10:
	movq	%r12, %rdi
	callq	_wc_FreeDhKey
	movq	%r12, %rdi
	callq	_os_free
	leaq	-44(%rbp), %rdi
	callq	_wc_FreeRng
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_crypto_dh_init                 ; -- Begin function crypto_dh_init
	.p2align	2
_crypto_dh_init:                        ; @crypto_dh_init
	.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
	mov	x20, x4
	mov	x22, x3
	mov	x21, x2
	mov	x23, x1
	str	w0, [sp, #28]
	bl	_TEST_FAIL
	cbz	x0, LBB0_3
LBB0_1:
	mov	w20, #-1
LBB0_2:
	mov	x0, x20
	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
LBB0_3:
	mov	w0, #4
	bl	_os_malloc
	cbz	x0, LBB0_1
; %bb.4:
	mov	x19, x0
	bl	_wc_InitDhKey
	add	x0, sp, #24
	bl	_wc_InitRng
	cbz	x0, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_os_free
	b	LBB0_1
LBB0_6:
	add	x3, sp, #28
	mov	x0, x19
	mov	x1, x23
	mov	x2, x21
	mov	w4, #1
	bl	_wc_DhSetKey
	cbnz	x0, LBB0_8
; %bb.7:
	add	x1, sp, #24
	add	x3, sp, #16
	add	x5, sp, #8
	mov	x0, x19
	mov	x2, x22
	mov	x4, x20
	bl	_wc_DhGenerateKeyPair
	cbz	x0, LBB0_10
LBB0_8:
	mov	w20, #-1
LBB0_9:
	mov	x0, x19
	bl	_wc_FreeDhKey
	mov	x0, x19
	bl	_os_free
	add	x0, sp, #24
	bl	_wc_FreeRng
	b	LBB0_2
LBB0_10:
	ldr	x2, [sp, #16]
	cmp	x2, x21
	b.hs	LBB0_12
; %bb.11:
	sub	x23, x21, x2
	add	x0, x22, x23, lsl #2
	mov	x1, x22
	bl	_os_memmove
	mov	x0, x22
	mov	w1, #0
	mov	x2, x23
	bl	_os_memset
LBB0_12:
	ldr	x2, [sp, #8]
	cmp	x2, x21
	b.hs	LBB0_14
; %bb.13:
	sub	x21, x21, x2
	add	x0, x20, x21, lsl #2
	mov	x1, x20
	bl	_os_memmove
	mov	x0, x20
	mov	w1, #0
	mov	x2, x21
	bl	_os_memset
LBB0_14:
	mov	w20, #0
	b	LBB0_9
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
