	.file	"extr_sfxge_tx.c_tso_init.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	tso_init, @function
tso_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
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	r14, QWORD PTR 8[rdi]
	mov	edi, DWORD PTR [r14]
	call	TSOH_PAGE_COUNT@PLT
	mov	edx, DWORD PTR M_WAITOK[rip]
	mov	esi, DWORD PTR M_SFXGE[rip]
	lea	edi, 0[0+rax*4]
	mov	ebx, eax
	call	malloc@PLT
	mov	QWORD PTR 0[rbp], rax
	test	ebx, ebx
	je	.L2
	lea	r15d, -1[rbx]
	xor	ebx, ebx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L5:
	lea	rdx, 1[rbx]
	cmp	rbx, r15
	je	.L2
	mov	rax, QWORD PTR 0[rbp]
	mov	rbx, rdx
.L3:
	mov	esi, DWORD PTR PAGE_SIZE[rip]
	lea	rdx, [rax+rbx*4]
	mov	rdi, r14
	movsx	r13, ebx
	call	sfxge_dma_alloc@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L5
	lea	r14d, -1[r13]
	test	r13d, r13d
	je	.L8
	lea	eax, -1[rbx]
	movsx	r14, r14d
	sub	r13, rax
	sal	r14, 2
	lea	rbx, -8[0+r13*4]
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rdi, QWORD PTR 0[rbp]
	add	rdi, r14
	sub	r14, 4
	call	sfxge_dma_free@PLT
	cmp	r14, rbx
	jne	.L7
.L8:
	mov	esi, DWORD PTR M_SFXGE[rip]
	mov	rdi, QWORD PTR 0[rbp]
	call	free@PLT
	mov	QWORD PTR 0[rbp], 0
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L2:
	xor	r12d, r12d
.L1:
	add	rsp, 8
	.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
	.cfi_endproc
.LFE0:
	.size	tso_init, .-tso_init
	.comm	PAGE_SIZE,4,4
	.comm	M_WAITOK,4,4
	.comm	M_SFXGE,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_sfxge_tx.c_tso_init.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tso_init, %function
tso_init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r8, [r0, #4]
	mov	r6, r0
	ldr	r0, [r8]
	bl	TSOH_PAGE_COUNT
	ldr	r9, .L15
	ldr	r3, .L15+4
	mov	r7, r0
	ldr	r2, [r3]
	ldr	r1, [r9]
	lsl	r0, r0, #2
	bl	malloc
	cmp	r7, #0
	str	r0, [r6]
	beq	.L2
	mov	r2, r0
	mov	r4, #0
	ldr	r10, .L15+8
	b	.L3
.L5:
	add	r4, r4, #1
	cmp	r7, r4
	beq	.L2
	ldr	r2, [r6]
.L3:
	mov	r0, r8
	ldr	r1, [r10]
	add	r2, r2, r4, lsl #2
	bl	sfxge_dma_alloc
	subs	r5, r0, #0
	beq	.L5
	cmp	r4, #0
	sub	r4, r4, #1
	beq	.L7
.L6:
	ldr	r0, [r6]
	add	r0, r0, r4, lsl #2
	sub	r4, r4, #1
	bl	sfxge_dma_free
	cmn	r4, #1
	bne	.L6
.L7:
	ldr	r1, [r9]
	ldr	r0, [r6]
	bl	free
	mov	r3, #0
	mov	r0, r5
	str	r3, [r6]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	mov	r5, #0
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L16:
	.align	2
.L15:
	.word	M_SFXGE
	.word	M_WAITOK
	.word	PAGE_SIZE
	.size	tso_init, .-tso_init
	.comm	PAGE_SIZE,4,4
	.comm	M_WAITOK,4,4
	.comm	M_SFXGE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
