// File: /workspace/github_c_makefile_star2_O3/ShinyaKato[P]skcc/lex.c
// Function: remove_comment
struct utf8c remove_comment(struct pp_token_lexer *lexer) {
  for(; lexer->comment_queue_size < 2; lexer->comment_queue_size++) {
    lexer->comment_queue[lexer->comment_queue_size] = next_source_char(lexer->src);
    if(lexer->comment_queue[lexer->comment_queue_size].bytes == 0) {
      break;
    }
  }

  if(lexer->comment_queue_size == 0) {
    return ueof;
  }

  if(lexer->comment_queue_size == 2) {
    if(lexer->comment_queue[0].sequence[0] == '/') {
      if(lexer->comment_queue[1].sequence[0] == '/') {
        while(1) {
          struct utf8c uc = next_source_char(lexer->src);
          if(uc.bytes == 0) {
            error("reached end of file while removing \"//...\" comment.\n");
          }
          if(uc.sequence[0] == '\n') {
            break;
          }
        }
        struct utf8c uc = single_byte_char('\n');
        lexer->comment_queue_size = 0;
        return uc;
      } else if(lexer->comment_queue[1].sequence[0] == '*') {
        struct utf8c last = next_source_char(lexer->src);
        while(1) {
          struct utf8c uc = next_source_char(lexer->src);
          if(uc.bytes == 0) {
            error("reached end of file while removing \"/* ... */\" comment.\n");
          }
          if(last.sequence[0] == '*' && uc.sequence[0] == '/') {
            break;
          }
          last = uc;
        }
        struct utf8c uc = single_byte_char(' ');
        lexer->comment_queue_size = 0;
        return uc;
      }
    }
  }

  struct utf8c uc = lexer->comment_queue[0];
  lexer->comment_queue_size--;
  for(int i = 0; i < lexer->comment_queue_size; i++) {
    lexer->comment_queue[i] = lexer->comment_queue[i + 1];
  }
  return uc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xc(%rdi), %r14
movl 0x8(%rdi), %eax
cmpl $0x1, %eax
jg 0x1c3a
cltq
leaq (%rax,%rax,2), %r15
movq (%rbx), %rdi
callq 0x19fb
movq %rax, (%r14,%r15,4)
movb %dl, 0x8(%r14,%r15,4)
movslq 0x8(%rbx), %rcx
leaq (%rcx,%rcx,2), %rax
cmpl $0x0, (%r14,%rax,4)
je 0x1c38
leal 0x1(%rcx), %eax
movl %eax, 0x8(%rbx)
testl %ecx, %ecx
jle 0x1c06
jmp 0x1c3a
movl %ecx, %eax
cmpl $0x2, %eax
je 0x1c5a
testl %eax, %eax
jne 0x1ccc
leaq 0x944a(%rip), %rax      # 0xb098
movq (%rax), %r15
movb 0x8(%rax), %bpl
jmp 0x1d94
cmpb $0x2f, 0x10(%rbx)
jne 0x1ce4
movzbl 0x1c(%rbx), %ecx
cmpl $0x2a, %ecx
je 0x1d14
cmpl $0x2f, %ecx
jne 0x1ce4
movabsq $0xff00000000, %r13     # imm = 0xFF00000000
leaq 0x6040(%rip), %r14      # 0x7cc7
leaq 0x603f(%rip), %r15      # 0x7ccd
movabsq $0xa00000000, %rbp      # imm = 0xA00000000
movq (%rbx), %rdi
callq 0x19fb
movq %rax, %r12
testl %r12d, %r12d
jne 0x1cba
movq %r14, %rdi
movl $0x67, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x142c
andq %r13, %r12
cmpq %rbp, %r12
jne 0x1c98
movl $0xa, %edi
jmp 0x1d83
movq 0xc(%rbx), %r15
movb 0x14(%rbx), %bpl
leal -0x1(%rax), %ecx
movl %ecx, 0x8(%rbx)
cmpl $0x2, %eax
jge 0x1cf6
jmp 0x1d94
movq 0xc(%rbx), %r15
movb 0x14(%rbx), %bpl
decl %eax
movl %eax, 0x8(%rbx)
movl $0x1, %ecx
addq $0x18, %rbx
movl %ecx, %eax
shlq $0x2, %rax
leaq (%rax,%rax,2), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10c0
jmp 0x1d94
movabsq $0xff00000000, %rbp     # imm = 0xFF00000000
movq (%rbx), %rdi
callq 0x19fb
movq %rax, %r14
movabsq $0x2a00000000, %r15     # imm = 0x2A00000000
movabsq $0x2f00000000, %r12     # imm = 0x2F00000000
movq (%rbx), %rdi
callq 0x19fb
movq %rax, %r13
testl %r13d, %r13d
jne 0x1d67
leaq 0x5f73(%rip), %rdi      # 0x7cc7
movl $0x75, %esi
leaq 0x5fa2(%rip), %rdx      # 0x7d02
xorl %eax, %eax
callq 0x142c
andq %rbp, %r14
xorq %r15, %r14
movq %r13, %rax
andq %rbp, %rax
xorq %r12, %rax
orq %r14, %rax
movq %r13, %r14
jne 0x1d3d
movl $0x20, %edi
callq 0x15f9
movq %rax, %r15
movl %edx, %ebp
movl $0x0, 0x8(%rbx)
movq %r15, %rax
movl %ebp, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq