	.file	"extr_x86bios.c_x86bios_alloc.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	x86bios_alloc
	.type	x86bios_alloc, @function
x86bios_alloc:
.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
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	test	rdi, rdi
	je	.L3
	mov	r12, rsi
	test	rsi, rsi
	je	.L3
	sub	rsp, 8
	.cfi_def_cfa_offset 40
	mov	r9d, DWORD PTR X86BIOS_PAGE_SIZE[rip]
	mov	rbx, rdi
	mov	r8d, DWORD PTR x86bios_rom_phys[rip]
	push	0
	.cfi_def_cfa_offset 48
	mov	ecx, DWORD PTR X86BIOS_RAM_BASE[rip]
	mov	rdi, r12
	mov	esi, DWORD PTR M_DEVBUF[rip]
	call	contigmalloc@PLT
	mov	r13, rax
	pop	rax
	.cfi_def_cfa_offset 40
	pop	rdx
	.cfi_def_cfa_offset 32
	test	r13, r13
	je	.L1
	mov	rdi, r13
	call	vtophys@PLT
	lea	rdi, x86bios_lock[rip]
	mov	DWORD PTR [rbx], eax
	call	mtx_lock@PLT
	mov	esi, DWORD PTR [rbx]
	mov	edi, r13d
	mov	rdx, r12
	call	x86bios_set_pages@PLT
	lea	rdi, x86bios_lock[rip]
	call	mtx_unlock@PLT
.L1:
	mov	rax, r13
	pop	rbx
	.cfi_remember_state
	.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
.L3:
	.cfi_restore_state
	xor	r13d, r13d
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	mov	rax, r13
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	x86bios_alloc, .-x86bios_alloc
	.comm	x86bios_rom_phys,4,4
	.comm	x86bios_lock,4,4
	.comm	X86BIOS_RAM_BASE,4,4
	.comm	X86BIOS_PAGE_SIZE,4,4
	.comm	M_DEVBUF,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_x86bios.c_x86bios_alloc.c"
	.text
	.align	2
	.global	x86bios_alloc
	.syntax unified
	.arm
	.fpu softvfp
	.type	x86bios_alloc, %function
x86bios_alloc:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	clz	r3, r1
	cmp	r0, #0
	lsr	r3, r3, #5
	moveq	r3, #1
	push	{r4, r5, r6, lr}
	cmp	r3, #0
	movne	r4, #0
	sub	sp, sp, #16
	bne	.L1
	mov	r5, r1
	mov	r6, r0
	ldr	r1, .L9
	ldr	r0, .L9+4
	ldr	ip, [r1]
	ldr	lr, [r0]
	ldr	r1, .L9+8
	stm	sp, {ip, lr}
	ldr	r0, .L9+12
	str	r3, [sp, #8]
	ldr	r3, [r0]
	ldr	r1, [r1]
	mov	r0, r5
	bl	contigmalloc
	subs	r4, r0, #0
	beq	.L1
	bl	vtophys
	mov	r3, r0
	ldr	r0, .L9+16
	str	r3, [r6]
	bl	mtx_lock
	mov	r2, r5
	mov	r0, r4
	ldr	r1, [r6]
	bl	x86bios_set_pages
	ldr	r0, .L9+16
	bl	mtx_unlock
.L1:
	mov	r0, r4
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, pc}
.L10:
	.align	2
.L9:
	.word	x86bios_rom_phys
	.word	X86BIOS_PAGE_SIZE
	.word	M_DEVBUF
	.word	X86BIOS_RAM_BASE
	.word	x86bios_lock
	.size	x86bios_alloc, .-x86bios_alloc
	.comm	x86bios_rom_phys,4,4
	.comm	x86bios_lock,4,4
	.comm	X86BIOS_RAM_BASE,4,4
	.comm	X86BIOS_PAGE_SIZE,4,4
	.comm	M_DEVBUF,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
