	.file	"extr_dtrace.c_dtrace_buffer_alloc.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	dtrace_buffer_alloc, @function
dtrace_buffer_alloc:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	lea	rdi, cpu_lock[rip]
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, r8
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdx
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR dtrace_buffer_memory_inuse[rip]
	mov	esi, DWORD PTR LCK_MTX_ASSERT_OWNED[rip]
	mov	DWORD PTR 12[rsp], ecx
	mov	QWORD PTR 16[rsp], rax
	call	LCK_MTX_ASSERT@PLT
	mov	esi, DWORD PTR LCK_MTX_ASSERT_OWNED[rip]
	lea	rdi, dtrace_lock[rip]
	call	LCK_MTX_ASSERT@PLT
	cmp	QWORD PTR dtrace_nonroot_maxsize[rip], rbx
	jb	.L28
.L2:
	mov	r15, QWORD PTR cpu_list[rip]
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L30:
	xor	edi, edi
	cmp	QWORD PTR [r14], rbx
	sete	dil
	call	ASSERT@PLT
.L5:
	mov	r15, QWORD PTR 8[r15]
	cmp	QWORD PTR cpu_list[rip], r15
	je	.L29
.L9:
	cmp	QWORD PTR DTRACE_CPUALL[rip], rbp
	mov	rdx, QWORD PTR [r15]
	je	.L4
	cmp	rbp, rdx
	jne	.L5
.L4:
	sal	rdx, 6
	lea	r14, 0[r13+rdx]
	cmp	QWORD PTR 40[r14], 0
	jne	.L30
	xor	edi, edi
	cmp	QWORD PTR 32[r14], 0
	sete	dil
	call	ASSERT@PLT
	mov	rdi, rbx
	call	dtrace_buffer_canalloc@PLT
	cmp	rax, QWORD PTR B_FALSE[rip]
	je	.L7
	mov	esi, DWORD PTR KM_NOSLEEP[rip]
	mov	rdi, rbx
	call	kmem_zalloc@PLT
	mov	QWORD PTR 40[r14], rax
	test	rax, rax
	je	.L7
	add	QWORD PTR dtrace_buffer_memory_inuse[rip], rbx
	xor	eax, eax
	cmp	r12, rbx
	sete	al
	mov	QWORD PTR [r14], rbx
	sub	r12, rax
	mov	eax, DWORD PTR 12[rsp]
	mov	QWORD PTR 56[r14], 0
	mov	QWORD PTR 8[r14], r12
	mov	QWORD PTR 16[r14], r12
	mov	DWORD PTR 24[r14], eax
	mov	QWORD PTR 48[r14], 0
	test	DWORD PTR DTRACEBUF_NOSWITCH[rip], eax
	jne	.L5
	mov	rdi, rbx
	call	dtrace_buffer_canalloc@PLT
	cmp	rax, QWORD PTR B_FALSE[rip]
	je	.L7
	mov	esi, DWORD PTR KM_NOSLEEP[rip]
	mov	rdi, rbx
	call	kmem_zalloc@PLT
	mov	QWORD PTR 32[r14], rax
	test	rax, rax
	je	.L7
	add	QWORD PTR dtrace_buffer_memory_inuse[rip], rbx
	mov	r15, QWORD PTR 8[r15]
	cmp	QWORD PTR cpu_list[rip], r15
	jne	.L9
.L29:
	mov	rax, QWORD PTR dtrace_buffer_memory_maxsize[rip]
	xor	edi, edi
	cmp	QWORD PTR dtrace_buffer_memory_inuse[rip], rax
	setbe	dil
	call	ASSERT@PLT
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	mov	r14, QWORD PTR cpu_list[rip]
	.p2align 4,,10
	.p2align 3
.L14:
	cmp	QWORD PTR DTRACE_CPUALL[rip], rbp
	mov	r12, QWORD PTR [r14]
	je	.L10
	cmp	rbp, r12
	jne	.L11
.L10:
	sal	r12, 6
	add	r12, r13
	cmp	QWORD PTR 32[r12], 0
	mov	rax, QWORD PTR 40[r12]
	je	.L12
	xor	edi, edi
	test	rax, rax
	setne	dil
	call	ASSERT@PLT
	xor	edi, edi
	cmp	QWORD PTR [r12], rbx
	sete	dil
	call	ASSERT@PLT
	mov	rdi, QWORD PTR 32[r12]
	mov	rsi, rbx
	call	kmem_free@PLT
	mov	rax, QWORD PTR 40[r12]
