// File: /workspace/github_c_makefile_star2_O2/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), %ecx
cmpl $0x1, %ecx
jg 0x1b2a
movslq %ecx, %rax
imulq $0xc, %rax, %r15
movq (%rbx), %rdi
callq 0x18fc
movq %rax, (%r14,%r15)
movb %dl, 0x8(%r14,%r15)
movslq 0x8(%rbx), %rcx
imulq $0xc, %rcx, %rax
cmpl $0x0, (%r14,%rax)
je 0x1b2a
incl %ecx
movl %ecx, 0x8(%rbx)
jmp 0x1af7
cmpl $0x2, %ecx
je 0x1b45
testl %ecx, %ecx
jne 0x1bad
leaq 0x8556(%rip), %rcx      # 0xa090
movq (%rcx), %rax
movb 0x8(%rcx), %dl
jmp 0x1c5c
cmpb $0x2f, 0x10(%rbx)
jne 0x1bad
movzbl 0x1c(%rbx), %eax
cmpl $0x2a, %eax
je 0x1be8
cmpl $0x2f, %eax
jne 0x1bad
movabsq $0xff00000000, %r13     # imm = 0xFF00000000
leaq 0x515f(%rip), %r15      # 0x6ccd
pushq $0x67
popq %rbp
movabsq $0xa00000000, %r14      # imm = 0xA00000000
movq (%rbx), %rdi
callq 0x18fc
movq %rax, %r12
testl %r12d, %r12d
jne 0x1b9e
leaq 0x5135(%rip), %rdi      # 0x6cc7
movl %ebp, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1252
andq %r13, %r12
cmpq %r14, %r12
jne 0x1b7b
pushq $0xa
jmp 0x1c52
movq 0xc(%rbx), %rax
movb 0x14(%rbx), %dl
decl %ecx
movl %ecx, 0x8(%rbx)
xorl %esi, %esi
testl %ecx, %ecx
cmovlel %esi, %ecx
imulq $0xc, %rcx, %rcx
addq $0x18, %rbx
cmpq %rsi, %rcx
je 0x1c5c
movl 0x8(%rbx,%rsi), %edi
movl %edi, -0x4(%rbx,%rsi)
movq (%rbx,%rsi), %rdi
movq %rdi, -0xc(%rbx,%rsi)
addq $0xc, %rsi
jmp 0x1bc8
movabsq $0xff00000000, %r15     # imm = 0xFF00000000
movq (%rbx), %rdi
callq 0x18fc
movq %rax, %r14
movabsq $0x2a00000000, %r12     # imm = 0x2A00000000
movabsq $0x2f00000000, %rbp     # imm = 0x2F00000000
movq (%rbx), %rdi
callq 0x18fc
movq %rax, %r13
testl %r13d, %r13d
jne 0x1c39
leaq 0x509f(%rip), %rdi      # 0x6cc7
pushq $0x75
popq %rsi
leaq 0x50d0(%rip), %rdx      # 0x6d02
xorl %eax, %eax
callq 0x1252
andq %r15, %r14
xorq %r12, %r14
movq %r13, %rax
andq %r15, %rax
xorq %rbp, %rax
orq %r14, %rax
movq %r13, %r14
jne 0x1c11
pushq $0x20
popq %rdi
callq 0x1539
andl $0x0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq