	.file	"extr_cardbus_cis.c_cardbus_read_tuple_init.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"CIS in PCI config space\n"
.LC1:
	.string	"CIS in option rom\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"Unable to read CIS: Unknown space: %d\n"
	.align 8
.LC3:
	.string	"Unable to allocate resource to read CIS.\n"
	.align 8
.LC4:
	.string	"Bad header in rom %d: [%x] %04x\n"
	.align 8
.LC5:
	.string	"Warning, size of Option ROM image %d is 0 bytes, assuming 512 bytes.\n"
	.align 8
.LC6:
	.string	"Cannot find CIS in Option ROM\n"
	.text
	.p2align 4
	.type	cardbus_read_tuple_init, @function
cardbus_read_tuple_init:
.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
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	edx, DWORD PTR [rdx]
	and	edx, DWORD PTR PCIM_CIS_ASI_MASK[rip]
	mov	DWORD PTR 12[rsp], edi
	mov	DWORD PTR 24[rsp], esi
	mov	QWORD PTR 16[rsp], rcx
	cmp	edx, 129
	je	.L2
	jg	.L3
	cmp	edx, 128
	jne	.L5
	mov	eax, DWORD PTR PCIR_BIOS[rip]
	mov	rbx, QWORD PTR 16[rsp]
	mov	DWORD PTR [rbx], eax
	lea	rax, .LC1[rip]
	lea	edi, [rax]
	call	DEVPRINTF@PLT
	mov	edi, 4096
	call	rman_make_alignment_flags@PLT
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	mov	edi, DWORD PTR 24[rsp]
	mov	rdx, rbx
	or	eax, DWORD PTR RF_ACTIVE[rip]
	mov	ecx, eax
	call	bus_alloc_resource_any@PLT
	mov	r14, rax
	test	rax, rax
	je	.L8
	mov	rdi, rax
	xor	r13d, r13d
	xor	ebp, ebp
	call	rman_get_start@PLT
	mov	edi, eax
	call	DEVPRINTF@PLT
	mov	eax, DWORD PTR [r12]
	and	eax, DWORD PTR PCIM_CIS_ROM_MASK[rip]
	sar	eax, 28
	mov	DWORD PTR 28[rsp], eax
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L32:
	sal	ebx, 9
.L15:
	mov	esi, DWORD PTR CARDBUS_EXROM_DATA_INDICATOR[rip]
	mov	rdi, r14
	add	esi, r15d
	call	bus_read_1@PLT
	test	al, -128
	jne	.L30
	add	ebp, ebx
	add	r13d, 1
.L17:
	mov	esi, DWORD PTR CARDBUS_EXROM_SIGNATURE[rip]
	mov	rdi, r14
	add	esi, ebp
	call	bus_read_2@PLT
	cmp	eax, 43605
	jne	.L31
	cmp	r13d, DWORD PTR 28[rsp]
	je	.L13
	mov	esi, DWORD PTR CARDBUS_EXROM_DATA_PTR[rip]
	mov	rdi, r14
	add	esi, ebp
	call	bus_read_2@PLT
	mov	esi, DWORD PTR CARDBUS_EXROM_DATA_IMAGE_LENGTH[rip]
	mov	rdi, r14
	lea	r15d, [rax+rbp]
	add	esi, r15d
	call	bus_read_2@PLT
	mov	ebx, eax
	test	eax, eax
	jne	.L32
	mov	edi, DWORD PTR 12[rsp]
	mov	edx, r13d
	lea	rsi, .LC5[rip]
	xor	eax, eax
	mov	ebx, 512
	call	device_printf@PLT
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L3:
	lea	eax, -130[rdx]
	cmp	eax, 5
	ja	.L5
	lea	edi, -135[rdx]
	call	PCIR_BAR@PLT
	mov	rbx, QWORD PTR 16[rsp]
	mov	edi, eax
	mov	DWORD PTR [rbx], eax
	call	DEVPRINTF@PLT
	mov	edi, 4096
	call	rman_make_alignment_flags@PLT
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	mov	edi, DWORD PTR 24[rsp]
	mov	rdx, rbx
	or	eax, DWORD PTR RF_ACTIVE[rip]
	mov	ecx, eax
	call	bus_alloc_resource_any@PLT
	mov	r14, rax
	test	rax, rax
	je	.L8
	mov	rdi, rax
	call	rman_get_start@PLT
	mov	edi, eax
	call	DEVPRINTF@PLT
	mov	edi, DWORD PTR [r12]
	and	edi, DWORD PTR PCIM_CIS_ADDR_MASK[rip]
	mov	DWORD PTR [r12], edi
.L11:
	call	DEVPRINTF@PLT
.L1:
	add	rsp, 40
	.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