.L12:
	test	rax, rax
	je	.L13
	xor	edi, edi
	cmp	QWORD PTR [r12], rbx
	sete	dil
	call	ASSERT@PLT
	mov	rdi, QWORD PTR 40[r12]
	mov	rsi, rbx
	call	kmem_free@PLT
.L13:
	mov	QWORD PTR 40[r12], 0
	mov	QWORD PTR 32[r12], 0
	mov	QWORD PTR [r12], 0
.L11:
	mov	r14, QWORD PTR 8[r14]
	cmp	QWORD PTR cpu_list[rip], r14
	jne	.L14
	mov	rax, QWORD PTR 16[rsp]
	mov	QWORD PTR dtrace_buffer_memory_inuse[rip], rax
	mov	eax, DWORD PTR ENOMEM[rip]
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	mov	rdx, QWORD PTR B_FALSE[rip]
	mov	r15d, DWORD PTR PRIV_ALL[rip]
	xor	eax, eax
	mov	QWORD PTR 24[rsp], rdx
	call	CRED@PLT
	mov	rdx, QWORD PTR 24[rsp]
	mov	esi, r15d
	mov	edi, eax
	call	PRIV_POLICY_CHOICE@PLT
	test	eax, eax
	jne	.L2
	mov	eax, DWORD PTR EFBIG[rip]
	add	rsp, 40
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	dtrace_buffer_alloc, .-dtrace_buffer_alloc
	.comm	dtrace_nonroot_maxsize,8,8
	.comm	dtrace_lock,4,4
	.comm	dtrace_buffer_memory_maxsize,8,8
	.comm	dtrace_buffer_memory_inuse,8,8
	.comm	cpu_lock,4,4
	.comm	cpu_list,8,8
	.comm	PRIV_ALL,4,4
	.comm	LCK_MTX_ASSERT_OWNED,4,4
	.comm	KM_NOSLEEP,4,4
	.comm	ENOMEM,4,4
	.comm	EFBIG,4,4
	.comm	DTRACE_CPUALL,8,8
	.comm	DTRACEBUF_NOSWITCH,4,4
	.comm	B_FALSE,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_dtrace.c_dtrace_buffer_alloc.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	dtrace_buffer_alloc, %function
