// File: /workspace/github_c_makefile_star2_O0/tylerneylon[P]APIsWithLua/lua/lobject.c
// Function: luaO_chunkid
void luaO_chunkid (char *out, const char *source, size_t bufflen) {
  size_t l = strlen(source);
  if (*source == '=') {  /* 'literal' source */
    if (l <= bufflen)  /* small enough? */
      memcpy(out, source + 1, l * sizeof(char));
    else {  /* truncate it */
      addstr(out, source + 1, bufflen - 1);
      *out = '\0';
    }
  }
  else if (*source == '@') {  /* file name */
    if (l <= bufflen)  /* small enough? */
      memcpy(out, source + 1, l * sizeof(char));
    else {  /* add '...' before rest of name */
      addstr(out, RETS, LL(RETS));
      bufflen -= LL(RETS);
      memcpy(out, source + 1 + l - bufflen, bufflen * sizeof(char));
    }
  }
  else {  /* string; format as [string "source"] */
    const char *nl = strchr(source, '\n');  /* find first new line (if any) */
    addstr(out, PRE, LL(PRE));  /* add prefix */
    bufflen -= LL(PRE RETS POS) + 1;  /* save space for prefix+suffix+'\0' */
    if (l < bufflen && nl == NULL) {  /* small one-line source? */
      addstr(out, source, l);  /* keep it */
    }
    else {
      if (nl != NULL) l = nl - source;  /* stop at first newline */
      if (l > bufflen) l = bufflen;
      addstr(out, source, l);
      addstr(out, RETS, LL(RETS));
    }
    memcpy(out, POS, (LL(POS) + 1) * sizeof(char));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5150
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3d, %eax
jne 0x115db
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
ja 0x115a2
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x1, %rsi
movq -0x20(%rbp), %rdx
shlq $0x0, %rdx
callq 0x5300
jmp 0x115d6
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x1, %rsi
movq -0x18(%rbp), %rdx
subq $0x1, %rdx
shlq $0x0, %rdx
callq 0x5300
movq -0x18(%rbp), %rax
subq $0x1, %rax
addq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
jmp 0x11760
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
jne 0x11666
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
ja 0x1160c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x1, %rsi
movq -0x20(%rbp), %rdx
shlq $0x0, %rdx
callq 0x5300
jmp 0x11661
movq -0x8(%rbp), %rax
movw 0x24010(%rip), %cx      # 0x35627
movw %cx, (%rax)
movb 0x24009(%rip), %cl      # 0x35629
movb %cl, 0x2(%rax)
movq -0x8(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x8(%rbp)
movq -0x18(%rbp), %rax
subq $0x3, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x1, %rsi
addq -0x20(%rbp), %rsi
xorl %eax, %eax
subq -0x18(%rbp), %rax
addq %rax, %rsi
movq -0x18(%rbp), %rdx
shlq $0x0, %rdx
callq 0x5300
jmp 0x1175e
movq -0x10(%rbp), %rdi
movl $0xa, %esi
callq 0x5170
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x2359e(%rip), %rcx     # 0x34c21
movq %rcx, (%rax)
movb 0x2359d(%rip), %cl      # 0x34c29
movb %cl, 0x8(%rax)
movq -0x8(%rbp), %rax
addq $0x9, %rax
movq %rax, -0x8(%rbp)
movq -0x18(%rbp), %rax
subq $0xf, %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x116db
cmpq $0x0, -0x28(%rbp)
jne 0x116db
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
shlq $0x0, %rdx
callq 0x5300
movq -0x20(%rbp), %rax
addq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x11747
cmpq $0x0, -0x28(%rbp)
je 0x116f1
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jbe 0x11703
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
shlq $0x0, %rdx
callq 0x5300
movq -0x20(%rbp), %rax
addq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw 0x23ef8(%rip), %cx      # 0x35627
movw %cx, (%rax)
movb 0x23ef1(%rip), %cl      # 0x35629
movb %cl, 0x2(%rax)
movq -0x8(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw 0x234d9(%rip), %cx      # 0x34c2b
movw %cx, (%rax)
movb 0x234d2(%rip), %cl      # 0x34c2d
movb %cl, 0x2(%rax)
jmp 0x11760
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)