	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bayes_global_save              ## -- Begin function bayes_global_save
	.p2align	4, 0x90
_bayes_global_save:                     ## @bayes_global_save
	.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
	movl	24(%rbp), %r12d
	leal	(%r12,%r12,2), %eax
	movl	%eax, %r15d
	shrl	$31, %r15d
	addl	%eax, %r15d
	sarl	%r15d
	movq	_max_words@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	cmpl	%eax, %r15d
	cmovlel	%eax, %r15d
	movl	28(%rbp), %r14d
	xorl	%edi, %edi
	cmpl	%r14d, %r15d
	setge	%dil
	callq	_assert
	leaq	16(%rbp), %r8
	leaq	24(%rbp), %r9
	cmpl	%r14d, %r15d
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	jle	LBB0_1
## %bb.2:
	movslq	%r15d, %rax
	imulq	$1801439851, %rax, %r13         ## imm = 0x6B5FCA6B
	movq	%r13, %rax
	shrq	$63, %rax
	sarq	$56, %r13
	addl	%eax, %r13d
	movl	%r15d, %edx
	cmpl	$40000000, %r15d                ## imm = 0x2625A00
	jl	LBB0_10
## %bb.3:
	movq	%rbx, %r10
	testl	%r14d, %r14d
	jle	LBB0_4
## %bb.5:
	movq	16(%r8), %rcx
	movq	%r14, %rdx
	shlq	$5, %rdx
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	addq	$32, %rsi
	cmpq	%rsi, %rdx
	je	LBB0_9
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rcx,%rsi)
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	28(%rcx,%rsi), %edi
	addl	24(%rcx,%rsi), %edi
	xorl	%ebx, %ebx
	cmpl	%r13d, %edi
	setg	%bl
	addl	%ebx, %eax
	jmp	LBB0_8
LBB0_1:
	movq	%r9, -48(%rbp)                  ## 8-byte Spill
	jmp	LBB0_17
LBB0_4:
	xorl	%eax, %eax
LBB0_9:
	leal	(%rax,%rax,2), %ecx
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	sarl	%edx
	movl	(%r10), %ecx
	cmpl	%ecx, %edx
	cmovlel	%ecx, %edx
	movl	%eax, (%r9)
LBB0_10:
	movl	$16, %edi
	movl	%edx, %r12d
	callq	_qmalloc0
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_qhtbl_init
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	movl	%r12d, %esi
	callq	_qhtbl_set_size
	leaq	16(%rbp), %r8
	testl	%r14d, %r14d
	jle	LBB0_16
## %bb.11:
	movl	$28, %r14d
	xorl	%ebx, %ebx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
                                        ## kill: def $eax killed $eax killed $rax
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_12 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	addq	$32, %r14
	cmpq	%rcx, %rbx
	jge	LBB0_16
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r8), %r12
	movq	-28(%r12,%r14), %rsi
	testq	%rsi, %rsi
	je	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	(%r12,%r14), %ecx
	addl	-4(%r12,%r14), %ecx
	cmpl	%r13d, %ecx
	jle	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_qhtbl_add
	leaq	16(%rbp), %r8
	movq	-4(%r12,%r14), %rcx
	movq	%rcx, (%rax)
	movl	12(%r8), %eax
	jmp	LBB0_15
LBB0_16:
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 12(%r8)
LBB0_17:
	movq	_fd@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movl	4(%rax), %edi
	movl	$28, %edx
	movq	%r8, %rsi
	movq	%r8, %r13
	callq	_write
	xorl	%edi, %edi
	cmpq	$28, %rax
	sete	%dil
	callq	_assert
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movslq	4(%r12), %rbx
	shlq	$2, %rbx
	movq	(%r14), %rax
	movl	4(%rax), %edi
	movq	8(%r12), %rsi
	movq	%rbx, %rdx
	callq	_write
	xorl	%edi, %edi
	cmpq	%rbx, %rax
	sete	%dil
	callq	_assert
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	cmpl	%r14d, %r15d
	jle	LBB0_19
## %bb.18:
	movq	%r12, %rdi
	callq	_qhtbl_free
	movq	%r12, %rdi
	movl	$16, %esi
	callq	_qfree
	movl	%r14d, 12(%r13)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, 8(%r13)
