	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function md5_doc_insert
_md5_doc_insert:                        ## @md5_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	%rcx, %r12
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rsi
	movl	$3, %edi
	callq	_vkprintf
	leaq	-56(%rbp), %rcx
	movq	%r14, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_md5_doc_lookup
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	_STORAGE_ERR_WRONG_SECRET@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_2
## %bb.3:
	movl	4(%r14), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_lrand48
	movq	_STORAGE_SECRET_MASK@GOTPCREL(%rip), %rcx
	andq	(%rcx), %rbx
	orq	%r12, %rbx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%r15, %rsi
	movl	%eax, %edx
	movq	%rbx, %rcx
	callq	_md5_tree_insert
	movl	%eax, 4(%r14)
	incl	(%r14)
	movq	_tot_docs@GOTPCREL(%rip), %rax
	incl	(%rax)
	jmp	LBB0_4
LBB0_2:
	movq	_STORAGE_ERR_DOC_EXISTS@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_4:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"md5_doc_insert (secret = %llx, file_pos = %llx)\n"

	.comm	_STORAGE_ERR_WRONG_SECRET,4,2   ## @STORAGE_ERR_WRONG_SECRET
	.comm	_STORAGE_ERR_DOC_EXISTS,4,2     ## @STORAGE_ERR_DOC_EXISTS
	.comm	_STORAGE_SECRET_MASK,8,3        ## @STORAGE_SECRET_MASK
	.comm	_tot_docs,4,2                   ## @tot_docs
	.no_dead_strip	_md5_doc_insert
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function md5_doc_insert
_md5_doc_insert:                        ; @md5_doc_insert
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x21, x3
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #3
	bl	_vkprintf
	add	x3, sp, #8
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_md5_doc_lookup
	cbz	w0, LBB0_3
; %bb.1:
Lloh2:
	adrp	x8, _STORAGE_ERR_WRONG_SECRET@GOTPAGE
Lloh3:
	ldr	x8, [x8, _STORAGE_ERR_WRONG_SECRET@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w0, w8
	b.eq	LBB0_3
; %bb.2:
	ldr	w23, [x19, #4]
	bl	_lrand48
	mov	x2, x0
Lloh5:
	adrp	x8, _STORAGE_SECRET_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _STORAGE_SECRET_MASK@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	and	x8, x8, x22
	orr	x3, x8, x21
	mov	x0, x23
	mov	x1, x20
	bl	_md5_tree_insert
	mov	x8, x0
	mov	w0, #0
	ldr	w9, [x19]
	add	w9, w9, #1
	stp	w9, w8, [x19]
Lloh8:
	adrp	x8, _tot_docs@GOTPAGE
Lloh9:
	ldr	x8, [x8, _tot_docs@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	b	LBB0_4
LBB0_3:
Lloh10:
	adrp	x8, _STORAGE_ERR_DOC_EXISTS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _STORAGE_ERR_DOC_EXISTS@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
LBB0_4:
	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
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"md5_doc_insert (secret = %llx, file_pos = %llx)\n"

	.comm	_STORAGE_ERR_WRONG_SECRET,4,2   ; @STORAGE_ERR_WRONG_SECRET
	.comm	_STORAGE_ERR_DOC_EXISTS,4,2     ; @STORAGE_ERR_DOC_EXISTS
	.comm	_STORAGE_SECRET_MASK,8,3        ; @STORAGE_SECRET_MASK
	.comm	_tot_docs,4,2                   ; @tot_docs
	.no_dead_strip	_md5_doc_insert
.subsections_via_symbols
