// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_syntax.c
// Function: match_c_literal
static int64_t match_c_literal(const char* str, const char* beginning_of_line){
     const char* itr = str;
     int64_t count = 0;
     char ch = *itr;
     bool seen_decimal = false;
     bool seen_hex = false;
     bool seen_u = false;
     bool seen_digit = false;
     int seen_l = 0;

     while(ch != 0){
          if(isdigit((int)(ch))){
               if(seen_u || seen_l) break;
               seen_digit = true;
               count++;
          }else if(!seen_decimal && ch == '.'){
               if(seen_u || seen_l) break;
               seen_decimal = true;
               count++;
          }else if(ch == 'f' && seen_decimal){
               if(seen_u || seen_l) break;
               count++;
               break;
          }else if(ch == '-' && itr == str){
               count++;
          }else if(ch == 'x' && itr == (str + 1)){
               seen_hex = true;
               count++;
          }else if((ch == 'u' || ch == 'U') && !seen_u){
               seen_u = true;
               count++;
          }else if((ch == 'l' || ch == 'L') && seen_l < 2){
               seen_l++;
               count++;
          }else if(seen_hex){
               if(seen_u || seen_l) break;

               bool valid_hex_char = false;

               switch(ch){
               default:
                    break;
               case 'a':
               case 'b':
               case 'c':
               case 'd':
               case 'e':
               case 'f':
               case 'A':
               case 'B':
               case 'C':
               case 'D':
               case 'E':
               case 'F':
                    count++;
                    valid_hex_char = true;
                    break;
               }

               if(!valid_hex_char) break;
          }else{
               break;
          }

          itr++;
          ch = *itr;
     }

     if(count == 1 && (str[0] == '-' || str[0] == '.')) return 0;
     if(!seen_digit) return 0;

     // check if the previous character is not a delimiter
     if(str > beginning_of_line){
          const char* prev = str - 1;
          if(is_caps_var_char(*prev) || isalpha((int)(*prev))) return 0;
     }

     return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x10(%rsp)
movq %rdi, %r14
xorl %ebx, %ebx
xorl %r15d, %r15d
movq $0x0, 0x8(%rsp)
xorl %r13d, %r13d
movq $0x0, (%rsp)
xorl %ebp, %ebp
movsbq (%r14,%rbx), %r12
testq %r12, %r12
je 0x1e8bf
callq 0xd720
movq (%rax), %rax
testb $0x8, 0x1(%rax,%r12,2)
jne 0x1e81f
cmpb $0x2e, %r12b
setne %al
orb %r15b, %al
testb $0x1, %al
je 0x1e83b
cmpb $0x66, %r12b
setne %al
movl %r15d, %ecx
notb %cl
orb %al, %cl
testb $0x1, %cl
je 0x1e8ad
cmpb $0x2d, %r12b
sete %al
testq %rbx, %rbx
sete %cl
testb %al, %cl
jne 0x1e84a
cmpb $0x78, %r12b
sete %al
cmpq $0x1, %rbx
sete %cl
testb %al, %cl
je 0x1e852
movb $0x1, %al
movq %rax, 0x8(%rsp)
jmp 0x1e84a
testb $0x1, %r13b
jne 0x1e8bf
testl %ebp, %ebp
jne 0x1e8bf
xorl %ebp, %ebp
movb $0x1, %al
movq %rax, (%rsp)
jmp 0x1e84a
testb $0x1, %r13b
jne 0x1e8bf
testl %ebp, %ebp
jne 0x1e8bf
xorl %ebp, %ebp
movb $0x1, %r15b
incq %rbx
jmp 0x1e7b0
movl %r12d, %eax
andb $-0x21, %al
cmpb $0x55, %al
jne 0x1e868
movb $0x1, %al
testb $0x1, %r13b
jne 0x1e87e
movb $0x1, %r13b
jmp 0x1e84a
cmpb $0x4c, %al
sete %al
cmpl $0x2, %ebp
setl %cl
testb %cl, %al
je 0x1e87b
incl %ebp
jmp 0x1e84a
movl %r13d, %eax
testb $0x1, 0x8(%rsp)
je 0x1e8bf
testb $0x1, %al
jne 0x1e8bf
testl %ebp, %ebp
jne 0x1e8bf
movzbl %r12b, %eax
addl $-0x41, %eax
cmpl $0x25, %eax
ja 0x1e8bf
xorl %ebp, %ebp
movabsq $0x3f0000003f, %rcx     # imm = 0x3F0000003F
btq %rax, %rcx
jb 0x1e84a
jmp 0x1e8bf
testl %ebp, %ebp
sete %al
notb %r13b
andb %al, %r13b
movzbl %r13b, %eax
addq %rax, %rbx
cmpq $0x1, %rbx
jne 0x1e8d6
movb (%r14), %al
addb $-0x2f, %al
cmpb $-0x2, %al
setb %al
testb %al, (%rsp)
jne 0x1e8dc
jmp 0x1e909
testb $0x1, (%rsp)
je 0x1e909
cmpq 0x10(%rsp), %r14
jbe 0x1e90b
movb -0x1(%r14), %al
movsbl %al, %ecx
leal -0x41(%rcx), %edx
cmpl $0x1a, %edx
setb %dl
cmpb $0x5f, %al
sete %sil
addl $-0x30, %ecx
cmpl $0xa, %ecx
setb %cl
orb %dl, %cl
orb %sil, %cl
je 0x1e91d
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsbq %al, %r14
callq 0xd720
movq (%rax), %rax
xorl %ecx, %ecx
testb $0x4, 0x1(%rax,%r14,2)
cmovneq %rcx, %rbx
jmp 0x1e90b