	.file	"extr_nexus.c_nexus_alloc_resource.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	nexus_alloc_resource, @function
nexus_alloc_resource:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15d, r9d
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, r8d
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, edx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rcx
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	QWORD PTR 8[rsp], rdi
	mov	rdi, rsi
	call	DEVTONX@PLT
	mov	esi, r15d
	mov	edi, r13d
	mov	r14, rax
	mov	eax, DWORD PTR RF_ACTIVE[rip]
	mov	DWORD PTR 4[rsp], eax
	call	RMAN_IS_DEFAULT_RANGE@PLT
	cmp	DWORD PTR 80[rsp], 1
	jne	.L2
	test	rax, rax
	jne	.L31
.L2:
	cmp	ebp, 129
	je	.L8
	mov	eax, ebp
	xor	r14d, r14d
	lea	rdi, mem_rman[rip]
	and	eax, -3
	cmp	eax, 128
	je	.L7
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r14
	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
.L8:
	.cfi_restore_state
	lea	rdi, irq_rman[rip]
.L7:
	mov	r8d, DWORD PTR 88[rsp]
	mov	ecx, DWORD PTR 80[rsp]
	mov	r9, r12
	mov	edx, r15d
	mov	esi, r13d
	call	rman_reserve_resource@PLT
	mov	r14, rax
	test	rax, rax
	je	.L29
	mov	esi, DWORD PTR [rbx]
	mov	rdi, rax
	call	rman_set_rid@PLT
	mov	rdi, r14
	call	rman_get_start@PLT
	mov	rdi, r14
	mov	esi, eax
	call	rman_set_bushandle@PLT
	mov	eax, DWORD PTR 4[rsp]
	test	DWORD PTR 88[rsp], eax
	je	.L1
	mov	edx, DWORD PTR [rbx]
	mov	rcx, r14
	mov	esi, ebp
	mov	rdi, r12
	call	bus_activate_resource@PLT
	test	rax, rax
	je	.L1
	mov	rdi, r14
	call	rman_release_resource@PLT
	.p2align 4,,10
	.p2align 3
.L29:
	xor	r14d, r14d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L31:
	mov	rdi, r12
	call	device_get_parent@PLT
	cmp	rax, QWORD PTR 8[rsp]
	jne	.L29
	test	r14, r14
	je	.L29
	mov	edx, DWORD PTR [rbx]
	mov	esi, ebp
	mov	rdi, r14
	call	resource_list_find@PLT
	test	rax, rax
	je	.L29
	mov	r13d, DWORD PTR [rax]
	mov	r15d, DWORD PTR 4[rax]
	mov	eax, DWORD PTR 8[rax]
	mov	DWORD PTR 80[rsp], eax
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	nexus_alloc_resource, .-nexus_alloc_resource
	.comm	mem_rman,4,4
	.comm	irq_rman,4,4
	.comm	RF_ACTIVE,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_nexus.c_nexus_alloc_resource.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	nexus_alloc_resource, %function
nexus_alloc_resource:
	@ args = 16, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r1
	mov	r1, r0
	sub	sp, sp, #20
	mov	r0, r5
	add	r8, sp, #56
	ldm	r8, {r8, r9, r10}
	mov	r4, r2
	mov	r6, r3
	str	r1, [sp, #12]
	bl	DEVTONX
	ldr	r3, .L27
	mov	r7, r0
	mov	r1, r9
	mov	r0, r8
	ldr	fp, [r3]
	bl	RMAN_IS_DEFAULT_RANGE
	sub	r3, r10, #1
	clz	r3, r3
	cmp	r0, #0
	lsr	r3, r3, #5
	moveq	r3, #0
	cmp	r3, #0
	bne	.L26
.L2:
	cmp	r4, #129
	beq	.L7
	bic	r3, r4, #2
	cmp	r3, #128
	ldreq	r0, .L27+4
	beq	.L6
.L8:
	mov	r7, #0
.L1:
	mov	r0, r7
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	ldr	r0, .L27+8
.L6:
	ldr	r3, [sp, #68]
	mov	r2, r9
	str	r3, [sp]
	mov	r1, r8
	mov	r3, r10
	str	r5, [sp, #4]
	bl	rman_reserve_resource
	subs	r7, r0, #0
	beq	.L8
	ldr	r1, [r6]
	bl	rman_set_rid
	mov	r0, r7
	bl	rman_get_start
	mov	r1, r0
	mov	r0, r7
	bl	rman_set_bushandle
	ldr	r3, [sp, #68]
	tst	fp, r3
	beq	.L1
	mov	r1, r4
	mov	r0, r5
	mov	r3, r7
	ldr	r2, [r6]
	bl	bus_activate_resource
	cmp	r0, #0
	beq	.L1
	mov	r0, r7
	bl	rman_release_resource
	mov	r7, #0
	b	.L1
.L26:
	mov	r0, r5
	bl	device_get_parent
	clz	r3, r7
	ldr	r2, [sp, #12]
	lsr	r3, r3, #5
	cmp	r0, r2
	orrne	r3, r3, #1
	cmp	r3, #0
	bne	.L8
	mov	r0, r7
	mov	r1, r4
	ldr	r2, [r6]
	bl	resource_list_find
	cmp	r0, #0
	beq	.L8
	ldm	r0, {r8, r9, r10}
	b	.L2
.L28:
	.align	2
.L27:
	.word	RF_ACTIVE
	.word	mem_rman
	.word	irq_rman
	.size	nexus_alloc_resource, .-nexus_alloc_resource
	.comm	mem_rman,4,4
	.comm	irq_rman,4,4
	.comm	RF_ACTIVE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
