	.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 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, 136
	.cfi_def_cfa_offset 192
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 120[rsp], rax
	xor	eax, eax
	lea	rdx, 48[rsp]
	call	luaL_checklstring@PLT
	lea	rdx, 56[rsp]
	mov	esi, 2
	mov	rdi, r15
	mov	r14, rax
	call	luaL_checklstring@PLT
	mov	esi, 3
	mov	rdi, r15
	mov	r12, rax
	call	lua_type@PLT
	mov	esi, 4
	mov	rdi, r15
	mov	DWORD PTR 28[rsp], eax
	mov	ebx, eax
	mov	rax, QWORD PTR 48[rsp]
	lea	rdx, 1[rax]
	call	luaL_optinteger@PLT
	cmp	DWORD PTR LUA_TNUMBER[rip], ebx
	mov	esi, 1
	mov	QWORD PTR 8[rsp], rax
	movzx	eax, BYTE PTR [r12]
	mov	BYTE PTR 27[rsp], al
	je	.L2
	cmp	DWORD PTR LUA_TSTRING[rip], ebx
	je	.L2
	cmp	DWORD PTR LUA_TFUNCTION[rip], ebx
	je	.L2
	xor	esi, esi
	cmp	DWORD PTR LUA_TTABLE[rip], ebx
	sete	sil
.L2:
	lea	rcx, .LC0[rip]
	mov	edx, 3
	mov	rdi, r15
	call	luaL_argcheck@PLT
	lea	r13, 44[rsp]
	mov	rdi, r15
	mov	rsi, r13
	call	luaL_buffinit@PLT
	cmp	BYTE PTR 27[rsp], 94
	je	.L3
	mov	rax, QWORD PTR 56[rsp]
.L4:
	add	rax, r12
	mov	QWORD PTR 104[rsp], r15
	xor	ebp, ebp
	lea	rbx, 64[rsp]
	mov	rdx, QWORD PTR MAXCCALLS[rip]
	mov	QWORD PTR 72[rsp], r14
	mov	QWORD PTR 88[rsp], rax
	mov	QWORD PTR 64[rsp], rdx
	mov	rdx, QWORD PTR 48[rsp]
	add	rdx, r14
	mov	QWORD PTR 80[rsp], rdx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L22:
	mov	r8d, DWORD PTR 28[rsp]
	mov	rdx, r14
	mov	rsi, r13
	mov	rdi, rbx
	mov	QWORD PTR 16[rsp], rax
	add	rbp, 1
	call	add_value@PLT
	mov	rcx, QWORD PTR 16[rsp]
	cmp	r14, rcx
	jnb	.L6
	cmp	BYTE PTR 27[rsp], 94
	mov	r14, rcx
	je	.L20
.L5:
	cmp	rbp, QWORD PTR 8[rsp]
	jnb	.L20
	mov	rax, QWORD PTR MAXCCALLS[rip]
	xor	edi, edi
	cmp	QWORD PTR 64[rsp], rax
	mov	QWORD PTR 96[rsp], 0
	sete	dil
	call	lua_assert@PLT
	mov	rdx, r12
	mov	rsi, r14
	mov	rdi, rbx
	call	match@PLT
	mov	rcx, rax
	test	rax, rax
	jne	.L22
.L6:
	mov	rdx, QWORD PTR 80[rsp]
	cmp	rdx, r14
	jbe	.L8
	movsx	esi, BYTE PTR [r14]
	lea	rax, 1[r14]
	mov	rdi, r13
	mov	QWORD PTR 16[rsp], rax
	call	luaL_addchar@PLT
	cmp	BYTE PTR 27[rsp], 94
	mov	r14, QWORD PTR 16[rsp]
	jne	.L5
.L20:
	mov	rdx, QWORD PTR 80[rsp]
