	.file	"extr_i40iw_hmc.c_i40iw_add_sd_table_entry.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	i40iw_add_sd_table_entry
	.type	i40iw_add_sd_table_entry, @function
i40iw_add_sd_table_entry:
.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
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	lea	rbx, 0[0+rdx*8]
	sub	rbx, rdx
	sal	rbx, 3
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	r14, QWORD PTR [rsi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	add	r14, rbx
	mov	eax, DWORD PTR 48[r14]
	test	eax, eax
	jne	.L2
	cmp	DWORD PTR I40IW_SD_TYPE_PAGED[rip], ecx
	mov	r15, rdi
	mov	r13, rsi
	mov	rbp, rdx
	mov	r9d, ecx
	je	.L12
.L3:
	lea	r10, 20[rsp]
	mov	edx, r8d
	mov	rdi, r15
	mov	DWORD PTR 8[rsp], r9d
	mov	ecx, DWORD PTR I40IW_HMC_PD_BP_BUF_ALIGNMENT[rip]
	mov	rsi, r10
	mov	QWORD PTR [rsp], r10
	call	i40iw_allocate_dma_mem@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	r9d, DWORD PTR 8[rsp]
	cmp	DWORD PTR I40IW_SD_TYPE_PAGED[rip], r9d
	mov	r10, QWORD PTR [rsp]
	je	.L13
	lea	rdi, 16[r14]
	mov	edx, 4
	mov	rsi, r10
	mov	DWORD PTR [rsp], r9d
	call	memcpy@PLT
	mov	QWORD PTR 8[r14], rbp
	mov	r9d, DWORD PTR [rsp]
.L7:
	mov	rax, QWORD PTR 0[r13]
	mov	rdi, r13
	mov	DWORD PTR [rax+rbx], r9d
	call	I40IW_INC_SD_REFCNT@PLT
.L2:
	movsx	rax, DWORD PTR [r14]
	xor	r12d, r12d
	cmp	rax, QWORD PTR I40IW_SD_TYPE_DIRECT[rip]
	je	.L14
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L15
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L12:
	.cfi_restore_state
	mov	r8d, DWORD PTR I40IW_HMC_PAGED_BP_SIZE[rip]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L14:
	lea	rdi, 8[r14]
	call	I40IW_INC_BP_REFCNT@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	lea	rsi, 32[r14]
	mov	edx, 2048
	mov	rdi, r15
	mov	DWORD PTR [rsp], r9d
	mov	QWORD PTR 8[rsp], r10
	call	i40iw_allocate_virt_mem@PLT
	mov	r9d, DWORD PTR [rsp]
	mov	r10, QWORD PTR 8[rsp]
	test	eax, eax
	mov	r12d, eax
	jne	.L16
	mov	rax, QWORD PTR 32[r14]
	lea	rdi, 24[r14]
	mov	edx, 4
	mov	rsi, r10
	mov	DWORD PTR [rsp], r9d
	mov	QWORD PTR 40[r14], rax
	call	memcpy@PLT
	mov	r9d, DWORD PTR [rsp]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rsi, r10
	mov	rdi, r15
	call	i40iw_free_dma_mem@PLT
	jmp	.L1
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	i40iw_add_sd_table_entry, .-i40iw_add_sd_table_entry
	.comm	I40IW_SD_TYPE_PAGED,4,4
	.comm	I40IW_SD_TYPE_DIRECT,8,8
	.comm	I40IW_HMC_PD_BP_BUF_ALIGNMENT,4,4
	.comm	I40IW_HMC_PAGED_BP_SIZE,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_i40iw_hmc.c_i40iw_add_sd_table_entry.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	i40iw_add_sd_table_entry
	.syntax unified
	.arm
	.fpu softvfp
	.type	i40iw_add_sd_table_entry, %function
i40iw_add_sd_table_entry:
	@ args = 4, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r10, [r1]
	rsb	r5, r2, r2, lsl #3
	add	r9, r10, r5, lsl #2
	mov	r4, r2
	ldr	r2, [r9, #24]
	mov	r7, r3
	ldr	r3, .L16
	sub	sp, sp, #20
	cmp	r2, #0
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	lsl	r5, r5, #2
	bne	.L2
	ldr	fp, .L16+4
	mov	r6, r1
	ldr	r3, [fp]
	add	r1, sp, #8
	cmp	r3, r7
	ldreq	r3, .L16+8
	mov	r8, r0
	ldreq	r3, [r3]
	streq	r3, [sp, #56]
	ldr	r3, .L16+12
	ldr	r2, [sp, #56]
	ldr	r3, [r3]
	bl	i40iw_allocate_dma_mem
	subs	r3, r0, #0
	bne	.L1
	ldr	r3, [fp]
	cmp	r3, r7
	beq	.L12
	mov	r2, #4
	add	r1, sp, #8
	add	r0, r9, #8
	bl	memcpy
	str	r4, [r9, #4]
.L7:
	ldr	r3, [r6]
	mov	r0, r6
	str	r7, [r3, r5]
	bl	I40IW_INC_SD_REFCNT
.L2:
	ldr	r3, .L16+16
	ldr	r2, [r10, r5]
	ldr	r3, [r3]
	cmp	r2, r3
	movne	r3, #0
	beq	.L13
.L1:
	ldr	r2, .L16
	ldr	r1, [r2]
	ldr	r2, [sp, #12]
	eors	r1, r2, r1
	mov	r2, #0
	bne	.L14
	mov	r0, r3
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L13:
	add	r0, r9, #4
	bl	I40IW_INC_BP_REFCNT
	mov	r3, #0
	b	.L1
.L12:
	mov	r2, #2048
	mov	r0, r8
	add	r1, r9, #16
	bl	i40iw_allocate_virt_mem
	subs	r3, r0, #0
	str	r3, [sp, #4]
	bne	.L15
	ldr	r3, [r9, #16]
	mov	r2, #4
	add	r1, sp, #8
	str	r3, [r9, #20]
	add	r0, r9, #12
	bl	memcpy
	b	.L7
.L15:
	mov	r0, r8
	add	r1, sp, #8
	bl	i40iw_free_dma_mem
	ldr	r3, [sp, #4]
	b	.L1
.L14:
	bl	__stack_chk_fail
.L17:
	.align	2
.L16:
	.word	.LC0
	.word	I40IW_SD_TYPE_PAGED
	.word	I40IW_HMC_PAGED_BP_SIZE
	.word	I40IW_HMC_PD_BP_BUF_ALIGNMENT
	.word	I40IW_SD_TYPE_DIRECT
	.size	i40iw_add_sd_table_entry, .-i40iw_add_sd_table_entry
	.comm	I40IW_SD_TYPE_PAGED,4,4
	.comm	I40IW_SD_TYPE_DIRECT,4,4
	.comm	I40IW_HMC_PD_BP_BUF_ALIGNMENT,4,4
	.comm	I40IW_HMC_PAGED_BP_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
