	.file	"extr_lstrlib.c_str_gsub.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"string/function/table/lightfunction expected"
	.text
	.p2align 4
	.type	str_gsub, @function
str_gsub:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	esi, 1
	mov	r15, rdi
	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
	sub	rsp, 88
	.cfi_def_cfa_offset 144
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 72[rsp], rax
	xor	eax, eax
	lea	rdx, 24[rsp]
	call	luaL_checklstring@PLT
	mov	esi, 2
	mov	rdi, r15
	mov	r14, rax
	call	luaL_checkstring@PLT
	mov	esi, 3
	mov	rdi, r15
	mov	r12, rax
	call	lua_type@PLT
	mov	esi, 4
	mov	rdi, r15
	mov	ebx, eax
	mov	rax, QWORD PTR 24[rsp]
	lea	rdx, 1[rax]
	call	luaL_optint@PLT
	cmp	BYTE PTR [r12], 94
	mov	DWORD PTR 4[rsp], 0
	mov	DWORD PTR [rsp], eax
	jne	.L2
	mov	DWORD PTR 4[rsp], 1
	add	r12, 1
.L2:
	cmp	DWORD PTR LUA_TNUMBER[rip], ebx
	mov	esi, 1
	je	.L3
	cmp	DWORD PTR LUA_TSTRING[rip], ebx
	je	.L3
	cmp	DWORD PTR LUA_TFUNCTION[rip], ebx
	je	.L3
	cmp	DWORD PTR LUA_TTABLE[rip], ebx
	je	.L3
	xor	esi, esi
	cmp	DWORD PTR LUA_TLIGHTFUNCTION[rip], ebx
	sete	sil
	.p2align 4,,10
	.p2align 3
.L3:
	mov	edx, 3
	mov	rdi, r15
	lea	r13, 20[rsp]
	xor	ebp, ebp
	lea	rcx, .LC0[rip]
	lea	rbx, 32[rsp]
	call	luaL_argcheck@PLT
	mov	rsi, r13
	mov	rdi, r15
	call	luaL_buffinit@PLT
	mov	rax, QWORD PTR 24[rsp]
	mov	QWORD PTR 56[rsp], r15
	mov	QWORD PTR 32[rsp], r14
	add	rax, r14
	mov	QWORD PTR 40[rsp], rax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L24:
	mov	rdx, r14
	mov	rsi, r13
	mov	rdi, rbx
	mov	QWORD PTR 8[rsp], rax
	call	add_value@PLT
	mov	rcx, QWORD PTR 8[rsp]
	add	ebp, 1
	cmp	r14, rcx
	jnb	.L5
	mov	eax, DWORD PTR 4[rsp]
	mov	r14, rcx
	test	eax, eax
	jne	.L22
.L4:
	cmp	ebp, DWORD PTR [rsp]
	jge	.L22
	mov	rdx, r12
	mov	rsi, r14
	mov	rdi, rbx
	mov	QWORD PTR 48[rsp], 0
	call	match@PLT
	mov	rcx, rax
	test	rax, rax
	jne	.L24
.L5:
	mov	rdx, QWORD PTR 40[rsp]
	cmp	rdx, r14
	jbe	.L7
	movsx	esi, BYTE PTR [r14]
	lea	rax, 1[r14]
	mov	rdi, r13
	mov	QWORD PTR 8[rsp], rax
	call	luaL_addchar@PLT
	mov	eax, DWORD PTR 4[rsp]
	mov	r14, QWORD PTR 8[rsp]
	test	eax, eax
	je	.L4
.L22:
	mov	rdx, QWORD PTR 40[rsp]
