	.file	"extr_g_eli.c_g_eli_worker.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Thread %s started."
.LC1:
	.string	"Thread %s exiting."
.LC2:
	.string	"inflight=%d"
.LC3:
	.string	"geli:inf"
.LC4:
	.string	"geli:suspend"
.LC5:
	.string	"geli:w"
	.text
	.p2align 4
	.type	g_eli_worker, @function
g_eli_worker:
.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
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rbx, QWORD PTR 16[rdi]
	mov	rdi, QWORD PTR curthread[rip]
	call	thread_lock@PLT
	mov	esi, DWORD PTR PUSER[rip]
	mov	rdi, QWORD PTR curthread[rip]
	call	sched_prio@PLT
	cmp	QWORD PTR 24[rbx], 0
	jne	.L24
.L2:
	mov	rdi, QWORD PTR curthread[rip]
	lea	r12, 16[rbx]
	lea	r13, 20[rbx]
	lea	r14, .LC1[rip]
	call	thread_unlock@PLT
	mov	rax, QWORD PTR curthread[rip]
	mov	edi, 1
	lea	rsi, .LC0[rip]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR [rax]
	call	G_ELI_DEBUG@PLT
	lea	rax, 8[rbx]
	mov	QWORD PTR 8[rsp], rax
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rdi, r12
	call	mtx_lock@PLT
.L4:
	mov	rdi, rbx
	call	g_eli_takefirst@PLT
	mov	r15, rax
	test	rax, rax
	jne	.L5
.L29:
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR G_ELI_FLAG_DESTROY[rip], eax
	jne	.L25
	test	DWORD PTR G_ELI_FLAG_SUSPEND[rip], eax
	je	.L26
.L10:
	mov	rdx, QWORD PTR 8[rbx]
	test	rdx, rdx
	jg	.L27
	cmp	QWORD PTR 8[rbp], 0
	jne	.L28
.L9:
	mov	rdi, r13
	call	wakeup@PLT
	xor	r8d, r8d
	mov	rsi, r12
	mov	rdi, rbx
	mov	edx, DWORD PTR PRIBIO[rip]
	lea	rcx, .LC4[rip]
	call	msleep@PLT
	cmp	QWORD PTR 8[rbp], 0
	jne	.L4
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR G_ELI_FLAG_SUSPEND[rip], eax
	jne	.L4
	mov	rdi, rbp
	call	g_eli_newsession@PLT
	xor	edi, edi
	test	eax, eax
	movsx	rsi, eax
	sete	dil
	call	KASSERT@PLT
	mov	rax, QWORD PTR TRUE[rip]
	mov	rdi, rbx
	mov	QWORD PTR 8[rbp], rax
	call	g_eli_takefirst@PLT
	mov	r15, rax
	test	rax, rax
	je	.L29
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rax, QWORD PTR G_ELI_NEW_BIO[rip]
	cmp	QWORD PTR [r15], rax
	je	.L30
.L12:
	mov	rdi, r12
	call	mtx_unlock@PLT
	mov	rax, QWORD PTR G_ELI_NEW_BIO[rip]
	cmp	QWORD PTR [r15], rax
	je	.L31
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR G_ELI_FLAG_AUTH[rip], eax
	je	.L17
.L22:
	mov	rsi, r15
	mov	rdi, rbp
	call	g_eli_auth_run@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L27:
	xor	edi, edi
	lea	rsi, .LC2[rip]
	call	G_ELI_DEBUG@PLT
	movsx	r8, DWORD PTR hz[rip]
	mov	rsi, r12
	mov	rdi, rbx
	mov	edx, DWORD PTR PRIBIO[rip]
	lea	rcx, .LC3[rip]
	mov	rax, r8
	imul	r8, r8, 1717986919
	sar	eax, 31
	sar	r8, 33
	sub	r8d, eax
	call	msleep@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L25:
	mov	rdi, rbx
	call	g_eli_cancel@PLT
	mov	esi, DWORD PTR w_next[rip]
	mov	rdi, rbp
	call	LIST_REMOVE@PLT
	mov	rdi, rbp
	call	g_eli_freesession@PLT
	mov	esi, DWORD PTR M_ELI[rip]
	mov	rdi, rbp
	call	free@PLT
	mov	rax, QWORD PTR curthread[rip]
	mov	rsi, r14
	mov	edi, 1
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR [rax]
	call	G_ELI_DEBUG@PLT
	mov	rdi, r13
	call	wakeup@PLT
	mov	rdi, r12
	call	mtx_unlock@PLT
	xor	edi, edi
	call	kproc_exit@PLT
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR G_ELI_FLAG_SUSPEND[rip], eax
	jne	.L10
.L26:
	mov	edx, DWORD PTR PDROP[rip]
	xor	r8d, r8d
	mov	rsi, r12
	mov	rdi, rbx
	lea	rcx, .LC5[rip]
	call	msleep@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L28:
	mov	rdi, rbp
	call	g_eli_freesession@PLT
	mov	rax, QWORD PTR FALSE[rip]
	mov	QWORD PTR 8[rbp], rax
	jmp	.L9
