	.file	"extr_osdmap.c_apply_upmap.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	apply_upmap, @function
apply_upmap:
.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
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	add	rdi, 20
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	call	lookup_pg_mapping@PLT
	test	rax, rax
	je	.L2
	mov	ecx, DWORD PTR 16[rax]
	test	ecx, ecx
	jle	.L3
	mov	rsi, QWORD PTR 24[rax]
	sub	ecx, 1
	mov	edi, DWORD PTR CRUSH_ITEM_NONE[rip]
	mov	rdx, rsi
	lea	r8, 4[rsi+rcx*4]
	.p2align 4,,10
	.p2align 3
.L5:
	movsx	rcx, DWORD PTR [rdx]
	cmp	edi, ecx
	je	.L4
	cmp	DWORD PTR [rbx], ecx
	jle	.L4
	mov	r9, QWORD PTR 8[rbx]
	cmp	QWORD PTR [r9+rcx*8], 0
	je	.L1
.L4:
	add	rdx, 4
	cmp	rdx, r8
	jne	.L5
	mov	rdi, QWORD PTR [r12]
	xor	edx, edx
	.p2align 4,,10
	.p2align 3
.L6:
	mov	ecx, DWORD PTR [rsi+rdx*4]
	mov	DWORD PTR [rdi+rdx*4], ecx
	mov	ecx, DWORD PTR 16[rax]
	add	rdx, 1
	cmp	ecx, edx
	jg	.L6
.L3:
	mov	DWORD PTR 8[r12], ecx
.L2:
	lea	rdi, 16[rbx]
	mov	rsi, rbp
	call	lookup_pg_mapping@PLT
	mov	r13, rax
	test	rax, rax
	je	.L1
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jle	.L1
	mov	r15, QWORD PTR 8[r13]
	xor	ebp, ebp
	mov	r14d, -1
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rax, QWORD PTR [r15+rbp*8]
	mov	ecx, DWORD PTR 8[r12]
	mov	r10d, DWORD PTR [rax]
	mov	edi, DWORD PTR 4[rax]
	test	ecx, ecx
	jle	.L8
	movsx	rdx, edi
	lea	r11d, -1[rcx]
	mov	r9, QWORD PTR [r12]
	xor	ecx, ecx
	mov	eax, DWORD PTR CRUSH_ITEM_NONE[rip]
	sal	rdx, 3
	mov	r8d, -1
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L34:
	cmp	r10d, esi
	jne	.L9
	test	r8d, r8d
	jns	.L9
	mov	r8d, ecx
	cmp	eax, edi
	je	.L9
	cmp	DWORD PTR [rbx], edi
	jle	.L9
	mov	rsi, QWORD PTR 8[rbx]
	mov	r8d, r14d
	cmp	QWORD PTR [rsi+rdx], 0
	cmovne	r8d, ecx
	.p2align 4,,10
	.p2align 3
.L9:
	lea	rsi, 1[rcx]
	cmp	r11, rcx
	je	.L33
	mov	rcx, rsi
.L10:
	mov	esi, DWORD PTR [r9+rcx*4]
	cmp	edi, esi
	jne	.L34
.L8:
	add	rbp, 1
	cmp	DWORD PTR 0[r13], ebp
	jg	.L11
.L1:
	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
	ret
	.p2align 4,,10
	.p2align 3
.L33:
	.cfi_restore_state
	cmp	r8d, -1
	je	.L8
	movsx	r8, r8d
	add	rbp, 1
	mov	DWORD PTR [r9+r8*4], edi
	cmp	DWORD PTR 0[r13], ebp
	jg	.L11
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	apply_upmap, .-apply_upmap
	.comm	CRUSH_ITEM_NONE,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_osdmap.c_apply_upmap.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	apply_upmap, %function
apply_upmap:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r8, r0
	sub	sp, sp, #20
	add	r0, r0, #12
	mov	r9, r2
	mov	r5, r1
	bl	lookup_pg_mapping
	subs	r6, r0, #0
	beq	.L2
	ldr	r0, [r6, #8]
	cmp	r0, #0
	ble	.L3
	ldr	r4, [r6, #12]
	mov	r3, #0
	sub	r4, r4, #4
	mov	ip, r4
	ldr	r2, .L36
	ldr	r1, [r2]
.L5:
	ldr	r2, [ip, #4]!
	add	r3, r3, #1
	cmp	r1, r2
	beq	.L4
	ldr	lr, [r8]
	cmp	lr, r2
	ble	.L4
	ldr	lr, [r8, #4]
	ldr	r2, [lr, r2, lsl #2]
	cmp	r2, #0
	beq	.L1
.L4:
	cmp	r3, r0
	bne	.L5
	mov	r3, #0
	ldr	r2, [r9]
	sub	r2, r2, #4
.L6:
	ldr	r1, [r4, #4]!
	add	r3, r3, #1
	str	r1, [r2, #4]!
	ldr	r0, [r6, #8]
	cmp	r0, r3
	bgt	.L6
.L3:
	str	r0, [r9, #4]
.L2:
	mov	r1, r5
	add	r0, r8, #8
	bl	lookup_pg_mapping
	subs	r3, r0, #0
	str	r3, [sp, #12]
	beq	.L1
	ldr	r2, [r3]
	cmp	r2, #0
	str	r2, [sp, #8]
	ble	.L1
	mov	r0, #0
	ldr	r3, [r3, #4]
	sub	r3, r3, #4
	str	r3, [sp, #4]
.L11:
	ldr	r2, [sp, #4]
	ldr	r5, [r9, #4]
	ldr	r3, [r2, #4]!
	cmp	r5, #0
	str	r2, [sp, #4]
	ldm	r3, {r6, lr}
	ble	.L8
	ldr	r10, [r9]
	ldr	r3, .L36
	mvn	r4, #0
	mov	r2, #0
	ldr	r7, [r3]
	sub	ip, r10, #4
	lsl	fp, lr, #2
	b	.L10
.L35:
	ldr	r3, [r8]
	cmp	r3, lr
	ble	.L13
	ldr	r3, [r8, #4]
	ldr	r3, [r3, fp]
	cmp	r3, #0
	movne	r4, r2
	mvneq	r4, #0
.L9:
	add	r2, r2, #1
	cmp	r2, r5
	beq	.L34
.L10:
	ldr	r1, [ip, #4]!
	lsr	r3, r4, #31
	cmp	lr, r1
	beq	.L8
	cmp	r6, r1
	movne	r3, #0
	andeq	r3, r3, #1
	cmp	r3, #0
	beq	.L9
	cmp	r7, lr
	bne	.L35
.L13:
	mov	r4, r2
	add	r2, r2, #1
	cmp	r2, r5
	bne	.L10
.L34:
	cmn	r4, #1
	ldrne	r3, [sp, #12]
	strne	lr, [r10, r4, lsl #2]
	ldrne	r3, [r3]
	strne	r3, [sp, #8]
.L8:
	ldr	r3, [sp, #8]
	add	r0, r0, #1
	cmp	r3, r0
	bgt	.L11
.L1:
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L37:
	.align	2
.L36:
	.word	CRUSH_ITEM_NONE
	.size	apply_upmap, .-apply_upmap
	.comm	CRUSH_ITEM_NONE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
