	.file	"extr_book3s_32_mmu_host.c_create_sid_map.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	create_sid_map, @function
create_sid_map:
.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	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	to_book3s@PLT
	mov	rdi, rbp
	mov	rbx, rax
	call	kvmppc_get_msr@PLT
	test	DWORD PTR MSR_PR[rip], eax
	je	.L2
	or	r12d, DWORD PTR VSID_PR[rip]
.L2:
	mov	esi, r12d
	mov	rdi, rbp
	call	kvmppc_sid_hash@PLT
	mov	ecx, DWORD PTR backwards_map.1956[rip]
	mov	r13, rax
	test	ecx, ecx
	je	.L3
	mov	rax, QWORD PTR SID_MAP_MASK[rip]
	sub	rax, r13
	mov	r13, rax
.L3:
	mov	rdi, rbp
	call	to_book3s@PLT
	lea	rdx, 0[r13+r13*2]
	mov	rax, QWORD PTR 16[rax]
	lea	r13, [rax+rdx*4]
	mov	edx, DWORD PTR backwards_map.1956[rip]
	xor	eax, eax
	test	edx, edx
	sete	al
	mov	DWORD PTR backwards_map.1956[rip], eax
	mov	rax, QWORD PTR [rbx]
	cmp	rax, QWORD PTR VSID_POOL_SIZE[rip]
	jnb	.L10
.L4:
	mov	rdx, QWORD PTR 8[rbx]
	mov	edx, DWORD PTR [rdx+rax*4]
	add	rax, 1
	mov	DWORD PTR 8[r13], edx
	mov	QWORD PTR [rbx], rax
	mov	rax, r13
	mov	DWORD PTR 4[r13], r12d
	mov	DWORD PTR 0[r13], 1
	add	rsp, 8
	.cfi_remember_state
	.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
.L10:
	.cfi_restore_state
	mov	eax, DWORD PTR SID_MAP_NUM[rip]
	mov	rdi, QWORD PTR 16[rbx]
	mov	QWORD PTR [rbx], 0
	xor	esi, esi
	lea	edx, [rax+rax*2]
	sal	edx, 2
	call	memset@PLT
	xor	edx, edx
	xor	esi, esi
	mov	rdi, rbp
	call	kvmppc_mmu_pte_flush@PLT
	mov	rdi, rbp
	call	kvmppc_mmu_flush_segments@PLT
	mov	rax, QWORD PTR [rbx]
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	create_sid_map, .-create_sid_map
	.local	backwards_map.1956
	.comm	backwards_map.1956,4,4
	.comm	VSID_PR,4,4
	.comm	VSID_POOL_SIZE,8,8
	.comm	SID_MAP_NUM,4,4
	.comm	SID_MAP_MASK,8,8
	.comm	MSR_PR,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_book3s_32_mmu_host.c_create_sid_map.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	create_sid_map, %function
create_sid_map:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r6, r0
	mov	r7, r1
	bl	to_book3s
	mov	r5, r0
	mov	r0, r6
	bl	kvmppc_get_msr
	ldr	r3, .L14
	ldr	r9, .L14+4
	ldr	r3, [r3]
	tst	r0, r3
	ldrne	r3, .L14+8
	mov	r0, r6
	ldrne	r3, [r3]
	orrne	r7, r7, r3
	mov	r1, r7
	bl	kvmppc_sid_hash
	ldr	r3, [r9]
	mov	r4, r0
	cmp	r3, #0
	ldrne	r3, .L14+12
	ldrne	r3, [r3]
	subne	r4, r3, r0
	mov	r0, r6
	bl	to_book3s
	ldr	r2, [r9]
	ldr	r3, .L14+16
	clz	r2, r2
	ldr	r1, [r3]
	ldr	r3, [r5]
	ldr	r8, [r0, #8]
	add	r4, r4, r4, lsl #1
	lsr	r2, r2, #5
	cmp	r3, r1
	str	r2, [r9]
	add	r9, r8, r4, lsl #2
	lsl	r4, r4, #2
	bcs	.L13
.L4:
	mov	r2, #1
	ldr	r1, [r5, #4]
	mov	r0, r9
	ldr	r1, [r1, r3, lsl #2]
	add	r3, r3, r2
	str	r1, [r9, #8]
	str	r3, [r5]
	str	r7, [r9, #4]
	str	r2, [r8, r4]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L13:
	mov	r10, #0
	ldr	r3, .L14+20
	mov	r1, r10
	ldr	r2, [r3]
	ldr	r0, [r5, #8]
	add	r2, r2, r2, lsl #1
	lsl	r2, r2, #2
	str	r10, [r5]
	bl	memset
	mov	r2, r10
	mov	r1, r10
	mov	r0, r6
	bl	kvmppc_mmu_pte_flush
	mov	r0, r6
	bl	kvmppc_mmu_flush_segments
	ldr	r3, [r5]
	b	.L4
.L15:
	.align	2
.L14:
	.word	MSR_PR
	.word	.LANCHOR0
	.word	VSID_PR
	.word	SID_MAP_MASK
	.word	VSID_POOL_SIZE
	.word	SID_MAP_NUM
	.size	create_sid_map, .-create_sid_map
	.comm	VSID_PR,4,4
	.comm	VSID_POOL_SIZE,4,4
	.comm	SID_MAP_NUM,4,4
	.comm	SID_MAP_MASK,4,4
	.comm	MSR_PR,4,4
	.bss
	.align	2
	.set	.LANCHOR0,. + 0
	.type	backwards_map.4240, %object
	.size	backwards_map.4240, 4
backwards_map.4240:
	.space	4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
