
/* bool std::(anonymous namespace)::read_bom<char16_t const, false, 2ul>(std::(anonymous
   namespace)::range<char16_t const, false>&, unsigned char const (&) [2ul]) */

bool std::(anonymous_namespace)::read_bom<char16_t_const,false,2ul>
               (range *param_1,unsigned_char *param_2)

{
  short *psVar1;
  
  psVar1 = *(short **)param_1;
  if ((1 < (ulong)(*(long *)(param_1 + 8) - (long)psVar1)) && (*(short *)param_2 == *psVar1)) {
    *(short **)param_1 = psVar1 + 1;
    return true;
  }
  return false;
}



undefined8 FUN_00359410(undefined8 *param_1,short *param_2)

{
  short *psVar1;
  
  psVar1 = (short *)*param_1;
  if ((1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1)) {
    *param_1 = psVar1 + 1;
    return 1;
  }
  return 0;
}


MOV RCX,qword ptr [RDI]
MOV RDX,qword ptr [RDI + 0x8]
XOR EAX,EAX
SUB RDX,RCX
CMP RDX,0x1
JBE 0x0035942a
MOVZX EDX,word ptr [RCX]
CMP word ptr [RSI],DX
JZ 0x00359430
RET
ADD RCX,0x2
MOV EAX,0x1
MOV qword ptr [RDI],RCX
RET
(translation_unit "undefined8 FUN_00359410(undefined8 *param_1,short *param_2)\n\n{\n  short *psVar1;\n  \n  psVar1 = (short *)*param_1;\n  if ((1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1)) {\n    *param_1 = psVar1 + 1;\n    return 1;\n  }\n  return 0;\n}\n\n" (function_definition "undefined8 FUN_00359410(undefined8 *param_1,short *param_2)\n\n{\n  short *psVar1;\n  \n  psVar1 = (short *)*param_1;\n  if ((1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1)) {\n    *param_1 = psVar1 + 1;\n    return 1;\n  }\n  return 0;\n}" type_identifier (function_declarator "FUN_00359410(undefined8 *param_1,short *param_2)" identifier (parameter_list "(undefined8 *param_1,short *param_2)" ( (parameter_declaration "undefined8 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "short *param_2" (sized_type_specifier "short" short) (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  short *psVar1;\n  \n  psVar1 = (short *)*param_1;\n  if ((1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1)) {\n    *param_1 = psVar1 + 1;\n    return 1;\n  }\n  return 0;\n}" { (declaration "short *psVar1;" (sized_type_specifier "short" short) (pointer_declarator "*psVar1" * identifier) ;) (expression_statement "psVar1 = (short *)*param_1;" (assignment_expression "psVar1 = (short *)*param_1" identifier = (cast_expression "(short *)*param_1" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (if_statement "if ((1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1)) {\n    *param_1 = psVar1 + 1;\n    return 1;\n  }" if (parenthesized_expression "((1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1))" ( (binary_expression "(1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1)" (parenthesized_expression "(1 < (ulong)(param_1[1] - (long)psVar1))" ( (binary_expression "1 < (ulong)(param_1[1] - (long)psVar1)" number_literal < (call_expression "(ulong)(param_1[1] - (long)psVar1)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "(param_1[1] - (long)psVar1)" ( (binary_expression "param_1[1] - (long)psVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) - (cast_expression "(long)psVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) )))) )) && (parenthesized_expression "(*param_2 == *psVar1)" ( (binary_expression "*param_2 == *psVar1" (pointer_expression "*param_2" * identifier) == (pointer_expression "*psVar1" * identifier)) ))) )) (compound_statement "{\n    *param_1 = psVar1 + 1;\n    return 1;\n  }" { (expression_statement "*param_1 = psVar1 + 1;" (assignment_expression "*param_1 = psVar1 + 1" (pointer_expression "*param_1" * identifier) = (binary_expression "psVar1 + 1" identifier + number_literal)) ;) (return_statement "return 1;" return number_literal ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "/* bool std::(anonymous namespace)::read_bom<char16_t const, false, 2ul>(std::(anonymous\n   namespace)::range<char16_t const, false>&, unsigned char const (&) [2ul]) */\n\nbool std::(anonymous_namespace)::read_bom<char16_t_const,false,2ul>\n               (range *param_1,unsigned_char *param_2)\n\n{\n  short *psVar1;\n  \n  psVar1 = *(short **)param_1;\n  if ((1 < (ulong)(*(long *)(param_1 + 8) - (long)psVar1)) && (*(short *)param_2 == *psVar1)) {\n    *(short **)param_1 = psVar1 + 1;\n    return true;\n  }\n  return false;\n}\n\n" comment (declaration "bool std::(anonymous_namespace)::read_bom<char16_t_const,false,2ul>\n               (range *param_1,unsigned_char *param_2)\n\n{\n  short *psVar1;" primitive_type (ERROR "std::(anonymous_namespace)::read_bom<" identifier : : ( identifier ) : : identifier <) identifier , identifier , (ERROR "2ul>\n               (range *param_1,unsigned_char *param_2)\n\n{\n  short" number_literal > (parenthesized_declarator "(range *param_1,unsigned_char *param_2)" ( (ERROR "range *param_1,unsigned_char" identifier (pointer_declarator "*param_1" * identifier) , identifier) (pointer_declarator "*param_2" * identifier) )) { short) (pointer_declarator "*psVar1" * identifier) ;) (expression_statement "psVar1 = *(short **)param_1;" (assignment_expression "psVar1 = *(short **)param_1" identifier = (pointer_expression "*(short **)param_1" * (cast_expression "(short **)param_1" ( (type_descriptor "short **" (sized_type_specifier "short" short) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (if_statement "if ((1 < (ulong)(*(long *)(param_1 + 8) - (long)psVar1)) && (*(short *)param_2 == *psVar1)) {\n    *(short **)param_1 = psVar1 + 1;\n    return true;\n  }" if (parenthesized_expression "((1 < (ulong)(*(long *)(param_1 + 8) - (long)psVar1)) && (*(short *)param_2 == *psVar1))" ( (binary_expression "(1 < (ulong)(*(long *)(param_1 + 8) - (long)psVar1)) && (*(short *)param_2 == *psVar1)" (parenthesized_expression "(1 < (ulong)(*(long *)(param_1 + 8) - (long)psVar1))" ( (binary_expression "1 < (ulong)(*(long *)(param_1 + 8) - (long)psVar1)" number_literal < (call_expression "(ulong)(*(long *)(param_1 + 8) - (long)psVar1)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "(*(long *)(param_1 + 8) - (long)psVar1)" ( (binary_expression "*(long *)(param_1 + 8) - (long)psVar1" (pointer_expression "*(long *)(param_1 + 8)" * (cast_expression "(long *)(param_1 + 8)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) - (cast_expression "(long)psVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) )))) )) && (parenthesized_expression "(*(short *)param_2 == *psVar1)" ( (binary_expression "*(short *)param_2 == *psVar1" (pointer_expression "*(short *)param_2" * (cast_expression "(short *)param_2" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) identifier)) == (pointer_expression "*psVar1" * identifier)) ))) )) (compound_statement "{\n    *(short **)param_1 = psVar1 + 1;\n    return true;\n  }" { (expression_statement "*(short **)param_1 = psVar1 + 1;" (assignment_expression "*(short **)param_1 = psVar1 + 1" (pointer_expression "*(short **)param_1" * (cast_expression "(short **)param_1" ( (type_descriptor "short **" (sized_type_specifier "short" short) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = (binary_expression "psVar1 + 1" identifier + number_literal)) ;) (return_statement "return true;" return true ;) })) (return_statement "return false;" return false ;) (ERROR "}" }))
(translation_unit "undefined8 FUN_00359410(undefined8 *param_1,short *param_2)\n\n{\n  short *psVar1;\n  \n  psVar1 = (short *)*param_1;\n  if ((1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1)) {\n    *param_1 = psVar1 + 1;\n    return 1;\n  }\n  return 0;\n}\n\n" (function_definition "undefined8 FUN_00359410(undefined8 *param_1,short *param_2)\n\n{\n  short *psVar1;\n  \n  psVar1 = (short *)*param_1;\n  if ((1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1)) {\n    *param_1 = psVar1 + 1;\n    return 1;\n  }\n  return 0;\n}" type_identifier (function_declarator "FUN_00359410(undefined8 *param_1,short *param_2)" identifier (parameter_list "(undefined8 *param_1,short *param_2)" ( (parameter_declaration "undefined8 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "short *param_2" (sized_type_specifier "short" short) (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  short *psVar1;\n  \n  psVar1 = (short *)*param_1;\n  if ((1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1)) {\n    *param_1 = psVar1 + 1;\n    return 1;\n  }\n  return 0;\n}" { (declaration "short *psVar1;" (sized_type_specifier "short" short) (pointer_declarator "*psVar1" * identifier) ;) (expression_statement "psVar1 = (short *)*param_1;" (assignment_expression "psVar1 = (short *)*param_1" identifier = (cast_expression "(short *)*param_1" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (if_statement "if ((1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1)) {\n    *param_1 = psVar1 + 1;\n    return 1;\n  }" if (parenthesized_expression "((1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1))" ( (binary_expression "(1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1)" (parenthesized_expression "(1 < (ulong)(param_1[1] - (long)psVar1))" ( (binary_expression "1 < (ulong)(param_1[1] - (long)psVar1)" number_literal < (call_expression "(ulong)(param_1[1] - (long)psVar1)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "(param_1[1] - (long)psVar1)" ( (binary_expression "param_1[1] - (long)psVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) - (cast_expression "(long)psVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) )))) )) && (parenthesized_expression "(*param_2 == *psVar1)" ( (binary_expression "*param_2 == *psVar1" (pointer_expression "*param_2" * identifier) == (pointer_expression "*psVar1" * identifier)) ))) )) (compound_statement "{\n    *param_1 = psVar1 + 1;\n    return 1;\n  }" { (expression_statement "*param_1 = psVar1 + 1;" (assignment_expression "*param_1 = psVar1 + 1" (pointer_expression "*param_1" * identifier) = (binary_expression "psVar1 + 1" identifier + number_literal)) ;) (return_statement "return 1;" return number_literal ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration (sized_type_specifier short) (pointer_declarator * IDENT)) ))) (compound_statement { (declaration (sized_type_specifier short) (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor (sized_type_specifier short) (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression LIT < (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (subscript_expression IDENT [ LIT ]) - (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT)) )))) )) && (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == (pointer_expression * IDENT)) ))) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression IDENT + LIT)) ;) (return_statement return LIT ;) })) (return_statement return LIT ;) })))
(function_definition "undefined8 FUN_00359410(undefined8 *param_1,short *param_2)\n\n{\n  short *psVar1;\n  \n  psVar1 = (short *)*param_1;\n  if ((1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1)) {\n    *param_1 = psVar1 + 1;\n    return 1;\n  }\n  return 0;\n}" (type_identifier "undefined8") (function_declarator "FUN_00359410(undefined8 *param_1,short *param_2)" (identifier "FUN_00359410") (parameter_list "(undefined8 *param_1,short *param_2)" (( "(") (parameter_declaration "undefined8 *param_1" (type_identifier "undefined8") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "short *param_2" (sized_type_specifier "short" (short "short")) (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")"))) (compound_statement "{\n  short *psVar1;\n  \n  psVar1 = (short *)*param_1;\n  if ((1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1)) {\n    *param_1 = psVar1 + 1;\n    return 1;\n  }\n  return 0;\n}" ({ "{") (declaration "short *psVar1;" (sized_type_specifier "short" (short "short")) (pointer_declarator "*psVar1" (* "*") (identifier "psVar1")) (; ";")) (expression_statement "psVar1 = (short *)*param_1;" (assignment_expression "psVar1 = (short *)*param_1" (identifier "psVar1") (= "=") (cast_expression "(short *)*param_1" (( "(") (type_descriptor "short *" (sized_type_specifier "short" (short "short")) (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (if_statement "if ((1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1)) {\n    *param_1 = psVar1 + 1;\n    return 1;\n  }" (if "if") (parenthesized_expression "((1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1))" (( "(") (binary_expression "(1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1)" (parenthesized_expression "(1 < (ulong)(param_1[1] - (long)psVar1))" (( "(") (binary_expression "1 < (ulong)(param_1[1] - (long)psVar1)" (number_literal "1") (< "<") (call_expression "(ulong)(param_1[1] - (long)psVar1)" (parenthesized_expression "(ulong)" (( "(") (identifier "ulong") () ")")) (argument_list "(param_1[1] - (long)psVar1)" (( "(") (binary_expression "param_1[1] - (long)psVar1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (- "-") (cast_expression "(long)psVar1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "psVar1"))) () ")")))) () ")")) (&& "&&") (parenthesized_expression "(*param_2 == *psVar1)" (( "(") (binary_expression "*param_2 == *psVar1" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (== "==") (pointer_expression "*psVar1" (* "*") (identifier "psVar1"))) () ")"))) () ")")) (compound_statement "{\n    *param_1 = psVar1 + 1;\n    return 1;\n  }" ({ "{") (expression_statement "*param_1 = psVar1 + 1;" (assignment_expression "*param_1 = psVar1 + 1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (binary_expression "psVar1 + 1" (identifier "psVar1") (+ "+") (number_literal "1"))) (; ";")) (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}"))) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

/* bool std::(anonymous namespace)::read_bom<char16_t const, false, 2ul>(std::(anonymous
   namespace)::range<char16_t const, false>&, unsigned char const (&) [2ul]) */

bool std::(anonymous_namespace)::read_bom<char16_t_const,false,2ul>
               (range *var_1,unsigned_char *param_2)

{
  short *var_2;
  
  var_2 = *(short **)var_1;
  if ((1 < (ulong)(*(long *)(var_1 + 8) - (long)var_2)) && (*(short *)param_2 == *var_2)) {
    *(short **)var_1 = var_2 + 1;
    return true;
  }
  return false;
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (sized_type_specifier) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (sized_type_specifier) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (sized_type_specifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (number_literal) right: (call_expression function: (parenthesized_expression (identifier)) arguments: (argument_list (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier))))))) right: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (pointer_expression argument: (identifier)))))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (binary_expression left: (identifier) right: (number_literal)))) (return_statement (number_literal)))) (return_statement (number_literal)))))

undefined8 MASKED(undefined8 *param_1,short *param_2)

{
  short *psVar1;
  
  psVar1 = (short *)*param_1;
  if ((1 < (ulong)(param_1[1] - (long)psVar1)) && (*param_2 == *psVar1)) {
    *param_1 = psVar1 + 1;
    return 1;
  }
  return 0;
}

