// File: /workspace/github_c_makefile_star2_O1/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 0x1c0e
cltq
leaq (%rax,%rax,2), %r15
movq (%rbx), %rdi
callq 0x19e3
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 0x1c0e
leal 0x1(%rcx), %eax
movl %eax, 0x8(%rbx)
testl %ecx, %ecx
jle 0x1bde
movl 0x8(%rbx), %eax
cmpl $0x2, %eax
je 0x1c31
testl %eax, %eax
jne 0x1c9f
leaq 0x9473(%rip), %rax      # 0xb098
movq (%rax), %r15
movb 0x8(%rax), %bpl
jmp 0x1d59
cmpb $0x2f, 0x10(%rbx)
jne 0x1c9f
movzbl 0x1c(%rbx), %ecx
cmpl $0x2a, %ecx
je 0x1cd4
cmpl $0x2f, %ecx
jne 0x1c9f
movabsq $0xff00000000, %r13     # imm = 0xFF00000000
leaq 0x5f8d(%rip), %r14      # 0x7be7
leaq 0x5f8c(%rip), %r15      # 0x7bed
movabsq $0xa00000000, %rbp      # imm = 0xA00000000
movq (%rbx), %rdi
callq 0x19e3
movq %rax, %r12
testl %r12d, %r12d
jne 0x1c8d
movq %r14, %rdi
movl $0x67, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x140c
andq %r13, %r12
cmpq %rbp, %r12
jne 0x1c6b
movl $0xa, %edi
jmp 0x1d48
movq 0xc(%rbx), %r15
movb 0x14(%rbx), %bpl
leal -0x1(%rax), %ecx
movl %ecx, 0x8(%rbx)
cmpl $0x2, %eax
jl 0x1d59
addq $0x18, %rbx
movl %ecx, %eax
shlq $0x2, %rax
leaq (%rax,%rax,2), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10c0
jmp 0x1d59
movabsq $0xff00000000, %rbp     # imm = 0xFF00000000
movq (%rbx), %rdi
callq 0x19e3
movq %rax, %r15
movabsq $0x2a00000000, %r14     # imm = 0x2A00000000
movabsq $0x2f00000000, %r12     # imm = 0x2F00000000
movq (%rbx), %rdi
callq 0x19e3
movq %rax, %r13
testl %r13d, %r13d
jne 0x1d27
leaq 0x5ed3(%rip), %rdi      # 0x7be7
movl $0x75, %esi
leaq 0x5f02(%rip), %rdx      # 0x7c22
xorl %eax, %eax
callq 0x140c
movq %r15, %rax
andq %rbp, %rax
xorq %r14, %rax
movq %r13, %rcx
andq %rbp, %rcx
xorq %r12, %rcx
orq %rax, %rcx
je 0x1d41
movq %r13, %r15
jne 0x1cfd
movl $0x20, %edi
callq 0x15d9
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