	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function doc_insert
_doc_insert:                            ## @doc_insert
	.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
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	_STORAGE_SECRET_MASK@GOTPCREL(%rip), %rax
	andq	(%rax), %rbx
	orq	%rdx, %rbx
	movq	_tot_docs@GOTPCREL(%rip), %rax
	incl	(%rax)
	addq	$24, %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_pthread_mutex_lock
	movl	(%r12), %r13d
	leal	1(%r13), %r15d
	movl	%r15d, (%r12)
	subl	4(%r12), %r13d
	movl	%r13d, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_assert
	movl	%r13d, %r14d
	sarl	$11, %r14d
	andl	$2047, %r13d                    ## imm = 0x7FF
	je	LBB0_1
## %bb.4:
	xorl	%edi, %edi
	cmpl	8(%r12), %r14d
	setl	%dil
	callq	_assert
	movq	16(%r12), %rax
	movslq	%r14d, %rcx
	movq	(%rax,%rcx,8), %rax
	movl	%r13d, %ecx
	movq	%rbx, (%rax,%rcx,8)
	jmp	LBB0_5
LBB0_1:
	movl	$2048, %edi                     ## imm = 0x800
	movl	$8, %esi
	callq	_calloc
	movq	%rax, %r13
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	callq	_assert
	movq	%rbx, (%r13)
	movl	8(%r12), %ebx
	cmpl	%ebx, %r14d
	jne	LBB0_3
## %bb.2:
	leal	(%r14,%r14), %eax
	leal	(%r14,%r14), %ebx
	incl	%ebx
	movq	16(%r12), %rdi
	leal	8(,%rax,8), %esi
	callq	_realloc
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, %r13
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	callq	_assert
	movq	%r13, 16(%r12)
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movl	%ebx, 8(%r12)
LBB0_3:
	xorl	%edi, %edi
	cmpl	%ebx, %r14d
	setl	%dil
	callq	_assert
	movq	16(%r12), %rax
	movslq	%r14d, %rcx
	movq	%r13, (%rax,%rcx,8)
LBB0_5:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_pthread_mutex_unlock
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STORAGE_SECRET_MASK,8,3        ## @STORAGE_SECRET_MASK
	.comm	_tot_docs,4,2                   ## @tot_docs
	.no_dead_strip	_doc_insert
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function doc_insert
_doc_insert:                            ; @doc_insert
	.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	x19, x0
Lloh0:
	adrp	x8, _STORAGE_SECRET_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STORAGE_SECRET_MASK@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	and	x8, x8, x1
	orr	x23, x8, x2
Lloh3:
	adrp	x8, _tot_docs@GOTPAGE
Lloh4:
	ldr	x8, [x8, _tot_docs@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	add	x20, x0, #24
	mov	x0, x20
	bl	_pthread_mutex_lock
	ldp	w8, w9, [x19]
	add	w21, w8, #1
	str	w21, [x19]
	sub	w22, w8, w9
	mvn	w8, w22
	lsr	w0, w8, #31
	bl	_assert
	asr	w24, w22, #11
	ands	w22, w22, #0x7ff
	b.eq	LBB0_2
; %bb.1:
	ldr	w8, [x19, #8]
	cmp	w24, w8
	cset	w0, lt
	bl	_assert
	ldr	x8, [x19, #16]
	ldr	x8, [x8, w24, sxtw #3]
	str	x23, [x8, w22, uxtw #3]
	b	LBB0_5
LBB0_2:
	mov	w0, #2048
	mov	w1, #8
	bl	_calloc
	mov	x22, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
	str	x23, [x22]
	ldr	w25, [x19, #8]
	cmp	w24, w25
	b.ne	LBB0_4
; %bb.3:
	mov	w25, #1
	bfi	w25, w24, #1, #31
	ldr	x0, [x19, #16]
	lsl	w1, w25, #3
	bl	_realloc
	mov	x23, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
	str	x23, [x19, #16]
	str	w25, [x19, #8]
LBB0_4:
	cmp	w24, w25
	cset	w0, lt
	bl	_assert
	ldr	x8, [x19, #16]
	str	x22, [x8, w24, sxtw #3]
LBB0_5:
	mov	x0, x20
	bl	_pthread_mutex_unlock
	mov	x0, x21
	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
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_STORAGE_SECRET_MASK,8,3        ; @STORAGE_SECRET_MASK
	.comm	_tot_docs,4,2                   ; @tot_docs
	.no_dead_strip	_doc_insert
.subsections_via_symbols
