// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x20(%rbp), %rax
movb (%rax), %al
movb %al, -0x29(%rbp)
movb $0x0, -0x2a(%rbp)
movb $0x0, -0x2b(%rbp)
movb $0x0, -0x2c(%rbp)
movb $0x0, -0x2d(%rbp)
movl $0x0, -0x34(%rbp)
movsbl -0x29(%rbp), %eax
cmpl $0x0, %eax
je 0x2cc21
callq 0xd700
movq (%rax), %rax
movsbl -0x29(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x2ca90
testb $0x1, -0x2c(%rbp)
jne 0x2ca76
cmpl $0x0, -0x34(%rbp)
je 0x2ca7b
jmp 0x2cc21
movb $0x1, -0x2d(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x2cc07
testb $0x1, -0x2a(%rbp)
jne 0x2cac5
movsbl -0x29(%rbp), %eax
cmpl $0x2e, %eax
jne 0x2cac5
testb $0x1, -0x2c(%rbp)
jne 0x2caab
cmpl $0x0, -0x34(%rbp)
je 0x2cab0
jmp 0x2cc21
movb $0x1, -0x2a(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x2cc05
movsbl -0x29(%rbp), %eax
cmpl $0x66, %eax
jne 0x2caf6
testb $0x1, -0x2a(%rbp)
je 0x2caf6
testb $0x1, -0x2c(%rbp)
jne 0x2cae0
cmpl $0x0, -0x34(%rbp)
je 0x2cae5
jmp 0x2cc21
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x2cc21
movsbl -0x29(%rbp), %eax
cmpl $0x2d, %eax
jne 0x2cb1a
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jne 0x2cb1a
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x2cc01
movsbl -0x29(%rbp), %eax
cmpl $0x78, %eax
jne 0x2cb49
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0x2cb49
movb $0x1, -0x2b(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x2cbff
movsbl -0x29(%rbp), %eax
cmpl $0x75, %eax
je 0x2cb5b
movsbl -0x29(%rbp), %eax
cmpl $0x55, %eax
jne 0x2cb76
testb $0x1, -0x2c(%rbp)
jne 0x2cb76
movb $0x1, -0x2c(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x2cbfd
movsbl -0x29(%rbp), %eax
cmpl $0x6c, %eax
je 0x2cb88
movsbl -0x29(%rbp), %eax
cmpl $0x4c, %eax
jne 0x2cba5
cmpl $0x2, -0x34(%rbp)
jge 0x2cba5
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x2cbfb
testb $0x1, -0x2b(%rbp)
je 0x2cbf7
testb $0x1, -0x2c(%rbp)
jne 0x2cbb7
cmpl $0x0, -0x34(%rbp)
je 0x2cbb9
jmp 0x2cc21
movb $0x0, -0x35(%rbp)
movsbl -0x29(%rbp), %eax
movl %eax, -0x44(%rbp)
addl $-0x41, %eax
subl $0x6, %eax
jb 0x2cbdd
jmp 0x2cbce
movl -0x44(%rbp), %eax
addl $-0x61, %eax
subl $0x6, %eax
jb 0x2cbdd
jmp 0x2cbdb
jmp 0x2cbed
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movb $0x1, -0x35(%rbp)
testb $0x1, -0x35(%rbp)
jne 0x2cbf5
jmp 0x2cc21
jmp 0x2cbf9
jmp 0x2cc21
jmp 0x2cbfb
jmp 0x2cbfd
jmp 0x2cbff
jmp 0x2cc01
jmp 0x2cc03
jmp 0x2cc05
jmp 0x2cc07
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb (%rax), %al
movb %al, -0x29(%rbp)
jmp 0x2ca40
cmpq $0x1, -0x28(%rbp)
jne 0x2cc4a
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x2cc40
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x2cc4a
movq $0x0, -0x8(%rbp)
jmp 0x2ccb4
testb $0x1, -0x2d(%rbp)
jne 0x2cc5a
movq $0x0, -0x8(%rbp)
jmp 0x2ccb4
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
jbe 0x2ccac
movq -0x10(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %edi
callq 0x2fcf0
testb $0x1, %al
jne 0x2cca0
callq 0xd700
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x2ccaa
movq $0x0, -0x8(%rbp)
jmp 0x2ccb4
jmp 0x2ccac
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nop