.L14:
	cmp	rdx, rax
	je	.L32
.L17:
	mov	rsi, r15
	mov	rdi, rbp
	call	g_eli_crypto_run@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L31:
	mov	rax, QWORD PTR 8[r15]
	mov	rdx, QWORD PTR BIO_READ[rip]
	mov	QWORD PTR [r15], 0
	mov	ecx, DWORD PTR [rbx]
	test	DWORD PTR G_ELI_FLAG_AUTH[rip], ecx
	je	.L14
	cmp	rdx, rax
	jne	.L22
	mov	rsi, r15
	mov	rdi, rbx
	call	g_eli_auth_read@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L30:
	mov	rdi, QWORD PTR 8[rsp]
	mov	esi, 1
	call	atomic_add_int@PLT
	jmp	.L12
.L32:
	mov	edx, 1
	mov	rsi, r15
	mov	rdi, rbx
	call	g_eli_crypto_read@PLT
	jmp	.L3
.L24:
	mov	eax, DWORD PTR 0[rbp]
	mov	rdi, QWORD PTR curthread[rip]
	cdq
	idiv	DWORD PTR mp_ncpus[rip]
	mov	esi, edx
	call	sched_bind@PLT
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	g_eli_worker, .-g_eli_worker
	.comm	w_next,4,4
	.comm	smp_started,8,8
	.comm	mp_ncpus,4,4
	.comm	hz,4,4
	.comm	curthread,8,8
	.comm	TRUE,8,8
	.comm	PUSER,4,4
	.comm	PRIBIO,4,4
	.comm	PDROP,4,4
	.comm	M_ELI,4,4
	.comm	G_ELI_NEW_BIO,8,8
	.comm	G_ELI_FLAG_SUSPEND,4,4
	.comm	G_ELI_FLAG_DESTROY,4,4
	.comm	G_ELI_FLAG_AUTH,4,4
	.comm	FALSE,8,8
	.comm	BIO_READ,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_g_eli.c_g_eli_worker.c"
	.text
	.global	__aeabi_idivmod
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Thread %s started.\000"
	.align	2
.LC1:
	.ascii	"Thread %s exiting.\000"
	.align	2
.LC2:
	.ascii	"inflight=%d\000"
	.align	2
.LC3:
	.ascii	"geli:inf\000"
	.align	2
.LC4:
	.ascii	"geli:suspend\000"
	.align	2
.LC5:
	.ascii	"geli:w\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	g_eli_worker, %function
