	.file	"extr_grumain.c_gru_load_context.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"err %d: cch %p, gts %p, cbr 0x%lx, dsr 0x%lx\n"
	.align 8
.LC1:
	.string	"gid %d, gts %p, cbrmap 0x%lx, dsrmap 0x%lx, tie %d, tis %d\n"
	.text
	.p2align 4
	.globl	gru_load_context
	.type	gru_load_context, @function
gru_load_context:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	rbx, QWORD PTR 40[rdi]
	mov	r13d, DWORD PTR [rdi]
	mov	edi, DWORD PTR 4[rbx]
	mov	esi, r13d
	call	get_cch@PLT
	mov	rdi, rax
	mov	rbp, rax
	call	lock_cch_handle@PLT
	mov	rax, QWORD PTR 8[r12]
	cmp	rax, QWORD PTR GRU_OPT_MISS_FMM_POLL[rip]
	mov	rdx, QWORD PTR GRU_OPT_MISS_FMM_INTR[rip]
	je	.L21
	xor	ecx, ecx
	cmp	rax, rdx
	sete	cl
	mov	esi, ecx
	mov	DWORD PTR 4[rbp], ecx
	mov	DWORD PTR 0[rbp], esi
	cmp	rax, rdx
	je	.L22
.L4:
	mov	rax, QWORD PTR 16[r12]
	test	rax, rax
	js	.L5
	mov	DWORD PTR 8[rbp], 1
	mov	QWORD PTR 16[rbp], rax
.L6:
	mov	eax, DWORD PTR 32[r12]
	mov	DWORD PTR 24[rbp], 0
	mov	rdi, r12
	mov	DWORD PTR 68[rbp], eax
	mov	eax, DWORD PTR 36[r12]
	mov	DWORD PTR 64[rbp], eax
	call	is_kernel_context@PLT
	test	rax, rax
	je	.L7
	movabs	rax, 4294967297
	mov	DWORD PTR 32[rbp], 1
	mov	QWORD PTR 24[rbp], rax
	mov	QWORD PTR 56[rbp], 0
.L8:
	mov	rdi, rbp
	call	cch_allocate@PLT
	test	eax, eax
	jne	.L23
.L10:
	mov	edi, DWORD PTR 52[r12]
	mov	ecx, DWORD PTR 36[r12]
	mov	edx, r13d
	mov	esi, DWORD PTR 4[rbx]
	mov	r9d, DWORD PTR 48[r12]
	mov	r8d, DWORD PTR 32[r12]
	call	gru_load_context_data@PLT
	mov	rdi, rbp
	call	cch_start@PLT
	test	rax, rax
	jne	.L24
.L11:
	mov	rdi, rbp
	call	unlock_cch_handle@PLT
	xor	edx, edx
	mov	rax, QWORD PTR 40[r12]
	mov	rcx, r12
	mov	r9d, DWORD PTR 32[r12]
	mov	r8d, DWORD PTR 36[r12]
	push	QWORD PTR 24[r12]
	.cfi_def_cfa_offset 56
	lea	rsi, .LC1[rip]
	mov	rbx, QWORD PTR GRU_OPT_MISS_FMM_INTR[rip]
	cmp	QWORD PTR 8[r12], rbx
	mov	edi, DWORD PTR grudev[rip]
	sete	dl
	push	rdx
	.cfi_def_cfa_offset 64
	mov	edx, DWORD PTR [rax]
	xor	eax, eax
	call	gru_dbg@PLT
	add	rsp, 24
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_def_cfa_offset 48
	mov	DWORD PTR 8[rbp], 0
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L21:
	cmp	rax, rdx
	mov	esi, 1
	sete	cl
	mov	DWORD PTR 0[rbp], esi
	movzx	ecx, cl
	mov	DWORD PTR 4[rbp], ecx
	cmp	rax, rdx
	jne	.L4
.L22:
	xor	eax, eax
	call	gru_cpu_fault_map_id@PLT
	mov	QWORD PTR 24[r12], rax
	mov	QWORD PTR 56[rbp], rax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L24:
	xor	eax, eax
	call	BUG@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L23:
	mov	edx, DWORD PTR 32[r12]
	sub	rsp, 8
	.cfi_def_cfa_offset 56
	mov	r8, r12
	mov	rcx, rbp
	mov	r9d, DWORD PTR 36[r12]
	mov	edi, DWORD PTR grudev[rip]
	lea	rsi, .LC0[rip]
	push	rdx
	.cfi_def_cfa_offset 64
	mov	edx, eax
	xor	eax, eax
	call	gru_dbg@PLT
	xor	eax, eax
	call	BUG@PLT
	pop	rax
	.cfi_def_cfa_offset 56
	pop	rdx
	.cfi_def_cfa_offset 48
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L7:
	mov	QWORD PTR 24[rbp], 0
	mov	rsi, r12
	mov	rdi, rbx
	mov	DWORD PTR 32[rbp], 0
	call	gru_load_mm_tracker@PLT
	mov	rdi, QWORD PTR 40[rbp]
	mov	rsi, QWORD PTR 48[rbp]
	xor	edx, edx
	.p2align 4,,10
	.p2align 3
