// File: /workspace/github_c_makefile_star2_O2/takoeight0821[P]hoc_nyan/src/cpp.c
// Function: traverse
static void traverse(void) {
  if (input->tag == TDIRECTIVE && streq(input->ident, "define")) {
    consume();
    read_define(expect("macro name", TIDENT)->ident);
    traverse();
  } else if (input->tag == TDIRECTIVE && streq(input->ident, "include")) {
    Token* included = lex(include_path(input->str));
    append(&included, input->next);
    input = included;
  } else if (input->tag == TDIRECTIVE && streq(input->ident, "ifdef")) {
    consume();
    Token* tag = expect("macro name", TIDENT);
    if (!is_macro(tag)) {
      skip_to_endif();
    }
  } else if (input->tag == TDIRECTIVE && streq(input->ident, "ifndef")) {
    consume();
    Token* tag = expect("macro name", TIDENT);
    if (is_macro(tag)) {
      skip_to_endif();
    }
  } else if (input->tag == TDIRECTIVE && streq(input->ident, "endif")) {
    consume();
  } else if (is_macro(input)) {
    // TODO: 関数マクロの仮引数名と実引数が同じだと無限ループする
    char* name = expect("macro name", TIDENT)->ident;
    apply(name);
  } else {
    Token* new = copy_token(input);
    append(&output, new);
    consume();
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x9c6c(%rip), %r13      # 0xc00c
leaq 0xaf4b(%rip), %r12      # 0xd2f2
leaq 0x9c8b(%rip), %r14      # 0xc039
leaq 0x9c99(%rip), %r15      # 0xc04e
movq 0xfd34(%rip), %rdi      # 0x120f0
cmpl $0x4, 0x8(%rdi)
jne 0x265b
movq 0x10(%rdi), %rdi
movq %r13, %rsi
callq 0xaa3e
movq 0xfd17(%rip), %rdi      # 0x120f0
testl %eax, %eax
je 0x251c
testq %rdi, %rdi
je 0x23f0
movq (%rdi), %rax
movq %rax, 0xfd00(%rip)      # 0x120f0
leaq 0x9c1c(%rip), %rdi      # 0xc013
callq 0x2931
movq 0x10(%rax), %rbp
movq 0xfce9(%rip), %rdi      # 0x120f0
leaq 0xb444(%rip), %rsi      # 0xd852
callq 0xab1d
testb %al, %al
je 0x24ad
movq 0xfcce(%rip), %rax      # 0x120f0
testq %rax, %rax
je 0x2431
movq (%rax), %rax
movq %rax, 0xfcbf(%rip)      # 0x120f0
xorl %eax, %eax
callq 0x229c
movq %rax, %r13
movq 0xfcae(%rip), %rsi      # 0x120f0
movq %rsi, %rdi
movq %r12, %rsi
callq 0xab1d
testb %al, %al
jne 0x24ca
movq %r14, %rdi
callq 0x2931
movq 0x10(%rax), %rsi
movq %r13, %rdi
callq 0x22c6
movq 0xfc84(%rip), %rdi      # 0x120f0
movq %r15, %rsi
callq 0xab1d
movq 0xfc75(%rip), %rdi      # 0x120f0
testb %al, %al
je 0x2495
movl $0x0, %esi
testq %rdi, %rdi
je 0x2442
movq (%rdi), %rsi
movq %rsi, 0xfc5d(%rip)      # 0x120f0
jmp 0x2442
movq %r12, %rsi
callq 0xab1d
movq 0xfc4c(%rip), %rsi      # 0x120f0
testb %al, %al
jne 0x2442
jmp 0x27a4
callq 0x2a2d
movq %rax, %rbx
pushq $0x1
popq %rdi
pushq $0x20
popq %rsi
callq 0x20f0
movq %rbp, 0x8(%rax)
movq %rbx, 0x10(%rax)
jmp 0x2506
movq 0xfc1f(%rip), %rax      # 0x120f0
testq %rax, %rax
je 0x24e0
movq (%rax), %rax
movq %rax, 0xfc10(%rip)      # 0x120f0
callq 0x2a2d
movq %rax, %rbx
pushq $0x1
popq %rdi
pushq $0x20
popq %rsi
callq 0x20f0
movq %rbp, 0x8(%rax)
movq %rbx, 0x10(%rax)
movq %r13, 0x18(%rax)
leaq 0x9b06(%rip), %r13      # 0xc00c
movq 0xfbdb(%rip), %rcx      # 0x120e8
movq %rcx, (%rax)
movq %rax, 0xfbd1(%rip)      # 0x120e8
jmp 0x23b5
cmpl $0x4, 0x8(%rdi)
jne 0x265b
movq 0x10(%rdi), %rdi
leaq 0x9aed(%rip), %rsi      # 0xc01e
callq 0xaa3e
movq 0xfbb3(%rip), %rdi      # 0x120f0
testl %eax, %eax
je 0x2579
movq 0x18(%rdi), %rdx
movq 0xfbac(%rip), %rsi      # 0x120f8
leaq 0x9b09(%rip), %rdi      # 0xc05c
xorl %eax, %eax
callq 0xa84a
movq %rax, %rdi
callq 0xa132
leaq 0x8(%rsp), %rbx
movq %rax, (%rbx)
movq 0xfb7f(%rip), %rax      # 0x120f0
movq (%rax), %rsi
jmp 0x27fa
cmpl $0x4, 0x8(%rdi)
jne 0x265b
movq 0x10(%rdi), %rdi
leaq 0x9a98(%rip), %rsi      # 0xc026
callq 0xaa3e
movq 0xfb56(%rip), %rdi      # 0x120f0
testl %eax, %eax
je 0x25dc
testq %rdi, %rdi
je 0x25ad
movq (%rdi), %rax
movq %rax, 0xfb43(%rip)      # 0x120f0
leaq 0x9a5f(%rip), %rdi      # 0xc013
callq 0x2931
movq %rax, %rdi
callq 0x2961
testb %al, %al
jne 0x290f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x299d
cmpl $0x4, 0x8(%rdi)
jne 0x265b
movq 0x10(%rdi), %rdi
leaq 0x9a3f(%rip), %rsi      # 0xc02c
callq 0xaa3e
movq 0xfaf7(%rip), %rdi      # 0x120f0
testl %eax, %eax
je 0x2629
testq %rdi, %rdi
je 0x260c
movq (%rdi), %rax
movq %rax, 0xfae4(%rip)      # 0x120f0
leaq 0x9a00(%rip), %rdi      # 0xc013
callq 0x2931
movq %rax, %rdi
callq 0x2961
testb %al, %al
jne 0x25c9
jmp 0x290f
cmpl $0x4, 0x8(%rdi)
jne 0x265b
movq 0x10(%rdi), %rdi
leaq 0x99f9(%rip), %rsi      # 0xc033
callq 0xaa3e
movq 0xfaaa(%rip), %rdi      # 0x120f0
testl %eax, %eax
je 0x265b
testq %rdi, %rdi
je 0x290f
movq (%rdi), %rax
jmp 0x2908
callq 0x2961
testb %al, %al
je 0x27b0
leaq 0x99a4(%rip), %rdi      # 0xc013
callq 0x2931
movq 0x10(%rax), %rbp
movq 0xfa71(%rip), %rdi      # 0x120f0
testq %rdi, %rdi
je 0x27e3
leaq 0xb1c3(%rip), %rsi      # 0xd852
callq 0xab1d
testb %al, %al
je 0x27e3
movq 0xfa4d(%rip), %rax      # 0x120f0
testq %rax, %rax
je 0x26b2
movq (%rax), %rax
movq %rax, 0xfa3e(%rip)      # 0x120f0
xorl %eax, %eax
callq 0x229c
movq %rax, %r14
movq 0xfa2d(%rip), %rsi      # 0x120f0
leaq 0xac28(%rip), %r15      # 0xd2f2
leaq 0x997d(%rip), %r12      # 0xc04e
leaq 0x8(%rsp), %r13
movq %rsi, %rdi
movq %r15, %rsi
callq 0xab1d
testb %al, %al
jne 0x280a
andq $0x0, 0x8(%rsp)
movq 0xf9fa(%rip), %rdi      # 0x120f0
movq %r15, %rsi
callq 0xab1d
testb %al, %al
jne 0x2749
movq 0xf9e7(%rip), %rdi      # 0x120f0
movq %r12, %rsi
callq 0xab1d
testb %al, %al
jne 0x2749
movq 0xf9d4(%rip), %rdi      # 0x120f0
callq 0x29fa
movq %r13, %rdi
movq %rax, %rsi
callq 0x2952
movq 0xf9bd(%rip), %rax      # 0x120f0
movl $0x0, %edi
testq %rax, %rax
je 0x26f6
movq (%rax), %rdi
movq %rdi, 0xf9a9(%rip)      # 0x120f0
jmp 0x26f6
movq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x22c6
movq 0xf993(%rip), %rdi      # 0x120f0
movq %r12, %rsi
callq 0xab1d
movq 0xf984(%rip), %rdi      # 0x120f0
testb %al, %al
je 0x278d
movl $0x0, %esi
testq %rdi, %rdi
je 0x26d6
movq (%rdi), %rsi
movq %rsi, 0xf968(%rip)      # 0x120f0
jmp 0x26d6
movq %r15, %rsi
callq 0xab1d
movq 0xf954(%rip), %rsi      # 0x120f0
testb %al, %al
jne 0x26d6
leaq 0x989e(%rip), %rdi      # 0xc049
callq 0x2a6a
movq 0xf939(%rip), %rdi      # 0x120f0
callq 0x29fa
leaq 0xf93d(%rip), %rdi      # 0x12100
movq %rax, %rsi
callq 0x2952
movq 0xf91e(%rip), %rax      # 0x120f0
testq %rax, %rax
je 0x290f
movq (%rax), %rax
jmp 0x2908
movq %rbp, %rdi
callq 0x2a8a
leaq 0x8(%rsp), %rbx
movq %rax, (%rbx)
movq 0xf8f6(%rip), %rsi      # 0x120f0
movq %rbx, %rdi
callq 0x2952
movq (%rbx), %rax
jmp 0x2908
movq 0xf8df(%rip), %rax      # 0x120f0
testq %rax, %rax
je 0x2820
movq (%rax), %rax
movq %rax, 0xf8d0(%rip)      # 0x120f0
leaq 0xf8c1(%rip), %rbx      # 0x120e8
xorl %r13d, %r13d
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x2848
movq 0x8(%rbx), %rsi
movq %rbp, %rdi
callq 0xaa3e
testl %eax, %eax
je 0x282a
movq 0x18(%rbx), %r13
jmp 0x282a
movq %rbp, 0x10(%rsp)
testq %r13, %r13
je 0x291e
movq 0x10(%r13), %rbp
xorl %r15d, %r15d
pushq $0x20
popq %r12
xorl %ebx, %ebx
cmpq %r15, %rbp
je 0x2895
pushq $0x1
popq %rdi
movq %r12, %rsi
callq 0x20f0
movq (%r13), %rcx
movq (%rcx,%r15,8), %rcx
movq %rcx, 0x8(%rax)
movq (%r14), %rcx
movq (%rcx,%r15,8), %rcx
movq %rcx, 0x10(%rax)
movq %rbx, (%rax)
incq %r15
movq %rax, %rbx
jmp 0x2863
movq 0x10(%rsp), %rdi
callq 0x2a8a
movq 0xf842(%rip), %r12      # 0x120e8
movq 0xf843(%rip), %r15      # 0x120f0
movq 0xf84c(%rip), %r13      # 0x12100
movq %rbx, 0xf82d(%rip)      # 0x120e8
movq %rax, 0xf82e(%rip)      # 0x120f0
andq $0x0, 0xf836(%rip)      # 0x12100
testq %rax, %rax
je 0x28dd
callq 0x238b
movq 0xf815(%rip), %rax      # 0x120f0
jmp 0x28ca
movq 0xf81c(%rip), %rax      # 0x12100
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %r12, 0xf7f5(%rip)      # 0x120e8
movq %r13, 0xf806(%rip)      # 0x12100
movq %r14, %rdi
movq %r15, %rsi
callq 0x2952
movq (%r14), %rax
movq %rax, 0xf7e1(%rip)      # 0x120f0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x973d(%rip), %rdi      # 0xc062
movq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0xa90e