	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function shm_mq_receive_bytes
_shm_mq_receive_bytes:                  ## @shm_mq_receive_bytes
	.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
	movq	%r8, -88(%rbp)                  ## 8-byte Spill
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movq	%rsi, -104(%rbp)                ## 8-byte Spill
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	(%rax), %r15
	leaq	16(%rax), %rbx
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	addq	$40, %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	callq	_pg_read_barrier
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_pg_atomic_read_u64
	cmpq	%rax, %r12
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_9
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_pg_atomic_read_u64
	movq	%rax, %r12
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	callq	_pg_atomic_read_u64
	movq	%rax, %rbx
	addq	(%r14), %rbx
	movq	%r12, %r14
	subq	%rbx, %r14
	xorl	%edi, %edi
	cmpq	%r15, %r14
	setle	%dil
	callq	_Assert
	movq	%rbx, %rax
	orq	%r15, %rax
	shrq	$32, %rax
	je	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rax
	cqto
	idivq	%r15
	movq	%rdx, %r13
	cmpq	-104(%rbp), %r14                ## 8-byte Folded Reload
	jl	LBB0_5
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%r15d
	movl	%edx, %r13d
	cmpq	-104(%rbp), %r14                ## 8-byte Folded Reload
	jge	LBB0_6
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	leaq	(%r14,%r13), %rax
	cmpq	%r15, %rax
	jge	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, 24(%rax)
	jne	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	(%r14), %rsi
	testq	%rsi, %rsi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jle	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_shm_mq_inc_bytes_read
	movq	$0, (%r14)
LBB0_12:                                ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_13
## %bb.15:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_MyLatch@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	_WL_EXIT_ON_PM_DEATH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_WL_LATCH_SET@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_WAIT_EVENT_MQ_RECEIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%edx, %edx
	callq	_WaitLatch
	movl	(%r12), %edi
	callq	_ResetLatch
	xorl	%eax, %eax
	callq	_CHECK_FOR_INTERRUPTS
	jmp	LBB0_1
LBB0_6:
	subq	%r13, %r15
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_Min
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	8(%rax), %r13
	shlq	$2, %r13
	addq	32(%rax), %r13
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	%r13, (%rax)
	xorl	%eax, %eax
	callq	_pg_read_barrier
	movq	_SHM_MQ_SUCCESS@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_9:
	movq	_SHM_MQ_DETACHED@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_13:
	movq	_SHM_MQ_WOULD_BLOCK@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SHM_MQ_SUCCESS,4,2             ## @SHM_MQ_SUCCESS
	.comm	_SHM_MQ_DETACHED,4,2            ## @SHM_MQ_DETACHED
	.comm	_SHM_MQ_WOULD_BLOCK,4,2         ## @SHM_MQ_WOULD_BLOCK
	.comm	_MyLatch,4,2                    ## @MyLatch
	.comm	_WL_LATCH_SET,4,2               ## @WL_LATCH_SET
	.comm	_WL_EXIT_ON_PM_DEATH,4,2        ## @WL_EXIT_ON_PM_DEATH
	.comm	_WAIT_EVENT_MQ_RECEIVE,4,2      ## @WAIT_EVENT_MQ_RECEIVE
	.no_dead_strip	_shm_mq_receive_bytes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function shm_mq_receive_bytes
_shm_mq_receive_bytes:                  ; @shm_mq_receive_bytes
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	stp	x3, x4, [sp]                    ; 16-byte Folded Spill
	mov	x22, x2
	mov	x23, x1
	mov	x24, x0
	ldr	x21, [x0, #8]
	add	x25, x21, #16
	mov	x26, x21
	ldr	x20, [x26], #40
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	bl	_pg_read_barrier
	mov	x0, x25
	bl	_pg_atomic_read_u64
	cmp	x27, x0
	b.eq	LBB0_10
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x25
	bl	_pg_atomic_read_u64
	mov	x27, x0
	mov	x0, x26
	bl	_pg_atomic_read_u64
	ldr	x8, [x24]
	add	x19, x8, x0
	sub	x28, x27, x19
	cmp	x28, x20
	cset	w0, le
	bl	_Assert
	sdiv	x8, x19, x20
	mul	x8, x8, x20
	cmp	x28, x23
	b.ge	LBB0_9
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	x9, x27, x8
	cmp	x9, x20
	b.ge	LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x21, #24]
	cbnz	x8, LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x1, [x24]
	cmp	x1, #1
	b.lt	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x21
	bl	_shm_mq_inc_bytes_read
	str	xzr, [x24]
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	cbnz	w22, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh0:
	adrp	x19, _MyLatch@GOTPAGE
Lloh1:
	ldr	x19, [x19, _MyLatch@GOTPAGEOFF]
	ldr	w0, [x19]
Lloh2:
	adrp	x8, _WL_LATCH_SET@GOTPAGE
Lloh3:
	ldr	x8, [x8, _WL_LATCH_SET@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _WL_EXIT_ON_PM_DEATH@GOTPAGE
Lloh6:
	ldr	x9, [x9, _WL_EXIT_ON_PM_DEATH@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh8:
	adrp	x8, _WAIT_EVENT_MQ_RECEIVE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _WAIT_EVENT_MQ_RECEIVE@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	mov	w2, #0
	bl	_WaitLatch
	ldr	w0, [x19]
	bl	_ResetLatch
	bl	_CHECK_FOR_INTERRUPTS
	b	LBB0_2
LBB0_9:
	sub	x19, x19, x8
	sub	x1, x20, x19
	mov	x0, x28
	bl	_Min
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	str	x0, [x8]
	ldr	x8, [x21, #32]
	ldr	x9, [x21, #8]
	add	x9, x9, x19
	add	x8, x8, x9, lsl #2
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	str	x8, [x9]
	bl	_pg_read_barrier
Lloh11:
	adrp	x8, _SHM_MQ_SUCCESS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SHM_MQ_SUCCESS@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
Lloh13:
	adrp	x8, _SHM_MQ_DETACHED@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SHM_MQ_DETACHED@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh15:
	adrp	x8, _SHM_MQ_WOULD_BLOCK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SHM_MQ_WOULD_BLOCK@GOTPAGEOFF]
LBB0_12:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_SHM_MQ_SUCCESS,4,2             ; @SHM_MQ_SUCCESS
	.comm	_SHM_MQ_DETACHED,4,2            ; @SHM_MQ_DETACHED
	.comm	_SHM_MQ_WOULD_BLOCK,4,2         ; @SHM_MQ_WOULD_BLOCK
	.comm	_MyLatch,4,2                    ; @MyLatch
	.comm	_WL_LATCH_SET,4,2               ; @WL_LATCH_SET
	.comm	_WL_EXIT_ON_PM_DEATH,4,2        ; @WL_EXIT_ON_PM_DEATH
	.comm	_WAIT_EVENT_MQ_RECEIVE,4,2      ; @WAIT_EVENT_MQ_RECEIVE
	.no_dead_strip	_shm_mq_receive_bytes
.subsections_via_symbols
