// File: /workspace/github_c_makefile_star2_O0/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lstrlib.c
// Function: add_s
static void add_s (MatchState *ms, luaL_Buffer *b, const char *s,
                                                   const char *e) {
  size_t l, i;
  const char *news = lua_tolstring(ms->L, 3, &l);
  for (i = 0; i < l; i++) {
    if (news[i] != L_ESC)
      luaL_addchar(b, news[i]);
    else {
      i++;  /* skip ESC */
      if (!isdigit(uchar(news[i]))) {
        if (news[i] != L_ESC)
          luaL_error(ms->L, "invalid use of " LUA_QL("%c")
                           " in replacement string", L_ESC);
        luaL_addchar(b, news[i]);
      }
      else if (news[i] == '0')
          luaL_addlstring(b, s, e - s);
      else {
        push_onecapture(ms, news[i] - '1', s, e);
        luaL_addvalue(b);  /* add capture to accumulated result */
      }
    }
  }
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rdi
movl $0x3, %esi
leaq 0x20(%rsp), %rdx
callq 0x9a80
movq %rax, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x20(%rsp), %rax
jae 0x24061
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x25, %eax
je 0x23f1a
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x38(%rsp), %rdx
movb $0x1, %al
cmpq 0x8(%rdx), %rcx
movb %al, 0xf(%rsp)
jb 0x23ee5
movq 0x38(%rsp), %rdi
movl $0x1, %esi
callq 0xd080
cmpq $0x0, %rax
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movb (%rax,%rcx), %dl
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq 0x38(%rsp), %rsi
movq 0x10(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x10(%rsi)
movb %dl, (%rax,%rcx)
jmp 0x2404c
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
callq 0x75c0
movq (%rax), %rax
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x23fe8
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x25, %eax
je 0x23f82
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rdi
leaq 0x12df2(%rip), %rsi     # 0x36d68
movl $0x25, %edx
movb $0x0, %al
callq 0xc520
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x38(%rsp), %rdx
movb $0x1, %al
cmpq 0x8(%rdx), %rcx
movb %al, 0xe(%rsp)
jb 0x23fb6
movq 0x38(%rsp), %rdi
movl $0x1, %esi
callq 0xd080
cmpq $0x0, %rax
setne %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movb (%rax,%rcx), %dl
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq 0x38(%rsp), %rsi
movq 0x10(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x10(%rsi)
movb %dl, (%rax,%rcx)
jmp 0x2404a
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x30, %eax
jne 0x24019
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rax
subq %rax, %rdx
callq 0xd1b0
jmp 0x24048
movq 0x40(%rsp), %rdi
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movsbl (%rax,%rcx), %esi
subl $0x31, %esi
movq 0x30(%rsp), %rdx
movq 0x28(%rsp), %rcx
callq 0x23490
movq 0x38(%rsp), %rdi
callq 0xd2f0
jmp 0x2404a
jmp 0x2404c
jmp 0x2404e
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x23e8e
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)