	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_get_peer_msglist_pos           ## -- Begin function get_peer_msglist_pos
	.p2align	4, 0x90
_get_peer_msglist_pos:                  ## @get_peer_msglist_pos
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	_R_cnt@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	leaq	_get_peer_msglist_pos.X(%rip), %rdx
	callq	_prepare_peer_msglist
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	leaq	_get_peer_msglist_pos.X(%rip), %rdi
	callq	_listree_get_size
	movl	%eax, %r15d
	movl	%eax, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_assert
	testl	%r15d, %r15d
	je	LBB0_3
## %bb.4:
	leaq	_get_peer_msglist_pos.X(%rip), %rdi
	movl	%r14d, %esi
	movl	$1, %edx
	callq	_listree_get_pos
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %ebx
	cmpl	$-1, %eax
	setge	%cl
	cmpl	%r15d, %eax
	setl	%al
	andb	%cl, %al
	movzbl	%al, %edi
	callq	_assert
	jmp	LBB0_5
LBB0_1:
	movl	%eax, %ebx
	jmp	LBB0_5
LBB0_3:
	xorl	%ebx, %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_get_peer_msglist_pos.X,4,2 ## @get_peer_msglist_pos.X
	.comm	_R_cnt,8,3                      ## @R_cnt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_get_peer_msglist_pos           ; -- Begin function get_peer_msglist_pos
	.p2align	2
_get_peer_msglist_pos:                  ; @get_peer_msglist_pos
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x2
Lloh0:
	adrp	x8, _R_cnt@GOTPAGE
Lloh1:
	ldr	x8, [x8, _R_cnt@GOTPAGEOFF]
Lloh2:
	str	xzr, [x8]
Lloh3:
	adrp	x2, _get_peer_msglist_pos.X@PAGE
Lloh4:
	add	x2, x2, _get_peer_msglist_pos.X@PAGEOFF
	bl	_prepare_peer_msglist
	cmp	w0, #1
	b.lt	LBB0_3
; %bb.1:
Lloh5:
	adrp	x0, _get_peer_msglist_pos.X@PAGE
Lloh6:
	add	x0, x0, _get_peer_msglist_pos.X@PAGEOFF
	bl	_listree_get_size
	mov	x20, x0
	mvn	w8, w0
	lsr	w0, w8, #31
	bl	_assert
	cbz	w20, LBB0_4
; %bb.2:
Lloh7:
	adrp	x0, _get_peer_msglist_pos.X@PAGE
Lloh8:
	add	x0, x0, _get_peer_msglist_pos.X@PAGEOFF
	mov	x1, x19
	mov	w2, #1
	bl	_listree_get_pos
	add	w21, w0, #1
	cmn	w0, #2
	ccmp	w0, w20, #0, gt
	cset	w0, lt
	bl	_assert
	b	LBB0_5
LBB0_3:
	mov	x21, x0
	b	LBB0_5
LBB0_4:
	mov	w21, #0
LBB0_5:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_get_peer_msglist_pos.X,4,2 ; @get_peer_msglist_pos.X
	.comm	_R_cnt,8,3                      ; @R_cnt
.subsections_via_symbols
