// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq 0x151d9(%rip), %rax     # 0x17618
cmpl $0x4, 0x8(%rax)
jne 0x248a
movq 0x151cc(%rip), %rax     # 0x17618
movq 0x10(%rax), %rdi
leaq 0xfbb5(%rip), %rsi      # 0x1200c
callq 0xfca0
cmpl $0x0, %eax
je 0x248a
callq 0x2650
leaq 0xfba6(%rip), %rdi      # 0x12013
movl $0x2, %esi
callq 0x26d0
movq 0x10(%rax), %rdi
callq 0x2680
callq 0x2430
jmp 0x263d
movq 0x15187(%rip), %rax     # 0x17618
cmpl $0x4, 0x8(%rax)
jne 0x24f2
movq 0x1517a(%rip), %rax     # 0x17618
movq 0x10(%rax), %rdi
leaq 0xfb75(%rip), %rsi      # 0x1201e
callq 0xfca0
cmpl $0x0, %eax
je 0x24f2
movq 0x1515e(%rip), %rax     # 0x17618
movq 0x18(%rax), %rdi
callq 0x2730
movq %rax, %rdi
callq 0xedc0
movq %rax, -0x8(%rbp)
movq 0x15142(%rip), %rax     # 0x17618
movq (%rax), %rsi
leaq -0x8(%rbp), %rdi
callq 0x2760
movq -0x8(%rbp), %rax
movq %rax, 0x1512b(%rip)     # 0x17618
jmp 0x263b
movq 0x1511f(%rip), %rax     # 0x17618
cmpl $0x4, 0x8(%rax)
jne 0x254c
movq 0x15112(%rip), %rax     # 0x17618
movq 0x10(%rax), %rdi
leaq 0xfb15(%rip), %rsi      # 0x12026
callq 0xfca0
cmpl $0x0, %eax
je 0x254c
callq 0x2650
leaq 0xfaec(%rip), %rdi      # 0x12013
movl $0x2, %esi
callq 0x26d0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x27a0
testb $0x1, %al
jne 0x2547
callq 0x2810
jmp 0x2639
movq 0x150c5(%rip), %rax     # 0x17618
cmpl $0x4, 0x8(%rax)
jne 0x25a8
movq 0x150b8(%rip), %rax     # 0x17618
movq 0x10(%rax), %rdi
leaq 0xfac1(%rip), %rsi      # 0x1202c
callq 0xfca0
cmpl $0x0, %eax
je 0x25a8
callq 0x2650
leaq 0xfa92(%rip), %rdi      # 0x12013
movl $0x2, %esi
callq 0x26d0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x27a0
testb $0x1, %al
jne 0x259e
jmp 0x25a3
callq 0x2810
jmp 0x2637
movq 0x15069(%rip), %rax     # 0x17618
cmpl $0x4, 0x8(%rax)
jne 0x25d8
movq 0x1505c(%rip), %rax     # 0x17618
movq 0x10(%rax), %rdi
leaq 0xfa6c(%rip), %rsi      # 0x12033
callq 0xfca0
cmpl $0x0, %eax
je 0x25d8
callq 0x2650
jmp 0x2635
movq 0x15039(%rip), %rdi     # 0x17618
callq 0x27a0
testb $0x1, %al
jne 0x25ea
jmp 0x260e
leaq 0xfa22(%rip), %rdi      # 0x12013
movl $0x2, %esi
callq 0x26d0
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2880
jmp 0x2633
movq 0x15003(%rip), %rdi     # 0x17618
callq 0x28d0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rsi
leaq 0x14fff(%rip), %rdi     # 0x17628
callq 0x2760
callq 0x2650
jmp 0x2635
jmp 0x2637
jmp 0x2639
jmp 0x263b
jmp 0x263d
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)