dtrace_buffer_alloc:
	@ args = 4, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r9, r1
	mov	r5, r2
	ldr	fp, .L34
	sub	sp, sp, #20
	ldr	r4, .L34+4
	str	r3, [sp, #8]
	ldr	r3, [fp]
	ldr	r1, [r4]
	mov	r7, r0
	ldr	r0, .L34+8
	str	r3, [sp, #12]
	ldr	r6, [sp, #56]
	str	r9, [sp]
	bl	LCK_MTX_ASSERT
	ldr	r1, [r4]
	ldr	r0, .L34+12
	bl	LCK_MTX_ASSERT
	ldr	r3, .L34+16
	ldr	r3, [r3]
	cmp	r3, r5
	bcc	.L31
.L2:
	ldr	r8, .L34+20
	ldr	r10, .L34+24
	ldr	r4, [r8]
	b	.L9
.L33:
	ldr	r0, [r7, r2, lsl #5]
	sub	r0, r0, r5
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ASSERT
.L5:
	ldr	r4, [r4, #4]
	ldr	r3, [r8]
	cmp	r3, r4
	beq	.L32
.L9:
	ldr	r3, [r10]
	ldr	r2, [r4]
	cmp	r3, r6
	beq	.L4
	cmp	r6, r2
	bne	.L5
.L4:
	add	r9, r7, r2, lsl #5
	ldr	r1, [r9, #20]
	cmp	r1, #0
	bne	.L33
	ldr	r0, [r9, #16]
	str	r2, [sp, #4]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ASSERT
	mov	r0, r5
	bl	dtrace_buffer_canalloc
	ldr	r3, .L34+28
	ldr	r1, [r3]
	cmp	r0, r1
	beq	.L7
	ldr	r3, .L34+32
	mov	r0, r5
	ldr	r1, [r3]
	bl	kmem_zalloc
	cmp	r0, #0
	str	r0, [r9, #20]
	beq	.L7
	ldr	r1, [fp]
	ldr	r3, [sp]
	add	r1, r1, r5
	str	r1, [fp]
	mov	r1, #0
	cmp	r3, r5
	subeq	r3, r3, #1
	streq	r3, [sp]
	ldr	r3, .L34+36
	ldr	ip, [sp, #8]
	ldr	r0, [r3]
	ldr	r2, [sp, #4]
	ldr	r3, [sp]
	tst	ip, r0
	str	r3, [r9, #4]
	str	r3, [r9, #8]
	str	r5, [r7, r2, lsl #5]
	str	ip, [r9, #12]
	str	r1, [r9, #28]
	str	r1, [r9, #24]
	bne	.L5
	mov	r0, r5
	bl	dtrace_buffer_canalloc
	ldr	r3, .L34+28
	ldr	r2, [r3]
	cmp	r0, r2
	beq	.L7
	ldr	r3, .L34+32
	mov	r0, r5
	ldr	r1, [r3]
	bl	kmem_zalloc
	cmp	r0, #0
	str	r0, [r9, #16]
	beq	.L7
	ldr	r3, [fp]
	ldr	r4, [r4, #4]
	add	r3, r3, r5
	str	r3, [fp]
	ldr	r3, [r8]
	cmp	r3, r4
	bne	.L9
.L32:
	ldr	r3, .L34+40
	ldr	r0, [fp]
	ldr	r3, [r3]
	cmp	r0, r3
	movhi	r0, #0
	movls	r0, #1
	bl	ASSERT
	mov	r0, #0
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	mov	r3, r6
	mov	r2, #0
	mov	r6, r5
	ldr	r9, [r8]
.L14:
	ldr	r1, [r10]
	ldr	r5, [r9]
	cmp	r1, r3
	add	r4, r7, r5, lsl #5
	beq	.L10
	cmp	r3, r5
	bne	.L11
.L10:
	ldr	r1, [r4, #16]
	ldr	r0, [r4, #20]
	cmp	r1, #0
	beq	.L12
	subs	r0, r0, #0
	movne	r0, #1
	str	r3, [sp, #56]
	bl	ASSERT
	ldr	r0, [r7, r5, lsl #5]
	sub	r0, r0, r6
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ASSERT
	mov	r1, r6
	ldr	r0, [r4, #16]
	bl	kmem_free
	mov	r2, #0
	ldr	r0, [r4, #20]
	ldr	r3, [sp, #56]
.L12:
	cmp	r0, #0
	beq	.L13
	ldr	r0, [r7, r5, lsl #5]
	str	r3, [sp, #56]
	sub	r0, r0, r6
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ASSERT
	mov	r1, r6
	ldr	r0, [r4, #20]
	bl	kmem_free
	mov	r2, #0
	ldr	r3, [sp, #56]
.L13:
	str	r2, [r4, #20]
	str	r2, [r4, #16]
	str	r2, [r7, r5, lsl #5]
.L11:
	ldr	r9, [r9, #4]
	ldr	r1, [r8]
	cmp	r1, r9
	bne	.L14
	ldr	r3, .L34+44
	ldr	r2, [sp, #12]
	ldr	r0, [r3]
	str	r2, [fp]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L31:
	bl	CRED
	ldr	r3, .L34+48
	ldr	r2, .L34+28
	ldr	r1, [r3]
	ldr	r2, [r2]
	bl	PRIV_POLICY_CHOICE
	cmp	r0, #0
	bne	.L2
	ldr	r3, .L34+52
	ldr	r0, [r3]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L35:
	.align	2
.L34:
	.word	dtrace_buffer_memory_inuse
	.word	LCK_MTX_ASSERT_OWNED
	.word	cpu_lock
	.word	dtrace_lock
	.word	dtrace_nonroot_maxsize
	.word	cpu_list
	.word	DTRACE_CPUALL
	.word	B_FALSE
	.word	KM_NOSLEEP
	.word	DTRACEBUF_NOSWITCH
	.word	dtrace_buffer_memory_maxsize
	.word	ENOMEM
	.word	PRIV_ALL
	.word	EFBIG
	.size	dtrace_buffer_alloc, .-dtrace_buffer_alloc
	.comm	dtrace_nonroot_maxsize,4,4
	.comm	dtrace_lock,4,4
	.comm	dtrace_buffer_memory_maxsize,4,4
	.comm	dtrace_buffer_memory_inuse,4,4
	.comm	cpu_lock,4,4
	.comm	cpu_list,4,4
	.comm	PRIV_ALL,4,4
	.comm	LCK_MTX_ASSERT_OWNED,4,4
	.comm	KM_NOSLEEP,4,4
	.comm	ENOMEM,4,4
	.comm	EFBIG,4,4
	.comm	DTRACE_CPUALL,4,4
	.comm	DTRACEBUF_NOSWITCH,4,4
	.comm	B_FALSE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
