	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_upd_stat                       ## -- Begin function upd_stat
	.p2align	4, 0x90
_upd_stat:                              ## @upd_stat
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	movq	_idn@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	negl	%ecx
	cmpl	%edi, %ecx
	setle	%cl
	cmpl	%edi, %eax
	setge	%al
	testl	%edi, %edi
	setne	%dl
	andb	%al, %dl
	andb	%cl, %dl
	movzbl	%dl, %edi
	callq	_assert
	movq	_qen@GOTPCREL(%rip), %r14
	movq	_STAT_EV@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	addl	$-5, %eax
	cmpl	%eax, (%r14)
	jle	LBB0_3
## %bb.1:
	movq	_q_events@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_qel@GOTPCREL(%rip), %r12
	movslq	(%r12), %rcx
	leal	1(%rcx), %edx
	movl	%edx, (%r12)
	movl	(%rax,%rcx,4), %edi
	movl	$-1, %esi
	callq	_upd_stat_
	decl	(%r14)
	movl	(%r12), %eax
	cmpl	(%r15), %eax
	jne	LBB0_3
## %bb.2:
	movl	$0, (%r12)
LBB0_3:
	movq	_q_events@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_qer@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movl	%ebx, (%rax,%rcx,4)
	incq	%rcx
	movq	%rcx, (%r12)
	movl	%ebx, %edi
	movl	$1, %esi
	callq	_upd_stat_
	incl	(%r14)
	movslq	(%r15), %rax
	cmpq	%rax, (%r12)
	jne	LBB0_5
## %bb.4:
	movq	$0, (%r12)
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_idn,4,2                        ## @idn
	.comm	_qen,4,2                        ## @qen
	.comm	_STAT_EV,4,2                    ## @STAT_EV
	.comm	_q_events,8,3                   ## @q_events
	.comm	_qel,4,2                        ## @qel
	.comm	_qer,8,3                        ## @qer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_upd_stat                       ; -- Begin function upd_stat
	.p2align	2
_upd_stat:                              ; @upd_stat
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _idn@GOTPAGE
Lloh1:
	ldr	x8, [x8, _idn@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w9, w8
	cmp	w9, w0
	ccmp	w8, w0, #8, le
	ccmp	w0, #0, #4, ge
	cset	w0, ne
	bl	_assert
Lloh3:
	adrp	x20, _qen@GOTPAGE
Lloh4:
	ldr	x20, [x20, _qen@GOTPAGEOFF]
Lloh5:
	adrp	x21, _STAT_EV@GOTPAGE
Lloh6:
	ldr	x21, [x21, _STAT_EV@GOTPAGEOFF]
	ldr	w8, [x20]
	ldr	w9, [x21]
	sub	w9, w9, #5
Lloh7:
	adrp	x22, _q_events@GOTPAGE
Lloh8:
	ldr	x22, [x22, _q_events@GOTPAGEOFF]
	cmp	w8, w9
	b.le	LBB0_3
; %bb.1:
Lloh9:
	adrp	x23, _qel@GOTPAGE
Lloh10:
	ldr	x23, [x23, _qel@GOTPAGEOFF]
	ldr	x8, [x22]
	ldrsw	x9, [x23]
	add	w10, w9, #1
	str	w10, [x23]
	ldr	w0, [x8, x9, lsl #2]
	mov	w1, #-1
	bl	_upd_stat_
	ldr	w8, [x20]
	sub	w8, w8, #1
	str	w8, [x20]
	ldr	w8, [x23]
	ldr	w9, [x21]
	cmp	w8, w9
	b.ne	LBB0_3
; %bb.2:
	str	wzr, [x23]
LBB0_3:
Lloh11:
	adrp	x23, _qer@GOTPAGE
Lloh12:
	ldr	x23, [x23, _qer@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x9, [x23]
	str	w19, [x8, x9, lsl #2]
	add	x8, x9, #1
	str	x8, [x23]
	mov	x0, x19
	mov	w1, #1
	bl	_upd_stat_
	ldr	w8, [x20]
	add	w8, w8, #1
	str	w8, [x20]
	ldr	x8, [x23]
	ldrsw	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.4:
	str	xzr, [x23]
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_idn,4,2                        ; @idn
	.comm	_qen,4,2                        ; @qen
	.comm	_STAT_EV,4,2                    ; @STAT_EV
	.comm	_q_events,8,3                   ; @q_events
	.comm	_qel,4,2                        ; @qel
	.comm	_qer,8,3                        ; @qer
.subsections_via_symbols
