// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/llex.c
// Function: read_long_string
static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) {
  int line = ls->linenumber;  /* initial line (for error message) */
  save_and_next(ls);  /* skip 2nd '[' */
  if (currIsNewline(ls))  /* string starts with a newline? */
    inclinenumber(ls);  /* skip it */
  for (;;) {
    switch (ls->current) {
      case EOZ: {  /* error */
        const char *what = (seminfo ? "string" : "comment");
        const char *msg = luaO_pushfstring(ls->L,
                     "unfinished long %s (starting at line %d)", what, line);
        lexerror(ls, msg, TK_EOS);
        break;  /* to avoid warnings */
      }
      case ']': {
        if (skip_sep(ls) == sep) {
          save_and_next(ls);  /* skip 2nd ']' */
          goto endloop;
        }
        break;
      }
      case '\n': case '\r': {
        save(ls, '\n');
        inclinenumber(ls);
        if (!seminfo) luaZ_resetbuffer(ls->buff);  /* avoid wasting space */
        break;
      }
      default: {
        if (seminfo) save_and_next(ls);
        else next(ls);
      }
    }
  } endloop:
  if (seminfo)
    seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + (2 + sep),
                                     luaZ_bufflen(ls->buff) - 2*(2 + sep));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movl (%rdi), %esi
movl 0x4(%rdi), %ebp
callq 0x17907
movq 0x40(%rbx), %rdi
subq $0x1, (%rdi)
jae 0x17aa2
callq 0x13ad0
jmp 0x17ab1
movq 0x8(%rdi), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rdi)
movzbl (%rax), %eax
movl %eax, (%rbx)
cmpl $0xd, %eax
je 0x17abd
cmpl $0xa, %eax
jne 0x17b2c
movq %rbx, %rdi
callq 0x17971
jmp 0x17b2c
cmpl $0xa, %esi
jne 0x17af4
movq %rbx, %rdi
movl $0xa, %esi
callq 0x17907
movq %rbx, %rdi
callq 0x17971
testq %r14, %r14
jne 0x17b2c
movq 0x48(%rbx), %rax
movq $0x0, 0x8(%rax)
jmp 0x17b2c
cmpl $-0x1, %esi
je 0x17bb1
testq %r14, %r14
je 0x17b0a
movq %rbx, %rdi
callq 0x17907
movq 0x40(%rbx), %rdi
subq $0x1, (%rdi)
jae 0x17b1b
callq 0x13ad0
jmp 0x17b2a
movq 0x8(%rdi), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rdi)
movzbl (%rax), %eax
movl %eax, (%rbx)
movl (%rbx), %esi
cmpl $0xc, %esi
jle 0x17ac7
cmpl $0xd, %esi
je 0x17acc
cmpl $0x5d, %esi
jne 0x17afd
movq %rbx, %rdi
callq 0x179f2
cmpl %r15d, %eax
jne 0x17b2c
movl (%rbx), %esi
movq %rbx, %rdi
callq 0x17907
movq 0x40(%rbx), %rdi
subq $0x1, (%rdi)
jae 0x17b65
callq 0x13ad0
jmp 0x17b74
movq 0x8(%rdi), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rdi)
movzbl (%rax), %eax
movl %eax, (%rbx)
testq %r14, %r14
je 0x17ba6
movq 0x48(%rbx), %rax
movl %r15d, %ecx
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rcx, %rsi
addq $0x2, %rsi
leal 0x4(,%r15,2), %eax
subq %rax, %rdx
movq %rbx, %rdi
callq 0x16e18
movq %rax, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
testq %r14, %r14
leaq 0xad50(%rip), %rax      # 0x2290b
leaq 0xc09e(%rip), %rdx      # 0x23c60
cmoveq %rax, %rdx
movq 0x38(%rbx), %rdi
leaq 0xad42(%rip), %rsi      # 0x22913
movl %ebp, %ecx
xorl %eax, %eax
callq 0xbf04
movq %rbx, %rdi
movq %rax, %rsi
movl $0x121, %edx            # imm = 0x121
callq 0x16d8f