
int md_estimate_size_before_relax(fragS *fragP,asection *segment)

{
  long lVar1;
  long lVar2;
  
  lVar1 = fragP->fr_fix;
  lVar2 = lVar1;
  if (lVar1 % fragP->fr_offset == 0) {
    return 0;
  }
  do {
    lVar2 = lVar2 + 1;
  } while (lVar2 % fragP->fr_offset != 0);
  return (int)lVar2 - (int)lVar1;
}



int FUN_0013d040(long param_1)

{
  long lVar1;
  long lVar2;
  
  lVar1 = *(long *)(param_1 + 0x10);
  lVar2 = lVar1;
  if (lVar1 % *(long *)(param_1 + 0x20) == 0) {
    return 0;
  }
  do {
    lVar2 = lVar2 + 1;
  } while (lVar2 % *(long *)(param_1 + 0x20) != 0);
  return (int)lVar2 - (int)lVar1;
}


MOV R8,qword ptr [RDI + 0x10]
MOV RSI,qword ptr [RDI + 0x20]
MOV RAX,R8
CQO
IDIV RSI
TEST RDX,RDX
JZ 0x0013d080
LEA RCX,[R8 + 0x1]
NOP dword ptr [RAX]
MOV RAX,RCX
MOV EDI,ECX
ADD RCX,0x1
CQO
SUB EDI,R8D
IDIV RSI
TEST RDX,RDX
JNZ 0x0013d060
MOV EAX,EDI
RET
XOR EDI,EDI
MOV EAX,EDI
RET
(translation_unit "int FUN_0013d040(long param_1)\n\n{\n  long lVar1;\n  long lVar2;\n  \n  lVar1 = *(long *)(param_1 + 0x10);\n  lVar2 = lVar1;\n  if (lVar1 % *(long *)(param_1 + 0x20) == 0) {\n    return 0;\n  }\n  do {\n    lVar2 = lVar2 + 1;\n  } while (lVar2 % *(long *)(param_1 + 0x20) != 0);\n  return (int)lVar2 - (int)lVar1;\n}\n\n" (function_definition "int FUN_0013d040(long param_1)\n\n{\n  long lVar1;\n  long lVar2;\n  \n  lVar1 = *(long *)(param_1 + 0x10);\n  lVar2 = lVar1;\n  if (lVar1 % *(long *)(param_1 + 0x20) == 0) {\n    return 0;\n  }\n  do {\n    lVar2 = lVar2 + 1;\n  } while (lVar2 % *(long *)(param_1 + 0x20) != 0);\n  return (int)lVar2 - (int)lVar1;\n}" primitive_type (function_declarator "FUN_0013d040(long param_1)" identifier (parameter_list "(long param_1)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  long lVar1;\n  long lVar2;\n  \n  lVar1 = *(long *)(param_1 + 0x10);\n  lVar2 = lVar1;\n  if (lVar1 % *(long *)(param_1 + 0x20) == 0) {\n    return 0;\n  }\n  do {\n    lVar2 = lVar2 + 1;\n  } while (lVar2 % *(long *)(param_1 + 0x20) != 0);\n  return (int)lVar2 - (int)lVar1;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (expression_statement "lVar1 = *(long *)(param_1 + 0x10);" (assignment_expression "lVar1 = *(long *)(param_1 + 0x10)" identifier = (pointer_expression "*(long *)(param_1 + 0x10)" * (cast_expression "(long *)(param_1 + 0x10)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) ;) (expression_statement "lVar2 = lVar1;" (assignment_expression "lVar2 = lVar1" identifier = identifier) ;) (if_statement "if (lVar1 % *(long *)(param_1 + 0x20) == 0) {\n    return 0;\n  }" if (parenthesized_expression "(lVar1 % *(long *)(param_1 + 0x20) == 0)" ( (binary_expression "lVar1 % *(long *)(param_1 + 0x20) == 0" (binary_expression "lVar1 % *(long *)(param_1 + 0x20)" identifier % (pointer_expression "*(long *)(param_1 + 0x20)" * (cast_expression "(long *)(param_1 + 0x20)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) ))))) == number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (do_statement "do {\n    lVar2 = lVar2 + 1;\n  } while (lVar2 % *(long *)(param_1 + 0x20) != 0);" do (compound_statement "{\n    lVar2 = lVar2 + 1;\n  }" { (expression_statement "lVar2 = lVar2 + 1;" (assignment_expression "lVar2 = lVar2 + 1" identifier = (binary_expression "lVar2 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(lVar2 % *(long *)(param_1 + 0x20) != 0)" ( (binary_expression "lVar2 % *(long *)(param_1 + 0x20) != 0" (binary_expression "lVar2 % *(long *)(param_1 + 0x20)" identifier % (pointer_expression "*(long *)(param_1 + 0x20)" * (cast_expression "(long *)(param_1 + 0x20)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) ))))) != number_literal) )) ;) (return_statement "return (int)lVar2 - (int)lVar1;" return (binary_expression "(int)lVar2 - (int)lVar1" (cast_expression "(int)lVar2" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)lVar1" ( (type_descriptor "int" primitive_type) ) identifier)) ;) })))
(translation_unit "int md_estimate_size_before_relax(fragS *fragP,asection *segment)\n\n{\n  long lVar1;\n  long lVar2;\n  \n  lVar1 = fragP->fr_fix;\n  lVar2 = lVar1;\n  if (lVar1 % fragP->fr_offset == 0) {\n    return 0;\n  }\n  do {\n    lVar2 = lVar2 + 1;\n  } while (lVar2 % fragP->fr_offset != 0);\n  return (int)lVar2 - (int)lVar1;\n}\n\n" (function_definition "int md_estimate_size_before_relax(fragS *fragP,asection *segment)\n\n{\n  long lVar1;\n  long lVar2;\n  \n  lVar1 = fragP->fr_fix;\n  lVar2 = lVar1;\n  if (lVar1 % fragP->fr_offset == 0) {\n    return 0;\n  }\n  do {\n    lVar2 = lVar2 + 1;\n  } while (lVar2 % fragP->fr_offset != 0);\n  return (int)lVar2 - (int)lVar1;\n}" primitive_type (function_declarator "md_estimate_size_before_relax(fragS *fragP,asection *segment)" identifier (parameter_list "(fragS *fragP,asection *segment)" ( (parameter_declaration "fragS *fragP" type_identifier (pointer_declarator "*fragP" * identifier)) , (parameter_declaration "asection *segment" type_identifier (pointer_declarator "*segment" * identifier)) ))) (compound_statement "{\n  long lVar1;\n  long lVar2;\n  \n  lVar1 = fragP->fr_fix;\n  lVar2 = lVar1;\n  if (lVar1 % fragP->fr_offset == 0) {\n    return 0;\n  }\n  do {\n    lVar2 = lVar2 + 1;\n  } while (lVar2 % fragP->fr_offset != 0);\n  return (int)lVar2 - (int)lVar1;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (expression_statement "lVar1 = fragP->fr_fix;" (assignment_expression "lVar1 = fragP->fr_fix" identifier = (field_expression "fragP->fr_fix" identifier -> field_identifier)) ;) (expression_statement "lVar2 = lVar1;" (assignment_expression "lVar2 = lVar1" identifier = identifier) ;) (if_statement "if (lVar1 % fragP->fr_offset == 0) {\n    return 0;\n  }" if (parenthesized_expression "(lVar1 % fragP->fr_offset == 0)" ( (binary_expression "lVar1 % fragP->fr_offset == 0" (binary_expression "lVar1 % fragP->fr_offset" identifier % (field_expression "fragP->fr_offset" identifier -> field_identifier)) == number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (do_statement "do {\n    lVar2 = lVar2 + 1;\n  } while (lVar2 % fragP->fr_offset != 0);" do (compound_statement "{\n    lVar2 = lVar2 + 1;\n  }" { (expression_statement "lVar2 = lVar2 + 1;" (assignment_expression "lVar2 = lVar2 + 1" identifier = (binary_expression "lVar2 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(lVar2 % fragP->fr_offset != 0)" ( (binary_expression "lVar2 % fragP->fr_offset != 0" (binary_expression "lVar2 % fragP->fr_offset" identifier % (field_expression "fragP->fr_offset" identifier -> field_identifier)) != number_literal) )) ;) (return_statement "return (int)lVar2 - (int)lVar1;" return (binary_expression "(int)lVar2 - (int)lVar1" (cast_expression "(int)lVar2" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)lVar1" ( (type_descriptor "int" primitive_type) ) identifier)) ;) })))
(translation_unit "int FUN_0013d040(long param_1)\n\n{\n  long lVar1;\n  long lVar2;\n  \n  lVar1 = *(long *)(param_1 + 0x10);\n  lVar2 = lVar1;\n  if (lVar1 % *(long *)(param_1 + 0x20) == 0) {\n    return 0;\n  }\n  do {\n    lVar2 = lVar2 + 1;\n  } while (lVar2 % *(long *)(param_1 + 0x20) != 0);\n  return (int)lVar2 - (int)lVar1;\n}\n\n" (function_definition "int FUN_0013d040(long param_1)\n\n{\n  long lVar1;\n  long lVar2;\n  \n  lVar1 = *(long *)(param_1 + 0x10);\n  lVar2 = lVar1;\n  if (lVar1 % *(long *)(param_1 + 0x20) == 0) {\n    return 0;\n  }\n  do {\n    lVar2 = lVar2 + 1;\n  } while (lVar2 % *(long *)(param_1 + 0x20) != 0);\n  return (int)lVar2 - (int)lVar1;\n}" primitive_type (function_declarator "FUN_0013d040(long param_1)" identifier (parameter_list "(long param_1)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  long lVar1;\n  long lVar2;\n  \n  lVar1 = *(long *)(param_1 + 0x10);\n  lVar2 = lVar1;\n  if (lVar1 % *(long *)(param_1 + 0x20) == 0) {\n    return 0;\n  }\n  do {\n    lVar2 = lVar2 + 1;\n  } while (lVar2 % *(long *)(param_1 + 0x20) != 0);\n  return (int)lVar2 - (int)lVar1;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (expression_statement "lVar1 = *(long *)(param_1 + 0x10);" (assignment_expression "lVar1 = *(long *)(param_1 + 0x10)" identifier = (pointer_expression "*(long *)(param_1 + 0x10)" * (cast_expression "(long *)(param_1 + 0x10)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) ;) (expression_statement "lVar2 = lVar1;" (assignment_expression "lVar2 = lVar1" identifier = identifier) ;) (if_statement "if (lVar1 % *(long *)(param_1 + 0x20) == 0) {\n    return 0;\n  }" if (parenthesized_expression "(lVar1 % *(long *)(param_1 + 0x20) == 0)" ( (binary_expression "lVar1 % *(long *)(param_1 + 0x20) == 0" (binary_expression "lVar1 % *(long *)(param_1 + 0x20)" identifier % (pointer_expression "*(long *)(param_1 + 0x20)" * (cast_expression "(long *)(param_1 + 0x20)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) ))))) == number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (do_statement "do {\n    lVar2 = lVar2 + 1;\n  } while (lVar2 % *(long *)(param_1 + 0x20) != 0);" do (compound_statement "{\n    lVar2 = lVar2 + 1;\n  }" { (expression_statement "lVar2 = lVar2 + 1;" (assignment_expression "lVar2 = lVar2 + 1" identifier = (binary_expression "lVar2 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(lVar2 % *(long *)(param_1 + 0x20) != 0)" ( (binary_expression "lVar2 % *(long *)(param_1 + 0x20) != 0" (binary_expression "lVar2 % *(long *)(param_1 + 0x20)" identifier % (pointer_expression "*(long *)(param_1 + 0x20)" * (cast_expression "(long *)(param_1 + 0x20)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) ))))) != number_literal) )) ;) (return_statement "return (int)lVar2 - (int)lVar1;" return (binary_expression "(int)lVar2 - (int)lVar1" (cast_expression "(int)lVar2" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)lVar1" ( (type_descriptor "int" primitive_type) ) identifier)) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) IDENT) ))) (compound_statement { (declaration (sized_type_specifier long) IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression IDENT % (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) == LIT) )) (compound_statement { (return_statement return LIT ;) })) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression (binary_expression IDENT % (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) != LIT) )) ;) (return_statement return (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) - (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) })))
(function_definition "int FUN_0013d040(long param_1)\n\n{\n  long lVar1;\n  long lVar2;\n  \n  lVar1 = *(long *)(param_1 + 0x10);\n  lVar2 = lVar1;\n  if (lVar1 % *(long *)(param_1 + 0x20) == 0) {\n    return 0;\n  }\n  do {\n    lVar2 = lVar2 + 1;\n  } while (lVar2 % *(long *)(param_1 + 0x20) != 0);\n  return (int)lVar2 - (int)lVar1;\n}" (primitive_type "int") (function_declarator "FUN_0013d040(long param_1)" (identifier "FUN_0013d040") (parameter_list "(long param_1)" (( "(") (parameter_declaration "long param_1" (sized_type_specifier "long" (long "long")) (identifier "param_1")) () ")"))) (compound_statement "{\n  long lVar1;\n  long lVar2;\n  \n  lVar1 = *(long *)(param_1 + 0x10);\n  lVar2 = lVar1;\n  if (lVar1 % *(long *)(param_1 + 0x20) == 0) {\n    return 0;\n  }\n  do {\n    lVar2 = lVar2 + 1;\n  } while (lVar2 % *(long *)(param_1 + 0x20) != 0);\n  return (int)lVar2 - (int)lVar1;\n}" ({ "{") (declaration "long lVar1;" (sized_type_specifier "long" (long "long")) (identifier "lVar1") (; ";")) (declaration "long lVar2;" (sized_type_specifier "long" (long "long")) (identifier "lVar2") (; ";")) (expression_statement "lVar1 = *(long *)(param_1 + 0x10);" (assignment_expression "lVar1 = *(long *)(param_1 + 0x10)" (identifier "lVar1") (= "=") (pointer_expression "*(long *)(param_1 + 0x10)" (* "*") (cast_expression "(long *)(param_1 + 0x10)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")"))))) (; ";")) (expression_statement "lVar2 = lVar1;" (assignment_expression "lVar2 = lVar1" (identifier "lVar2") (= "=") (identifier "lVar1")) (; ";")) (if_statement "if (lVar1 % *(long *)(param_1 + 0x20) == 0) {\n    return 0;\n  }" (if "if") (parenthesized_expression "(lVar1 % *(long *)(param_1 + 0x20) == 0)" (( "(") (binary_expression "lVar1 % *(long *)(param_1 + 0x20) == 0" (binary_expression "lVar1 % *(long *)(param_1 + 0x20)" (identifier "lVar1") (% "%") (pointer_expression "*(long *)(param_1 + 0x20)" (* "*") (cast_expression "(long *)(param_1 + 0x20)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x20)" (( "(") (binary_expression "param_1 + 0x20" (identifier "param_1") (+ "+") (number_literal "0x20")) () ")"))))) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    return 0;\n  }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (do_statement "do {\n    lVar2 = lVar2 + 1;\n  } while (lVar2 % *(long *)(param_1 + 0x20) != 0);" (do "do") (compound_statement "{\n    lVar2 = lVar2 + 1;\n  }" ({ "{") (expression_statement "lVar2 = lVar2 + 1;" (assignment_expression "lVar2 = lVar2 + 1" (identifier "lVar2") (= "=") (binary_expression "lVar2 + 1" (identifier "lVar2") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(lVar2 % *(long *)(param_1 + 0x20) != 0)" (( "(") (binary_expression "lVar2 % *(long *)(param_1 + 0x20) != 0" (binary_expression "lVar2 % *(long *)(param_1 + 0x20)" (identifier "lVar2") (% "%") (pointer_expression "*(long *)(param_1 + 0x20)" (* "*") (cast_expression "(long *)(param_1 + 0x20)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x20)" (( "(") (binary_expression "param_1 + 0x20" (identifier "param_1") (+ "+") (number_literal "0x20")) () ")"))))) (!= "!=") (number_literal "0")) () ")")) (; ";")) (return_statement "return (int)lVar2 - (int)lVar1;" (return "return") (binary_expression "(int)lVar2 - (int)lVar1" (cast_expression "(int)lVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "lVar2")) (- "-") (cast_expression "(int)lVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "lVar1"))) (; ";")) (} "}")))

int function_1(type_1 *fragP,type_2 *segment)

{
  long var_1;
  long var_2;
  
  var_1 = fragP->fr_fix;
  var_2 = var_1;
  if (var_1 % fragP->fr_offset == 0) {
    return 0;
  }
  do {
    var_2 = var_2 + 1;
  } while (var_2 % fragP->fr_offset != 0);
  return (int)var_2 - (int)var_1;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (sized_type_specifier) declarator: (identifier)))) body: (compound_statement (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (sized_type_specifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) right: (number_literal))) consequence: (compound_statement (return_statement (number_literal)))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) right: (number_literal)))) (return_statement (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)))))))

int MASKED(long param_1)

{
  long lVar1;
  long lVar2;
  
  lVar1 = *(long *)(param_1 + 0x10);
  lVar2 = lVar1;
  if (lVar1 % *(long *)(param_1 + 0x20) == 0) {
    return 0;
  }
  do {
    lVar2 = lVar2 + 1;
  } while (lVar2 % *(long *)(param_1 + 0x20) != 0);
  return (int)lVar2 - (int)lVar1;
}

