	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function buf_advance
_buf_advance:                           ## @buf_advance
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	callq	_buf_valid
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%r14d, %r14d
	js	LBB0_4
## %bb.1:
	testl	%ecx, %ecx
	je	LBB0_4
## %bb.2:
	movl	(%rbx), %ecx
	subl	%r14d, %ecx
	jl	LBB0_4
## %bb.3:
	addl	%r14d, 4(%rbx)
	movl	%ecx, (%rbx)
	movl	$1, %eax
LBB0_4:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_buf_advance
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function buf_advance
_buf_advance:                           ; @buf_advance
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	bl	_buf_valid
	mov	x8, x0
	mov	w0, #0
	tbnz	w20, #31, LBB0_5
; %bb.1:
	cbz	w8, LBB0_5
; %bb.2:
	ldr	w8, [x19]
	subs	w8, w8, w20
	b.ge	LBB0_4
; %bb.3:
	mov	w0, #0
	b	LBB0_5
LBB0_4:
	ldr	w9, [x19, #4]
	add	w9, w9, w20
	stp	w8, w9, [x19]
	mov	w0, #1
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_buf_advance
.subsections_via_symbols