.L8:
	sub	rdx, r14
	mov	rsi, r14
	mov	rdi, r13
	call	luaL_addlstring@PLT
	mov	rdi, r13
	call	luaL_pushresult@PLT
	mov	rsi, rbp
	mov	rdi, r15
	call	lua_pushinteger@PLT
	mov	rax, QWORD PTR 120[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L23
	add	rsp, 136
	.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
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	rax, QWORD PTR 56[rsp]
	add	r12, 1
	sub	rax, 1
	mov	QWORD PTR 56[rsp], rax
	jmp	.L4
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	str_gsub, .-str_gsub
	.comm	MAXCCALLS,8,8
	.comm	LUA_TTABLE,4,4
	.comm	LUA_TSTRING,4,4
	.comm	LUA_TNUMBER,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 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 = 48
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L25
	sub	sp, sp, #60
	mov	r1, #1
	add	r2, sp, #16
	ldr	r3, [r3]
	str	r3, [sp, #52]
	mov	r3,#0
	mov	fp, r0
	bl	luaL_checklstring
	add	r2, sp, #20
	mov	r1, #2
	mov	r4, r0
	mov	r0, fp
	bl	luaL_checklstring
	mov	r1, #3
	mov	r6, r0
	mov	r0, fp
	bl	lua_type
	ldr	r2, [sp, #16]
	mov	r5, r0
	str	r0, [sp, #8]
	mov	r1, #4
	mov	r0, fp
	add	r2, r2, #1
	bl	luaL_optinteger
	ldr	r3, .L25+4
	mov	r7, r0
	ldr	r3, [r3]
	ldrb	r9, [r6]	@ zero_extendqisi2
	cmp	r3, r5
	beq	.L13
	ldr	r3, .L25+8
	ldr	r3, [r3]
	cmp	r3, r5
	beq	.L13
	ldr	r3, .L25+12
	ldr	r3, [r3]
	cmp	r3, r5
	beq	.L13
	ldr	r3, .L25+16
	ldr	r1, [r3]
	sub	r1, r1, r5
	clz	r1, r1
	lsr	r1, r1, #5
	b	.L2
.L13:
	mov	r1, #1
.L2:
	mov	r5, #0
	mov	r2, #3
	ldr	r3, .L25+20
	mov	r0, fp
	bl	luaL_argcheck
	add	r1, sp, #24
	mov	r0, fp
	bl	luaL_buffinit
	ldr	r8, .L25+24
	ldr	r3, [sp, #20]
	cmp	r9, #94
	ldr	r2, [sp, #16]
	subeq	r3, r3, #1
	ldr	r1, [r8]
	addeq	r6, r6, #1
	streq	r3, [sp, #20]
	add	r2, r4, r2
	add	r3, r6, r3
	mov	r10, r5
	str	r3, [sp, #40]
	str	fp, [sp, #48]
	str	r4, [sp, #32]
	str	r1, [sp, #28]
	str	r2, [sp, #36]
	str	fp, [sp, #12]
	b	.L5
.L23:
	ldr	r3, [sp, #8]
	mov	r2, r4
	str	r3, [sp]
	add	r1, sp, #24
	mov	r3, fp
	add	r0, sp, #28
	bl	add_value
	cmp	r4, fp
	movcc	r4, fp
	add	r5, r5, #1
	bcs	.L6
	cmp	r9, #94
	beq	.L21
.L5:
	cmp	r5, r7
	bcs	.L21
	ldr	r3, [r8]
	ldr	r0, [sp, #28]
	str	r10, [sp, #44]
	sub	r0, r0, r3
	clz	r0, r0
	lsr	r0, r0, #5
	bl	lua_assert
	mov	r2, r6
	mov	r1, r4
	add	r0, sp, #28
	bl	match
	subs	fp, r0, #0
	bne	.L23
.L6:
	ldr	r2, [sp, #36]
	cmp	r2, r4
	bls	.L19
	ldrb	r1, [r4], #1	@ zero_extendqisi2
	add	r0, sp, #24
	bl	luaL_addchar
	cmp	r9, #94
	bne	.L5
.L21:
	ldr	fp, [sp, #12]
	ldr	r2, [sp, #36]
.L8:
	sub	r2, r2, r4
	mov	r1, r4
	add	r0, sp, #24
	bl	luaL_addlstring
	add	r0, sp, #24
	bl	luaL_pushresult
	mov	r1, r5
	mov	r0, fp
	bl	lua_pushinteger
	ldr	r3, .L25
	ldr	r2, [r3]
	ldr	r3, [sp, #52]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L24
	mov	r0, #2
	add	sp, sp, #60
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L19:
	ldr	fp, [sp, #12]
	b	.L8
.L24:
	bl	__stack_chk_fail
.L26:
	.align	2
.L25:
	.word	.LC1
	.word	LUA_TNUMBER
	.word	LUA_TSTRING
	.word	LUA_TFUNCTION
	.word	LUA_TTABLE
	.word	.LC0
	.word	MAXCCALLS
	.size	str_gsub, .-str_gsub
	.comm	MAXCCALLS,4,4
	.comm	LUA_TTABLE,4,4
	.comm	LUA_TSTRING,4,4
	.comm	LUA_TNUMBER,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