g_eli_worker:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r6, .L39
	ldr	r4, [r0, #8]
	sub	sp, sp, #20
	mov	r5, r0
	ldr	r0, [r6]
	bl	thread_lock
	ldr	r3, .L39+4
	ldr	r0, [r6]
	ldr	r1, [r3]
	bl	sched_prio
	ldr	r3, [r4, #16]
	cmp	r3, #0
	bne	.L30
.L2:
	ldr	r3, .L39
	ldr	r8, .L39+8
	mov	r6, r3
	ldr	r0, [r3]
	bl	thread_unlock
	ldr	r3, [r6]
	mov	r0, #1
	ldr	r3, [r3]
	ldr	r1, .L39+12
	ldr	r2, [r3]
	bl	G_ELI_DEBUG
	ldr	r9, .L39+16
	add	r3, r4, #4
	ldr	r7, .L39+20
	ldr	fp, .L39+24
	add	r6, r4, #8
	add	r10, r4, #12
	str	r3, [sp, #12]
.L3:
	mov	r0, r6
	bl	mtx_lock
.L4:
	mov	r0, r4
	bl	g_eli_takefirst
	subs	r3, r0, #0
	bne	.L5
.L35:
	ldr	r2, [r4]
	ldr	r1, [r8]
	tst	r2, r1
	bne	.L31
	ldr	r3, [r7]
	ands	r2, r2, r3
	beq	.L32
.L10:
	ldr	r2, [r4, #4]
	cmp	r2, #0
	bgt	.L33
	ldr	r3, [r5, #4]
	cmp	r3, #0
	bne	.L34
.L9:
	mov	r0, r10
	bl	wakeup
	mov	r2, #0
	mov	r3, fp
	str	r2, [sp]
	mov	r1, r6
	mov	r0, r4
	ldr	r2, [r9]
	bl	msleep
	ldr	r3, [r5, #4]
	cmp	r3, #0
	bne	.L4
	ldr	r2, [r4]
	ldr	r3, [r7]
	tst	r2, r3
	bne	.L4
	mov	r0, r5
	bl	g_eli_newsession
	mov	r1, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	KASSERT
	ldr	r3, .L39+28
	mov	r0, r4
	ldr	r3, [r3]
	str	r3, [r5, #4]
	bl	g_eli_takefirst
	subs	r3, r0, #0
	beq	.L35
.L5:
	ldr	r2, .L39+32
	ldr	r1, [r3]
	ldr	r2, [r2]
	cmp	r1, r2
	beq	.L36
.L12:
	mov	r0, r6
	str	r3, [sp, #8]
	bl	mtx_unlock
	ldr	r3, [sp, #8]
	ldr	r2, .L39+32
	ldr	r1, [r3]
	ldr	r2, [r2]
	cmp	r1, r2
	beq	.L37
	ldr	r2, .L39+36
	ldr	r1, [r4]
	ldr	r2, [r2]
	tst	r1, r2
	beq	.L17
.L28:
	mov	r1, r3
	mov	r0, r5
	bl	g_eli_auth_run
	b	.L3
.L33:
	ldr	r1, .L39+40
	mov	r0, #0
	bl	G_ELI_DEBUG
	ldr	r3, .L39+44
	ldr	r1, .L39+48
	ldr	r2, [r3]
	ldr	r3, .L39+52
	smull	r0, r1, r2, r1
	asr	r2, r2, #31
	rsb	r2, r2, r1, asr #1
	str	r2, [sp]
	mov	r1, r6
	mov	r0, r4
	ldr	r2, [r9]
	bl	msleep
	b	.L4
.L31:
	mov	r0, r4
	str	r3, [sp, #8]
	bl	g_eli_cancel
	ldr	r3, .L39+56
	mov	r0, r5
	ldr	r1, [r3]
	bl	LIST_REMOVE
	mov	r0, r5
	bl	g_eli_freesession
	ldr	r3, .L39+60
	mov	r0, r5
	ldr	r1, [r3]
	bl	free
	ldr	r3, .L39
	ldr	r1, .L39+64
	ldr	r2, [r3]
	mov	r0, #1
	ldr	r2, [r2]
	ldr	r2, [r2]
	bl	G_ELI_DEBUG
	mov	r0, r10
	bl	wakeup
	mov	r0, r6
	bl	mtx_unlock
	ldr	r3, [sp, #8]
	mov	r0, r3
	bl	kproc_exit
	ldr	r2, [r4]
	ldr	r3, [r7]
	ands	r2, r2, r3
	bne	.L10
.L32:
	str	r2, [sp]
	ldr	r2, .L39+68
	mov	r1, r6
	mov	r0, r4
	ldr	r3, .L39+72
	ldr	r2, [r2]
	bl	msleep
	b	.L3
.L34:
	mov	r0, r5
	bl	g_eli_freesession
	ldr	r3, .L39+76
	ldr	r3, [r3]
	str	r3, [r5, #4]
	b	.L9
.L14:
	cmp	r1, r2
	beq	.L38
.L17:
	mov	r1, r3
	mov	r0, r5
	bl	g_eli_crypto_run
	b	.L3
.L37:
	mov	r0, #0
	ldr	r2, .L39+36
	ldr	r1, [r4]
	ldr	r2, [r2]
	str	r0, [r3]
	tst	r1, r2
	ldr	r1, .L39+80
	ldr	r2, [r3, #4]
	ldr	r1, [r1]
	beq	.L14
	cmp	r1, r2
	bne	.L28
	mov	r1, r3
	mov	r0, r4
	bl	g_eli_auth_read
	b	.L3
.L36:
	mov	r1, #1
	ldr	r0, [sp, #12]
	str	r3, [sp, #8]
	bl	atomic_add_int
	ldr	r3, [sp, #8]
	b	.L12
.L38:
	mov	r1, r3
	mov	r2, #1
	mov	r0, r4
	bl	g_eli_crypto_read
	b	.L3
.L30:
	ldr	r3, .L39+84
	ldr	r0, [r5]
	ldr	r1, [r3]
	bl	__aeabi_idivmod
	ldr	r0, [r6]
	bl	sched_bind
	b	.L2
.L40:
	.align	2
.L39:
	.word	curthread
	.word	PUSER
	.word	G_ELI_FLAG_DESTROY
	.word	.LC0
	.word	PRIBIO
	.word	G_ELI_FLAG_SUSPEND
	.word	.LC4
	.word	TRUE
	.word	G_ELI_NEW_BIO
	.word	G_ELI_FLAG_AUTH
	.word	.LC2
	.word	hz
	.word	1717986919
	.word	.LC3
	.word	w_next
	.word	M_ELI
	.word	.LC1
	.word	PDROP
	.word	.LC5
	.word	FALSE
	.word	BIO_READ
	.word	mp_ncpus
	.size	g_eli_worker, .-g_eli_worker
	.comm	w_next,4,4
	.comm	smp_started,4,4
	.comm	mp_ncpus,4,4
	.comm	hz,4,4
	.comm	curthread,4,4
	.comm	TRUE,4,4
	.comm	PUSER,4,4
	.comm	PRIBIO,4,4
	.comm	PDROP,4,4
	.comm	M_ELI,4,4
	.comm	G_ELI_NEW_BIO,4,4
	.comm	G_ELI_FLAG_SUSPEND,4,4
	.comm	G_ELI_FLAG_DESTROY,4,4
	.comm	G_ELI_FLAG_AUTH,4,4
	.comm	FALSE,4,4
	.comm	BIO_READ,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