.L7:
	sub	rdx, r14
	mov	rsi, r14
	mov	rdi, r13
	call	luaL_addlstring@PLT
	mov	rdi, r13
	call	luaL_pushresult@PLT
	mov	esi, ebp
	mov	rdi, r15
	call	lua_pushinteger@PLT
	mov	rax, QWORD PTR 72[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L25
	add	rsp, 88
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, 2
	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
.L25:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	str_gsub, .-str_gsub
	.comm	LUA_TTABLE,4,4
	.comm	LUA_TSTRING,4,4
	.comm	LUA_TNUMBER,4,4
	.comm	LUA_TLIGHTFUNCTION,4,4
	.comm	LUA_TFUNCTION,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_lstrlib.c_str_gsub.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"string/function/table/lightfunction expected\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	str_gsub, %function
str_gsub:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L26
	sub	sp, sp, #36
	add	r2, sp, #4
	mov	r1, #1
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	mov	r10, r0
	bl	luaL_checklstring
	mov	r1, #2
	mov	r4, r0
	mov	r0, r10
	bl	luaL_checkstring
	mov	r1, #3
	mov	r6, r0
	mov	r0, r10
	bl	lua_type
	ldr	r2, [sp, #4]
	mov	r5, r0
	mov	r1, #4
	mov	r0, r10
	add	r2, r2, #1
	bl	luaL_optint
	ldrb	r3, [r6]	@ zero_extendqisi2
	mov	r7, r0
	cmp	r3, #94
	ldr	r3, .L26+4
	moveq	r9, #1
	ldr	r3, [r3]
	movne	r9, #0
	addeq	r6, r6, #1
	cmp	r3, r5
	beq	.L14
	ldr	r3, .L26+8
	ldr	r3, [r3]
	cmp	r3, r5
	beq	.L14
	ldr	r3, .L26+12
	ldr	r3, [r3]
	cmp	r3, r5
	beq	.L14
	ldr	r3, .L26+16
	ldr	r3, [r3]
	cmp	r3, r5
	beq	.L14
	ldr	r3, .L26+20
	ldr	r1, [r3]
	sub	r1, r1, r5
	clz	r1, r1
	lsr	r1, r1, #5
	b	.L3
.L14:
	mov	r1, #1
.L3:
	mov	r5, #0
	ldr	r3, .L26+24
	mov	r2, #3
	mov	r0, r10
	bl	luaL_argcheck
	mov	r0, r10
	add	r1, sp, #8
	bl	luaL_buffinit
	ldr	r3, [sp, #4]
	mov	r8, r5
	add	r3, r4, r3
	str	r10, [sp, #24]
	str	r4, [sp, #12]
	str	r3, [sp, #16]
	b	.L4
.L24:
	mov	r2, r4
	mov	r3, fp
	add	r1, sp, #8
	add	r0, sp, #12
	bl	add_value
	cmp	r4, fp
	movcc	r4, fp
	add	r5, r5, #1
	bcs	.L5
	cmp	r9, #0
	bne	.L22
.L4:
	cmp	r5, r7
	bge	.L22
	mov	r2, r6
	mov	r1, r4
	add	r0, sp, #12
	str	r8, [sp, #20]
	bl	match
	subs	fp, r0, #0
	bne	.L24
.L5:
	ldr	r2, [sp, #16]
	cmp	r2, r4
	bls	.L7
	ldrb	r1, [r4], #1	@ zero_extendqisi2
	add	r0, sp, #8
	bl	luaL_addchar
	cmp	r9, #0
	beq	.L4
.L22:
	ldr	r2, [sp, #16]
.L7:
	sub	r2, r2, r4
	mov	r1, r4
	add	r0, sp, #8
	bl	luaL_addlstring
	add	r0, sp, #8
	bl	luaL_pushresult
	mov	r1, r5
	mov	r0, r10
	bl	lua_pushinteger
	ldr	r3, .L26
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L25
	mov	r0, #2
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L25:
	bl	__stack_chk_fail
.L27:
	.align	2
.L26:
	.word	.LC1
	.word	LUA_TNUMBER
	.word	LUA_TSTRING
	.word	LUA_TFUNCTION
	.word	LUA_TTABLE
	.word	LUA_TLIGHTFUNCTION
	.word	.LC0
	.size	str_gsub, .-str_gsub
	.comm	LUA_TTABLE,4,4
	.comm	LUA_TSTRING,4,4
	.comm	LUA_TNUMBER,4,4
	.comm	LUA_TLIGHTFUNCTION,4,4
	.comm	LUA_TFUNCTION,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
