	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_adjust_topmsg_tree             ## -- Begin function adjust_topmsg_tree
	.p2align	4, 0x90
_adjust_topmsg_tree:                    ## @adjust_topmsg_tree
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movl	%edx, %r15d
                                        ## kill: def $esi killed $esi def $rsi
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	callq	_get_user_metafile
	movq	%rax, %rbx
	movq	24(%r13), %r12
	testl	%r15d, %r15d
	jle	LBB0_1
## %bb.2:
	movl	$1, %edi
	testq	%rbx, %rbx
	jne	LBB0_5
## %bb.3:
	testq	%r12, %r12
	je	LBB0_5
## %bb.4:
	xorl	%edi, %edi
	cmpl	%r15d, (%r12)
	setl	%dil
	jmp	LBB0_5
LBB0_1:
	xorl	%edi, %edi
LBB0_5:
	callq	_assert
	testq	%rbx, %rbx
	jne	LBB0_8
## %bb.6:
	testq	%r12, %r12
	je	LBB0_8
## %bb.7:
	movq	8(%r13), %rax
	movq	_NIL_N@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_assert
	xorl	%ebx, %ebx
	jmp	LBB0_35
LBB0_8:
	movl	16(%r13), %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_tree_lookup
	testq	%rax, %rax
	jne	LBB0_10
## %bb.9:
	movq	_NIL@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %eax
	movl	%eax, -96(%rbp)
	testq	%rbx, %rbx
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	je	LBB0_15
## %bb.11:
	leaq	-112(%rbp), %rdx
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_fetch_file_peer_list
	movq	%rax, -104(%rbp)
	movslq	-112(%rbp), %rcx
	testq	%rcx, %rcx
	je	LBB0_12
## %bb.13:
	movl	-4(%rax,%rcx,4), %eax
	jmp	LBB0_14
LBB0_15:
	movq	%r14, %r15
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -112(%rbp)
	jmp	LBB0_16
LBB0_12:
	xorl	%eax, %eax
LBB0_14:
	movq	%r14, %r15
	movl	%eax, -108(%rbp)
LBB0_16:
	leaq	-112(%rbp), %rdi
	xorl	%esi, %esi
	callq	_listree_get_kth_last
	movl	%eax, %r14d
	movl	(%r13), %ecx
	leaq	L_.str(%rip), %rsi
	movl	$4, %edi
	movq	%r13, %rdx
	movq	%r13, %r12
	movq	-48(%rbp), %r8                  ## 8-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movl	%r13d, %r9d
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	pushq	-88(%rbp)                       ## 8-byte Folded Reload
	pushq	%r14
	pushq	%r15
	callq	_vkprintf
	addq	$32, %rsp
	cmpl	$-1, %r14d
	sete	%al
	testl	%r14d, %r14d
	setg	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_assert
	movq	%r14, %rbx
	cmpl	%r13d, %r14d
	jg	LBB0_35
## %bb.17:
	movq	8(%r12), %r13
	testl	%r15d, %r15d
	movq	%r15, %rax
	jle	LBB0_27
## %bb.18:
	testl	%ebx, %ebx
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	jle	LBB0_19
## %bb.20:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_tree_num_lookup
	movl	(%rax), %r10d
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movl	%r13d, %ecx
	cmpl	%r13d, %r10d
	je	LBB0_25
## %bb.21:
	movq	_stderr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	(%r12), %edx
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	testq	%r9, %r9
	je	LBB0_22
## %bb.23:
	movl	(%r9), %ecx
	jmp	LBB0_24
LBB0_27:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	%r14d, %esi
	callq	_tree_num_lookup
	movl	(%rax), %r10d
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movl	%r13d, %ecx
	cmpl	%r13d, %r10d
	movq	-88(%rbp), %r8                  ## 8-byte Reload
	je	LBB0_32
## %bb.28:
	movq	_stderr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	(%r12), %edx
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	testq	%r9, %r9
	je	LBB0_29
## %bb.30:
	movl	(%r9), %ecx
	jmp	LBB0_31
LBB0_19:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_26
LBB0_22:
	xorl	%ecx, %ecx
