	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nb_alloc                       ## -- Begin function nb_alloc
	.p2align	4, 0x90
_nb_alloc:                              ## @nb_alloc
	.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
	xorl	%ebx, %ebx
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.1:
	movl	%esi, %r14d
	testl	%esi, %esi
	js	LBB0_9
## %bb.2:
	movq	_NETBUFF_DATA_SIZE@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jl	LBB0_9
## %bb.3:
	movq	%rdi, %r15
	movq	(%rdi), %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
	xorl	%edi, %edi
	cmpl	$0, 40(%r15)
	sete	%dil
	callq	_assert
	movq	24(%r15), %r12
	movl	8(%r12), %eax
	movl	12(%r12), %edx
	movl	%eax, %ecx
	negl	%ecx
	andl	$3, %ecx
	subl	%eax, %edx
	leal	(%rcx,%r14), %esi
	cmpl	%edx, %esi
	jle	LBB0_4
## %bb.5:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_alloc_buffer
	testq	%rax, %rax
	je	LBB0_9
## %bb.6:
	movq	%rax, 32(%r12)
	movq	%r12, 24(%rax)
	movq	%r15, 32(%rax)
	movq	%rax, 24(%r15)
	incl	20(%r15)
	movl	8(%rax), %ecx
	movl	12(%rax), %edx
	subl	%ecx, %edx
	cmpl	%r14d, %edx
	jge	LBB0_7
## %bb.10:
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_4:
	addq	$8, %r12
	addl	%eax, %ecx
	jmp	LBB0_8
LBB0_7:
	addq	$8, %rax
	movq	%rax, %r12
LBB0_8:
	movslq	%ecx, %rbx
	leal	(%rbx,%r14), %eax
	movl	%eax, (%r12)
	addl	%r14d, 16(%r15)
LBB0_9:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NETBUFF_DATA_SIZE,4,2          ## @NETBUFF_DATA_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	_nb_alloc                       ; -- Begin function nb_alloc
	.p2align	2
_nb_alloc:                              ; @nb_alloc
	.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
	mov	x8, #0
	cbz	x0, LBB0_9
; %bb.1:
	mov	x20, x1
	tbnz	w1, #31, LBB0_9
; %bb.2:
Lloh0:
	adrp	x9, _NETBUFF_DATA_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NETBUFF_DATA_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w9, w20
	b.lt	LBB0_9
; %bb.3:
	mov	x19, x0
	ldr	x8, [x0]
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
	ldr	w8, [x19, #40]
	cmp	w8, #0
	cset	w0, eq
	bl	_assert
	ldr	x21, [x19, #24]
	mov	x0, x21
	ldr	w8, [x0, #8]!
	neg	w9, w8
	and	w9, w9, #0x3
	ldr	w10, [x21, #12]
	sub	w10, w10, w8
	add	w11, w9, w20
	cmp	w11, w10
	b.le	LBB0_7
; %bb.4:
	bl	_alloc_buffer
	cbz	x0, LBB0_6
; %bb.5:
	str	x0, [x21, #32]
	stp	x21, x19, [x0, #24]
	str	x0, [x19, #24]
	ldr	w8, [x19, #20]
	add	w8, w8, #1
	str	w8, [x19, #20]
	ldr	w8, [x0, #12]
	ldr	w9, [x0, #8]!
	sub	w8, w8, w9
	cmp	w8, w20
	b.ge	LBB0_8
LBB0_6:
	mov	x8, #0
	b	LBB0_9
LBB0_7:
	add	w9, w9, w8
LBB0_8:
	sxtw	x8, w9
	add	w9, w9, w20
	str	w9, [x0]
	ldr	w9, [x19, #16]
	add	w9, w9, w20
	str	w9, [x19, #16]
LBB0_9:
	mov	x0, x8
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_NETBUFF_DATA_SIZE,4,2          ; @NETBUFF_DATA_SIZE
	.comm	_NB_MAGIC_HEAD,8,3              ; @NB_MAGIC_HEAD
	.comm	_NB_MAGIC_BUSYHEAD,8,3          ; @NB_MAGIC_BUSYHEAD
.subsections_via_symbols