.L5:
	.cfi_restore_state
	mov	edi, DWORD PTR 12[rsp]
	lea	rsi, .LC2[rip]
	xor	eax, eax
	xor	r14d, r14d
	call	device_printf@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L2:
	lea	rax, .LC0[rip]
	lea	edi, [rax]
	call	DEVPRINTF@PLT
	mov	r14, QWORD PTR CIS_CONFIG_SPACE[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L8:
	mov	edi, DWORD PTR 12[rsp]
	lea	rsi, .LC3[rip]
	xor	eax, eax
	xor	r14d, r14d
	call	device_printf@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L31:
	mov	ecx, DWORD PTR CARDBUS_EXROM_SIGNATURE[rip]
	mov	r15d, DWORD PTR 12[rsp]
	mov	r8d, eax
	mov	edx, r13d
	lea	rsi, .LC4[rip]
	xor	eax, eax
	add	ecx, ebp
	mov	edi, r15d
	call	device_printf@PLT
.L28:
	mov	rbx, QWORD PTR 16[rsp]
	mov	esi, DWORD PTR 24[rsp]
	mov	rcx, r14
	mov	edi, r15d
	xor	r14d, r14d
	mov	edx, DWORD PTR [rbx]
	call	cardbus_read_tuple_finish@PLT
	mov	DWORD PTR [rbx], 0
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	mov	edi, DWORD PTR [r12]
	and	edi, DWORD PTR PCIM_CIS_ADDR_MASK[rip]
	add	edi, ebp
	mov	DWORD PTR [r12], edi
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L30:
	mov	r15d, DWORD PTR 12[rsp]
	lea	rsi, .LC6[rip]
	xor	eax, eax
	mov	edi, r15d
	call	device_printf@PLT
	jmp	.L28
	.cfi_endproc
.LFE0:
	.size	cardbus_read_tuple_init, .-cardbus_read_tuple_init
	.comm	SYS_RES_MEMORY,4,4
	.comm	RF_ACTIVE,4,4
	.comm	PCIR_BIOS,4,4
	.comm	PCIM_CIS_ROM_MASK,4,4
	.comm	PCIM_CIS_ASI_MASK,4,4
	.comm	PCIM_CIS_ADDR_MASK,4,4
	.comm	CIS_CONFIG_SPACE,8,8
	.comm	CARDBUS_EXROM_SIGNATURE,4,4
	.comm	CARDBUS_EXROM_DATA_PTR,4,4
	.comm	CARDBUS_EXROM_DATA_INDICATOR,4,4
	.comm	CARDBUS_EXROM_DATA_IMAGE_LENGTH,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_cardbus_cis.c_cardbus_read_tuple_init.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"CIS in PCI config space\012\000"
	.align	2
.LC1:
	.ascii	"CIS in option rom\012\000"
	.align	2
.LC2:
	.ascii	"Unable to read CIS: Unknown space: %d\012\000"
	.align	2
.LC3:
	.ascii	"Unable to allocate resource to read CIS.\012\000"
	.align	2
.LC4:
	.ascii	"Bad header in rom %d: [%x] %04x\012\000"
	.align	2
.LC5:
	.ascii	"Warning, size of Option ROM image %d is 0 bytes, as"
	.ascii	"suming 512 bytes.\012\000"
	.align	2
.LC6:
	.ascii	"Cannot find CIS in Option ROM\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cardbus_read_tuple_init, %function
cardbus_read_tuple_init:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	ip, .L32
	mov	r8, r2
	ldr	ip, [ip]
	ldr	r2, [r2]
	sub	sp, sp, #36
	and	r2, r2, ip
	cmp	r2, #129
	str	r0, [sp, #12]
	str	r1, [sp, #16]
	str	r3, [sp, #20]
	beq	.L2
	bgt	.L3
	cmp	r2, #128
	bne	.L5
	ldr	r3, .L32+4
	ldr	r5, [sp, #20]
	ldr	r3, [r3]
	ldr	r0, .L32+8
	str	r3, [r5]
	bl	DEVPRINTF
	ldr	r3, .L32+12
	mov	r0, #4096
	ldr	r4, [r3]
	bl	rman_make_alignment_flags
	ldr	r3, .L32+16
	mov	r1, r4
	ldr	r3, [r3]
	mov	r2, r5
	orr	r3, r0, r3
	ldr	r0, [sp, #16]
	bl	bus_alloc_resource_any
	subs	r4, r0, #0
	beq	.L8
	mov	r7, #0
	bl	rman_get_start
	bl	DEVPRINTF
	ldr	r2, .L32+20
	ldr	r3, [r8]
	ldr	r2, [r2]
	mov	r6, r7
	and	r3, r3, r2
	asr	r3, r3, #28
	ldr	r10, .L32+24
	ldr	fp, .L32+28
	ldr	r9, .L32+32
	str	r3, [sp, #24]
	str	r8, [sp, #28]
	b	.L17
.L15:
	ldr	r3, .L32+36
	mov	r0, r4
	ldr	r1, [r3]
	add	r1, r8, r1
	bl	bus_read_1
	tst	r0, #128
	bne	.L30
	add	r6, r6, r5
	add	r7, r7, #1
.L17:
	ldr	r1, [r10]
	mov	r0, r4
	add	r1, r6, r1
	bl	bus_read_2
	ldr	r3, .L32+40
	cmp	r0, r3
	bne	.L31
	ldr	r3, [sp, #24]
	cmp	r7, r3
	beq	.L13
	ldr	r1, [fp]
	mov	r0, r4
	add	r1, r6, r1
	bl	bus_read_2
	ldr	r1, [r9]
	add	r8, r0, r6
	add	r1, r8, r1
	mov	r0, r4
	bl	bus_read_2
	cmp	r0, #0
	lslne	r5, r0, #9
	bne	.L15
	mov	r2, r7
	ldr	r1, .L32+44
	ldr	r0, [sp, #12]
	bl	device_printf
	mov	r5, #512
	b	.L15
.L3:
	sub	r3, r2, #130
	cmp	r3, #5
	bhi	.L5
	sub	r0, r2, #135
	bl	PCIR_BAR
	ldr	r5, [sp, #20]
	str	r0, [r5]
	bl	DEVPRINTF
	ldr	r3, .L32+12
	mov	r0, #4096
	ldr	r4, [r3]
	bl	rman_make_alignment_flags
	mov	ip, r0
	ldr	r3, .L32+16
	mov	r1, r4
	ldr	r3, [r3]
	mov	r2, r5
	ldr	r0, [sp, #16]
	orr	r3, ip, r3
	bl	bus_alloc_resource_any
	subs	r4, r0, #0
	beq	.L8
	bl	rman_get_start
	bl	DEVPRINTF
	ldr	r3, .L32+48
	ldr	r0, [r8]
	ldr	r6, [r3]
	and	r0, r0, r6
	str	r0, [r8]
.L11:
	bl	DEVPRINTF
.L1:
	mov	r0, r4
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L5:
	mov	r4, #0
	ldr	r0, [sp, #12]
	ldr	r1, .L32+52
	bl	device_printf
	mov	r0, r4
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r0, .L32+56
	bl	DEVPRINTF
	ldr	r3, .L32+60
	ldr	r4, [r3]
	mov	r0, r4
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L8:
	ldr	r0, [sp, #12]
	ldr	r1, .L32+64
	bl	device_printf
	mov	r4, #0
	b	.L1
.L31:
	ldr	r3, [r10]
	ldr	r5, [sp, #12]
	str	r0, [sp]
	mov	r2, r7
	mov	r0, r5
	ldr	r1, .L32+68
	add	r3, r6, r3
	bl	device_printf
.L28:
	mov	r3, r4
	mov	r4, #0
	mov	r0, r5
	ldr	r5, [sp, #20]
	ldr	r1, [sp, #16]
	ldr	r2, [r5]
	bl	cardbus_read_tuple_finish
	mov	r0, r4
	str	r4, [r5]
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L13:
	ldr	r8, [sp, #28]
	ldr	r3, .L32+48
	ldr	r0, [r8]
	ldr	r3, [r3]
	and	r0, r0, r3
	add	r0, r0, r6
	str	r0, [r8]
	b	.L11
.L30:
	ldr	r5, [sp, #12]
	ldr	r1, .L32+72
	mov	r0, r5
	bl	device_printf
	b	.L28
.L33:
	.align	2
.L32:
	.word	PCIM_CIS_ASI_MASK
	.word	PCIR_BIOS
	.word	.LC1
	.word	SYS_RES_MEMORY
	.word	RF_ACTIVE
	.word	PCIM_CIS_ROM_MASK
	.word	CARDBUS_EXROM_SIGNATURE
	.word	CARDBUS_EXROM_DATA_PTR
	.word	CARDBUS_EXROM_DATA_IMAGE_LENGTH
	.word	CARDBUS_EXROM_DATA_INDICATOR
	.word	43605
	.word	.LC5
	.word	PCIM_CIS_ADDR_MASK
	.word	.LC2
	.word	.LC0
	.word	CIS_CONFIG_SPACE
	.word	.LC3
	.word	.LC4
	.word	.LC6
	.size	cardbus_read_tuple_init, .-cardbus_read_tuple_init
	.comm	SYS_RES_MEMORY,4,4
	.comm	RF_ACTIVE,4,4
	.comm	PCIR_BIOS,4,4
	.comm	PCIM_CIS_ROM_MASK,4,4
	.comm	PCIM_CIS_ASI_MASK,4,4
	.comm	PCIM_CIS_ADDR_MASK,4,4
	.comm	CIS_CONFIG_SPACE,4,4
	.comm	CARDBUS_EXROM_SIGNATURE,4,4
	.comm	CARDBUS_EXROM_DATA_PTR,4,4
	.comm	CARDBUS_EXROM_DATA_INDICATOR,4,4
	.comm	CARDBUS_EXROM_DATA_IMAGE_LENGTH,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
