	.file	"extr_mpsp.c_mp_add_cs_buf.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	mp_add_cs_buf, @function
mp_add_cs_buf:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	sal	r8, 4
	mov	r14, rdx
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	r13, QWORD PTR [rdi]
	lea	rbx, [rcx+r8]
	movsx	rdi, DWORD PTR CHARSIZ[rip]
	sal	rdi, 3
	call	hcmalloc@PLT
	cmp	QWORD PTR [rbx], 0
	mov	r12, rax
	je	.L2
	mov	rsi, QWORD PTR 8[rbx]
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rcx, QWORD PTR [rsi+rax*8]
	add	rax, 1
	mov	QWORD PTR [r12+rcx*8], 1
	cmp	QWORD PTR [rbx], rax
	ja	.L3
.L2:
	test	r14, r14
	je	.L4
	lea	r14, 0[rbp+r14*8]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	lea	rax, [r12+rdi*8]
	cmp	QWORD PTR [rax], 1
	je	.L6
	mov	QWORD PTR [rax], 1
	mov	rax, QWORD PTR 8[rbx]
	mov	rdx, QWORD PTR [rbx]
	mov	QWORD PTR [rax+rdx*8], rdi
	add	QWORD PTR [rbx], 1
.L6:
	add	rbp, 8
	cmp	rbp, r14
	je	.L4
.L7:
	movzx	edi, BYTE PTR 0[rbp]
	mov	eax, DWORD PTR 0[r13]
	test	DWORD PTR OPTS_TYPE_PT_UPPER[rip], eax
	je	.L5
	call	toupper@PLT
	mov	rdi, rax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rdi, r12
	call	hcfree@PLT
	pop	rbx
	.cfi_def_cfa_offset 40
	xor	eax, eax
	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	mp_add_cs_buf, .-mp_add_cs_buf
	.comm	OPTS_TYPE_PT_UPPER,4,4
	.comm	CHARSIZ,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_mpsp.c_mp_add_cs_buf.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mp_add_cs_buf, %function
mp_add_cs_buf:
	@ args = 4, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	ip, .L24
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r3
	ldr	r3, [ip]
	ldr	r9, [r0]
	lsl	r0, r3, #2
	ldr	r7, [sp, #32]
	mov	r5, r1
	mov	r8, r2
	bl	hcmalloc
	ldr	r3, [r4, r7, lsl #3]
	mov	r6, r0
	cmp	r3, #0
	add	r4, r4, r7, lsl #3
	beq	.L2
	mov	r3, #0
	mov	ip, #1
	ldr	r0, [r4, #4]
	sub	r0, r0, #4
.L3:
	ldr	r2, [r0, #4]!
	add	r3, r3, #1
	str	ip, [r6, r2, lsl #2]
	ldr	r1, [r4]
	cmp	r1, r3
	bhi	.L3
.L2:
	cmp	r8, #0
	beq	.L4
	mov	r7, #1
	ldr	r3, .L24+4
	ldr	r9, [r9]
	ldr	r3, [r3]
	sub	r5, r5, #4
	add	r8, r5, r8, lsl #2
	and	r9, r9, r3
.L7:
	ldr	r0, [r5, #4]!
	cmp	r9, #0
	and	r0, r0, #255
	beq	.L5
	bl	toupper
.L5:
	ldr	r3, [r6, r0, lsl #2]
	cmp	r3, #1
	beq	.L6
	str	r7, [r6, r0, lsl #2]
	ldm	r4, {r2, r3}
	str	r0, [r3, r2, lsl #2]
	ldr	r3, [r4]
	add	r3, r3, #1
	str	r3, [r4]
.L6:
	cmp	r8, r5
	bne	.L7
.L4:
	mov	r0, r6
	bl	hcfree
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L25:
	.align	2
.L24:
	.word	CHARSIZ
	.word	OPTS_TYPE_PT_UPPER
	.size	mp_add_cs_buf, .-mp_add_cs_buf
	.comm	OPTS_TYPE_PT_UPPER,4,4
	.comm	CHARSIZ,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
