	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bnrand
_bnrand:                                ## @bnrand
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $edx killed $edx def $rdx
	testl	%edx, %edx
	je	LBB0_1
## %bb.2:
	movl	%ecx, %r13d
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	leal	7(%rdx), %eax
	leal	14(%rdx), %r14d
	testl	%eax, %eax
	cmovnsl	%eax, %r14d
	sarl	$3, %r14d
	leal	-1(%rdx), %eax
	leal	6(%rdx), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	andl	$-8, %ecx
	negl	%ecx
	leal	(%rdx,%rcx), %r15d
	decl	%r15d
	movl	$255, %ebx
	movl	%r15d, %ecx
	shll	%cl, %ebx
	movl	%r14d, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r12
	movq	%rax, %rdi
	movl	%r14d, %esi
	callq	_t_random
	testl	%r13d, %r13d
	je	LBB0_8
## %bb.5:
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.7:
	decb	%r15b
	movl	$3, %eax
	jmp	LBB0_9
LBB0_1:
	movq	%rsi, %rdi
	callq	_BN_zero
	movl	$1, %ebx
	jmp	LBB0_13
LBB0_3:
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_8:
	movl	$1, %eax
LBB0_9:
	movl	%r15d, %ecx
	shll	%cl, %eax
	orb	(%r12), %al
	addb	%bl, %bl
	notb	%bl
	andb	%al, %bl
	movb	%bl, (%r12)
	jmp	LBB0_10
LBB0_6:
	movb	$1, (%r12)
	orb	$-128, 1(%r12)
LBB0_10:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movslq	%r14d, %rax
	orb	$1, -1(%rax,%r12)
LBB0_12:
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_BN_bin2bn
	xorl	%ebx, %ebx
	testl	%eax, %eax
	setne	%bl
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	%r14d, %edx
	callq	_memset
	movq	%r12, %rdi
	callq	_free
LBB0_13:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_bnrand
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bnrand
_bnrand:                                ; @bnrand
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	cbz	w2, LBB0_5
; %bb.1:
	mov	x22, x4
	mov	x23, x3
	add	w8, w2, #7
	add	w9, w2, #14
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w19, w8, #3
	sub	w8, w2, #1
	negs	w9, w8
	and	w9, w9, #0x7
	and	w8, w8, #0x7
	csneg	w24, w8, w9, mi
	mov	x0, x19
	bl	_malloc
	cbz	x0, LBB0_6
; %bb.2:
	mov	x21, x0
	mov	w8, #255
	lsl	w25, w8, w24
	mov	x1, x19
	bl	_t_random
	cbz	w23, LBB0_7
; %bb.3:
	cbz	w24, LBB0_12
; %bb.4:
	sub	w8, w24, #1
	mov	w9, #3
	lsl	w8, w9, w8
	b	LBB0_8
LBB0_5:
	mov	x0, x20
	bl	_BN_zero
	mov	w20, #1
	b	LBB0_11
LBB0_6:
	mov	w20, #0
	b	LBB0_11
LBB0_7:
	mov	w8, #1
	lsl	w8, w8, w24
LBB0_8:
	ldrb	w9, [x21]
	orr	w8, w9, w8
	bic	w8, w8, w25, lsl #1
	strb	w8, [x21]
	cbz	w22, LBB0_10
LBB0_9:
	add	x8, x21, w19, sxtw
	ldurb	w9, [x8, #-1]
	orr	w9, w9, #0x1
	sturb	w9, [x8, #-1]
LBB0_10:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_BN_bin2bn
	cmp	w0, #0
	cset	w20, ne
	mov	x0, x21
	mov	w1, #0
	mov	x2, x19
	bl	_memset
	mov	x0, x21
	bl	_free
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_12:
	mov	w8, #1
	strb	w8, [x21]
	ldrb	w8, [x21, #1]
	orr	w8, w8, #0x80
	strb	w8, [x21, #1]
	cbnz	w22, LBB0_9
	b	LBB0_10
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_bnrand
.subsections_via_symbols
