	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_crypto_dh_derive_secret        ## -- Begin function crypto_dh_derive_secret
	.p2align	4, 0x90
_crypto_dh_derive_secret:               ## @crypto_dh_derive_secret
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	32(%rbp), %rdx
	movl	$-1, %r15d
	cmpq	%r14, %rdx
	ja	LBB0_22
## %bb.1:
	movq	%r9, %r13
	movq	%rcx, %r12
	movq	%rsi, %rbx
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	movq	24(%rbp), %rdi
	jne	LBB0_3
## %bb.2:
	movq	%rbx, %rsi
	callq	_os_memcmp
	testq	%rax, %rax
	jns	LBB0_22
LBB0_3:
	xorl	%eax, %eax
	callq	_bignum_init
	movq	%rax, %rdi
	movl	$-1, %r15d
	testq	%rax, %rax
	je	LBB0_21
## %bb.4:
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%r13, %rbx
	movq	%rdi, %r13
	movq	24(%rbp), %rsi
	movq	32(%rbp), %rdx
	callq	_bignum_set_unsigned_bin
	testq	%rax, %rax
	js	LBB0_5
## %bb.6:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_bignum_cmp_d
	testq	%rax, %rax
	jle	LBB0_20
## %bb.7:
	testq	%r12, %r12
	movq	%rbx, %rdx
	je	LBB0_15
## %bb.8:
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	callq	_bignum_init
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_bignum_init
	movq	%rax, %r13
	xorl	%eax, %eax
	callq	_bignum_init
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testq	%rbx, %rbx
	je	LBB0_18
## %bb.9:
	testq	%r13, %r13
	je	LBB0_18
## %bb.10:
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_18
## %bb.11:
	movq	%rbx, %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	_bignum_set_unsigned_bin
	testq	%rax, %rax
	js	LBB0_18
## %bb.12:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_bignum_set_unsigned_bin
	testq	%rax, %rax
	js	LBB0_17
## %bb.13:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	callq	_bignum_exptmod
	testq	%rax, %rax
	js	LBB0_16
## %bb.14:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_bignum_cmp_d
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_bignum_deinit
	movq	%r13, %rdi
	callq	_bignum_deinit
	movq	%rbx, %rdi
	callq	_bignum_deinit
	cmpq	$0, -64(%rbp)                   ## 8-byte Folded Reload
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	jne	LBB0_21
LBB0_15:
	movq	16(%rbp), %rcx
	movq	24(%rbp), %rdi
	movq	32(%rbp), %rsi
	movq	-80(%rbp), %r8                  ## 8-byte Reload
	movq	%r14, %r9
	pushq	48(%rbp)
	pushq	40(%rbp)
	callq	_crypto_mod_exp
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	addq	$16, %rsp
	movl	%eax, %r15d
	jmp	LBB0_21
LBB0_5:
	movq	%r13, %rdi
	jmp	LBB0_21
LBB0_18:
	movq	%rbx, %rdi
LBB0_19:
	callq	_bignum_deinit
	movq	%r13, %rdi
	callq	_bignum_deinit
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_bignum_deinit
LBB0_20:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_21:
	callq	_bignum_deinit
LBB0_22:
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_19
LBB0_16:
	movq	%r12, %rdi
	jmp	LBB0_19
	.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_derive_secret        ; -- Begin function crypto_dh_derive_secret
	.p2align	2
_crypto_dh_derive_secret:               ; @crypto_dh_derive_secret
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	ldr	x25, [x29, #16]
	cmp	x25, x2
	b.hi	LBB0_3
; %bb.1:
	mov	x23, x7
	mov	x20, x6
	mov	x22, x5
	mov	x27, x4
	mov	x28, x3
	mov	x21, x2
	mov	x24, x1
	b.ne	LBB0_4
; %bb.2:
	mov	x0, x23
	mov	x1, x24
	mov	x2, x25
	bl	_os_memcmp
	tbnz	x0, #63, LBB0_4
LBB0_3:
	mov	w20, #-1
	b	LBB0_23
LBB0_4:
	bl	_bignum_init
	mov	x19, x0
	cbz	x0, LBB0_21
; %bb.5:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x25
	bl	_bignum_set_unsigned_bin
	tbnz	x0, #63, LBB0_21
; %bb.6:
	mov	x0, x19
	mov	w1, #1
	bl	_bignum_cmp_d
	cmp	x0, #1
	b.lt	LBB0_21
; %bb.7:
	cbz	x28, LBB0_15
; %bb.8:
	bl	_bignum_init
	mov	x26, x0
	bl	_bignum_init
	str	x0, [sp, #24]                   ; 8-byte Folded Spill
	bl	_bignum_init
	cbz	x26, LBB0_16
; %bb.9:
	ldr	x9, [sp, #24]                   ; 8-byte Folded Reload
	cbz	x9, LBB0_16
; %bb.10:
	cbz	x0, LBB0_16
; %bb.11:
	str	x0, [sp, #16]                   ; 8-byte Folded Spill
	mov	x0, x26
	mov	x1, x24
	mov	x2, x21
	bl	_bignum_set_unsigned_bin
	tbnz	x0, #63, LBB0_17
; %bb.12:
	str	x26, [sp, #8]                   ; 8-byte Folded Spill
	ldr	x26, [sp, #24]                  ; 8-byte Folded Reload
	mov	x0, x26
	mov	x1, x28
	mov	x2, x27
	bl	_bignum_set_unsigned_bin
	tbnz	x0, #63, LBB0_18
; %bb.13:
	mov	x0, x19
	mov	x1, x26
	ldp	x27, x28, [sp, #8]              ; 16-byte Folded Reload
	mov	x2, x27
	mov	x3, x28
	bl	_bignum_exptmod
	tbnz	x0, #63, LBB0_24
; %bb.14:
	mov	x0, x28
	mov	w1, #1
	bl	_bignum_cmp_d
	str	x0, [sp]                        ; 8-byte Folded Spill
	mov	x0, x27
	bl	_bignum_deinit
	mov	x0, x26
	bl	_bignum_deinit
	mov	x0, x28
	bl	_bignum_deinit
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	cbnz	x8, LBB0_21
LBB0_15:
	ldp	x6, x7, [x29, #24]
	mov	x0, x23
	mov	x1, x25
	mov	x2, x22
	mov	x3, x20
	mov	x4, x24
	mov	x5, x21
	bl	_crypto_mod_exp
	mov	x20, x0
	b	LBB0_22
LBB0_16:
	mov	x20, x0
	mov	x0, x26
	bl	_bignum_deinit
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	bl	_bignum_deinit
	mov	x0, x20
	b	LBB0_20
LBB0_17:
	mov	x0, x26
	bl	_bignum_deinit
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	b	LBB0_19
LBB0_18:
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_bignum_deinit
	mov	x0, x26
LBB0_19:
	bl	_bignum_deinit
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
LBB0_20:
	bl	_bignum_deinit
LBB0_21:
	mov	w20, #-1
LBB0_22:
	mov	x0, x19
	bl	_bignum_deinit
LBB0_23:
	mov	x0, x20
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_24:
	mov	x0, x27
	bl	_bignum_deinit
	mov	x0, x26
	bl	_bignum_deinit
	mov	x0, x28
	b	LBB0_20
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
