// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movl (%rdi), %esi
movl 0x4(%rdi), %ebp
callq 0x1615d
movq 0x40(%rbx), %rdi
subq $0x1, (%rdi)
jae 0x16302
callq 0x1273c
jmp 0x16311
movq 0x8(%rdi), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rdi)
movzbl (%rax), %eax
movl %eax, (%rbx)
cmpl $0xd, %eax
je 0x1631d
cmpl $0xa, %eax
jne 0x16325
movq %rbx, %rdi
callq 0x161ca
pushq $0xa
popq %r12
movl (%rbx), %esi
cmpl $0xa, %esi
je 0x16361
cmpl $0xd, %esi
je 0x16361
cmpl $0x5d, %esi
je 0x16384
cmpl $-0x1, %esi
je 0x1640b
testq %r14, %r14
je 0x16350
movq %rbx, %rdi
callq 0x1615d
movq 0x40(%rbx), %rdi
subq $0x1, (%rdi)
jae 0x16393
callq 0x1273c
jmp 0x163a2
movq %rbx, %rdi
movl %r12d, %esi
callq 0x1615d
movq %rbx, %rdi
callq 0x161ca
testq %r14, %r14
jne 0x16329
movq 0x48(%rbx), %rax
andq $0x0, 0x8(%rax)
jmp 0x16329
movq %rbx, %rdi
callq 0x1624b
cmpl %r15d, %eax
jne 0x16329
jmp 0x163a6
movq 0x8(%rdi), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rdi)
movzbl (%rax), %eax
movl %eax, (%rbx)
jmp 0x16329
movl (%rbx), %esi
movq %rbx, %rdi
callq 0x1615d
movq 0x40(%rbx), %rdi
subq $0x1, (%rdi)
jae 0x163c1
callq 0x1273c
jmp 0x163d0
movq 0x8(%rdi), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rdi)
movzbl (%rax), %eax
movl %eax, (%rbx)
testq %r14, %r14
je 0x16402
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 0x15706
movq %rax, (%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testq %r14, %r14
leaq 0xa616(%rip), %rax      # 0x20a2b
leaq 0xb964(%rip), %rdx      # 0x21d80
cmoveq %rax, %rdx
movq 0x38(%rbx), %rdi
leaq 0xa608(%rip), %rsi      # 0x20a33
movl %ebp, %ecx
xorl %eax, %eax
callq 0xb593
movq %rbx, %rdi
movq %rax, %rsi
movl $0x121, %edx            # imm = 0x121
callq 0x1567f