	.file	"extr_ledger.c_ledger_template_info.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	ledger_template_info
	.type	ledger_template_info, @function
ledger_template_info:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xor	eax, eax
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	current_task@PLT
	mov	r14, QWORD PTR [rax]
	mov	eax, DWORD PTR 0[r13]
	test	r14, r14
	je	.L9
	test	eax, eax
	js	.L9
	mov	edx, DWORD PTR [r14]
	cmp	eax, edx
	jle	.L5
	mov	DWORD PTR 0[r13], edx
	mov	eax, edx
.L5:
	lea	edi, [rax+rax*2]
	sal	edi, 2
	call	kalloc@PLT
	mov	rbx, rax
	mov	eax, DWORD PTR ENOMEM[rip]
	test	rbx, rbx
	je	.L1
	mov	QWORD PTR 0[rbp], rbx
	mov	rdi, QWORD PTR 8[r14]
	call	template_lock@PLT
	mov	rdi, QWORD PTR 8[r14]
	mov	eax, DWORD PTR 0[r13]
	mov	rbp, QWORD PTR [rdi]
	test	eax, eax
	jle	.L7
	xor	r12d, r12d
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdi, rbx
	mov	edx, 12
	xor	esi, esi
	add	rbp, 12
	call	memset@PLT
	mov	edi, DWORD PTR 8[rbx]
	mov	esi, DWORD PTR -4[rbp]
	add	rbx, 12
	mov	edx, DWORD PTR LEDGER_NAME_MAX[rip]
	add	r12d, 1
	call	strlcpy@PLT
	mov	esi, DWORD PTR -8[rbp]
	mov	edi, DWORD PTR -8[rbx]
	mov	edx, DWORD PTR LEDGER_NAME_MAX[rip]
	call	strlcpy@PLT
	mov	esi, DWORD PTR -12[rbp]
	mov	edi, DWORD PTR -12[rbx]
	mov	edx, DWORD PTR LEDGER_NAME_MAX[rip]
	call	strlcpy@PLT
	cmp	DWORD PTR 0[r13], r12d
	jg	.L8
	mov	rdi, QWORD PTR 8[r14]
.L7:
	call	template_unlock@PLT
	xor	eax, eax
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	pop	rbx
	.cfi_def_cfa_offset 40
	mov	eax, DWORD PTR EINVAL[rip]
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	ledger_template_info, .-ledger_template_info
	.comm	LEDGER_NAME_MAX,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,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_ledger.c_ledger_template_info.c"
	.text
	.align	2
	.global	ledger_template_info
	.syntax unified
	.arm
	.fpu softvfp
	.type	ledger_template_info, %function
ledger_template_info:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r8, r1
	mov	r4, r0
	bl	current_task
	ldr	r9, [r0]
	ldr	r3, [r8]
	clz	r2, r9
	lsr	r2, r2, #5
	orrs	r2, r2, r3, lsr #31
	bne	.L11
	ldr	r2, [r9]
	cmp	r3, r2
	movgt	r3, r2
	add	r3, r3, r3, lsl #1
	strgt	r2, [r8]
	lsl	r0, r3, #2
	bl	kalloc
	subs	r5, r0, #0
	beq	.L12
	str	r5, [r4]
	ldr	r0, [r9, #4]
	bl	template_lock
	ldr	r3, [r8]
	ldr	r0, [r9, #4]
	cmp	r3, #0
	ldr	r4, [r0]
	ble	.L6
	mov	r7, #0
	ldr	r6, .L13
	add	r4, r4, #12
.L7:
	mov	r2, #12
	mov	r1, #0
	mov	r0, r5
	bl	memset
	ldr	r1, [r4, #-4]
	ldr	r2, [r6]
	mov	r0, #0
	bl	strlcpy
	ldr	r1, [r4, #-8]
	ldr	r2, [r6]
	ldr	r0, [r5, #4]
	bl	strlcpy
	ldr	r1, [r4, #-12]
	ldr	r2, [r6]
	ldr	r0, [r5], #12
	bl	strlcpy
	ldr	r3, [r8]
	add	r7, r7, #1
	cmp	r3, r7
	add	r4, r4, #12
	bgt	.L7
	ldr	r0, [r9, #4]
.L6:
	bl	template_unlock
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L11:
	ldr	r3, .L13+4
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L12:
	ldr	r3, .L13+8
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L14:
	.align	2
.L13:
	.word	LEDGER_NAME_MAX
	.word	EINVAL
	.word	ENOMEM
	.size	ledger_template_info, .-ledger_template_info
	.comm	LEDGER_NAME_MAX,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
