
/* WARNING: Removing unreachable block (ram,0x00040604) */
/* WARNING: Removing unreachable block (ram,0x00040694) */
/* WARNING: Removing unreachable block (ram,0x00040610) */
/* WARNING: Removing unreachable block (ram,0x0004061c) */
/* WARNING: Removing unreachable block (ram,0x000406a4) */
/* WARNING: Removing unreachable block (ram,0x000406b4) */
/* WARNING: Removing unreachable block (ram,0x000406bc) */
/* WARNING: Removing unreachable block (ram,0x0004062c) */
/* WARNING: Unknown calling convention */

void sqlite3PcacheMakeDirty(PgHdr *p)

{
  ushort uVar1;
  PCache *pPVar2;
  PgHdr *pPVar3;
  
  uVar1 = p->flags;
  if ((uVar1 & 0x11) == 0) {
    return;
  }
  if ((uVar1 & 1) != 0) {
    p->flags = uVar1 & 0xffef ^ 3;
    pPVar2 = p->pCache;
    p->pDirtyPrev = (PgHdr *)0x0;
    pPVar3 = pPVar2->pDirty;
    p->pDirtyNext = pPVar3;
    if (pPVar3 == (PgHdr *)0x0) {
      pPVar2->pDirtyTail = p;
      if (pPVar2->bPurgeable != '\0') {
        pPVar2->eCreate = '\x01';
      }
    }
    else {
      pPVar3->pDirtyPrev = p;
    }
    pPVar2->pDirty = p;
    if ((pPVar2->pSynced == (PgHdr *)0x0) && ((p->flags & 8) == 0)) {
      pPVar2->pSynced = p;
      return;
    }
    return;
  }
  p->flags = uVar1 & 0xffef;
  return;
}



void FUN_000407e8(int param_1)

{
  ushort uVar1;
  
  uVar1 = *(ushort *)(param_1 + 0x1c);
  if ((uVar1 & 0x11) == 0) {
    return;
  }
  if ((uVar1 & 1) == 0) {
    *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;
    return;
  }
  *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef ^ 3;
  FUN_000405f8(param_1,2);
  return;
}


