	.file	"extr_intel_utils.c_dmar_map_pgtbl.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	dmar_map_pgtbl
	.type	dmar_map_pgtbl, @function
dmar_map_pgtbl:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15d, esi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rcx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, edi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, edx
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	test	DWORD PTR DMAR_PGF_OBJL[rip], edx
	je	.L34
.L2:
	mov	esi, r15d
	mov	edi, r12d
	xor	r14d, r14d
	call	vm_page_lookup@PLT
	mov	rbp, rax
	test	rax, rax
	je	.L35
.L3:
	test	DWORD PTR DMAR_PGF_WAITOK[rip], ebx
	jne	.L36
.L7:
	xor	eax, eax
	call	sched_pin@PLT
	test	DWORD PTR DMAR_PGF_WAITOK[rip], ebx
	mov	rdi, rbp
	mov	esi, 0
	cmove	esi, DWORD PTR SFB_NOWAIT[rip]
	or	esi, DWORD PTR SFB_CPUPRIVATE[rip]
	call	sf_buf_alloc@PLT
	mov	QWORD PTR 0[r13], rax
	mov	rdi, rax
	test	rax, rax
	je	.L37
	mov	eax, DWORD PTR DMAR_PGF_WAITOK[rip]
	or	eax, DWORD PTR DMAR_PGF_OBJL[rip]
	and	ebx, eax
	cmp	eax, ebx
	je	.L38
	test	ebx, ebx
	je	.L39
.L13:
	add	rsp, 8
	.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
	jmp	sf_buf_kva@PLT
	.p2align 4,,10
	.p2align 3
.L39:
	.cfi_restore_state
	mov	edi, r12d
	call	VM_OBJECT_WUNLOCK@PLT
	mov	rdi, QWORD PTR 0[r13]
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L34:
	call	VM_OBJECT_WLOCK@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L36:
	mov	edi, r12d
	call	VM_OBJECT_WUNLOCK@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L35:
	mov	edx, DWORD PTR DMAR_PGF_OBJL[rip]
	test	DWORD PTR DMAR_PGF_ALLOC[rip], ebx
	jne	.L40
.L4:
	test	ebx, edx
	je	.L5
.L1:
	add	rsp, 8
	.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
.L38:
	.cfi_restore_state
	mov	edi, r12d
	call	VM_OBJECT_WLOCK@PLT
	mov	rdi, QWORD PTR 0[r13]
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L40:
	or	edx, ebx
	mov	esi, r15d
	mov	edi, r12d
	mov	r14d, 1
	call	dmar_pgalloc@PLT
	mov	rbp, rax
	test	rax, rax
	jne	.L3
	mov	edx, DWORD PTR DMAR_PGF_OBJL[rip]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L37:
	xor	eax, eax
	call	sched_unpin@PLT
	test	r14d, r14d
	jne	.L41
.L10:
	test	DWORD PTR DMAR_PGF_OBJL[rip], ebx
	jne	.L1
.L5:
	mov	edi, r12d
	call	VM_OBJECT_WUNLOCK@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L41:
	mov	edi, r12d
	call	VM_OBJECT_ASSERT_WLOCKED@PLT
	mov	edx, DWORD PTR DMAR_PGF_OBJL[rip]
	mov	esi, DWORD PTR 0[rbp]
	mov	edi, r12d
	or	edx, ebx
	call	dmar_pgfree@PLT
	jmp	.L10
	.cfi_endproc
.LFE0:
	.size	dmar_map_pgtbl, .-dmar_map_pgtbl
	.comm	SFB_NOWAIT,4,4
	.comm	SFB_CPUPRIVATE,4,4
	.comm	DMAR_PGF_WAITOK,4,4
	.comm	DMAR_PGF_OBJL,4,4
	.comm	DMAR_PGF_ALLOC,4,4
	.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_intel_utils.c_dmar_map_pgtbl.c"
	.text
	.align	2
	.global	dmar_map_pgtbl
	.syntax unified
	.arm
	.fpu softvfp
	.type	dmar_map_pgtbl, %function
dmar_map_pgtbl:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r2
	ldr	r8, .L42
	mov	r7, r1
	ldr	r2, [r8]
	mov	r6, r3
	tst	r4, r2
	mov	r5, r0
	beq	.L34
.L2:
	mov	r1, r7
	mov	r0, r5
	bl	vm_page_lookup
	subs	r9, r0, #0
	movne	r7, #0
	beq	.L35
.L3:
	ldr	r10, .L42+4
	ldr	r3, [r10]
	tst	r4, r3
	bne	.L36
.L7:
	bl	sched_pin
	ldr	r3, [r10]
	mov	r0, r9
	tst	r4, r3
	movne	r1, #0
	ldreq	r3, .L42+8
	ldreq	r1, [r3]
	ldr	r3, .L42+12
	ldr	r3, [r3]
	orr	r1, r1, r3
	bl	sf_buf_alloc
	cmp	r0, #0
	str	r0, [r6]
	beq	.L37
	ldr	r3, [r8]
	ldr	r2, [r10]
	orr	r2, r2, r3
	bics	r3, r2, r4
	and	r2, r2, r4
	beq	.L38
	cmp	r2, #0
	beq	.L39
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	sf_buf_kva
.L39:
	mov	r0, r5
	bl	VM_OBJECT_WUNLOCK
	ldr	r0, [r6]
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	sf_buf_kva
.L34:
	bl	VM_OBJECT_WLOCK
	b	.L2
.L36:
	mov	r0, r5
	bl	VM_OBJECT_WUNLOCK
	b	.L7
.L35:
	ldr	r3, .L42+16
	ldr	r2, [r8]
	ldr	r3, [r3]
	tst	r4, r3
	bne	.L40
.L4:
	tst	r4, r2
	beq	.L5
.L1:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L38:
	mov	r0, r5
	bl	VM_OBJECT_WLOCK
	ldr	r0, [r6]
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	sf_buf_kva
.L40:
	mov	r1, r7
	mov	r0, r5
	orr	r2, r4, r2
	bl	dmar_pgalloc
	subs	r9, r0, #0
	movne	r7, #1
	bne	.L3
	ldr	r2, [r8]
	b	.L4
.L37:
	bl	sched_unpin
	cmp	r7, #0
	bne	.L41
.L10:
	ldr	r3, [r8]
	tst	r4, r3
	bne	.L1
.L5:
	mov	r0, r5
	bl	VM_OBJECT_WUNLOCK
	b	.L1
.L41:
	mov	r0, r5
	bl	VM_OBJECT_ASSERT_WLOCKED
	ldr	r2, [r8]
	mov	r0, r5
	ldr	r1, [r9]
	orr	r2, r4, r2
	bl	dmar_pgfree
	b	.L10
.L43:
	.align	2
.L42:
	.word	DMAR_PGF_OBJL
	.word	DMAR_PGF_WAITOK
	.word	SFB_NOWAIT
	.word	SFB_CPUPRIVATE
	.word	DMAR_PGF_ALLOC
	.size	dmar_map_pgtbl, .-dmar_map_pgtbl
	.comm	SFB_NOWAIT,4,4
	.comm	SFB_CPUPRIVATE,4,4
	.comm	DMAR_PGF_WAITOK,4,4
	.comm	DMAR_PGF_OBJL,4,4
	.comm	DMAR_PGF_ALLOC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
