// File: /workspace/github_c_makefile_star2_O3/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 0x58e3
movq %r14, %rax
addl 0x28(%rax), %ebp
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x58d7
xorl %eax, %eax
callq 0xac78
movq %rax, %rdi
movl %ebp, %esi
callq 0xacaf
movq %rax, 0x58(%r12)
leaq 0xd918(%rip), %rbx      # 0x13218
movq (%rbx), %rdi
callq 0x3f3a
movl %eax, 0x28(%r12)
movq (%rbx), %rdi
movq %r12, %rsi
callq 0x3f3e
incl %ebp
movslq %ebp, %rsi
movl $0x1, %edi
callq 0x10d0
movq %rax, %r15
movq %r12, (%rsp)
movq %rax, 0x40(%r12)
testq %r14, %r14
je 0x5a14
leaq 0x7991(%rip), %r12      # 0xd2d4
movq %r14, %r13
cmpl $0x0, 0x28(%r13)
jle 0x5a07
movq 0x20(%r13), %rbp
xorl %ebx, %ebx
movb (%rbp), %al
cmpb $0x5c, %al
jne 0x5987
incl %ebx
movzbl 0x1(%rbp), %eax
addq $0x2, %rbp
cmpl $0x61, %eax
jg 0x599a
cmpl $0x2f, %eax
jle 0x59b4
cmpl $0x30, %eax
je 0x59e0
cmpl $0x5c, %eax
je 0x59ec
cmpl $0x61, %eax
jne 0x59f8
movb $0x7, (%r15)
jmp 0x598d
incq %rbp
movb %al, (%r15)
incq %r15
incl %ebx
cmpl 0x28(%r13), %ebx
jl 0x5957
jmp 0x5a07
cmpl $0x6d, %eax
jle 0x59c4
cmpl $0x6e, %eax
je 0x59e6
cmpl $0x72, %eax
je 0x59f2
cmpl $0x74, %eax
jne 0x59f8
movb $0x9, (%r15)
jmp 0x598d
cmpl $0x22, %eax
je 0x59d4
cmpl $0x27, %eax
jne 0x59f8
movb $0x27, (%r15)
jmp 0x598d
cmpl $0x62, %eax
je 0x59da
cmpl $0x66, %eax
jne 0x59f8
movb $0xc, (%r15)
jmp 0x598d
movb $0x22, (%r15)
jmp 0x598d
movb $0x8, (%r15)
jmp 0x598d
movb $0x0, (%r15)
jmp 0x598d
movb $0xa, (%r15)
jmp 0x598d
movb $0x5c, (%r15)
jmp 0x598d
movb $0xd, (%r15)
jmp 0x598d
movq %r14, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x52cd
jmp 0x5990
movq 0x8(%r13), %r13
testq %r13, %r13
jne 0x5946
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