LBB0_24:
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	4(%rax), %r11d
	subq	$8, %rsp
	movq	%rax, %r15
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rcx
	movq	%r14, %r8
	pushq	%r10
	pushq	%r11
	pushq	-72(%rbp)                       ## 8-byte Folded Reload
	pushq	%rbx
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	pushq	%r13
	pushq	-56(%rbp)                       ## 8-byte Folded Reload
	callq	_fprintf
	addq	$64, %rsp
	movl	(%r15), %ecx
LBB0_25:
	xorl	%edi, %edi
	cmpl	%r13d, %ecx
	sete	%dil
	callq	_assert
	movq	8(%r12), %rdi
	movl	%ebx, %esi
	callq	_tree_num_delete
	movq	%r13, %r14
	movq	%rax, %r13
	movq	%rax, 8(%r12)
LBB0_26:
	xorl	%eax, %eax
	callq	_lrand48
	movq	%r13, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movl	%eax, %edx
	movl	%r14d, %ecx
	jmp	LBB0_34
LBB0_29:
	xorl	%ecx, %ecx
LBB0_31:
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	4(%rax), %r11d
	subq	$8, %rsp
	movq	%rax, %r15
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rcx
	pushq	%r10
	pushq	%r11
	pushq	-72(%rbp)                       ## 8-byte Folded Reload
	pushq	%rbx
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	pushq	%r14
	pushq	%r13
	pushq	-56(%rbp)                       ## 8-byte Folded Reload
	callq	_fprintf
	addq	$64, %rsp
	movl	(%r15), %ecx
LBB0_32:
	xorl	%edi, %edi
	cmpl	%r13d, %ecx
	sete	%dil
	callq	_assert
	movq	8(%r12), %rdi
	movl	%r14d, %esi
	callq	_tree_num_delete
	movq	%rax, 8(%r12)
	testl	%ebx, %ebx
	jle	LBB0_35
## %bb.33:
	movq	%rax, %r14
	xorl	%eax, %eax
	callq	_lrand48
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	movl	%r13d, %ecx
LBB0_34:
	callq	_tree_num_insert
	movq	%rax, 8(%r12)
LBB0_35:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NIL_N,8,3                      ## @NIL_N
	.comm	_NIL,4,2                        ## @NIL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"adjust_topmsg_tree (%p %d, %d, %d, %d) : prev_id=%d metafile=%p D=%p\n"

	.comm	_stderr,4,2                     ## @stderr
L_.str.1:                               ## @.str.1
	.asciz	"ERROR in adjust_topmsg_tree: uid=%d, U=%p, mf=%p, D=%p, mf_last_local_id=%d, peer=%d, local_id=%d, prev_id=%d, op=%d, TT.x=%d, TT.z=%d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_adjust_topmsg_tree             ; -- Begin function adjust_topmsg_tree
	.p2align	2
_adjust_topmsg_tree:                    ; @adjust_topmsg_tree
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	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
	mov	x25, x3
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	bl	_get_user_metafile
	mov	x23, x0
	ldr	x24, [x19, #24]
	cmp	w21, #1
	b.lt	LBB0_5
; %bb.1:
	mov	w0, #1
	cbnz	x23, LBB0_4
; %bb.2:
	cbz	x24, LBB0_4
; %bb.3:
	ldr	w8, [x24]
	cmp	w8, w21
	cset	w0, lt
LBB0_4:
	bl	_assert
	cbz	x23, LBB0_6
	b	LBB0_8
LBB0_5:
	mov	w0, #0
	bl	_assert
	cbnz	x23, LBB0_8
LBB0_6:
	cbz	x24, LBB0_8
; %bb.7:
	ldr	x8, [x19, #8]
Lloh0:
	adrp	x9, _NIL_N@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NIL_N@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_assert
	mov	w22, #0
	b	LBB0_31
LBB0_8:
	ldr	w0, [x19, #16]
	mov	x1, x20
	bl	_tree_lookup
Lloh3:
	adrp	x8, _NIL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NIL@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x8, x0, eq
	ldr	w8, [x8]
	str	w8, [sp, #40]
	cbz	x23, LBB0_12
; %bb.9:
	add	x2, sp, #24
	mov	x0, x23
	mov	x1, x20
	bl	_fetch_file_peer_list
	str	x0, [sp, #32]
	ldr	w8, [sp, #24]
	cbz	w8, LBB0_11
; %bb.10:
	sub	w8, w8, #1
	ldr	w8, [x0, w8, sxtw #2]
LBB0_11:
	str	w8, [sp, #28]
	b	LBB0_13
LBB0_12:
	stp	xzr, xzr, [sp, #24]
LBB0_13:
	add	x0, sp, #24
	mov	w1, #0
	bl	_listree_get_kth_last
	mov	x22, x0
	ldr	w3, [x19]
	stp	x23, x24, [sp]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #4
	mov	x2, x19
	mov	x4, x20
	mov	x5, x21
	mov	x6, x25
	mov	x7, x22
	bl	_vkprintf
	cmn	w22, #1
	ccmp	w22, #0, #0, ne
	cset	w0, gt
	bl	_assert
	cmp	w22, w21
	b.gt	LBB0_31
; %bb.14:
	ldr	x26, [x19, #8]
	cmp	w25, #1
	b.lt	LBB0_19
; %bb.15:
	cmp	w22, #1
	b.lt	LBB0_25
; %bb.16:
	mov	x0, x26
	mov	x1, x22
	bl	_tree_num_lookup
	ldr	w8, [x0]
	mov	x9, x20
	cmp	w8, w20
	b.eq	LBB0_24
; %bb.17:
	mov	x26, x0
Lloh7:
	adrp	x9, _stderr@GOTPAGE
Lloh8:
	ldr	x9, [x9, _stderr@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x9]
	ldr	w2, [x19]
	cbz	x24, LBB0_22
; %bb.18:
	ldr	w6, [x24]
	b	LBB0_23
LBB0_19:
	mov	x0, x26
	mov	x1, x21
	bl	_tree_num_lookup
	ldr	w8, [x0]
	mov	x9, x20
	cmp	w8, w20
	b.eq	LBB0_28
; %bb.20:
	mov	x26, x0
Lloh10:
	adrp	x9, _stderr@GOTPAGE
Lloh11:
	ldr	x9, [x9, _stderr@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x9]
	ldr	w2, [x19]
	cbz	x24, LBB0_26
; %bb.21:
	ldr	w6, [x24]
	b	LBB0_27
LBB0_22:
	mov	w6, #0
LBB0_23:
	ldr	w9, [x26, #4]
	stp	w9, w8, [sp, #12]
	stp	w22, w25, [sp, #4]
	str	w21, [sp]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x3, x19
	mov	x4, x23
	mov	x5, x24
	mov	x7, x20
	bl	_fprintf
	ldr	w9, [x26]
LBB0_24:
	cmp	w9, w20
	cset	w0, eq
	bl	_assert
	ldr	x0, [x19, #8]
	mov	x1, x22
	bl	_tree_num_delete
	mov	x26, x0
	str	x0, [x19, #8]
LBB0_25:
	bl	_lrand48
	mov	x2, x0
	mov	x0, x26
	mov	x1, x21
	b	LBB0_30
LBB0_26:
	mov	w6, #0
LBB0_27:
	ldr	w9, [x26, #4]
	stp	w9, w8, [sp, #12]
	stp	w22, w25, [sp, #4]
	str	w21, [sp]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x3, x19
	mov	x4, x23
	mov	x5, x24
	mov	x7, x20
	bl	_fprintf
	ldr	w9, [x26]
LBB0_28:
	cmp	w9, w20
	cset	w0, eq
	bl	_assert
	ldr	x0, [x19, #8]
	mov	x1, x21
	bl	_tree_num_delete
	str	x0, [x19, #8]
	cmp	w22, #1
	b.lt	LBB0_31
; %bb.29:
	mov	x21, x0
	bl	_lrand48
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
LBB0_30:
	mov	x3, x20
	bl	_tree_num_insert
	str	x0, [x19, #8]
LBB0_31:
	mov	x0, x22
	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
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_NIL_N,8,3                      ; @NIL_N
	.comm	_NIL,4,2                        ; @NIL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"adjust_topmsg_tree (%p %d, %d, %d, %d) : prev_id=%d metafile=%p D=%p\n"

	.comm	_stderr,4,2                     ; @stderr
l_.str.1:                               ; @.str.1
	.asciz	"ERROR in adjust_topmsg_tree: uid=%d, U=%p, mf=%p, D=%p, mf_last_local_id=%d, peer=%d, local_id=%d, prev_id=%d, op=%d, TT.x=%d, TT.z=%d\n"

.subsections_via_symbols
