	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ng_car_enqueue
_ng_car_enqueue:                        ## @ng_car_enqueue
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	movl	%esi, %edi
	callq	_NGI_GET_M
	movl	%ebx, %edi
	callq	_NG_FREE_ITEM
	leaq	20(%r15), %r14
	movq	%r14, %rdi
	callq	_mtx_lock
	movq	(%r15), %rcx
	movl	8(%r15), %eax
	movl	%ecx, %esi
	subl	%eax, %esi
	movq	_NG_CAR_QUEUE_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rdx
	movl	%esi, %eax
	sarl	$31, %eax
	andl	%edx, %eax
	addl	%esi, %eax
	leal	-1(%rdx), %esi
	cmpl	%esi, %eax
	jge	LBB0_2
## %bb.1:
	movl	12(%r15), %esi
	addl	%eax, %esi
	cmpl	%edx, %esi
	jge	LBB0_2
## %bb.3:
	incl	40(%r15)
	incq	%rcx
	xorl	%edi, %edi
	cmpq	%rdx, %rcx
	cmovbq	%rcx, %rdi
	movq	%rdi, (%r15)
	movq	_NG_CAR_QUEUE_MIN_TH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	jle	LBB0_5
## %bb.4:
	subl	%ecx, %esi
	movl	%esi, 12(%r15)
LBB0_5:
	testl	%eax, %eax
	jne	LBB0_9
## %bb.6:
	movq	_NG_CAR_COUNT_PACKETS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 24(%r15)
	je	LBB0_8
## %bb.7:
	addl	$-128, 16(%r15)
LBB0_8:
	movq	%r15, %rdi
	callq	_ng_car_schedule
	jmp	LBB0_9
LBB0_2:
	incl	48(%r15)
	incl	44(%r15)
	callq	_NG_FREE_M
	movl	$0, 12(%r15)
LBB0_9:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtx_unlock                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NG_CAR_QUEUE_SIZE,4,2          ## @NG_CAR_QUEUE_SIZE
	.comm	_NG_CAR_QUEUE_MIN_TH,4,2        ## @NG_CAR_QUEUE_MIN_TH
	.comm	_NG_CAR_COUNT_PACKETS,4,2       ## @NG_CAR_COUNT_PACKETS
	.no_dead_strip	_ng_car_enqueue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ng_car_enqueue
_ng_car_enqueue:                        ; @ng_car_enqueue
	.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
	mov	x0, x1
	bl	_NGI_GET_M
	mov	x0, x20
	bl	_NG_FREE_ITEM
	add	x20, x19, #20
	mov	x0, x20
	bl	_mtx_lock
	ldr	x9, [x19]
	ldr	w8, [x19, #8]
Lloh0:
	adrp	x10, _NG_CAR_QUEUE_SIZE@GOTPAGE
Lloh1:
	ldr	x10, [x10, _NG_CAR_QUEUE_SIZE@GOTPAGEOFF]
Lloh2:
	ldrsw	x10, [x10]
	sub	w8, w9, w8
	and	w11, w10, w8, asr #31
	add	w8, w11, w8
	sub	w11, w10, #1
	cmp	w8, w11
	b.ge	LBB0_8
; %bb.1:
	ldr	w11, [x19, #12]
	add	w11, w11, w8
	cmp	w11, w10
	b.ge	LBB0_8
; %bb.2:
	ldr	w12, [x19, #40]
	add	w12, w12, #1
	str	w12, [x19, #40]
	add	x12, x9, #1
	cmp	x12, x10
	csinc	x9, xzr, x9, hs
	str	x9, [x19]
Lloh3:
	adrp	x9, _NG_CAR_QUEUE_MIN_TH@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NG_CAR_QUEUE_MIN_TH@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_4
; %bb.3:
	sub	w9, w11, w9
	str	w9, [x19, #12]
LBB0_4:
	cbnz	w8, LBB0_9
; %bb.5:
	ldr	w8, [x19, #24]
Lloh6:
	adrp	x9, _NG_CAR_COUNT_PACKETS@GOTPAGE
Lloh7:
	ldr	x9, [x9, _NG_CAR_COUNT_PACKETS@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
	ldr	w8, [x19, #16]
	sub	w8, w8, #128
	str	w8, [x19, #16]
LBB0_7:
	mov	x0, x19
	bl	_ng_car_schedule
	b	LBB0_9
LBB0_8:
	ldur	d0, [x19, #44]
	movi.2s	v1, #1
	add.2s	v0, v0, v1
	stur	d0, [x19, #44]
	bl	_NG_FREE_M
	str	wzr, [x19, #12]
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_mtx_unlock
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_NG_CAR_QUEUE_SIZE,4,2          ; @NG_CAR_QUEUE_SIZE
	.comm	_NG_CAR_QUEUE_MIN_TH,4,2        ; @NG_CAR_QUEUE_MIN_TH
	.comm	_NG_CAR_COUNT_PACKETS,4,2       ; @NG_CAR_COUNT_PACKETS
	.no_dead_strip	_ng_car_enqueue
.subsections_via_symbols
