	.file	"extr_pci.c_nvme_setup_io_queues.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"%d/%d/%d default/read/poll queues\n"
	.text
	.p2align 4
	.type	nvme_setup_io_queues, @function
nvme_setup_io_queues:
.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	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	rbp, QWORD PTR 48[rdi]
	mov	edi, DWORD PTR 40[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	to_pci_dev@PLT
	mov	r13, rax
	xor	eax, eax
	call	max_io_queues@PLT
	mov	edx, DWORD PTR 28[rbx]
	test	DWORD PTR NVME_QUIRK_SHARED_TAGS[rip], edx
	mov	edx, 1
	cmovne	eax, edx
	lea	rsi, 4[rsp]
	lea	rdi, 28[rbx]
	mov	DWORD PTR 4[rsp], eax
	call	nvme_set_queue_count@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L1
	mov	edx, DWORD PTR 4[rsp]
	test	edx, edx
	jne	.L4
.L11:
	xor	r12d, r12d
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L19
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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
.L4:
	.cfi_restore_state
	mov	edi, DWORD PTR NVMEQ_ENABLED[rip]
	mov	rsi, rbp
	call	clear_bit@PLT
	mov	eax, DWORD PTR [rbx]
	test	eax, eax
	jne	.L20
.L5:
	mov	esi, DWORD PTR 4[rsp]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L22:
	mov	eax, DWORD PTR 4[rsp]
	lea	esi, -1[rax]
	mov	DWORD PTR 4[rsp], esi
	test	esi, esi
	je	.L21
.L7:
	mov	rdi, rbx
	call	db_bar_size@PLT
	mov	rdi, rbx
	mov	rsi, rax
	call	nvme_remap_bar@PLT
	test	eax, eax
	jne	.L22
	mov	eax, DWORD PTR 36[rbx]
	mov	DWORD PTR 4[rbp], eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	mov	DWORD PTR 8[rbx], eax
	lea	edi, -1[rax]
	mov	esi, 1
	call	max@PLT
	mov	rdx, QWORD PTR 16[rbx]
	mov	rcx, QWORD PTR HCTX_TYPE_POLL[rip]
	mov	rdi, rbp
	add	eax, DWORD PTR [rdx+rcx*4]
	mov	DWORD PTR 12[rbx], eax
	call	queue_request_irq@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	edi, DWORD PTR NVMEQ_ENABLED[rip]
	mov	rsi, rbp
	call	set_bit@PLT
	mov	rdi, rbx
	call	nvme_create_io_queues@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	eax, DWORD PTR 24[rbx]
	cmp	eax, 1
	jle	.L11
	cmp	eax, DWORD PTR 12[rbx]
	jg	.L12
	sub	eax, 1
	mov	rdi, rbx
	mov	DWORD PTR 4[rsp], eax
	call	nvme_disable_io_queues@PLT
	mov	rdi, rbx
	call	nvme_suspend_io_queues@PLT
.L9:
	xor	esi, esi
	mov	rdx, rbp
	mov	rdi, r13
	call	pci_free_irq@PLT
	mov	rdi, r13
	call	pci_free_irq_vectors@PLT
	mov	esi, DWORD PTR 4[rsp]
	mov	rdi, rbx
	call	nvme_setup_irqs@PLT
	test	eax, eax
	jg	.L10
	mov	r12d, DWORD PTR EIO[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L21:
	mov	r12d, DWORD PTR ENOMEM[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L20:
	mov	esi, DWORD PTR 4[rsp]
	mov	edx, 4
	mov	rdi, rbx
	call	nvme_cmb_qdepth@PLT
	test	eax, eax
	jle	.L6
	mov	DWORD PTR 4[rbx], eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	mov	DWORD PTR [rbx], 0
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rax, QWORD PTR 16[rbx]
	mov	rdx, QWORD PTR HCTX_TYPE_READ[rip]
	mov	rsi, QWORD PTR HCTX_TYPE_POLL[rip]
	mov	edi, DWORD PTR 32[rbx]
	mov	ecx, DWORD PTR [rax+rdx*4]
	mov	rdx, QWORD PTR HCTX_TYPE_DEFAULT[rip]
	mov	r8d, DWORD PTR [rax+rsi*4]
	lea	rsi, .LC0[rip]
	mov	edx, DWORD PTR [rax+rdx*4]
	call	dev_info@PLT
	jmp	.L1
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	nvme_setup_io_queues, .-nvme_setup_io_queues
	.comm	NVME_QUIRK_SHARED_TAGS,4,4
	.comm	NVMEQ_ENABLED,4,4
	.comm	HCTX_TYPE_READ,8,8
	.comm	HCTX_TYPE_POLL,8,8
	.comm	HCTX_TYPE_DEFAULT,8,8
	.comm	ENOMEM,4,4
	.comm	EIO,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_pci.c_nvme_setup_io_queues.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%d/%d/%d default/read/poll queues\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	nvme_setup_io_queues, %function
nvme_setup_io_queues:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r4, r0
	ldr	r3, .L27
	sub	sp, sp, #20
	ldr	r0, [r0, #36]
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	ldr	r6, [r4, #40]
	bl	to_pci_dev
	mov	r7, r0
	bl	max_io_queues
	ldr	r3, .L27+4
	ldr	r2, [r4, #24]
	ldr	r3, [r3]
	str	r0, [sp, #8]
	tst	r2, r3
	movne	r3, #1
	add	r1, sp, #8
	add	r0, r4, #24
	strne	r3, [sp, #8]
	bl	nvme_set_queue_count
	subs	r5, r0, #0
	blt	.L1
	ldr	r3, [sp, #8]
	cmp	r3, #0
	bne	.L4
.L11:
	mov	r5, #0
.L1:
	ldr	r3, .L27
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L23
	mov	r0, r5
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L4:
	ldr	r8, .L27+8
	mov	r1, r6
	ldr	r0, [r8]
	bl	clear_bit
	ldr	r3, [r4]
	cmp	r3, #0
	bne	.L24
.L5:
	ldr	r1, [sp, #8]
	b	.L7
.L26:
	ldr	r1, [sp, #8]
	sub	r1, r1, #1
	cmp	r1, #0
	str	r1, [sp, #8]
	beq	.L25
.L7:
	mov	r0, r4
	bl	db_bar_size
	mov	r1, r0
	mov	r0, r4
	bl	nvme_remap_bar
	cmp	r0, #0
	bne	.L26
	ldr	r3, [r4, #32]
	ldr	r9, .L27+12
	str	r3, [r6, #4]
	b	.L9
.L10:
	mov	r1, #1
	str	r0, [r4, #8]
	sub	r0, r0, #1
	bl	max
	mov	r2, r0
	ldr	r1, [r9]
	ldr	r3, [r4, #16]
	mov	r0, r6
	ldr	r3, [r3, r1, lsl #2]
	add	r3, r3, r2
	str	r3, [r4, #12]
	bl	queue_request_irq
	subs	r5, r0, #0
	bne	.L1
	mov	r1, r6
	ldr	r0, [r8]
	bl	set_bit
	mov	r0, r4
	bl	nvme_create_io_queues
	subs	r5, r0, #0
	bne	.L1
	ldr	r3, [r4, #20]
	cmp	r3, #1
	ble	.L11
	ldr	r2, [r4, #12]
	cmp	r3, r2
	bgt	.L12
	sub	r3, r3, #1
	mov	r0, r4
	str	r3, [sp, #8]
	bl	nvme_disable_io_queues
	mov	r0, r4
	bl	nvme_suspend_io_queues
.L9:
	mov	r2, r6
	mov	r1, #0
	mov	r0, r7
	bl	pci_free_irq
	mov	r0, r7
	bl	pci_free_irq_vectors
	mov	r0, r4
	ldr	r1, [sp, #8]
	bl	nvme_setup_irqs
	cmp	r0, #0
	bgt	.L10
	ldr	r3, .L27+16
	ldr	r5, [r3]
	rsb	r5, r5, #0
	b	.L1
.L25:
	ldr	r3, .L27+20
	ldr	r5, [r3]
	rsb	r5, r5, #0
	b	.L1
.L24:
	mov	r2, #4
	mov	r0, r4
	ldr	r1, [sp, #8]
	bl	nvme_cmb_qdepth
	cmp	r0, #0
	movle	r3, #0
	strgt	r0, [r4, #4]
	strle	r3, [r4]
	b	.L5
.L12:
	ldr	r2, [r4, #16]
	ldr	r1, [r9]
	ldr	r3, .L27+24
	ldr	r0, .L27+28
	ldr	r1, [r2, r1, lsl #2]
	ldr	r0, [r0]
	ldr	r3, [r3]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r2, [r2, r0, lsl #2]
	ldr	r0, [r4, #28]
	str	r1, [sp]
	ldr	r1, .L27+32
	bl	dev_info
	b	.L1
.L23:
	bl	__stack_chk_fail
.L28:
	.align	2
.L27:
	.word	.LC1
	.word	NVME_QUIRK_SHARED_TAGS
	.word	NVMEQ_ENABLED
	.word	HCTX_TYPE_POLL
	.word	EIO
	.word	ENOMEM
	.word	HCTX_TYPE_READ
	.word	HCTX_TYPE_DEFAULT
	.word	.LC0
	.size	nvme_setup_io_queues, .-nvme_setup_io_queues
	.comm	NVME_QUIRK_SHARED_TAGS,4,4
	.comm	NVMEQ_ENABLED,4,4
	.comm	HCTX_TYPE_READ,4,4
	.comm	HCTX_TYPE_POLL,4,4
	.comm	HCTX_TYPE_DEFAULT,4,4
	.comm	ENOMEM,4,4
	.comm	EIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