.L9:
	lea	ecx, [rax+rdx]
	mov	DWORD PTR [rdi+rdx*4], ecx
	mov	ecx, DWORD PTR 56[r12]
	mov	DWORD PTR [rsi+rdx*4], ecx
	add	rdx, 1
	cmp	rdx, 8
	jne	.L9
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	gru_load_context, .-gru_load_context
	.comm	grudev,4,4
	.comm	GRU_OPT_MISS_FMM_POLL,8,8
	.comm	GRU_OPT_MISS_FMM_INTR,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_grumain.c_gru_load_context.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"err %d: cch %p, gts %p, cbr 0x%lx, dsr 0x%lx\012\000"
	.align	2
.LC1:
	.ascii	"gid %d, gts %p, cbrmap 0x%lx, dsrmap 0x%lx, tie %d,"
	.ascii	" tis %d\012\000"
	.text
	.align	2
	.global	gru_load_context
	.syntax unified
	.arm
	.fpu softvfp
	.type	gru_load_context, %function
gru_load_context:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	ldr	r8, [r0]
	ldr	r6, [r0, #24]
	mov	r1, r8
	mov	r4, r0
	sub	sp, sp, #20
	ldr	r0, [r6, #4]
	bl	get_cch
	mov	r5, r0
	bl	lock_cch_handle
	ldr	r2, .L23
	ldr	r3, [r4, #4]
	ldr	r2, [r2]
	ldr	r7, .L23+4
	cmp	r3, r2
	ldrne	r2, [r7]
	ldreq	r2, [r7]
	subne	r1, r3, r2
	clzne	r1, r1
	subeq	r1, r3, r2
	clzeq	r1, r1
	lsrne	r1, r1, #5
	moveq	r0, #1
	movne	r0, r1
	lsreq	r1, r1, #5
	cmp	r3, r2
	stm	r5, {r0, r1}
	beq	.L21
.L4:
	ldr	r3, [r4, #8]
	mov	r9, #0
	cmp	r3, #0
	movge	r2, #1
	movlt	r3, #0
	strge	r3, [r5, #12]
	strge	r2, [r5, #8]
	strlt	r3, [r5, #8]
	ldr	r2, [r4, #16]
	ldr	r3, [r4, #20]
	mov	r0, r4
	str	r9, [r5, #16]
	str	r2, [r5, #44]
	str	r3, [r5, #40]
	bl	is_kernel_context
	cmp	r0, #0
	beq	.L7
	mov	r3, #1
	str	r9, [r5, #36]
	str	r3, [r5, #20]
	str	r3, [r5, #16]
	str	r3, [r5, #24]
.L8:
	mov	r0, r5
	bl	cch_allocate
	subs	r2, r0, #0
	ldr	r9, .L23+8
	bne	.L18
.L10:
	ldr	r0, [r4, #28]
	ldr	r3, [r4, #16]
	ldr	r1, [r6, #4]
	str	r0, [sp, #4]
	str	r3, [sp]
	mov	r2, r8
	ldr	r3, [r4, #20]
	ldr	r0, [r4, #32]
	bl	gru_load_context_data
	mov	r0, r5
	bl	cch_start
	cmp	r0, #0
	bne	.L22
.L11:
	mov	r0, r5
	bl	unlock_cch_handle
	ldr	r3, [r4, #4]
	ldr	r1, [r7]
	ldr	r2, [r4, #24]
	sub	r3, r3, r1
	clz	r3, r3
	lsr	r3, r3, #5
	ldr	r1, [r4, #16]
	ldr	r2, [r2]
	ldr	ip, [r4, #12]
	ldr	r0, [r9]
	str	r3, [sp, #8]
	ldr	r3, [r4, #20]
	str	r1, [sp, #4]
	str	r3, [sp]
	ldr	r1, .L23+12
	mov	r3, r4
	str	ip, [sp, #12]
	bl	gru_dbg
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L21:
	bl	gru_cpu_fault_map_id
	str	r0, [r4, #12]
	str	r0, [r5, #36]
	b	.L4
.L22:
	bl	BUG
	b	.L11
.L18:
	ldr	r1, [r4, #16]
	ldr	r3, [r4, #20]
	str	r4, [sp]
	ldr	r0, [r9]
	str	r1, [sp, #8]
	str	r3, [sp, #4]
	ldr	r1, .L23+16
	mov	r3, r5
	bl	gru_dbg
	bl	BUG
	b	.L10
.L7:
	str	r0, [r5, #20]
	str	r0, [r5, #16]
	str	r0, [r5, #24]
	mov	r1, r4
	mov	r0, r6
	bl	gru_load_mm_tracker
	ldr	r2, [r5, #28]
	ldr	r3, [r5, #32]
	add	ip, r0, #8
	sub	r2, r2, #4
	sub	r3, r3, #4
.L9:
	str	r0, [r2, #4]!
	ldr	r1, [r4, #36]
	add	r0, r0, #1
	cmp	r0, ip
	str	r1, [r3, #4]!
	bne	.L9
	b	.L8
.L24:
	.align	2
.L23:
	.word	GRU_OPT_MISS_FMM_POLL
	.word	GRU_OPT_MISS_FMM_INTR
	.word	grudev
	.word	.LC1
	.word	.LC0
	.size	gru_load_context, .-gru_load_context
	.comm	grudev,4,4
	.comm	GRU_OPT_MISS_FMM_POLL,4,4
	.comm	GRU_OPT_MISS_FMM_INTR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