lui gp,0x16
addiu gp,gp,-0x7ec8
addu gp,gp,t9
lhu v0,0x1c(a0)
andi a1,v0,0x11
beq a1,zero,0x00040814
_andi a1,v0,0x1
bne a1,zero,0x0004081c
_andi v0,v0,0xffef
jr ra
_sh v0,0x1c(a0)
jr ra
_nop
lw t9,-0x7de0(gp)
xori v0,v0,0x3
li a1,0x2
addiu t9,t9,0x5f8
b 0x000405f8
_sh v0,0x1c(a0)
(translation_unit "void FUN_000407e8(int param_1)\n\n{\n  ushort uVar1;\n  \n  uVar1 = *(ushort *)(param_1 + 0x1c);\n  if ((uVar1 & 0x11) == 0) {\n    return;\n  }\n  if ((uVar1 & 1) == 0) {\n    *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;\n    return;\n  }\n  *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef ^ 3;\n  FUN_000405f8(param_1,2);\n  return;\n}\n\n" (function_definition "void FUN_000407e8(int param_1)\n\n{\n  ushort uVar1;\n  \n  uVar1 = *(ushort *)(param_1 + 0x1c);\n  if ((uVar1 & 0x11) == 0) {\n    return;\n  }\n  if ((uVar1 & 1) == 0) {\n    *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;\n    return;\n  }\n  *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef ^ 3;\n  FUN_000405f8(param_1,2);\n  return;\n}" primitive_type (function_declarator "FUN_000407e8(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  ushort uVar1;\n  \n  uVar1 = *(ushort *)(param_1 + 0x1c);\n  if ((uVar1 & 0x11) == 0) {\n    return;\n  }\n  if ((uVar1 & 1) == 0) {\n    *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;\n    return;\n  }\n  *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef ^ 3;\n  FUN_000405f8(param_1,2);\n  return;\n}" { (declaration "ushort uVar1;" type_identifier identifier ;) (expression_statement "uVar1 = *(ushort *)(param_1 + 0x1c);" (assignment_expression "uVar1 = *(ushort *)(param_1 + 0x1c)" identifier = (pointer_expression "*(ushort *)(param_1 + 0x1c)" * (cast_expression "(ushort *)(param_1 + 0x1c)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) ))))) ;) (if_statement "if ((uVar1 & 0x11) == 0) {\n    return;\n  }" if (parenthesized_expression "((uVar1 & 0x11) == 0)" ( (binary_expression "(uVar1 & 0x11) == 0" (parenthesized_expression "(uVar1 & 0x11)" ( (binary_expression "uVar1 & 0x11" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (if_statement "if ((uVar1 & 1) == 0) {\n    *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;\n    return;\n  }" if (parenthesized_expression "((uVar1 & 1) == 0)" ( (binary_expression "(uVar1 & 1) == 0" (parenthesized_expression "(uVar1 & 1)" ( (binary_expression "uVar1 & 1" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n    *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;\n    return;\n  }" { (expression_statement "*(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;" (assignment_expression "*(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef" (pointer_expression "*(ushort *)(param_1 + 0x1c)" * (cast_expression "(ushort *)(param_1 + 0x1c)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) )))) = (binary_expression "uVar1 & 0xffef" identifier & number_literal)) ;) (return_statement "return;" return ;) })) (expression_statement "*(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef ^ 3;" (assignment_expression "*(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef ^ 3" (pointer_expression "*(ushort *)(param_1 + 0x1c)" * (cast_expression "(ushort *)(param_1 + 0x1c)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) )))) = (binary_expression "uVar1 & 0xffef ^ 3" (binary_expression "uVar1 & 0xffef" identifier & number_literal) ^ number_literal)) ;) (expression_statement "FUN_000405f8(param_1,2);" (call_expression "FUN_000405f8(param_1,2)" identifier (argument_list "(param_1,2)" ( identifier , number_literal ))) ;) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Removing unreachable block (ram,0x00040604) */\n/* WARNING: Removing unreachable block (ram,0x00040694) */\n/* WARNING: Removing unreachable block (ram,0x00040610) */\n/* WARNING: Removing unreachable block (ram,0x0004061c) */\n/* WARNING: Removing unreachable block (ram,0x000406a4) */\n/* WARNING: Removing unreachable block (ram,0x000406b4) */\n/* WARNING: Removing unreachable block (ram,0x000406bc) */\n/* WARNING: Removing unreachable block (ram,0x0004062c) */\n/* WARNING: Unknown calling convention */\n\nvoid sqlite3PcacheMakeDirty(PgHdr *p)\n\n{\n  ushort uVar1;\n  PCache *pPVar2;\n  PgHdr *pPVar3;\n  \n  uVar1 = p->flags;\n  if ((uVar1 & 0x11) == 0) {\n    return;\n  }\n  if ((uVar1 & 1) != 0) {\n    p->flags = uVar1 & 0xffef ^ 3;\n    pPVar2 = p->pCache;\n    p->pDirtyPrev = (PgHdr *)0x0;\n    pPVar3 = pPVar2->pDirty;\n    p->pDirtyNext = pPVar3;\n    if (pPVar3 == (PgHdr *)0x0) {\n      pPVar2->pDirtyTail = p;\n      if (pPVar2->bPurgeable != '\0') {\n        pPVar2->eCreate = '\x01';\n      }\n    }\n    else {\n      pPVar3->pDirtyPrev = p;\n    }\n    pPVar2->pDirty = p;\n    if ((pPVar2->pSynced == (PgHdr *)0x0) && ((p->flags & 8) == 0)) {\n      pPVar2->pSynced = p;\n      return;\n    }\n    return;\n  }\n  p->flags = uVar1 & 0xffef;\n  return;\n}\n\n" comment comment comment comment comment comment comment comment comment (function_definition "void sqlite3PcacheMakeDirty(PgHdr *p)\n\n{\n  ushort uVar1;\n  PCache *pPVar2;\n  PgHdr *pPVar3;\n  \n  uVar1 = p->flags;\n  if ((uVar1 & 0x11) == 0) {\n    return;\n  }\n  if ((uVar1 & 1) != 0) {\n    p->flags = uVar1 & 0xffef ^ 3;\n    pPVar2 = p->pCache;\n    p->pDirtyPrev = (PgHdr *)0x0;\n    pPVar3 = pPVar2->pDirty;\n    p->pDirtyNext = pPVar3;\n    if (pPVar3 == (PgHdr *)0x0) {\n      pPVar2->pDirtyTail = p;\n      if (pPVar2->bPurgeable != '\0') {\n        pPVar2->eCreate = '\x01';\n      }\n    }\n    else {\n      pPVar3->pDirtyPrev = p;\n    }\n    pPVar2->pDirty = p;\n    if ((pPVar2->pSynced == (PgHdr *)0x0) && ((p->flags & 8) == 0)) {\n      pPVar2->pSynced = p;\n      return;\n    }\n    return;\n  }\n  p->flags = uVar1 & 0xffef;\n  return;\n}" primitive_type (function_declarator "sqlite3PcacheMakeDirty(PgHdr *p)" identifier (parameter_list "(PgHdr *p)" ( (parameter_declaration "PgHdr *p" type_identifier (pointer_declarator "*p" * identifier)) ))) (compound_statement "{\n  ushort uVar1;\n  PCache *pPVar2;\n  PgHdr *pPVar3;\n  \n  uVar1 = p->flags;\n  if ((uVar1 & 0x11) == 0) {\n    return;\n  }\n  if ((uVar1 & 1) != 0) {\n    p->flags = uVar1 & 0xffef ^ 3;\n    pPVar2 = p->pCache;\n    p->pDirtyPrev = (PgHdr *)0x0;\n    pPVar3 = pPVar2->pDirty;\n    p->pDirtyNext = pPVar3;\n    if (pPVar3 == (PgHdr *)0x0) {\n      pPVar2->pDirtyTail = p;\n      if (pPVar2->bPurgeable != '\0') {\n        pPVar2->eCreate = '\x01';\n      }\n    }\n    else {\n      pPVar3->pDirtyPrev = p;\n    }\n    pPVar2->pDirty = p;\n    if ((pPVar2->pSynced == (PgHdr *)0x0) && ((p->flags & 8) == 0)) {\n      pPVar2->pSynced = p;\n      return;\n    }\n    return;\n  }\n  p->flags = uVar1 & 0xffef;\n  return;\n}" { (declaration "ushort uVar1;" type_identifier identifier ;) (declaration "PCache *pPVar2;" type_identifier (pointer_declarator "*pPVar2" * identifier) ;) (declaration "PgHdr *pPVar3;" type_identifier (pointer_declarator "*pPVar3" * identifier) ;) (expression_statement "uVar1 = p->flags;" (assignment_expression "uVar1 = p->flags" identifier = (field_expression "p->flags" identifier -> field_identifier)) ;) (if_statement "if ((uVar1 & 0x11) == 0) {\n    return;\n  }" if (parenthesized_expression "((uVar1 & 0x11) == 0)" ( (binary_expression "(uVar1 & 0x11) == 0" (parenthesized_expression "(uVar1 & 0x11)" ( (binary_expression "uVar1 & 0x11" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (if_statement "if ((uVar1 & 1) != 0) {\n    p->flags = uVar1 & 0xffef ^ 3;\n    pPVar2 = p->pCache;\n    p->pDirtyPrev = (PgHdr *)0x0;\n    pPVar3 = pPVar2->pDirty;\n    p->pDirtyNext = pPVar3;\n    if (pPVar3 == (PgHdr *)0x0) {\n      pPVar2->pDirtyTail = p;\n      if (pPVar2->bPurgeable != '\0') {\n        pPVar2->eCreate = '\x01';\n      }\n    }\n    else {\n      pPVar3->pDirtyPrev = p;\n    }\n    pPVar2->pDirty = p;\n    if ((pPVar2->pSynced == (PgHdr *)0x0) && ((p->flags & 8) == 0)) {\n      pPVar2->pSynced = p;\n      return;\n    }\n    return;\n  }" if (parenthesized_expression "((uVar1 & 1) != 0)" ( (binary_expression "(uVar1 & 1) != 0" (parenthesized_expression "(uVar1 & 1)" ( (binary_expression "uVar1 & 1" identifier & number_literal) )) != number_literal) )) (compound_statement "{\n    p->flags = uVar1 & 0xffef ^ 3;\n    pPVar2 = p->pCache;\n    p->pDirtyPrev = (PgHdr *)0x0;\n    pPVar3 = pPVar2->pDirty;\n    p->pDirtyNext = pPVar3;\n    if (pPVar3 == (PgHdr *)0x0) {\n      pPVar2->pDirtyTail = p;\n      if (pPVar2->bPurgeable != '\0') {\n        pPVar2->eCreate = '\x01';\n      }\n    }\n    else {\n      pPVar3->pDirtyPrev = p;\n    }\n    pPVar2->pDirty = p;\n    if ((pPVar2->pSynced == (PgHdr *)0x0) && ((p->flags & 8) == 0)) {\n      pPVar2->pSynced = p;\n      return;\n    }\n    return;\n  }" { (expression_statement "p->flags = uVar1 & 0xffef ^ 3;" (assignment_expression "p->flags = uVar1 & 0xffef ^ 3" (field_expression "p->flags" identifier -> field_identifier) = (binary_expression "uVar1 & 0xffef ^ 3" (binary_expression "uVar1 & 0xffef" identifier & number_literal) ^ number_literal)) ;) (expression_statement "pPVar2 = p->pCache;" (assignment_expression "pPVar2 = p->pCache" identifier = (field_expression "p->pCache" identifier -> field_identifier)) ;) (expression_statement "p->pDirtyPrev = (PgHdr *)0x0;" (assignment_expression "p->pDirtyPrev = (PgHdr *)0x0" (field_expression "p->pDirtyPrev" identifier -> field_identifier) = (cast_expression "(PgHdr *)0x0" ( (type_descriptor "PgHdr *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "pPVar3 = pPVar2->pDirty;" (assignment_expression "pPVar3 = pPVar2->pDirty" identifier = (field_expression "pPVar2->pDirty" identifier -> field_identifier)) ;) (expression_statement "p->pDirtyNext = pPVar3;" (assignment_expression "p->pDirtyNext = pPVar3" (field_expression "p->pDirtyNext" identifier -> field_identifier) = identifier) ;) (if_statement "if (pPVar3 == (PgHdr *)0x0) {\n      pPVar2->pDirtyTail = p;\n      if (pPVar2->bPurgeable != '\0') {\n        pPVar2->eCreate = '\x01';\n      }\n    }\n    else {\n      pPVar3->pDirtyPrev = p;\n    }" if (parenthesized_expression "(pPVar3 == (PgHdr *)0x0)" ( (binary_expression "pPVar3 == (PgHdr *)0x0" identifier == (cast_expression "(PgHdr *)0x0" ( (type_descriptor "PgHdr *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      pPVar2->pDirtyTail = p;\n      if (pPVar2->bPurgeable != '\0') {\n        pPVar2->eCreate = '\x01';\n      }\n    }" { (expression_statement "pPVar2->pDirtyTail = p;" (assignment_expression "pPVar2->pDirtyTail = p" (field_expression "pPVar2->pDirtyTail" identifier -> field_identifier) = identifier) ;) (if_statement "if (pPVar2->bPurgeable != '\0') {\n        pPVar2->eCreate = '\x01';\n      }" if (parenthesized_expression "(pPVar2->bPurgeable != '\0')" ( (binary_expression "pPVar2->bPurgeable != '\0'" (field_expression "pPVar2->bPurgeable" identifier -> field_identifier) != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n        pPVar2->eCreate = '\x01';\n      }" { (expression_statement "pPVar2->eCreate = '\x01';" (assignment_expression "pPVar2->eCreate = '\x01'" (field_expression "pPVar2->eCreate" identifier -> field_identifier) = (char_literal "'\x01'" ' escape_sequence ')) ;) })) }) (else_clause "else {\n      pPVar3->pDirtyPrev = p;\n    }" else (compound_statement "{\n      pPVar3->pDirtyPrev = p;\n    }" { (expression_statement "pPVar3->pDirtyPrev = p;" (assignment_expression "pPVar3->pDirtyPrev = p" (field_expression "pPVar3->pDirtyPrev" identifier -> field_identifier) = identifier) ;) }))) (expression_statement "pPVar2->pDirty = p;" (assignment_expression "pPVar2->pDirty = p" (field_expression "pPVar2->pDirty" identifier -> field_identifier) = identifier) ;) (if_statement "if ((pPVar2->pSynced == (PgHdr *)0x0) && ((p->flags & 8) == 0)) {\n      pPVar2->pSynced = p;\n      return;\n    }" if (parenthesized_expression "((pPVar2->pSynced == (PgHdr *)0x0) && ((p->flags & 8) == 0))" ( (binary_expression "(pPVar2->pSynced == (PgHdr *)0x0) && ((p->flags & 8) == 0)" (parenthesized_expression "(pPVar2->pSynced == (PgHdr *)0x0)" ( (binary_expression "pPVar2->pSynced == (PgHdr *)0x0" (field_expression "pPVar2->pSynced" identifier -> field_identifier) == (cast_expression "(PgHdr *)0x0" ( (type_descriptor "PgHdr *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) && (parenthesized_expression "((p->flags & 8) == 0)" ( (binary_expression "(p->flags & 8) == 0" (parenthesized_expression "(p->flags & 8)" ( (binary_expression "p->flags & 8" (field_expression "p->flags" identifier -> field_identifier) & number_literal) )) == number_literal) ))) )) (compound_statement "{\n      pPVar2->pSynced = p;\n      return;\n    }" { (expression_statement "pPVar2->pSynced = p;" (assignment_expression "pPVar2->pSynced = p" (field_expression "pPVar2->pSynced" identifier -> field_identifier) = identifier) ;) (return_statement "return;" return ;) })) (return_statement "return;" return ;) })) (expression_statement "p->flags = uVar1 & 0xffef;" (assignment_expression "p->flags = uVar1 & 0xffef" (field_expression "p->flags" identifier -> field_identifier) = (binary_expression "uVar1 & 0xffef" identifier & number_literal)) ;) (return_statement "return;" return ;) })))
(translation_unit "void FUN_000407e8(int param_1)\n\n{\n  ushort uVar1;\n  \n  uVar1 = *(ushort *)(param_1 + 0x1c);\n  if ((uVar1 & 0x11) == 0) {\n    return;\n  }\n  if ((uVar1 & 1) == 0) {\n    *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;\n    return;\n  }\n  *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef ^ 3;\n  FUN_000405f8(param_1,2);\n  return;\n}\n\n" (function_definition "void FUN_000407e8(int param_1)\n\n{\n  ushort uVar1;\n  \n  uVar1 = *(ushort *)(param_1 + 0x1c);\n  if ((uVar1 & 0x11) == 0) {\n    return;\n  }\n  if ((uVar1 & 1) == 0) {\n    *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;\n    return;\n  }\n  *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef ^ 3;\n  FUN_000405f8(param_1,2);\n  return;\n}" primitive_type (function_declarator "FUN_000407e8(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  ushort uVar1;\n  \n  uVar1 = *(ushort *)(param_1 + 0x1c);\n  if ((uVar1 & 0x11) == 0) {\n    return;\n  }\n  if ((uVar1 & 1) == 0) {\n    *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;\n    return;\n  }\n  *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef ^ 3;\n  FUN_000405f8(param_1,2);\n  return;\n}" { (declaration "ushort uVar1;" type_identifier identifier ;) (expression_statement "uVar1 = *(ushort *)(param_1 + 0x1c);" (assignment_expression "uVar1 = *(ushort *)(param_1 + 0x1c)" identifier = (pointer_expression "*(ushort *)(param_1 + 0x1c)" * (cast_expression "(ushort *)(param_1 + 0x1c)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) ))))) ;) (if_statement "if ((uVar1 & 0x11) == 0) {\n    return;\n  }" if (parenthesized_expression "((uVar1 & 0x11) == 0)" ( (binary_expression "(uVar1 & 0x11) == 0" (parenthesized_expression "(uVar1 & 0x11)" ( (binary_expression "uVar1 & 0x11" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (if_statement "if ((uVar1 & 1) == 0) {\n    *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;\n    return;\n  }" if (parenthesized_expression "((uVar1 & 1) == 0)" ( (binary_expression "(uVar1 & 1) == 0" (parenthesized_expression "(uVar1 & 1)" ( (binary_expression "uVar1 & 1" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n    *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;\n    return;\n  }" { (expression_statement "*(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;" (assignment_expression "*(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef" (pointer_expression "*(ushort *)(param_1 + 0x1c)" * (cast_expression "(ushort *)(param_1 + 0x1c)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) )))) = (binary_expression "uVar1 & 0xffef" identifier & number_literal)) ;) (return_statement "return;" return ;) })) (expression_statement "*(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef ^ 3;" (assignment_expression "*(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef ^ 3" (pointer_expression "*(ushort *)(param_1 + 0x1c)" * (cast_expression "(ushort *)(param_1 + 0x1c)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) )))) = (binary_expression "uVar1 & 0xffef ^ 3" (binary_expression "uVar1 & 0xffef" identifier & number_literal) ^ number_literal)) ;) (expression_statement "FUN_000405f8(param_1,2);" (call_expression "FUN_000405f8(param_1,2)" identifier (argument_list "(param_1,2)" ( identifier , number_literal ))) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) )) (compound_statement { (return_statement return ;) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression IDENT & LIT)) ;) (return_statement return ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression (binary_expression IDENT & LIT) ^ LIT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT ))) ;) (return_statement return ;) })))
(function_definition "void FUN_000407e8(int param_1)\n\n{\n  ushort uVar1;\n  \n  uVar1 = *(ushort *)(param_1 + 0x1c);\n  if ((uVar1 & 0x11) == 0) {\n    return;\n  }\n  if ((uVar1 & 1) == 0) {\n    *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;\n    return;\n  }\n  *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef ^ 3;\n  FUN_000405f8(param_1,2);\n  return;\n}" (primitive_type "void") (function_declarator "FUN_000407e8(int param_1)" (identifier "FUN_000407e8") (parameter_list "(int param_1)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) () ")"))) (compound_statement "{\n  ushort uVar1;\n  \n  uVar1 = *(ushort *)(param_1 + 0x1c);\n  if ((uVar1 & 0x11) == 0) {\n    return;\n  }\n  if ((uVar1 & 1) == 0) {\n    *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;\n    return;\n  }\n  *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef ^ 3;\n  FUN_000405f8(param_1,2);\n  return;\n}" ({ "{") (declaration "ushort uVar1;" (type_identifier "ushort") (identifier "uVar1") (; ";")) (expression_statement "uVar1 = *(ushort *)(param_1 + 0x1c);" (assignment_expression "uVar1 = *(ushort *)(param_1 + 0x1c)" (identifier "uVar1") (= "=") (pointer_expression "*(ushort *)(param_1 + 0x1c)" (* "*") (cast_expression "(ushort *)(param_1 + 0x1c)" (( "(") (type_descriptor "ushort *" (type_identifier "ushort") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1c)" (( "(") (binary_expression "param_1 + 0x1c" (identifier "param_1") (+ "+") (number_literal "0x1c")) () ")"))))) (; ";")) (if_statement "if ((uVar1 & 0x11) == 0) {\n    return;\n  }" (if "if") (parenthesized_expression "((uVar1 & 0x11) == 0)" (( "(") (binary_expression "(uVar1 & 0x11) == 0" (parenthesized_expression "(uVar1 & 0x11)" (( "(") (binary_expression "uVar1 & 0x11" (identifier "uVar1") (& "&") (number_literal "0x11")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    return;\n  }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (if_statement "if ((uVar1 & 1) == 0) {\n    *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;\n    return;\n  }" (if "if") (parenthesized_expression "((uVar1 & 1) == 0)" (( "(") (binary_expression "(uVar1 & 1) == 0" (parenthesized_expression "(uVar1 & 1)" (( "(") (binary_expression "uVar1 & 1" (identifier "uVar1") (& "&") (number_literal "1")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;\n    return;\n  }" ({ "{") (expression_statement "*(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;" (assignment_expression "*(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef" (pointer_expression "*(ushort *)(param_1 + 0x1c)" (* "*") (cast_expression "(ushort *)(param_1 + 0x1c)" (( "(") (type_descriptor "ushort *" (type_identifier "ushort") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1c)" (( "(") (binary_expression "param_1 + 0x1c" (identifier "param_1") (+ "+") (number_literal "0x1c")) () ")")))) (= "=") (binary_expression "uVar1 & 0xffef" (identifier "uVar1") (& "&") (number_literal "0xffef"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "*(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef ^ 3;" (assignment_expression "*(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef ^ 3" (pointer_expression "*(ushort *)(param_1 + 0x1c)" (* "*") (cast_expression "(ushort *)(param_1 + 0x1c)" (( "(") (type_descriptor "ushort *" (type_identifier "ushort") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1c)" (( "(") (binary_expression "param_1 + 0x1c" (identifier "param_1") (+ "+") (number_literal "0x1c")) () ")")))) (= "=") (binary_expression "uVar1 & 0xffef ^ 3" (binary_expression "uVar1 & 0xffef" (identifier "uVar1") (& "&") (number_literal "0xffef")) (^ "^") (number_literal "3"))) (; ";")) (expression_statement "FUN_000405f8(param_1,2);" (call_expression "FUN_000405f8(param_1,2)" (identifier "FUN_000405f8") (argument_list "(param_1,2)" (( "(") (identifier "param_1") (, ",") (number_literal "2") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* WARNING: Removing unreachable block (ram,0x00040604) */
/* WARNING: Removing unreachable block (ram,0x00040694) */
/* WARNING: Removing unreachable block (ram,0x00040610) */
/* WARNING: Removing unreachable block (ram,0x0004061c) */
/* WARNING: Removing unreachable block (ram,0x000406a4) */
/* WARNING: Removing unreachable block (ram,0x000406b4) */
/* WARNING: Removing unreachable block (ram,0x000406bc) */
/* WARNING: Removing unreachable block (ram,0x0004062c) */
/* WARNING: Unknown calling convention */

void function_1(type_1 *p)

{
  type_2 var_1;
  type_3 *pPVar2;
  type_1 *var_2;
  
  var_1 = p->flags;
  if ((var_1 & 0x11) == 0) {
    return;
  }
  if ((var_1 & 1) != 0) {
    p->flags = var_1 & 0xffef ^ 3;
    pPVar2 = p->pCache;
    p->pDirtyPrev = (type_1 *)0x0;
    var_2 = pPVar2->pDirty;
    p->pDirtyNext = var_2;
    if (var_2 == (type_1 *)0x0) {
      pPVar2->pDirtyTail = p;
      if (pPVar2->bPurgeable != '\0') {
        pPVar2->eCreate = '\x01';
      }
    }
    else {
      var_2->pDirtyPrev = p;
    }
    pPVar2->pDirty = p;
    if ((pPVar2->pSynced == (type_1 *)0x0) && ((p->flags & 8) == 0)) {
      pPVar2->pSynced = p;
      return;
    }
    return;
  }
  p->flags = var_1 & 0xffef;
  return;
}


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

void MASKED(int param_1)

{
  ushort uVar1;
  
  uVar1 = *(ushort *)(param_1 + 0x1c);
  if ((uVar1 & 0x11) == 0) {
    return;
  }
  if ((uVar1 & 1) == 0) {
    *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef;
    return;
  }
  *(ushort *)(param_1 + 0x1c) = uVar1 & 0xffef ^ 3;
  FUN_000405f8(param_1,2);
  return;
}

