	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_get_write_ptr                  ## -- Begin function get_write_ptr
	.p2align	4, 0x90
_get_write_ptr:                         ## @get_write_ptr
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	40(%rdi), %r13
	movslq	%esi, %r12
	movq	_NET_BUFFER_SIZE@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpq	%r12, (%rax)
	seta	%dil
	callq	_assert
	movq	(%r14), %rax
	movq	_NB_MAGIC_HEAD@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	%cl
	movq	_NB_MAGIC_BUSYHEAD@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	sete	%al
	orb	%cl, %al
	movzbl	%al, %edi
	callq	_assert
	movq	8(%r13), %rbx
	leaq	(%rbx,%r12), %rax
	cmpq	16(%r13), %rax
	jle	LBB0_5
## %bb.1:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_alloc_buffer
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movq	%rax, %r15
	incl	56(%r14)
	movq	%rax, 48(%r13)
	movq	%r13, 40(%rax)
	movq	%r14, 48(%rax)
	movq	%rax, 40(%r14)
	cmpq	$0, 32(%r13)
	je	LBB0_4
## %bb.3:
	movq	24(%r15), %rax
	movq	%rax, 32(%r15)
LBB0_4:
	addq	8(%r15), %r12
	xorl	%edi, %edi
	cmpq	16(%r15), %r12
	setle	%dil
	callq	_assert
	movq	8(%r15), %rbx
LBB0_5:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NET_BUFFER_SIZE,8,3            ## @NET_BUFFER_SIZE
	.comm	_NB_MAGIC_HEAD,8,3              ## @NB_MAGIC_HEAD
	.comm	_NB_MAGIC_BUSYHEAD,8,3          ## @NB_MAGIC_BUSYHEAD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_get_write_ptr                  ; -- Begin function get_write_ptr
	.p2align	2
_get_write_ptr:                         ; @get_write_ptr
	.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
                                        ; kill: def $w1 killed $w1 def $x1
	mov	x19, x0
	ldr	x22, [x0, #40]
	sxtw	x21, w1
Lloh0:
	adrp	x8, _NET_BUFFER_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NET_BUFFER_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x21
	cset	w0, hi
	bl	_assert
	ldr	x8, [x19]
Lloh3:
	adrp	x9, _NB_MAGIC_HEAD@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NB_MAGIC_HEAD@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
Lloh6:
	adrp	x9, _NB_MAGIC_BUSYHEAD@GOTPAGE
Lloh7:
	ldr	x9, [x9, _NB_MAGIC_BUSYHEAD@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	ccmp	x8, x9, #4, ne
	cset	w0, eq
	bl	_assert
	ldp	x0, x8, [x22, #8]
	add	x9, x0, x21
	cmp	x9, x8
	b.le	LBB0_5
; %bb.1:
	bl	_alloc_buffer
	cbz	x0, LBB0_5
; %bb.2:
	mov	x20, x0
	ldr	w8, [x19, #56]
	add	w8, w8, #1
	str	w8, [x19, #56]
	str	x0, [x22, #48]
	stp	x22, x19, [x0, #40]
	str	x0, [x19, #40]
	ldr	x8, [x22, #32]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	x8, [x20, #24]
	str	x8, [x20, #32]
LBB0_4:
	ldp	x8, x9, [x20, #8]
	add	x8, x8, x21
	cmp	x8, x9
	cset	w0, le
	bl	_assert
	ldr	x0, [x20, #8]
LBB0_5:
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NET_BUFFER_SIZE,8,3            ; @NET_BUFFER_SIZE
	.comm	_NB_MAGIC_HEAD,8,3              ; @NB_MAGIC_HEAD
	.comm	_NB_MAGIC_BUSYHEAD,8,3          ; @NB_MAGIC_BUSYHEAD
.subsections_via_symbols
