	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function shm_mq_send_bytes
_shm_mq_send_bytes:                     ## @shm_mq_send_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
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movq	%rdx, -96(%rbp)                 ## 8-byte Spill
	movq	_SHM_MQ_SUCCESS@GOTPCREL(%rip), %rax
	testq	%rsi, %rsi
	jle	LBB0_19
## %bb.1:
	movq	%rsi, %rbx
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rax
	movq	(%rax), %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	leaq	44(%rax), %rcx
	movq	%rcx, -112(%rbp)                ## 8-byte Spill
	leaq	40(%rax), %rcx
	movq	%rcx, -104(%rbp)                ## 8-byte Spill
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	addq	$32, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_4 Depth=1
	movzbl	%al, %edi
	callq	_Assert
	movq	%r13, %rdi
	callq	_MAXALIGN
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_shm_mq_inc_bytes_written
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	cmpq	%rbx, %r15
	jge	LBB0_20
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	-112(%rbp), %rdi                ## 8-byte Reload
	callq	_pg_atomic_read_u64
	movq	%rax, %r12
	movq	-104(%rbp), %rdi                ## 8-byte Reload
	callq	_pg_atomic_read_u64
	movq	%rax, %r13
	xorl	%edi, %edi
	movq	%rbx, %r14
	movq	%rax, %rbx
	subq	%r12, %rbx
	setge	%dil
	callq	_Assert
	xorl	%edi, %edi
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	subq	%rbx, %r12
	movq	%r14, %rbx
	setge	%dil
	callq	_Assert
	movq	%r14, %rsi
	subq	%r15, %rsi
	movq	%r12, %rdi
	callq	_Min
	movq	%rax, %r12
	xorl	%eax, %eax
	callq	_pg_compiler_barrier
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpl	$0, 8(%rax)
	jne	LBB0_23
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	testq	%r12, %r12
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rax
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	orq	%rsi, %rax
	shrq	$32, %rax
	je	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rax
	cqto
	idivq	%rsi
	movq	%rdx, %rbx
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	testl	%edi, %edi
	je	LBB0_14
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	callq	_Assert
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	callq	_SetLatch
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_21
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	_MyLatch@GOTPCREL(%rip), %r14
	movl	(%r14), %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_SEND@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%edx, %edx
	callq	_WaitLatch
	movl	(%r14), %edi
	callq	_ResetLatch
	xorl	%eax, %eax
	callq	_CHECK_FOR_INTERRUPTS
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%esi
	movl	%edx, %ebx
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	subq	%rbx, %rsi
	movq	%r12, %rdi
	callq	_Min
	movq	%rax, %r13
	xorl	%eax, %eax
	callq	_pg_memory_barrier
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	addq	16(%r12), %rbx
	shlq	$2, %rbx
	addq	24(%r12), %rbx
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r15), %rsi
	movq	%rbx, %rdi
	movq	%r13, %rdx
	callq	_memcpy
	addq	%r13, %r15
	movb	$1, %al
	movq	%r14, %rbx
	cmpq	%r14, %r15
	je	LBB0_2
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	callq	_MAXALIGN
	cmpq	%rax, %r13
	sete	%al
	jmp	LBB0_2
LBB0_14:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	4(%rax), %edx
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	%edx, %esi
	callq	_shm_mq_counterparty_gone
	testq	%rax, %rax
	jne	LBB0_23
## %bb.16:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	callq	_shm_mq_get_receiver
	testq	%rax, %rax
	jne	LBB0_18
	jmp	LBB0_21
LBB0_17:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_shm_mq_wait_internal
	testl	%eax, %eax
	je	LBB0_22
LBB0_18:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	jmp	LBB0_3
LBB0_19:
	xorl	%r15d, %r15d
	jmp	LBB0_25
LBB0_20:
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	movq	_SHM_MQ_SUCCESS@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_21:
	movq	_SHM_MQ_WOULD_BLOCK@GOTPCREL(%rip), %rax
	jmp	LBB0_24
LBB0_22:
	movl	$1, 8(%r14)
LBB0_23:
	movq	_SHM_MQ_DETACHED@GOTPCREL(%rip), %rax
LBB0_24:
	movq	-48(%rbp), %r8                  ## 8-byte Reload
LBB0_25:
	movq	%r15, (%r8)
	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_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_SEND,4,2         ## @WAIT_EVENT_MQ_SEND
	.comm	_SHM_MQ_SUCCESS,4,2             ## @SHM_MQ_SUCCESS
	.no_dead_strip	_shm_mq_send_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_send_bytes
_shm_mq_send_bytes:                     ; @shm_mq_send_bytes
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	w3, [sp, #20]                   ; 4-byte Folded Spill
	str	x2, [sp, #24]                   ; 8-byte Folded Spill
	cmp	x1, #1
	b.lt	LBB0_17
; %bb.1:
	mov	x22, x1
	mov	x23, x0
	mov	x27, #0
	ldr	x24, [x0, #8]
	ldr	x20, [x24]
	add	x25, x24, #44
	add	x26, x24, #40
	add	x8, x24, #32
	stp	x4, x8, [sp]                    ; 16-byte Folded Spill
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x28
	bl	_MAXALIGN
	cmp	x28, x0
	cset	w0, eq
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	bl	_Assert
	mov	x0, x28
	bl	_MAXALIGN
	mov	x1, x0
	mov	x0, x24
	bl	_shm_mq_inc_bytes_written
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	cmp	x27, x22
	b.ge	LBB0_19
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x25
	bl	_pg_atomic_read_u64
	mov	x19, x0
	mov	x0, x26
	bl	_pg_atomic_read_u64
	mov	x28, x0
	subs	x19, x0, x19
	cset	w0, ge
	bl	_Assert
	subs	x19, x20, x19
	cset	w0, ge
	bl	_Assert
	sub	x1, x22, x27
	mov	x0, x19
	bl	_Min
	mov	x19, x0
	bl	_pg_compiler_barrier
	ldr	w8, [x24, #8]
	cbnz	w8, LBB0_18
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	cbz	x19, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	sdiv	x8, x28, x20
	msub	x21, x8, x20, x28
	sub	x1, x20, x21
	mov	x0, x19
	bl	_Min
	mov	x28, x0
	bl	_pg_memory_barrier
	ldp	x9, x8, [x24, #16]
	add	x9, x9, x21
	add	x0, x8, x9, lsl #2
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	add	x1, x8, x27
	mov	x2, x28
	bl	_memcpy
	add	x27, x28, x27
	cmp	x27, x22
	b.ne	LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #1
	b	LBB0_3
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x23]
	cbz	w0, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	bl	_Assert
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	ldr	x0, [x8]
	bl	_SetLatch
	ldr	w8, [sp, #20]                   ; 4-byte Folded Reload
	cbnz	w8, LBB0_20
; %bb.11:                               ;   in Loop: Header=BB0_5 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_SEND@GOTPAGE
Lloh9:
	ldr	x8, [x8, _WAIT_EVENT_MQ_SEND@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	mov	w2, #0
	bl	_WaitLatch
	ldr	w0, [x19]
	bl	_ResetLatch
	bl	_CHECK_FOR_INTERRUPTS
	b	LBB0_4
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w2, [x23, #4]
	ldr	w8, [sp, #20]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	mov	x1, x2
	bl	_shm_mq_counterparty_gone
	cbnz	x0, LBB0_18
; %bb.14:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	bl	_shm_mq_get_receiver
	cbnz	x0, LBB0_16
	b	LBB0_20
LBB0_15:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	ldr	x1, [sp, #8]                    ; 8-byte Folded Reload
	bl	_shm_mq_wait_internal
	cbz	w0, LBB0_23
LBB0_16:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w8, #1
	str	w8, [x23]
	b	LBB0_4
LBB0_17:
	mov	x27, #0
Lloh11:
	adrp	x8, _SHM_MQ_SUCCESS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SHM_MQ_SUCCESS@GOTPAGEOFF]
	b	LBB0_22
LBB0_18:
	ldr	x4, [sp]                        ; 8-byte Folded Reload
Lloh13:
	adrp	x8, _SHM_MQ_DETACHED@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SHM_MQ_DETACHED@GOTPAGEOFF]
	b	LBB0_22
LBB0_19:
Lloh15:
	adrp	x8, _SHM_MQ_SUCCESS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SHM_MQ_SUCCESS@GOTPAGEOFF]
	b	LBB0_21
LBB0_20:
Lloh17:
	adrp	x8, _SHM_MQ_WOULD_BLOCK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SHM_MQ_WOULD_BLOCK@GOTPAGEOFF]
LBB0_21:
	ldr	x4, [sp]                        ; 8-byte Folded Reload
LBB0_22:
	str	x27, [x4]
	ldr	w0, [x8]
	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
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_23:
	mov	w8, #1
	str	w8, [x24, #8]
Lloh19:
	adrp	x8, _SHM_MQ_DETACHED@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SHM_MQ_DETACHED@GOTPAGEOFF]
	b	LBB0_21
	.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
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.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_SEND,4,2         ; @WAIT_EVENT_MQ_SEND
	.comm	_SHM_MQ_SUCCESS,4,2             ; @SHM_MQ_SUCCESS
	.no_dead_strip	_shm_mq_send_bytes
.subsections_via_symbols