LBB0_19:
	addq	$28, %rbx
	movq	%rbx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_max_words,4,2                  ## @max_words
	.comm	_fd,8,3                         ## @fd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bayes_global_save              ; -- Begin function bayes_global_save
	.p2align	2
_bayes_global_save:                     ; @bayes_global_save
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	mov	x20, x0
	ldp	w22, w23, [x20, #8]!
	add	w8, w22, w22, lsl #1
	cmp	w8, #0
	cinc	w8, w8, lt
Lloh0:
	adrp	x27, _max_words@GOTPAGE
Lloh1:
	ldr	x27, [x27, _max_words@GOTPAGEOFF]
	asr	w8, w8, #1
	ldr	w9, [x27]
	cmp	w8, w9
	csel	w24, w8, w9, gt
	cmp	w24, w23
	cset	w0, ge
	bl	_assert
	ldr	w25, [x20, #4]
	cmp	w24, w25
	b.le	LBB0_16
; %bb.1:
	mov	w8, #23039
	movk	w8, #610, lsl #16
	add	w9, w8, #1
	mov	x21, x24
	sdiv	w26, w24, w9
	cmp	w24, w8
	b.le	LBB0_9
; %bb.2:
	cmp	w25, #1
	b.lt	LBB0_7
; %bb.3:
	mov	w8, #0
	ldr	x9, [x19, #16]
	add	x9, x9, #28
	mov	x10, x25
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x9, x9, #32
	subs	x10, x10, #1
	b.eq	LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldur	x11, [x9, #-28]
	cbz	x11, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldp	w11, w12, [x9, #-4]
	add	w11, w12, w11
	cmp	w11, w26
	cinc	w8, w8, gt
	b	LBB0_4
LBB0_7:
	mov	w8, #0
LBB0_8:
	add	w9, w8, w8, lsl #1
	cmp	w9, #0
	cinc	w9, w9, lt
	asr	w9, w9, #1
	ldr	w10, [x27]
	cmp	w9, w10
	csel	w21, w9, w10, gt
	str	w8, [x20]
LBB0_9:
	mov	w0, #16
	bl	_qmalloc0
	mov	x20, x0
	bl	_qhtbl_init
	mov	x0, x20
	mov	x1, x21
	bl	_qhtbl_set_size
	ldr	w8, [x19, #12]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.10:
	mov	x27, #0
	mov	x28, #0
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x28, x28, #1
	add	x27, x27, #32
	cmp	x28, w8, sxtw
	b.ge	LBB0_15
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #16]
	ldr	x1, [x9, x27]
	cbz	x1, LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	add	x9, x9, x27
	ldp	w10, w9, [x9, #24]
	add	w9, w9, w10
	cmp	w9, w26
	b.le	LBB0_11
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x20
	bl	_qhtbl_add
	ldr	x8, [x19, #16]
	add	x8, x8, x27
	ldr	x8, [x8, #24]
	str	x8, [x0]
	ldr	w8, [x19, #12]
	b	LBB0_11
LBB0_15:
	str	w21, [x19, #12]
LBB0_16:
Lloh2:
	adrp	x26, _fd@GOTPAGE
Lloh3:
	ldr	x26, [x26, _fd@GOTPAGEOFF]
	ldr	x8, [x26]
	ldr	w0, [x8, #4]
	mov	x1, x19
	mov	w2, #28
	bl	_write
	cmp	x0, #28
	cset	w0, eq
	bl	_assert
	ldrsw	x8, [x20, #4]
	lsl	x21, x8, #2
	ldr	x8, [x26]
	ldr	w0, [x8, #4]
	ldr	x1, [x20, #8]
	mov	x2, x21
	bl	_write
	cmp	x0, x21
	cset	w0, eq
	bl	_assert
	cmp	w24, w25
	b.le	LBB0_18
; %bb.17:
	mov	x0, x20
	bl	_qhtbl_free
	mov	x0, x20
	mov	w1, #16
	bl	_qfree
	stp	w22, w23, [x19, #8]
LBB0_18:
	add	x0, x21, #28
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_max_words,4,2                  ; @max_words
	.comm	_fd,8,3                         ; @fd
.subsections_via_symbols
