// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %edi
movl $0x68, %esi
callq 0x10d0
movq %rax, %r12
movl $0x2, (%rax)
movq %r14, 0x50(%rax)
xorl %ebp, %ebp
testq %r14, %r14
je 0x592b
movq %r14, %rax
addl 0x28(%rax), %ebp
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x591f
xorl %eax, %eax
callq 0xada0
movq %rax, %rdi
movl %ebp, %esi
callq 0xadd7
movq %rax, 0x58(%r12)
leaq 0xd8d0(%rip), %rbx      # 0x13218
movq (%rbx), %rdi
callq 0x3f62
movl %eax, 0x28(%r12)
movq (%rbx), %rdi
movq %r12, %rsi
callq 0x3f66
incl %ebp
movslq %ebp, %rsi
movl $0x1, %edi
callq 0x10d0
movq %rax, %r15
movq %r12, (%rsp)
movq %rax, 0x40(%r12)
testq %r14, %r14
je 0x5a5c
leaq 0x790d(%rip), %r12      # 0xd298
movq %r14, %r13
cmpl $0x0, 0x28(%r13)
jle 0x5a4f
movq 0x20(%r13), %rbp
xorl %ebx, %ebx
movb (%rbp), %al
cmpb $0x5c, %al
jne 0x59cf
incl %ebx
movzbl 0x1(%rbp), %eax
addq $0x2, %rbp
cmpl $0x61, %eax
jg 0x59e2
cmpl $0x2f, %eax
jle 0x59fc
cmpl $0x30, %eax
je 0x5a28
cmpl $0x5c, %eax
je 0x5a34
cmpl $0x61, %eax
jne 0x5a40
movb $0x7, (%r15)
jmp 0x59d5
incq %rbp
movb %al, (%r15)
incq %r15
incl %ebx
cmpl 0x28(%r13), %ebx
jl 0x599f
jmp 0x5a4f
cmpl $0x6d, %eax
jle 0x5a0c
cmpl $0x6e, %eax
je 0x5a2e
cmpl $0x72, %eax
je 0x5a3a
cmpl $0x74, %eax
jne 0x5a40
movb $0x9, (%r15)
jmp 0x59d5
cmpl $0x22, %eax
je 0x5a1c
cmpl $0x27, %eax
jne 0x5a40
movb $0x27, (%r15)
jmp 0x59d5
cmpl $0x62, %eax
je 0x5a22
cmpl $0x66, %eax
jne 0x5a40
movb $0xc, (%r15)
jmp 0x59d5
movb $0x22, (%r15)
jmp 0x59d5
movb $0x8, (%r15)
jmp 0x59d5
movb $0x0, (%r15)
jmp 0x59d5
movb $0xa, (%r15)
jmp 0x59d5
movb $0x5c, (%r15)
jmp 0x59d5
movb $0xd, (%r15)
jmp 0x59d5
movq %r14, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x52f9
jmp 0x59d8
movq 0x8(%r13), %r13
testq %r13, %r13
jne 0x598e
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