// File: /workspace/github_c_makefile_star2_O2/sisshiki1969[P]monocc/src/parse.c
// Function: new_node_str
Node *new_node_str(Token *token) {
  Node *node = calloc(1, sizeof(Node));
  node->kind = ND_STR;
  node->token = token;
  int len = 0;
  for (Token *t = token; t; t = t->next) len += t->len;
  node->type = new_type_array(new_type_char(), len);
  node->str_id = vec_len(strings);
  vec_push(strings, node);

  node->label = (char *)calloc(1, len + 1);
  char *dest = node->label;
  for (Token *t = token; t; t = t->next) {
    char *src = t->str;
    for (int i = 0; i < t->len; i++) {
      if (*src != '\\') {
        *dest++ = *src++;
      } else {
        i++;
        src++;
        switch (*src++) {
          case '0':
            *dest++ = '\0';
            break;
          case 'a':
            *dest++ = '\a';
            break;
          case 'b':
            *dest++ = '\b';
            break;
          case 'f':
            *dest++ = '\f';
            break;
          case 'n':
            *dest++ = '\n';
            break;
          case 'r':
            *dest++ = '\r';
            break;
          case 't':
            *dest++ = '\t';
            break;
          case '\\':
            *dest++ = '\\';
            break;
          case '\'':
            *dest++ = '\'';
            break;
          case '\"':
            *dest++ = '\"';
            break;
          default:
            error_at_token(token, "Unsupported escape sequence.");
        }
      }
    }
  }
  *dest = '\0';
  node->offset = (int)(dest - node->label) + 1;

  return node;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x1
popq %rdi
pushq $0x68
popq %rsi
callq 0x10d0
movq %rax, %r12
movl $0x2, (%rax)
movq %r14, 0x50(%rax)
xorl %ebp, %ebp
movq %r14, %rax
testq %rax, %rax
je 0x5274
addl 0x28(%rax), %ebp
movq 0x8(%rax), %rax
jmp 0x5266
xorl %eax, %eax
callq 0x90b4
movq %rax, %rdi
movl %ebp, %esi
callq 0x90e7
movq %rax, 0x58(%r12)
leaq 0xbf87(%rip), %rbx      # 0x11218
movq (%rbx), %rdi
callq 0x34f2
movl %eax, 0x28(%r12)
movq (%rbx), %rdi
movq %r12, %rsi
callq 0x34f6
incl %ebp
movslq %ebp, %rsi
pushq $0x1
popq %rdi
callq 0x10d0
movq %rax, %r15
movq %r12, (%rsp)
movq %rax, 0x40(%r12)
leaq 0x5ff3(%rip), %r12      # 0xb2bc
movq %r14, %r13
testq %r13, %r13
je 0x5389
movq 0x20(%r13), %rbp
xorl %ebx, %ebx
cmpl 0x28(%r13), %ebx
jge 0x5380
movb (%rbp), %al
cmpb $0x5c, %al
jne 0x532e
incl %ebx
movzbl 0x1(%rbp), %eax
addq $0x2, %rbp
cmpl $0x22, %eax
je 0x5374
cmpl $0x27, %eax
je 0x5341
cmpl $0x74, %eax
je 0x537a
cmpl $0x5c, %eax
je 0x5353
cmpl $0x61, %eax
je 0x536e
cmpl $0x62, %eax
je 0x5368
cmpl $0x66, %eax
je 0x533b
cmpl $0x6e, %eax
je 0x534d
cmpl $0x72, %eax
je 0x5347
cmpl $0x30, %eax
jne 0x5359
movb $0x0, (%r15)
jmp 0x5334
incq %rbp
movb %al, (%r15)
incq %r15
incl %ebx
jmp 0x52db
movb $0xc, (%r15)
jmp 0x5334
movb $0x27, (%r15)
jmp 0x5334
movb $0xd, (%r15)
jmp 0x5334
movb $0xa, (%r15)
jmp 0x5334
movb $0x5c, (%r15)
jmp 0x5334
movq %r14, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x48b3
jmp 0x5337
movb $0x8, (%r15)
jmp 0x5334
movb $0x7, (%r15)
jmp 0x5334
movb $0x22, (%r15)
jmp 0x5334
movb $0x9, (%r15)
jmp 0x5334
movq 0x8(%r13), %r13
jmp 0x52cc
movb $0x0, (%r15)
movq (%rsp), %rax
subl 0x40(%rax), %r15d
incl %r15d
movl %r15d, 0x38(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq