
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void update_undo(undo_type action)

{
  undo *puVar1;
  int iVar2;
  filestruct *pfVar3;
  ssize_t sVar4;
  openfilestruct *poVar5;
  size_t sVar6;
  char *pcVar7;
  undo_type len1;
  char *pcVar8;
  size_t sVar9;
  filestruct *pfVar10;
  filestruct *pfVar11;
  uint uVar12;
  uint uVar13;
  int iVar14;
  
  poVar5 = openfile;
  puVar1 = openfile->undotop;
  len1 = puVar1->type;
  puVar1->newsize = openfile->totsize;
  pfVar10 = cutbuffer;
  switch(len1) {
  case ADD:
    pcVar7 = (char *)nmalloc(6);
    sVar9 = parse_mbchar(openfile->current->data + puVar1->mark_begin_x,pcVar7,(size_t *)0x0);
    pcVar8 = puVar1->strdata;
    if (pcVar8 != (char *)0x0) {
      len1 = strlen(pcVar8);
    }
    pcVar8 = addstrings(pcVar8,len1,pcVar7,sVar9);
    puVar1->strdata = pcVar8;
    poVar5 = openfile;
    puVar1->mark_begin_lineno = openfile->current->lineno;
    puVar1->mark_begin_x = poVar5->current_x;
    return;
  case ENTER:
    pcVar8 = mallocstrcpy((char *)0x0,poVar5->current->data);
    break;
  case BACK:
  case DEL:
    pcVar8 = (char *)nmalloc(6);
    sVar9 = parse_mbchar(openfile->current->data + openfile->current_x,pcVar8,(size_t *)0x0);
    if (openfile->current_x != puVar1->begin) {
      if (openfile->current_x != puVar1->begin - sVar9) {
        free(pcVar8);
        add_undo(puVar1->type);
        return;
      }
      pcVar7 = puVar1->strdata;
      sVar6 = strlen(pcVar7);
      pcVar8 = addstrings(pcVar8,sVar9,pcVar7,sVar6);
      puVar1->strdata = pcVar8;
      puVar1->begin = openfile->current_x;
      return;
    }
    pcVar7 = puVar1->strdata;
    sVar6 = strlen(pcVar7);
    pcVar8 = addstrings(pcVar7,sVar6,pcVar8,sVar9);
    break;
  case JOIN:
  case SPLIT_BEGIN:
  case SPLIT_END:
  case COUPLE_BEGIN:
    return;
  case REPLACE:
  case PASTE:
  case COUPLE_END:
    sVar4 = poVar5->current->lineno;
    puVar1->begin = poVar5->current_x;
    puVar1->lineno = sVar4;
    return;
  default:
    statusline(ALERT,"Wrong undo update type -- please report a bug");
    return;
  case ZAP:
  case CUT:
  case CUT_TO_EOF:
    if (cutbuffer == (filestruct *)0x0) {
      return;
    }
    if (len1 == ZAP) {
      puVar1->cutbuffer = cutbuffer;
    }
    else {
      free_filestruct(puVar1->cutbuffer);
      pfVar10 = copy_filestruct(cutbuffer);
      puVar1->cutbuffer = pfVar10;
    }
    iVar2 = puVar1->mark_begin_lineno;
    if (puVar1->xflags != 0x10) {
      pfVar3 = pfVar10->next;
      puVar1->cutbottom = pfVar10;
      pfVar11 = pfVar10;
      if (pfVar3 != (filestruct *)0x0) {
        do {
          pfVar11 = pfVar3;
          pfVar3 = pfVar11->next;
        } while (pfVar11->next != (filestruct *)0x0);
        puVar1->cutbottom = pfVar11;
      }
      iVar14 = (pfVar11->lineno + iVar2) - pfVar10->lineno;
      puVar1->lineno = iVar14;
      if (((flags[0] & 0x800) != 0) || (puVar1->type == CUT_TO_EOF)) {
        sVar6 = strlen(pfVar11->data);
        puVar1->begin = sVar6;
        if (iVar14 == iVar2) {
          puVar1->begin = sVar6 + puVar1->mark_begin_x;
          return;
        }
        return;
      }
      if (openfile->current != openfile->filebot) {
        return;
      }
      if ((flags[0] & 0x40000000) != 0) {
        sVar6 = strlen(pfVar11->data);
        puVar1->begin = sVar6;
        return;
      }
      return;
    }
    iVar14 = puVar1->lineno;
    if (iVar14 == iVar2) {
      uVar12 = puVar1->begin;
      uVar13 = puVar1->mark_begin_x;
      if (uVar13 <= uVar12) goto LAB_00037d97;
    }
    else {
      if (iVar2 <= iVar14) {
LAB_00037d97:
        puVar1->xflags = 0x20;
        return;
      }
      uVar12 = puVar1->begin;
      uVar13 = puVar1->mark_begin_x;
    }
    puVar1->begin = uVar13;
    puVar1->mark_begin_x = uVar12;
    puVar1->lineno = iVar2;
    puVar1->mark_begin_lineno = iVar14;
    return;
  case INSERT:
    sVar4 = poVar5->current->lineno;
    puVar1->mark_begin_x = poVar5->current_x;
    puVar1->mark_begin_lineno = sVar4;
    return;
  }
  puVar1->strdata = pcVar8;
  puVar1->mark_begin_x = openfile->current_x;
  return;
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void FUN_00037a60(void)

{
  int *piVar1;
  undefined4 *puVar2;
  char *pcVar3;
  size_t sVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  void *__ptr;
  int iVar7;
  undefined4 *puVar8;
  undefined4 *puVar9;
  uint uVar10;
  uint uVar11;
  int iVar12;
  
  iVar7 = DAT_0007b640;
  piVar1 = *(int **)(DAT_0007b640 + 0x40);
  sVar4 = piVar1[1];
  piVar1[5] = *(int *)(DAT_0007b640 + 0x14);
  puVar8 = DAT_0007b64c;
  switch(sVar4) {
  case 0:
    uVar5 = FUN_0003da70(6);
    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);
    pcVar3 = (char *)piVar1[3];
    if (pcVar3 != (char *)0x0) {
      sVar4 = strlen(pcVar3);
    }
    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);
    piVar1[3] = iVar7;
    iVar7 = DAT_0007b640;
    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);
    piVar1[0xb] = *(int *)(iVar7 + 0x1c);
    return;
  case 1:
    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));
    break;
  case 2:
  case 3:
    __ptr = (void *)FUN_0003da70(6);
    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);
    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {
      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {
        free(__ptr);
        FUN_000376d0(piVar1[1]);
        return;
      }
      pcVar3 = (char *)piVar1[3];
      sVar4 = strlen(pcVar3);
      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);
      piVar1[3] = iVar7;
      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);
      return;
    }
    pcVar3 = (char *)piVar1[3];
    sVar4 = strlen(pcVar3);
    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);
    break;
  case 4:
  case 6:
  case 7:
  case 0x12:
    return;
  case 5:
  case 0x10:
  case 0x13:
    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);
    piVar1[2] = *(int *)(iVar7 + 0x1c);
    *piVar1 = iVar12;
    return;
  default:
    FUN_00040b60(3,"Wrong undo update type -- please report a bug");
    return;
  case 0xd:
  case 0xe:
  case 0xf:
    if (DAT_0007b64c == (undefined4 *)0x0) {
      return;
    }
    if (sVar4 == 0xd) {
      piVar1[8] = (int)DAT_0007b64c;
    }
    else {
      FUN_0002af00(piVar1[8]);
      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);
      piVar1[8] = (int)puVar8;
    }
    iVar7 = piVar1[10];
    if (piVar1[6] != 0x10) {
      puVar2 = (undefined4 *)puVar8[2];
      piVar1[9] = (int)puVar8;
      puVar9 = puVar8;
      if (puVar2 != (undefined4 *)0x0) {
        do {
          puVar9 = puVar2;
          puVar2 = (undefined4 *)puVar9[2];
        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);
        piVar1[9] = (int)puVar9;
      }
      iVar12 = (puVar9[1] + iVar7) - puVar8[1];
      *piVar1 = iVar12;
      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {
        sVar4 = strlen((char *)*puVar9);
        piVar1[2] = sVar4;
        if (iVar12 == iVar7) {
          piVar1[2] = sVar4 + piVar1[0xb];
          return;
        }
        return;
      }
      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {
        return;
      }
      if ((DAT_0007b664 & 0x40000000) != 0) {
        sVar4 = strlen((char *)*puVar9);
        piVar1[2] = sVar4;
        return;
      }
      return;
    }
    iVar12 = *piVar1;
    if (iVar12 == iVar7) {
      uVar10 = piVar1[2];
      uVar11 = piVar1[0xb];
      if (uVar11 <= uVar10) goto code_r0x00037d97;
    }
    else {
      if (iVar7 <= iVar12) {
code_r0x00037d97:
        piVar1[6] = 0x20;
        return;
      }
      uVar10 = piVar1[2];
      uVar11 = piVar1[0xb];
    }
    piVar1[2] = uVar11;
    piVar1[0xb] = uVar10;
    *piVar1 = iVar7;
    piVar1[10] = iVar12;
    return;
  case 0x11:
    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);
    piVar1[0xb] = *(int *)(iVar7 + 0x1c);
    piVar1[10] = iVar12;
    return;
  }
  piVar1[3] = iVar7;
  piVar1[0xb] = *(int *)(DAT_0007b640 + 0x1c);
  return;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00015680
ADD EBX,0x43167
SUB ESP,0x1c
LEA EBP,[EBX + 0xa70]
MOV EAX,dword ptr [EBP]
MOV ESI,dword ptr [EAX + 0x40]
MOV EDX,dword ptr [EAX + 0x14]
MOV EDI,dword ptr [ESI + 0x4]
MOV dword ptr [ESI + 0x14],EDX
CMP EDI,0x13
JA 0x00037ca0
MOV EDX,dword ptr [EBX + EDI*0x4 + 0xfffe6150]
ADD EDX,EBX
JMP EDX
SUB ESP,0x8
LEA EAX,[EBX + 0xfffe5ea8]
PUSH EAX
PUSH 0x3
CALL 0x00040b60
ADD ESP,0x10
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_00037a60(void)\n\n{\n  int *piVar1;\n  undefined4 *puVar2;\n  char *pcVar3;\n  size_t sVar4;\n  undefined4 uVar5;\n  undefined4 uVar6;\n  void *__ptr;\n  int iVar7;\n  undefined4 *puVar8;\n  undefined4 *puVar9;\n  uint uVar10;\n  uint uVar11;\n  int iVar12;\n  \n  iVar7 = DAT_0007b640;\n  piVar1 = *(int **)(DAT_0007b640 + 0x40);\n  sVar4 = piVar1[1];\n  piVar1[5] = *(int *)(DAT_0007b640 + 0x14);\n  puVar8 = DAT_0007b64c;\n  switch(sVar4) {\n  case 0:\n    uVar5 = FUN_0003da70(6);\n    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);\n    pcVar3 = (char *)piVar1[3];\n    if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }\n    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);\n    piVar1[3] = iVar7;\n    iVar7 = DAT_0007b640;\n    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    return;\n  case 1:\n    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));\n    break;\n  case 2:\n  case 3:\n    __ptr = (void *)FUN_0003da70(6);\n    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);\n    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }\n    pcVar3 = (char *)piVar1[3];\n    sVar4 = strlen(pcVar3);\n    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);\n    break;\n  case 4:\n  case 6:\n  case 7:\n  case 0x12:\n    return;\n  case 5:\n  case 0x10:\n  case 0x13:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[2] = *(int *)(iVar7 + 0x1c);\n    *piVar1 = iVar12;\n    return;\n  default:\n    FUN_00040b60(3,"Wrong undo update type -- please report a bug");\n    return;\n  case 0xd:\n  case 0xe:\n  case 0xf:\n    if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }\n    if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }\n    iVar7 = piVar1[10];\n    if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }\n    iVar12 = *piVar1;\n    if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }\n    piVar1[2] = uVar11;\n    piVar1[0xb] = uVar10;\n    *piVar1 = iVar7;\n    piVar1[10] = iVar12;\n    return;\n  case 0x11:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    piVar1[10] = iVar12;\n    return;\n  }\n  piVar1[3] = iVar7;\n  piVar1[0xb] = *(int *)(DAT_0007b640 + 0x1c);\n  return;\n}\n\n" comment (function_definition "void FUN_00037a60(void)\n\n{\n  int *piVar1;\n  undefined4 *puVar2;\n  char *pcVar3;\n  size_t sVar4;\n  undefined4 uVar5;\n  undefined4 uVar6;\n  void *__ptr;\n  int iVar7;\n  undefined4 *puVar8;\n  undefined4 *puVar9;\n  uint uVar10;\n  uint uVar11;\n  int iVar12;\n  \n  iVar7 = DAT_0007b640;\n  piVar1 = *(int **)(DAT_0007b640 + 0x40);\n  sVar4 = piVar1[1];\n  piVar1[5] = *(int *)(DAT_0007b640 + 0x14);\n  puVar8 = DAT_0007b64c;\n  switch(sVar4) {\n  case 0:\n    uVar5 = FUN_0003da70(6);\n    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);\n    pcVar3 = (char *)piVar1[3];\n    if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }\n    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);\n    piVar1[3] = iVar7;\n    iVar7 = DAT_0007b640;\n    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    return;\n  case 1:\n    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));\n    break;\n  case 2:\n  case 3:\n    __ptr = (void *)FUN_0003da70(6);\n    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);\n    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }\n    pcVar3 = (char *)piVar1[3];\n    sVar4 = strlen(pcVar3);\n    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);\n    break;\n  case 4:\n  case 6:\n  case 7:\n  case 0x12:\n    return;\n  case 5:\n  case 0x10:\n  case 0x13:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[2] = *(int *)(iVar7 + 0x1c);\n    *piVar1 = iVar12;\n    return;\n  default:\n    FUN_00040b60(3,"Wrong undo update type -- please report a bug");\n    return;\n  case 0xd:\n  case 0xe:\n  case 0xf:\n    if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }\n    if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }\n    iVar7 = piVar1[10];\n    if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }\n    iVar12 = *piVar1;\n    if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }\n    piVar1[2] = uVar11;\n    piVar1[0xb] = uVar10;\n    *piVar1 = iVar7;\n    piVar1[10] = iVar12;\n    return;\n  case 0x11:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    piVar1[10] = iVar12;\n    return;\n  }\n  piVar1[3] = iVar7;\n  piVar1[0xb] = *(int *)(DAT_0007b640 + 0x1c);\n  return;\n}" primitive_type (function_declarator "FUN_00037a60(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  int *piVar1;\n  undefined4 *puVar2;\n  char *pcVar3;\n  size_t sVar4;\n  undefined4 uVar5;\n  undefined4 uVar6;\n  void *__ptr;\n  int iVar7;\n  undefined4 *puVar8;\n  undefined4 *puVar9;\n  uint uVar10;\n  uint uVar11;\n  int iVar12;\n  \n  iVar7 = DAT_0007b640;\n  piVar1 = *(int **)(DAT_0007b640 + 0x40);\n  sVar4 = piVar1[1];\n  piVar1[5] = *(int *)(DAT_0007b640 + 0x14);\n  puVar8 = DAT_0007b64c;\n  switch(sVar4) {\n  case 0:\n    uVar5 = FUN_0003da70(6);\n    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);\n    pcVar3 = (char *)piVar1[3];\n    if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }\n    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);\n    piVar1[3] = iVar7;\n    iVar7 = DAT_0007b640;\n    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    return;\n  case 1:\n    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));\n    break;\n  case 2:\n  case 3:\n    __ptr = (void *)FUN_0003da70(6);\n    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);\n    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }\n    pcVar3 = (char *)piVar1[3];\n    sVar4 = strlen(pcVar3);\n    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);\n    break;\n  case 4:\n  case 6:\n  case 7:\n  case 0x12:\n    return;\n  case 5:\n  case 0x10:\n  case 0x13:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[2] = *(int *)(iVar7 + 0x1c);\n    *piVar1 = iVar12;\n    return;\n  default:\n    FUN_00040b60(3,"Wrong undo update type -- please report a bug");\n    return;\n  case 0xd:\n  case 0xe:\n  case 0xf:\n    if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }\n    if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }\n    iVar7 = piVar1[10];\n    if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }\n    iVar12 = *piVar1;\n    if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }\n    piVar1[2] = uVar11;\n    piVar1[0xb] = uVar10;\n    *piVar1 = iVar7;\n    piVar1[10] = iVar12;\n    return;\n  case 0x11:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    piVar1[10] = iVar12;\n    return;\n  }\n  piVar1[3] = iVar7;\n  piVar1[0xb] = *(int *)(DAT_0007b640 + 0x1c);\n  return;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "undefined4 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "undefined4 uVar6;" type_identifier identifier ;) (declaration "void *__ptr;" primitive_type (pointer_declarator "*__ptr" * identifier) ;) (declaration "int iVar7;" primitive_type identifier ;) (declaration "undefined4 *puVar8;" type_identifier (pointer_declarator "*puVar8" * identifier) ;) (declaration "undefined4 *puVar9;" type_identifier (pointer_declarator "*puVar9" * identifier) ;) (declaration "uint uVar10;" type_identifier identifier ;) (declaration "uint uVar11;" type_identifier identifier ;) (declaration "int iVar12;" primitive_type identifier ;) (expression_statement "iVar7 = DAT_0007b640;" (assignment_expression "iVar7 = DAT_0007b640" identifier = identifier) ;) (expression_statement "piVar1 = *(int **)(DAT_0007b640 + 0x40);" (assignment_expression "piVar1 = *(int **)(DAT_0007b640 + 0x40)" identifier = (pointer_expression "*(int **)(DAT_0007b640 + 0x40)" * (cast_expression "(int **)(DAT_0007b640 + 0x40)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(DAT_0007b640 + 0x40)" ( (binary_expression "DAT_0007b640 + 0x40" identifier + number_literal) ))))) ;) (expression_statement "sVar4 = piVar1[1];" (assignment_expression "sVar4 = piVar1[1]" identifier = (subscript_expression "piVar1[1]" identifier [ number_literal ])) ;) (expression_statement "piVar1[5] = *(int *)(DAT_0007b640 + 0x14);" (assignment_expression "piVar1[5] = *(int *)(DAT_0007b640 + 0x14)" (subscript_expression "piVar1[5]" identifier [ number_literal ]) = (pointer_expression "*(int *)(DAT_0007b640 + 0x14)" * (cast_expression "(int *)(DAT_0007b640 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 0x14)" ( (binary_expression "DAT_0007b640 + 0x14" identifier + number_literal) ))))) ;) (expression_statement "puVar8 = DAT_0007b64c;" (assignment_expression "puVar8 = DAT_0007b64c" identifier = identifier) ;) (switch_statement "switch(sVar4) {\n  case 0:\n    uVar5 = FUN_0003da70(6);\n    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);\n    pcVar3 = (char *)piVar1[3];\n    if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }\n    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);\n    piVar1[3] = iVar7;\n    iVar7 = DAT_0007b640;\n    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    return;\n  case 1:\n    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));\n    break;\n  case 2:\n  case 3:\n    __ptr = (void *)FUN_0003da70(6);\n    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);\n    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }\n    pcVar3 = (char *)piVar1[3];\n    sVar4 = strlen(pcVar3);\n    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);\n    break;\n  case 4:\n  case 6:\n  case 7:\n  case 0x12:\n    return;\n  case 5:\n  case 0x10:\n  case 0x13:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[2] = *(int *)(iVar7 + 0x1c);\n    *piVar1 = iVar12;\n    return;\n  default:\n    FUN_00040b60(3,"Wrong undo update type -- please report a bug");\n    return;\n  case 0xd:\n  case 0xe:\n  case 0xf:\n    if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }\n    if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }\n    iVar7 = piVar1[10];\n    if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }\n    iVar12 = *piVar1;\n    if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }\n    piVar1[2] = uVar11;\n    piVar1[0xb] = uVar10;\n    *piVar1 = iVar7;\n    piVar1[10] = iVar12;\n    return;\n  case 0x11:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    piVar1[10] = iVar12;\n    return;\n  }" switch (parenthesized_expression "(sVar4)" ( identifier )) (compound_statement "{\n  case 0:\n    uVar5 = FUN_0003da70(6);\n    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);\n    pcVar3 = (char *)piVar1[3];\n    if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }\n    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);\n    piVar1[3] = iVar7;\n    iVar7 = DAT_0007b640;\n    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    return;\n  case 1:\n    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));\n    break;\n  case 2:\n  case 3:\n    __ptr = (void *)FUN_0003da70(6);\n    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);\n    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }\n    pcVar3 = (char *)piVar1[3];\n    sVar4 = strlen(pcVar3);\n    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);\n    break;\n  case 4:\n  case 6:\n  case 7:\n  case 0x12:\n    return;\n  case 5:\n  case 0x10:\n  case 0x13:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[2] = *(int *)(iVar7 + 0x1c);\n    *piVar1 = iVar12;\n    return;\n  default:\n    FUN_00040b60(3,"Wrong undo update type -- please report a bug");\n    return;\n  case 0xd:\n  case 0xe:\n  case 0xf:\n    if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }\n    if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }\n    iVar7 = piVar1[10];\n    if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }\n    iVar12 = *piVar1;\n    if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }\n    piVar1[2] = uVar11;\n    piVar1[0xb] = uVar10;\n    *piVar1 = iVar7;\n    piVar1[10] = iVar12;\n    return;\n  case 0x11:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    piVar1[10] = iVar12;\n    return;\n  }" { (case_statement "case 0:\n    uVar5 = FUN_0003da70(6);\n    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);\n    pcVar3 = (char *)piVar1[3];\n    if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }\n    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);\n    piVar1[3] = iVar7;\n    iVar7 = DAT_0007b640;\n    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    return;" case number_literal : (expression_statement "uVar5 = FUN_0003da70(6);" (assignment_expression "uVar5 = FUN_0003da70(6)" identifier = (call_expression "FUN_0003da70(6)" identifier (argument_list "(6)" ( number_literal )))) ;) (expression_statement "uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);" (assignment_expression "uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0)" identifier = (call_expression "FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0)" identifier (argument_list "(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0)" ( (binary_expression "piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10)" (subscript_expression "piVar1[0xb]" identifier [ number_literal ]) + (pointer_expression "**(int **)(DAT_0007b640 + 0x10)" * (pointer_expression "*(int **)(DAT_0007b640 + 0x10)" * (cast_expression "(int **)(DAT_0007b640 + 0x10)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(DAT_0007b640 + 0x10)" ( (binary_expression "DAT_0007b640 + 0x10" identifier + number_literal) )))))) , identifier , number_literal )))) ;) (expression_statement "pcVar3 = (char *)piVar1[3];" (assignment_expression "pcVar3 = (char *)piVar1[3]" identifier = (cast_expression "(char *)piVar1[3]" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar1[3]" identifier [ number_literal ]))) ;) (if_statement "if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }" if (parenthesized_expression "(pcVar3 != (char *)0x0)" ( (binary_expression "pcVar3 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      sVar4 = strlen(pcVar3);\n    }" { (expression_statement "sVar4 = strlen(pcVar3);" (assignment_expression "sVar4 = strlen(pcVar3)" identifier = (call_expression "strlen(pcVar3)" identifier (argument_list "(pcVar3)" ( identifier )))) ;) })) (expression_statement "iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);" (assignment_expression "iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6)" identifier = (call_expression "FUN_00017890(pcVar3,sVar4,uVar5,uVar6)" identifier (argument_list "(pcVar3,sVar4,uVar5,uVar6)" ( identifier , identifier , identifier , identifier )))) ;) (expression_statement "piVar1[3] = iVar7;" (assignment_expression "piVar1[3] = iVar7" (subscript_expression "piVar1[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "iVar7 = DAT_0007b640;" (assignment_expression "iVar7 = DAT_0007b640" identifier = identifier) ;) (expression_statement "piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);" (assignment_expression "piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4)" (subscript_expression "piVar1[10]" identifier [ number_literal ]) = (pointer_expression "*(int *)(*(int *)(DAT_0007b640 + 0x10) + 4)" * (cast_expression "(int *)(*(int *)(DAT_0007b640 + 0x10) + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(DAT_0007b640 + 0x10) + 4)" ( (binary_expression "*(int *)(DAT_0007b640 + 0x10) + 4" (pointer_expression "*(int *)(DAT_0007b640 + 0x10)" * (cast_expression "(int *)(DAT_0007b640 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 0x10)" ( (binary_expression "DAT_0007b640 + 0x10" identifier + number_literal) )))) + number_literal) ))))) ;) (expression_statement "piVar1[0xb] = *(int *)(iVar7 + 0x1c);" (assignment_expression "piVar1[0xb] = *(int *)(iVar7 + 0x1c)" (subscript_expression "piVar1[0xb]" identifier [ number_literal ]) = (pointer_expression "*(int *)(iVar7 + 0x1c)" * (cast_expression "(int *)(iVar7 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 0x1c)" ( (binary_expression "iVar7 + 0x1c" identifier + number_literal) ))))) ;) (return_statement "return;" return ;)) (case_statement "case 1:\n    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));\n    break;" case number_literal : (expression_statement "iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));" (assignment_expression "iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10))" identifier = (call_expression "FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10))" identifier (argument_list "(0,**(undefined4 **)(iVar7 + 0x10))" ( number_literal , (pointer_expression "**(undefined4 **)(iVar7 + 0x10)" * (pointer_expression "*(undefined4 **)(iVar7 + 0x10)" * (cast_expression "(undefined4 **)(iVar7 + 0x10)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar7 + 0x10)" ( (binary_expression "iVar7 + 0x10" identifier + number_literal) ))))) )))) ;) (break_statement "break;" break ;)) (case_statement "case 2:" case number_literal :) (case_statement "case 3:\n    __ptr = (void *)FUN_0003da70(6);\n    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);\n    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }\n    pcVar3 = (char *)piVar1[3];\n    sVar4 = strlen(pcVar3);\n    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);\n    break;" case number_literal : (expression_statement "__ptr = (void *)FUN_0003da70(6);" (assignment_expression "__ptr = (void *)FUN_0003da70(6)" identifier = (cast_expression "(void *)FUN_0003da70(6)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0003da70(6)" identifier (argument_list "(6)" ( number_literal ))))) ;) (expression_statement "iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);" (assignment_expression "iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0)" identifier = (call_expression "FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0)" identifier (argument_list "(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0)" ( (binary_expression "*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10)" (pointer_expression "*(int *)(DAT_0007b640 + 0x1c)" * (cast_expression "(int *)(DAT_0007b640 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 0x1c)" ( (binary_expression "DAT_0007b640 + 0x1c" identifier + number_literal) )))) + (pointer_expression "**(int **)(DAT_0007b640 + 0x10)" * (pointer_expression "*(int **)(DAT_0007b640 + 0x10)" * (cast_expression "(int **)(DAT_0007b640 + 0x10)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(DAT_0007b640 + 0x10)" ( (binary_expression "DAT_0007b640 + 0x10" identifier + number_literal) )))))) , identifier , number_literal )))) ;) (if_statement "if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }" if (parenthesized_expression "(*(int *)(DAT_0007b640 + 0x1c) != piVar1[2])" ( (binary_expression "*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]" (pointer_expression "*(int *)(DAT_0007b640 + 0x1c)" * (cast_expression "(int *)(DAT_0007b640 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 0x1c)" ( (binary_expression "DAT_0007b640 + 0x1c" identifier + number_literal) )))) != (subscript_expression "piVar1[2]" identifier [ number_literal ])) )) (compound_statement "{\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }" { (if_statement "if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }" if (parenthesized_expression "(*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7)" ( (binary_expression "*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7" (pointer_expression "*(int *)(DAT_0007b640 + 0x1c)" * (cast_expression "(int *)(DAT_0007b640 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 0x1c)" ( (binary_expression "DAT_0007b640 + 0x1c" identifier + number_literal) )))) != (binary_expression "piVar1[2] - iVar7" (subscript_expression "piVar1[2]" identifier [ number_literal ]) - identifier)) )) (compound_statement "{\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }" { (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) (expression_statement "FUN_000376d0(piVar1[1]);" (call_expression "FUN_000376d0(piVar1[1])" identifier (argument_list "(piVar1[1])" ( (subscript_expression "piVar1[1]" identifier [ number_literal ]) ))) ;) (return_statement "return;" return ;) })) (expression_statement "pcVar3 = (char *)piVar1[3];" (assignment_expression "pcVar3 = (char *)piVar1[3]" identifier = (cast_expression "(char *)piVar1[3]" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar1[3]" identifier [ number_literal ]))) ;) (expression_statement "sVar4 = strlen(pcVar3);" (assignment_expression "sVar4 = strlen(pcVar3)" identifier = (call_expression "strlen(pcVar3)" identifier (argument_list "(pcVar3)" ( identifier )))) ;) (expression_statement "iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);" (assignment_expression "iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4)" identifier = (call_expression "FUN_00017890(__ptr,iVar7,pcVar3,sVar4)" identifier (argument_list "(__ptr,iVar7,pcVar3,sVar4)" ( identifier , identifier , identifier , identifier )))) ;) (expression_statement "piVar1[3] = iVar7;" (assignment_expression "piVar1[3] = iVar7" (subscript_expression "piVar1[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);" (assignment_expression "piVar1[2] = *(int *)(DAT_0007b640 + 0x1c)" (subscript_expression "piVar1[2]" identifier [ number_literal ]) = (pointer_expression "*(int *)(DAT_0007b640 + 0x1c)" * (cast_expression "(int *)(DAT_0007b640 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 0x1c)" ( (binary_expression "DAT_0007b640 + 0x1c" identifier + number_literal) ))))) ;) (return_statement "return;" return ;) })) (expression_statement "pcVar3 = (char *)piVar1[3];" (assignment_expression "pcVar3 = (char *)piVar1[3]" identifier = (cast_expression "(char *)piVar1[3]" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar1[3]" identifier [ number_literal ]))) ;) (expression_statement "sVar4 = strlen(pcVar3);" (assignment_expression "sVar4 = strlen(pcVar3)" identifier = (call_expression "strlen(pcVar3)" identifier (argument_list "(pcVar3)" ( identifier )))) ;) (expression_statement "iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);" (assignment_expression "iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7)" identifier = (call_expression "FUN_00017890(pcVar3,sVar4,__ptr,iVar7)" identifier (argument_list "(pcVar3,sVar4,__ptr,iVar7)" ( identifier , identifier , identifier , identifier )))) ;) (break_statement "break;" break ;)) (case_statement "case 4:" case number_literal :) (case_statement "case 6:" case number_literal :) (case_statement "case 7:" case number_literal :) (case_statement "case 0x12:\n    return;" case number_literal : (return_statement "return;" return ;)) (case_statement "case 5:" case number_literal :) (case_statement "case 0x10:" case number_literal :) (case_statement "case 0x13:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[2] = *(int *)(iVar7 + 0x1c);\n    *piVar1 = iVar12;\n    return;" case number_literal : (expression_statement "iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);" (assignment_expression "iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4)" identifier = (pointer_expression "*(int *)(*(int *)(iVar7 + 0x10) + 4)" * (cast_expression "(int *)(*(int *)(iVar7 + 0x10) + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(iVar7 + 0x10) + 4)" ( (binary_expression "*(int *)(iVar7 + 0x10) + 4" (pointer_expression "*(int *)(iVar7 + 0x10)" * (cast_expression "(int *)(iVar7 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 0x10)" ( (binary_expression "iVar7 + 0x10" identifier + number_literal) )))) + number_literal) ))))) ;) (expression_statement "piVar1[2] = *(int *)(iVar7 + 0x1c);" (assignment_expression "piVar1[2] = *(int *)(iVar7 + 0x1c)" (subscript_expression "piVar1[2]" identifier [ number_literal ]) = (pointer_expression "*(int *)(iVar7 + 0x1c)" * (cast_expression "(int *)(iVar7 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 0x1c)" ( (binary_expression "iVar7 + 0x1c" identifier + number_literal) ))))) ;) (expression_statement "*piVar1 = iVar12;" (assignment_expression "*piVar1 = iVar12" (pointer_expression "*piVar1" * identifier) = identifier) ;) (return_statement "return;" return ;)) (case_statement "default:\n    FUN_00040b60(3,"Wrong undo update type -- please report a bug");\n    return;" default : (expression_statement "FUN_00040b60(3,"Wrong undo update type -- please report a bug");" (call_expression "FUN_00040b60(3,"Wrong undo update type -- please report a bug")" identifier (argument_list "(3,"Wrong undo update type -- please report a bug")" ( number_literal , (string_literal ""Wrong undo update type -- please report a bug"" " string_content ") ))) ;) (return_statement "return;" return ;)) (case_statement "case 0xd:" case number_literal :) (case_statement "case 0xe:" case number_literal :) (case_statement "case 0xf:\n    if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }\n    if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }\n    iVar7 = piVar1[10];\n    if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }\n    iVar12 = *piVar1;\n    if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }\n    piVar1[2] = uVar11;\n    piVar1[0xb] = uVar10;\n    *piVar1 = iVar7;\n    piVar1[10] = iVar12;\n    return;" case number_literal : (if_statement "if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }" if (parenthesized_expression "(DAT_0007b64c == (undefined4 *)0x0)" ( (binary_expression "DAT_0007b64c == (undefined4 *)0x0" identifier == (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return;\n    }" { (return_statement "return;" return ;) })) (if_statement "if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }" if (parenthesized_expression "(sVar4 == 0xd)" ( (binary_expression "sVar4 == 0xd" identifier == number_literal) )) (compound_statement "{\n      piVar1[8] = (int)DAT_0007b64c;\n    }" { (expression_statement "piVar1[8] = (int)DAT_0007b64c;" (assignment_expression "piVar1[8] = (int)DAT_0007b64c" (subscript_expression "piVar1[8]" identifier [ number_literal ]) = (cast_expression "(int)DAT_0007b64c" ( (type_descriptor "int" primitive_type) ) identifier)) ;) }) (else_clause "else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }" else (compound_statement "{\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }" { (expression_statement "FUN_0002af00(piVar1[8]);" (call_expression "FUN_0002af00(piVar1[8])" identifier (argument_list "(piVar1[8])" ( (subscript_expression "piVar1[8]" identifier [ number_literal ]) ))) ;) (expression_statement "puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);" (assignment_expression "puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c)" identifier = (cast_expression "(undefined4 *)FUN_0002ae40(DAT_0007b64c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0002ae40(DAT_0007b64c)" identifier (argument_list "(DAT_0007b64c)" ( identifier ))))) ;) (expression_statement "piVar1[8] = (int)puVar8;" (assignment_expression "piVar1[8] = (int)puVar8" (subscript_expression "piVar1[8]" identifier [ number_literal ]) = (cast_expression "(int)puVar8" ( (type_descriptor "int" primitive_type) ) identifier)) ;) }))) (expression_statement "iVar7 = piVar1[10];" (assignment_expression "iVar7 = piVar1[10]" identifier = (subscript_expression "piVar1[10]" identifier [ number_literal ])) ;) (if_statement "if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }" if (parenthesized_expression "(piVar1[6] != 0x10)" ( (binary_expression "piVar1[6] != 0x10" (subscript_expression "piVar1[6]" identifier [ number_literal ]) != number_literal) )) (compound_statement "{\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }" { (expression_statement "puVar2 = (undefined4 *)puVar8[2];" (assignment_expression "puVar2 = (undefined4 *)puVar8[2]" identifier = (cast_expression "(undefined4 *)puVar8[2]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "puVar8[2]" identifier [ number_literal ]))) ;) (expression_statement "piVar1[9] = (int)puVar8;" (assignment_expression "piVar1[9] = (int)puVar8" (subscript_expression "piVar1[9]" identifier [ number_literal ]) = (cast_expression "(int)puVar8" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "puVar9 = puVar8;" (assignment_expression "puVar9 = puVar8" identifier = identifier) ;) (if_statement "if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }" if (parenthesized_expression "(puVar2 != (undefined4 *)0x0)" ( (binary_expression "puVar2 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }" { (do_statement "do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);" do (compound_statement "{\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        }" { (expression_statement "puVar9 = puVar2;" (assignment_expression "puVar9 = puVar2" identifier = identifier) ;) (expression_statement "puVar2 = (undefined4 *)puVar9[2];" (assignment_expression "puVar2 = (undefined4 *)puVar9[2]" identifier = (cast_expression "(undefined4 *)puVar9[2]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "puVar9[2]" identifier [ number_literal ]))) ;) }) while (parenthesized_expression "((undefined4 *)puVar9[2] != (undefined4 *)0x0)" ( (binary_expression "(undefined4 *)puVar9[2] != (undefined4 *)0x0" (cast_expression "(undefined4 *)puVar9[2]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "puVar9[2]" identifier [ number_literal ])) != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) ;) (expression_statement "piVar1[9] = (int)puVar9;" (assignment_expression "piVar1[9] = (int)puVar9" (subscript_expression "piVar1[9]" identifier [ number_literal ]) = (cast_expression "(int)puVar9" ( (type_descriptor "int" primitive_type) ) identifier)) ;) })) (expression_statement "iVar12 = (puVar9[1] + iVar7) - puVar8[1];" (assignment_expression "iVar12 = (puVar9[1] + iVar7) - puVar8[1]" identifier = (binary_expression "(puVar9[1] + iVar7) - puVar8[1]" (parenthesized_expression "(puVar9[1] + iVar7)" ( (binary_expression "puVar9[1] + iVar7" (subscript_expression "puVar9[1]" identifier [ number_literal ]) + identifier) )) - (subscript_expression "puVar8[1]" identifier [ number_literal ]))) ;) (expression_statement "*piVar1 = iVar12;" (assignment_expression "*piVar1 = iVar12" (pointer_expression "*piVar1" * identifier) = identifier) ;) (if_statement "if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }" if (parenthesized_expression "(((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf))" ( (binary_expression "((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)" (parenthesized_expression "((DAT_0007b664 & 0x800) != 0)" ( (binary_expression "(DAT_0007b664 & 0x800) != 0" (parenthesized_expression "(DAT_0007b664 & 0x800)" ( (binary_expression "DAT_0007b664 & 0x800" identifier & number_literal) )) != number_literal) )) || (parenthesized_expression "(piVar1[1] == 0xf)" ( (binary_expression "piVar1[1] == 0xf" (subscript_expression "piVar1[1]" identifier [ number_literal ]) == number_literal) ))) )) (compound_statement "{\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }" { (expression_statement "sVar4 = strlen((char *)*puVar9);" (assignment_expression "sVar4 = strlen((char *)*puVar9)" identifier = (call_expression "strlen((char *)*puVar9)" identifier (argument_list "((char *)*puVar9)" ( (cast_expression "(char *)*puVar9" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*puVar9" * identifier)) )))) ;) (expression_statement "piVar1[2] = sVar4;" (assignment_expression "piVar1[2] = sVar4" (subscript_expression "piVar1[2]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }" if (parenthesized_expression "(iVar12 == iVar7)" ( (binary_expression "iVar12 == iVar7" identifier == identifier) )) (compound_statement "{\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }" { (expression_statement "piVar1[2] = sVar4 + piVar1[0xb];" (assignment_expression "piVar1[2] = sVar4 + piVar1[0xb]" (subscript_expression "piVar1[2]" identifier [ number_literal ]) = (binary_expression "sVar4 + piVar1[0xb]" identifier + (subscript_expression "piVar1[0xb]" identifier [ number_literal ]))) ;) (return_statement "return;" return ;) })) (return_statement "return;" return ;) })) (if_statement "if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }" if (parenthesized_expression "(*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8))" ( (binary_expression "*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)" (pointer_expression "*(int *)(DAT_0007b640 + 0x10)" * (cast_expression "(int *)(DAT_0007b640 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 0x10)" ( (binary_expression "DAT_0007b640 + 0x10" identifier + number_literal) )))) != (pointer_expression "*(int *)(DAT_0007b640 + 8)" * (cast_expression "(int *)(DAT_0007b640 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 8)" ( (binary_expression "DAT_0007b640 + 8" identifier + number_literal) ))))) )) (compound_statement "{\n        return;\n      }" { (return_statement "return;" return ;) })) (if_statement "if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }" if (parenthesized_expression "((DAT_0007b664 & 0x40000000) != 0)" ( (binary_expression "(DAT_0007b664 & 0x40000000) != 0" (parenthesized_expression "(DAT_0007b664 & 0x40000000)" ( (binary_expression "DAT_0007b664 & 0x40000000" identifier & number_literal) )) != number_literal) )) (compound_statement "{\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }" { (expression_statement "sVar4 = strlen((char *)*puVar9);" (assignment_expression "sVar4 = strlen((char *)*puVar9)" identifier = (call_expression "strlen((char *)*puVar9)" identifier (argument_list "((char *)*puVar9)" ( (cast_expression "(char *)*puVar9" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*puVar9" * identifier)) )))) ;) (expression_statement "piVar1[2] = sVar4;" (assignment_expression "piVar1[2] = sVar4" (subscript_expression "piVar1[2]" identifier [ number_literal ]) = identifier) ;) (return_statement "return;" return ;) })) (return_statement "return;" return ;) })) (expression_statement "iVar12 = *piVar1;" (assignment_expression "iVar12 = *piVar1" identifier = (pointer_expression "*piVar1" * identifier)) ;) (if_statement "if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }" if (parenthesized_expression "(iVar12 == iVar7)" ( (binary_expression "iVar12 == iVar7" identifier == identifier) )) (compound_statement "{\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }" { (expression_statement "uVar10 = piVar1[2];" (assignment_expression "uVar10 = piVar1[2]" identifier = (subscript_expression "piVar1[2]" identifier [ number_literal ])) ;) (expression_statement "uVar11 = piVar1[0xb];" (assignment_expression "uVar11 = piVar1[0xb]" identifier = (subscript_expression "piVar1[0xb]" identifier [ number_literal ])) ;) (if_statement "if (uVar11 <= uVar10) goto code_r0x00037d97;" if (parenthesized_expression "(uVar11 <= uVar10)" ( (binary_expression "uVar11 <= uVar10" identifier <= identifier) )) (goto_statement "goto code_r0x00037d97;" goto statement_identifier ;)) }) (else_clause "else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }" else (compound_statement "{\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }" { (if_statement "if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }" if (parenthesized_expression "(iVar7 <= iVar12)" ( (binary_expression "iVar7 <= iVar12" identifier <= identifier) )) (compound_statement "{\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }" { (labeled_statement "code_r0x00037d97:\n        piVar1[6] = 0x20;" statement_identifier : (expression_statement "piVar1[6] = 0x20;" (assignment_expression "piVar1[6] = 0x20" (subscript_expression "piVar1[6]" identifier [ number_literal ]) = number_literal) ;)) (return_statement "return;" return ;) })) (expression_statement "uVar10 = piVar1[2];" (assignment_expression "uVar10 = piVar1[2]" identifier = (subscript_expression "piVar1[2]" identifier [ number_literal ])) ;) (expression_statement "uVar11 = piVar1[0xb];" (assignment_expression "uVar11 = piVar1[0xb]" identifier = (subscript_expression "piVar1[0xb]" identifier [ number_literal ])) ;) }))) (expression_statement "piVar1[2] = uVar11;" (assignment_expression "piVar1[2] = uVar11" (subscript_expression "piVar1[2]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar1[0xb] = uVar10;" (assignment_expression "piVar1[0xb] = uVar10" (subscript_expression "piVar1[0xb]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*piVar1 = iVar7;" (assignment_expression "*piVar1 = iVar7" (pointer_expression "*piVar1" * identifier) = identifier) ;) (expression_statement "piVar1[10] = iVar12;" (assignment_expression "piVar1[10] = iVar12" (subscript_expression "piVar1[10]" identifier [ number_literal ]) = identifier) ;) (return_statement "return;" return ;)) (case_statement "case 0x11:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    piVar1[10] = iVar12;\n    return;" case number_literal : (expression_statement "iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);" (assignment_expression "iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4)" identifier = (pointer_expression "*(int *)(*(int *)(iVar7 + 0x10) + 4)" * (cast_expression "(int *)(*(int *)(iVar7 + 0x10) + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(iVar7 + 0x10) + 4)" ( (binary_expression "*(int *)(iVar7 + 0x10) + 4" (pointer_expression "*(int *)(iVar7 + 0x10)" * (cast_expression "(int *)(iVar7 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 0x10)" ( (binary_expression "iVar7 + 0x10" identifier + number_literal) )))) + number_literal) ))))) ;) (expression_statement "piVar1[0xb] = *(int *)(iVar7 + 0x1c);" (assignment_expression "piVar1[0xb] = *(int *)(iVar7 + 0x1c)" (subscript_expression "piVar1[0xb]" identifier [ number_literal ]) = (pointer_expression "*(int *)(iVar7 + 0x1c)" * (cast_expression "(int *)(iVar7 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 0x1c)" ( (binary_expression "iVar7 + 0x1c" identifier + number_literal) ))))) ;) (expression_statement "piVar1[10] = iVar12;" (assignment_expression "piVar1[10] = iVar12" (subscript_expression "piVar1[10]" identifier [ number_literal ]) = identifier) ;) (return_statement "return;" return ;)) })) (expression_statement "piVar1[3] = iVar7;" (assignment_expression "piVar1[3] = iVar7" (subscript_expression "piVar1[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar1[0xb] = *(int *)(DAT_0007b640 + 0x1c);" (assignment_expression "piVar1[0xb] = *(int *)(DAT_0007b640 + 0x1c)" (subscript_expression "piVar1[0xb]" identifier [ number_literal ]) = (pointer_expression "*(int *)(DAT_0007b640 + 0x1c)" * (cast_expression "(int *)(DAT_0007b640 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 0x1c)" ( (binary_expression "DAT_0007b640 + 0x1c" identifier + number_literal) ))))) ;) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid update_undo(undo_type action)\n\n{\n  undo *puVar1;\n  int iVar2;\n  filestruct *pfVar3;\n  ssize_t sVar4;\n  openfilestruct *poVar5;\n  size_t sVar6;\n  char *pcVar7;\n  undo_type len1;\n  char *pcVar8;\n  size_t sVar9;\n  filestruct *pfVar10;\n  filestruct *pfVar11;\n  uint uVar12;\n  uint uVar13;\n  int iVar14;\n  \n  poVar5 = openfile;\n  puVar1 = openfile->undotop;\n  len1 = puVar1->type;\n  puVar1->newsize = openfile->totsize;\n  pfVar10 = cutbuffer;\n  switch(len1) {\n  case ADD:\n    pcVar7 = (char *)nmalloc(6);\n    sVar9 = parse_mbchar(openfile->current->data + puVar1->mark_begin_x,pcVar7,(size_t *)0x0);\n    pcVar8 = puVar1->strdata;\n    if (pcVar8 != (char *)0x0) {\n      len1 = strlen(pcVar8);\n    }\n    pcVar8 = addstrings(pcVar8,len1,pcVar7,sVar9);\n    puVar1->strdata = pcVar8;\n    poVar5 = openfile;\n    puVar1->mark_begin_lineno = openfile->current->lineno;\n    puVar1->mark_begin_x = poVar5->current_x;\n    return;\n  case ENTER:\n    pcVar8 = mallocstrcpy((char *)0x0,poVar5->current->data);\n    break;\n  case BACK:\n  case DEL:\n    pcVar8 = (char *)nmalloc(6);\n    sVar9 = parse_mbchar(openfile->current->data + openfile->current_x,pcVar8,(size_t *)0x0);\n    if (openfile->current_x != puVar1->begin) {\n      if (openfile->current_x != puVar1->begin - sVar9) {\n        free(pcVar8);\n        add_undo(puVar1->type);\n        return;\n      }\n      pcVar7 = puVar1->strdata;\n      sVar6 = strlen(pcVar7);\n      pcVar8 = addstrings(pcVar8,sVar9,pcVar7,sVar6);\n      puVar1->strdata = pcVar8;\n      puVar1->begin = openfile->current_x;\n      return;\n    }\n    pcVar7 = puVar1->strdata;\n    sVar6 = strlen(pcVar7);\n    pcVar8 = addstrings(pcVar7,sVar6,pcVar8,sVar9);\n    break;\n  case JOIN:\n  case SPLIT_BEGIN:\n  case SPLIT_END:\n  case COUPLE_BEGIN:\n    return;\n  case REPLACE:\n  case PASTE:\n  case COUPLE_END:\n    sVar4 = poVar5->current->lineno;\n    puVar1->begin = poVar5->current_x;\n    puVar1->lineno = sVar4;\n    return;\n  default:\n    statusline(ALERT,"Wrong undo update type -- please report a bug");\n    return;\n  case ZAP:\n  case CUT:\n  case CUT_TO_EOF:\n    if (cutbuffer == (filestruct *)0x0) {\n      return;\n    }\n    if (len1 == ZAP) {\n      puVar1->cutbuffer = cutbuffer;\n    }\n    else {\n      free_filestruct(puVar1->cutbuffer);\n      pfVar10 = copy_filestruct(cutbuffer);\n      puVar1->cutbuffer = pfVar10;\n    }\n    iVar2 = puVar1->mark_begin_lineno;\n    if (puVar1->xflags != 0x10) {\n      pfVar3 = pfVar10->next;\n      puVar1->cutbottom = pfVar10;\n      pfVar11 = pfVar10;\n      if (pfVar3 != (filestruct *)0x0) {\n        do {\n          pfVar11 = pfVar3;\n          pfVar3 = pfVar11->next;\n        } while (pfVar11->next != (filestruct *)0x0);\n        puVar1->cutbottom = pfVar11;\n      }\n      iVar14 = (pfVar11->lineno + iVar2) - pfVar10->lineno;\n      puVar1->lineno = iVar14;\n      if (((flags[0] & 0x800) != 0) || (puVar1->type == CUT_TO_EOF)) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        if (iVar14 == iVar2) {\n          puVar1->begin = sVar6 + puVar1->mark_begin_x;\n          return;\n        }\n        return;\n      }\n      if (openfile->current != openfile->filebot) {\n        return;\n      }\n      if ((flags[0] & 0x40000000) != 0) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        return;\n      }\n      return;\n    }\n    iVar14 = puVar1->lineno;\n    if (iVar14 == iVar2) {\n      uVar12 = puVar1->begin;\n      uVar13 = puVar1->mark_begin_x;\n      if (uVar13 <= uVar12) goto LAB_00037d97;\n    }\n    else {\n      if (iVar2 <= iVar14) {\nLAB_00037d97:\n        puVar1->xflags = 0x20;\n        return;\n      }\n      uVar12 = puVar1->begin;\n      uVar13 = puVar1->mark_begin_x;\n    }\n    puVar1->begin = uVar13;\n    puVar1->mark_begin_x = uVar12;\n    puVar1->lineno = iVar2;\n    puVar1->mark_begin_lineno = iVar14;\n    return;\n  case INSERT:\n    sVar4 = poVar5->current->lineno;\n    puVar1->mark_begin_x = poVar5->current_x;\n    puVar1->mark_begin_lineno = sVar4;\n    return;\n  }\n  puVar1->strdata = pcVar8;\n  puVar1->mark_begin_x = openfile->current_x;\n  return;\n}\n\n" comment (function_definition "void update_undo(undo_type action)\n\n{\n  undo *puVar1;\n  int iVar2;\n  filestruct *pfVar3;\n  ssize_t sVar4;\n  openfilestruct *poVar5;\n  size_t sVar6;\n  char *pcVar7;\n  undo_type len1;\n  char *pcVar8;\n  size_t sVar9;\n  filestruct *pfVar10;\n  filestruct *pfVar11;\n  uint uVar12;\n  uint uVar13;\n  int iVar14;\n  \n  poVar5 = openfile;\n  puVar1 = openfile->undotop;\n  len1 = puVar1->type;\n  puVar1->newsize = openfile->totsize;\n  pfVar10 = cutbuffer;\n  switch(len1) {\n  case ADD:\n    pcVar7 = (char *)nmalloc(6);\n    sVar9 = parse_mbchar(openfile->current->data + puVar1->mark_begin_x,pcVar7,(size_t *)0x0);\n    pcVar8 = puVar1->strdata;\n    if (pcVar8 != (char *)0x0) {\n      len1 = strlen(pcVar8);\n    }\n    pcVar8 = addstrings(pcVar8,len1,pcVar7,sVar9);\n    puVar1->strdata = pcVar8;\n    poVar5 = openfile;\n    puVar1->mark_begin_lineno = openfile->current->lineno;\n    puVar1->mark_begin_x = poVar5->current_x;\n    return;\n  case ENTER:\n    pcVar8 = mallocstrcpy((char *)0x0,poVar5->current->data);\n    break;\n  case BACK:\n  case DEL:\n    pcVar8 = (char *)nmalloc(6);\n    sVar9 = parse_mbchar(openfile->current->data + openfile->current_x,pcVar8,(size_t *)0x0);\n    if (openfile->current_x != puVar1->begin) {\n      if (openfile->current_x != puVar1->begin - sVar9) {\n        free(pcVar8);\n        add_undo(puVar1->type);\n        return;\n      }\n      pcVar7 = puVar1->strdata;\n      sVar6 = strlen(pcVar7);\n      pcVar8 = addstrings(pcVar8,sVar9,pcVar7,sVar6);\n      puVar1->strdata = pcVar8;\n      puVar1->begin = openfile->current_x;\n      return;\n    }\n    pcVar7 = puVar1->strdata;\n    sVar6 = strlen(pcVar7);\n    pcVar8 = addstrings(pcVar7,sVar6,pcVar8,sVar9);\n    break;\n  case JOIN:\n  case SPLIT_BEGIN:\n  case SPLIT_END:\n  case COUPLE_BEGIN:\n    return;\n  case REPLACE:\n  case PASTE:\n  case COUPLE_END:\n    sVar4 = poVar5->current->lineno;\n    puVar1->begin = poVar5->current_x;\n    puVar1->lineno = sVar4;\n    return;\n  default:\n    statusline(ALERT,"Wrong undo update type -- please report a bug");\n    return;\n  case ZAP:\n  case CUT:\n  case CUT_TO_EOF:\n    if (cutbuffer == (filestruct *)0x0) {\n      return;\n    }\n    if (len1 == ZAP) {\n      puVar1->cutbuffer = cutbuffer;\n    }\n    else {\n      free_filestruct(puVar1->cutbuffer);\n      pfVar10 = copy_filestruct(cutbuffer);\n      puVar1->cutbuffer = pfVar10;\n    }\n    iVar2 = puVar1->mark_begin_lineno;\n    if (puVar1->xflags != 0x10) {\n      pfVar3 = pfVar10->next;\n      puVar1->cutbottom = pfVar10;\n      pfVar11 = pfVar10;\n      if (pfVar3 != (filestruct *)0x0) {\n        do {\n          pfVar11 = pfVar3;\n          pfVar3 = pfVar11->next;\n        } while (pfVar11->next != (filestruct *)0x0);\n        puVar1->cutbottom = pfVar11;\n      }\n      iVar14 = (pfVar11->lineno + iVar2) - pfVar10->lineno;\n      puVar1->lineno = iVar14;\n      if (((flags[0] & 0x800) != 0) || (puVar1->type == CUT_TO_EOF)) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        if (iVar14 == iVar2) {\n          puVar1->begin = sVar6 + puVar1->mark_begin_x;\n          return;\n        }\n        return;\n      }\n      if (openfile->current != openfile->filebot) {\n        return;\n      }\n      if ((flags[0] & 0x40000000) != 0) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        return;\n      }\n      return;\n    }\n    iVar14 = puVar1->lineno;\n    if (iVar14 == iVar2) {\n      uVar12 = puVar1->begin;\n      uVar13 = puVar1->mark_begin_x;\n      if (uVar13 <= uVar12) goto LAB_00037d97;\n    }\n    else {\n      if (iVar2 <= iVar14) {\nLAB_00037d97:\n        puVar1->xflags = 0x20;\n        return;\n      }\n      uVar12 = puVar1->begin;\n      uVar13 = puVar1->mark_begin_x;\n    }\n    puVar1->begin = uVar13;\n    puVar1->mark_begin_x = uVar12;\n    puVar1->lineno = iVar2;\n    puVar1->mark_begin_lineno = iVar14;\n    return;\n  case INSERT:\n    sVar4 = poVar5->current->lineno;\n    puVar1->mark_begin_x = poVar5->current_x;\n    puVar1->mark_begin_lineno = sVar4;\n    return;\n  }\n  puVar1->strdata = pcVar8;\n  puVar1->mark_begin_x = openfile->current_x;\n  return;\n}" primitive_type (function_declarator "update_undo(undo_type action)" identifier (parameter_list "(undo_type action)" ( (parameter_declaration "undo_type action" type_identifier identifier) ))) (compound_statement "{\n  undo *puVar1;\n  int iVar2;\n  filestruct *pfVar3;\n  ssize_t sVar4;\n  openfilestruct *poVar5;\n  size_t sVar6;\n  char *pcVar7;\n  undo_type len1;\n  char *pcVar8;\n  size_t sVar9;\n  filestruct *pfVar10;\n  filestruct *pfVar11;\n  uint uVar12;\n  uint uVar13;\n  int iVar14;\n  \n  poVar5 = openfile;\n  puVar1 = openfile->undotop;\n  len1 = puVar1->type;\n  puVar1->newsize = openfile->totsize;\n  pfVar10 = cutbuffer;\n  switch(len1) {\n  case ADD:\n    pcVar7 = (char *)nmalloc(6);\n    sVar9 = parse_mbchar(openfile->current->data + puVar1->mark_begin_x,pcVar7,(size_t *)0x0);\n    pcVar8 = puVar1->strdata;\n    if (pcVar8 != (char *)0x0) {\n      len1 = strlen(pcVar8);\n    }\n    pcVar8 = addstrings(pcVar8,len1,pcVar7,sVar9);\n    puVar1->strdata = pcVar8;\n    poVar5 = openfile;\n    puVar1->mark_begin_lineno = openfile->current->lineno;\n    puVar1->mark_begin_x = poVar5->current_x;\n    return;\n  case ENTER:\n    pcVar8 = mallocstrcpy((char *)0x0,poVar5->current->data);\n    break;\n  case BACK:\n  case DEL:\n    pcVar8 = (char *)nmalloc(6);\n    sVar9 = parse_mbchar(openfile->current->data + openfile->current_x,pcVar8,(size_t *)0x0);\n    if (openfile->current_x != puVar1->begin) {\n      if (openfile->current_x != puVar1->begin - sVar9) {\n        free(pcVar8);\n        add_undo(puVar1->type);\n        return;\n      }\n      pcVar7 = puVar1->strdata;\n      sVar6 = strlen(pcVar7);\n      pcVar8 = addstrings(pcVar8,sVar9,pcVar7,sVar6);\n      puVar1->strdata = pcVar8;\n      puVar1->begin = openfile->current_x;\n      return;\n    }\n    pcVar7 = puVar1->strdata;\n    sVar6 = strlen(pcVar7);\n    pcVar8 = addstrings(pcVar7,sVar6,pcVar8,sVar9);\n    break;\n  case JOIN:\n  case SPLIT_BEGIN:\n  case SPLIT_END:\n  case COUPLE_BEGIN:\n    return;\n  case REPLACE:\n  case PASTE:\n  case COUPLE_END:\n    sVar4 = poVar5->current->lineno;\n    puVar1->begin = poVar5->current_x;\n    puVar1->lineno = sVar4;\n    return;\n  default:\n    statusline(ALERT,"Wrong undo update type -- please report a bug");\n    return;\n  case ZAP:\n  case CUT:\n  case CUT_TO_EOF:\n    if (cutbuffer == (filestruct *)0x0) {\n      return;\n    }\n    if (len1 == ZAP) {\n      puVar1->cutbuffer = cutbuffer;\n    }\n    else {\n      free_filestruct(puVar1->cutbuffer);\n      pfVar10 = copy_filestruct(cutbuffer);\n      puVar1->cutbuffer = pfVar10;\n    }\n    iVar2 = puVar1->mark_begin_lineno;\n    if (puVar1->xflags != 0x10) {\n      pfVar3 = pfVar10->next;\n      puVar1->cutbottom = pfVar10;\n      pfVar11 = pfVar10;\n      if (pfVar3 != (filestruct *)0x0) {\n        do {\n          pfVar11 = pfVar3;\n          pfVar3 = pfVar11->next;\n        } while (pfVar11->next != (filestruct *)0x0);\n        puVar1->cutbottom = pfVar11;\n      }\n      iVar14 = (pfVar11->lineno + iVar2) - pfVar10->lineno;\n      puVar1->lineno = iVar14;\n      if (((flags[0] & 0x800) != 0) || (puVar1->type == CUT_TO_EOF)) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        if (iVar14 == iVar2) {\n          puVar1->begin = sVar6 + puVar1->mark_begin_x;\n          return;\n        }\n        return;\n      }\n      if (openfile->current != openfile->filebot) {\n        return;\n      }\n      if ((flags[0] & 0x40000000) != 0) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        return;\n      }\n      return;\n    }\n    iVar14 = puVar1->lineno;\n    if (iVar14 == iVar2) {\n      uVar12 = puVar1->begin;\n      uVar13 = puVar1->mark_begin_x;\n      if (uVar13 <= uVar12) goto LAB_00037d97;\n    }\n    else {\n      if (iVar2 <= iVar14) {\nLAB_00037d97:\n        puVar1->xflags = 0x20;\n        return;\n      }\n      uVar12 = puVar1->begin;\n      uVar13 = puVar1->mark_begin_x;\n    }\n    puVar1->begin = uVar13;\n    puVar1->mark_begin_x = uVar12;\n    puVar1->lineno = iVar2;\n    puVar1->mark_begin_lineno = iVar14;\n    return;\n  case INSERT:\n    sVar4 = poVar5->current->lineno;\n    puVar1->mark_begin_x = poVar5->current_x;\n    puVar1->mark_begin_lineno = sVar4;\n    return;\n  }\n  puVar1->strdata = pcVar8;\n  puVar1->mark_begin_x = openfile->current_x;\n  return;\n}" { (declaration "undo *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "filestruct *pfVar3;" type_identifier (pointer_declarator "*pfVar3" * identifier) ;) (declaration "ssize_t sVar4;" primitive_type identifier ;) (declaration "openfilestruct *poVar5;" type_identifier (pointer_declarator "*poVar5" * identifier) ;) (declaration "size_t sVar6;" primitive_type identifier ;) (declaration "char *pcVar7;" primitive_type (pointer_declarator "*pcVar7" * identifier) ;) (declaration "undo_type len1;" type_identifier identifier ;) (declaration "char *pcVar8;" primitive_type (pointer_declarator "*pcVar8" * identifier) ;) (declaration "size_t sVar9;" primitive_type identifier ;) (declaration "filestruct *pfVar10;" type_identifier (pointer_declarator "*pfVar10" * identifier) ;) (declaration "filestruct *pfVar11;" type_identifier (pointer_declarator "*pfVar11" * identifier) ;) (declaration "uint uVar12;" type_identifier identifier ;) (declaration "uint uVar13;" type_identifier identifier ;) (declaration "int iVar14;" primitive_type identifier ;) (expression_statement "poVar5 = openfile;" (assignment_expression "poVar5 = openfile" identifier = identifier) ;) (expression_statement "puVar1 = openfile->undotop;" (assignment_expression "puVar1 = openfile->undotop" identifier = (field_expression "openfile->undotop" identifier -> field_identifier)) ;) (expression_statement "len1 = puVar1->type;" (assignment_expression "len1 = puVar1->type" identifier = (field_expression "puVar1->type" identifier -> field_identifier)) ;) (expression_statement "puVar1->newsize = openfile->totsize;" (assignment_expression "puVar1->newsize = openfile->totsize" (field_expression "puVar1->newsize" identifier -> field_identifier) = (field_expression "openfile->totsize" identifier -> field_identifier)) ;) (expression_statement "pfVar10 = cutbuffer;" (assignment_expression "pfVar10 = cutbuffer" identifier = identifier) ;) (switch_statement "switch(len1) {\n  case ADD:\n    pcVar7 = (char *)nmalloc(6);\n    sVar9 = parse_mbchar(openfile->current->data + puVar1->mark_begin_x,pcVar7,(size_t *)0x0);\n    pcVar8 = puVar1->strdata;\n    if (pcVar8 != (char *)0x0) {\n      len1 = strlen(pcVar8);\n    }\n    pcVar8 = addstrings(pcVar8,len1,pcVar7,sVar9);\n    puVar1->strdata = pcVar8;\n    poVar5 = openfile;\n    puVar1->mark_begin_lineno = openfile->current->lineno;\n    puVar1->mark_begin_x = poVar5->current_x;\n    return;\n  case ENTER:\n    pcVar8 = mallocstrcpy((char *)0x0,poVar5->current->data);\n    break;\n  case BACK:\n  case DEL:\n    pcVar8 = (char *)nmalloc(6);\n    sVar9 = parse_mbchar(openfile->current->data + openfile->current_x,pcVar8,(size_t *)0x0);\n    if (openfile->current_x != puVar1->begin) {\n      if (openfile->current_x != puVar1->begin - sVar9) {\n        free(pcVar8);\n        add_undo(puVar1->type);\n        return;\n      }\n      pcVar7 = puVar1->strdata;\n      sVar6 = strlen(pcVar7);\n      pcVar8 = addstrings(pcVar8,sVar9,pcVar7,sVar6);\n      puVar1->strdata = pcVar8;\n      puVar1->begin = openfile->current_x;\n      return;\n    }\n    pcVar7 = puVar1->strdata;\n    sVar6 = strlen(pcVar7);\n    pcVar8 = addstrings(pcVar7,sVar6,pcVar8,sVar9);\n    break;\n  case JOIN:\n  case SPLIT_BEGIN:\n  case SPLIT_END:\n  case COUPLE_BEGIN:\n    return;\n  case REPLACE:\n  case PASTE:\n  case COUPLE_END:\n    sVar4 = poVar5->current->lineno;\n    puVar1->begin = poVar5->current_x;\n    puVar1->lineno = sVar4;\n    return;\n  default:\n    statusline(ALERT,"Wrong undo update type -- please report a bug");\n    return;\n  case ZAP:\n  case CUT:\n  case CUT_TO_EOF:\n    if (cutbuffer == (filestruct *)0x0) {\n      return;\n    }\n    if (len1 == ZAP) {\n      puVar1->cutbuffer = cutbuffer;\n    }\n    else {\n      free_filestruct(puVar1->cutbuffer);\n      pfVar10 = copy_filestruct(cutbuffer);\n      puVar1->cutbuffer = pfVar10;\n    }\n    iVar2 = puVar1->mark_begin_lineno;\n    if (puVar1->xflags != 0x10) {\n      pfVar3 = pfVar10->next;\n      puVar1->cutbottom = pfVar10;\n      pfVar11 = pfVar10;\n      if (pfVar3 != (filestruct *)0x0) {\n        do {\n          pfVar11 = pfVar3;\n          pfVar3 = pfVar11->next;\n        } while (pfVar11->next != (filestruct *)0x0);\n        puVar1->cutbottom = pfVar11;\n      }\n      iVar14 = (pfVar11->lineno + iVar2) - pfVar10->lineno;\n      puVar1->lineno = iVar14;\n      if (((flags[0] & 0x800) != 0) || (puVar1->type == CUT_TO_EOF)) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        if (iVar14 == iVar2) {\n          puVar1->begin = sVar6 + puVar1->mark_begin_x;\n          return;\n        }\n        return;\n      }\n      if (openfile->current != openfile->filebot) {\n        return;\n      }\n      if ((flags[0] & 0x40000000) != 0) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        return;\n      }\n      return;\n    }\n    iVar14 = puVar1->lineno;\n    if (iVar14 == iVar2) {\n      uVar12 = puVar1->begin;\n      uVar13 = puVar1->mark_begin_x;\n      if (uVar13 <= uVar12) goto LAB_00037d97;\n    }\n    else {\n      if (iVar2 <= iVar14) {\nLAB_00037d97:\n        puVar1->xflags = 0x20;\n        return;\n      }\n      uVar12 = puVar1->begin;\n      uVar13 = puVar1->mark_begin_x;\n    }\n    puVar1->begin = uVar13;\n    puVar1->mark_begin_x = uVar12;\n    puVar1->lineno = iVar2;\n    puVar1->mark_begin_lineno = iVar14;\n    return;\n  case INSERT:\n    sVar4 = poVar5->current->lineno;\n    puVar1->mark_begin_x = poVar5->current_x;\n    puVar1->mark_begin_lineno = sVar4;\n    return;\n  }" switch (parenthesized_expression "(len1)" ( identifier )) (compound_statement "{\n  case ADD:\n    pcVar7 = (char *)nmalloc(6);\n    sVar9 = parse_mbchar(openfile->current->data + puVar1->mark_begin_x,pcVar7,(size_t *)0x0);\n    pcVar8 = puVar1->strdata;\n    if (pcVar8 != (char *)0x0) {\n      len1 = strlen(pcVar8);\n    }\n    pcVar8 = addstrings(pcVar8,len1,pcVar7,sVar9);\n    puVar1->strdata = pcVar8;\n    poVar5 = openfile;\n    puVar1->mark_begin_lineno = openfile->current->lineno;\n    puVar1->mark_begin_x = poVar5->current_x;\n    return;\n  case ENTER:\n    pcVar8 = mallocstrcpy((char *)0x0,poVar5->current->data);\n    break;\n  case BACK:\n  case DEL:\n    pcVar8 = (char *)nmalloc(6);\n    sVar9 = parse_mbchar(openfile->current->data + openfile->current_x,pcVar8,(size_t *)0x0);\n    if (openfile->current_x != puVar1->begin) {\n      if (openfile->current_x != puVar1->begin - sVar9) {\n        free(pcVar8);\n        add_undo(puVar1->type);\n        return;\n      }\n      pcVar7 = puVar1->strdata;\n      sVar6 = strlen(pcVar7);\n      pcVar8 = addstrings(pcVar8,sVar9,pcVar7,sVar6);\n      puVar1->strdata = pcVar8;\n      puVar1->begin = openfile->current_x;\n      return;\n    }\n    pcVar7 = puVar1->strdata;\n    sVar6 = strlen(pcVar7);\n    pcVar8 = addstrings(pcVar7,sVar6,pcVar8,sVar9);\n    break;\n  case JOIN:\n  case SPLIT_BEGIN:\n  case SPLIT_END:\n  case COUPLE_BEGIN:\n    return;\n  case REPLACE:\n  case PASTE:\n  case COUPLE_END:\n    sVar4 = poVar5->current->lineno;\n    puVar1->begin = poVar5->current_x;\n    puVar1->lineno = sVar4;\n    return;\n  default:\n    statusline(ALERT,"Wrong undo update type -- please report a bug");\n    return;\n  case ZAP:\n  case CUT:\n  case CUT_TO_EOF:\n    if (cutbuffer == (filestruct *)0x0) {\n      return;\n    }\n    if (len1 == ZAP) {\n      puVar1->cutbuffer = cutbuffer;\n    }\n    else {\n      free_filestruct(puVar1->cutbuffer);\n      pfVar10 = copy_filestruct(cutbuffer);\n      puVar1->cutbuffer = pfVar10;\n    }\n    iVar2 = puVar1->mark_begin_lineno;\n    if (puVar1->xflags != 0x10) {\n      pfVar3 = pfVar10->next;\n      puVar1->cutbottom = pfVar10;\n      pfVar11 = pfVar10;\n      if (pfVar3 != (filestruct *)0x0) {\n        do {\n          pfVar11 = pfVar3;\n          pfVar3 = pfVar11->next;\n        } while (pfVar11->next != (filestruct *)0x0);\n        puVar1->cutbottom = pfVar11;\n      }\n      iVar14 = (pfVar11->lineno + iVar2) - pfVar10->lineno;\n      puVar1->lineno = iVar14;\n      if (((flags[0] & 0x800) != 0) || (puVar1->type == CUT_TO_EOF)) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        if (iVar14 == iVar2) {\n          puVar1->begin = sVar6 + puVar1->mark_begin_x;\n          return;\n        }\n        return;\n      }\n      if (openfile->current != openfile->filebot) {\n        return;\n      }\n      if ((flags[0] & 0x40000000) != 0) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        return;\n      }\n      return;\n    }\n    iVar14 = puVar1->lineno;\n    if (iVar14 == iVar2) {\n      uVar12 = puVar1->begin;\n      uVar13 = puVar1->mark_begin_x;\n      if (uVar13 <= uVar12) goto LAB_00037d97;\n    }\n    else {\n      if (iVar2 <= iVar14) {\nLAB_00037d97:\n        puVar1->xflags = 0x20;\n        return;\n      }\n      uVar12 = puVar1->begin;\n      uVar13 = puVar1->mark_begin_x;\n    }\n    puVar1->begin = uVar13;\n    puVar1->mark_begin_x = uVar12;\n    puVar1->lineno = iVar2;\n    puVar1->mark_begin_lineno = iVar14;\n    return;\n  case INSERT:\n    sVar4 = poVar5->current->lineno;\n    puVar1->mark_begin_x = poVar5->current_x;\n    puVar1->mark_begin_lineno = sVar4;\n    return;\n  }" { (case_statement "case ADD:\n    pcVar7 = (char *)nmalloc(6);\n    sVar9 = parse_mbchar(openfile->current->data + puVar1->mark_begin_x,pcVar7,(size_t *)0x0);\n    pcVar8 = puVar1->strdata;\n    if (pcVar8 != (char *)0x0) {\n      len1 = strlen(pcVar8);\n    }\n    pcVar8 = addstrings(pcVar8,len1,pcVar7,sVar9);\n    puVar1->strdata = pcVar8;\n    poVar5 = openfile;\n    puVar1->mark_begin_lineno = openfile->current->lineno;\n    puVar1->mark_begin_x = poVar5->current_x;\n    return;" case identifier : (expression_statement "pcVar7 = (char *)nmalloc(6);" (assignment_expression "pcVar7 = (char *)nmalloc(6)" identifier = (cast_expression "(char *)nmalloc(6)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "nmalloc(6)" identifier (argument_list "(6)" ( number_literal ))))) ;) (expression_statement "sVar9 = parse_mbchar(openfile->current->data + puVar1->mark_begin_x,pcVar7,(size_t *)0x0);" (assignment_expression "sVar9 = parse_mbchar(openfile->current->data + puVar1->mark_begin_x,pcVar7,(size_t *)0x0)" identifier = (call_expression "parse_mbchar(openfile->current->data + puVar1->mark_begin_x,pcVar7,(size_t *)0x0)" identifier (argument_list "(openfile->current->data + puVar1->mark_begin_x,pcVar7,(size_t *)0x0)" ( (binary_expression "openfile->current->data + puVar1->mark_begin_x" (field_expression "openfile->current->data" (field_expression "openfile->current" identifier -> field_identifier) -> field_identifier) + (field_expression "puVar1->mark_begin_x" identifier -> field_identifier)) , identifier , (cast_expression "(size_t *)0x0" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) )))) ;) (expression_statement "pcVar8 = puVar1->strdata;" (assignment_expression "pcVar8 = puVar1->strdata" identifier = (field_expression "puVar1->strdata" identifier -> field_identifier)) ;) (if_statement "if (pcVar8 != (char *)0x0) {\n      len1 = strlen(pcVar8);\n    }" if (parenthesized_expression "(pcVar8 != (char *)0x0)" ( (binary_expression "pcVar8 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      len1 = strlen(pcVar8);\n    }" { (expression_statement "len1 = strlen(pcVar8);" (assignment_expression "len1 = strlen(pcVar8)" identifier = (call_expression "strlen(pcVar8)" identifier (argument_list "(pcVar8)" ( identifier )))) ;) })) (expression_statement "pcVar8 = addstrings(pcVar8,len1,pcVar7,sVar9);" (assignment_expression "pcVar8 = addstrings(pcVar8,len1,pcVar7,sVar9)" identifier = (call_expression "addstrings(pcVar8,len1,pcVar7,sVar9)" identifier (argument_list "(pcVar8,len1,pcVar7,sVar9)" ( identifier , identifier , identifier , identifier )))) ;) (expression_statement "puVar1->strdata = pcVar8;" (assignment_expression "puVar1->strdata = pcVar8" (field_expression "puVar1->strdata" identifier -> field_identifier) = identifier) ;) (expression_statement "poVar5 = openfile;" (assignment_expression "poVar5 = openfile" identifier = identifier) ;) (expression_statement "puVar1->mark_begin_lineno = openfile->current->lineno;" (assignment_expression "puVar1->mark_begin_lineno = openfile->current->lineno" (field_expression "puVar1->mark_begin_lineno" identifier -> field_identifier) = (field_expression "openfile->current->lineno" (field_expression "openfile->current" identifier -> field_identifier) -> field_identifier)) ;) (expression_statement "puVar1->mark_begin_x = poVar5->current_x;" (assignment_expression "puVar1->mark_begin_x = poVar5->current_x" (field_expression "puVar1->mark_begin_x" identifier -> field_identifier) = (field_expression "poVar5->current_x" identifier -> field_identifier)) ;) (return_statement "return;" return ;)) (case_statement "case ENTER:\n    pcVar8 = mallocstrcpy((char *)0x0,poVar5->current->data);\n    break;" case identifier : (expression_statement "pcVar8 = mallocstrcpy((char *)0x0,poVar5->current->data);" (assignment_expression "pcVar8 = mallocstrcpy((char *)0x0,poVar5->current->data)" identifier = (call_expression "mallocstrcpy((char *)0x0,poVar5->current->data)" identifier (argument_list "((char *)0x0,poVar5->current->data)" ( (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , (field_expression "poVar5->current->data" (field_expression "poVar5->current" identifier -> field_identifier) -> field_identifier) )))) ;) (break_statement "break;" break ;)) (case_statement "case BACK:" case identifier :) (case_statement "case DEL:\n    pcVar8 = (char *)nmalloc(6);\n    sVar9 = parse_mbchar(openfile->current->data + openfile->current_x,pcVar8,(size_t *)0x0);\n    if (openfile->current_x != puVar1->begin) {\n      if (openfile->current_x != puVar1->begin - sVar9) {\n        free(pcVar8);\n        add_undo(puVar1->type);\n        return;\n      }\n      pcVar7 = puVar1->strdata;\n      sVar6 = strlen(pcVar7);\n      pcVar8 = addstrings(pcVar8,sVar9,pcVar7,sVar6);\n      puVar1->strdata = pcVar8;\n      puVar1->begin = openfile->current_x;\n      return;\n    }\n    pcVar7 = puVar1->strdata;\n    sVar6 = strlen(pcVar7);\n    pcVar8 = addstrings(pcVar7,sVar6,pcVar8,sVar9);\n    break;" case identifier : (expression_statement "pcVar8 = (char *)nmalloc(6);" (assignment_expression "pcVar8 = (char *)nmalloc(6)" identifier = (cast_expression "(char *)nmalloc(6)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "nmalloc(6)" identifier (argument_list "(6)" ( number_literal ))))) ;) (expression_statement "sVar9 = parse_mbchar(openfile->current->data + openfile->current_x,pcVar8,(size_t *)0x0);" (assignment_expression "sVar9 = parse_mbchar(openfile->current->data + openfile->current_x,pcVar8,(size_t *)0x0)" identifier = (call_expression "parse_mbchar(openfile->current->data + openfile->current_x,pcVar8,(size_t *)0x0)" identifier (argument_list "(openfile->current->data + openfile->current_x,pcVar8,(size_t *)0x0)" ( (binary_expression "openfile->current->data + openfile->current_x" (field_expression "openfile->current->data" (field_expression "openfile->current" identifier -> field_identifier) -> field_identifier) + (field_expression "openfile->current_x" identifier -> field_identifier)) , identifier , (cast_expression "(size_t *)0x0" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) )))) ;) (if_statement "if (openfile->current_x != puVar1->begin) {\n      if (openfile->current_x != puVar1->begin - sVar9) {\n        free(pcVar8);\n        add_undo(puVar1->type);\n        return;\n      }\n      pcVar7 = puVar1->strdata;\n      sVar6 = strlen(pcVar7);\n      pcVar8 = addstrings(pcVar8,sVar9,pcVar7,sVar6);\n      puVar1->strdata = pcVar8;\n      puVar1->begin = openfile->current_x;\n      return;\n    }" if (parenthesized_expression "(openfile->current_x != puVar1->begin)" ( (binary_expression "openfile->current_x != puVar1->begin" (field_expression "openfile->current_x" identifier -> field_identifier) != (field_expression "puVar1->begin" identifier -> field_identifier)) )) (compound_statement "{\n      if (openfile->current_x != puVar1->begin - sVar9) {\n        free(pcVar8);\n        add_undo(puVar1->type);\n        return;\n      }\n      pcVar7 = puVar1->strdata;\n      sVar6 = strlen(pcVar7);\n      pcVar8 = addstrings(pcVar8,sVar9,pcVar7,sVar6);\n      puVar1->strdata = pcVar8;\n      puVar1->begin = openfile->current_x;\n      return;\n    }" { (if_statement "if (openfile->current_x != puVar1->begin - sVar9) {\n        free(pcVar8);\n        add_undo(puVar1->type);\n        return;\n      }" if (parenthesized_expression "(openfile->current_x != puVar1->begin - sVar9)" ( (binary_expression "openfile->current_x != puVar1->begin - sVar9" (field_expression "openfile->current_x" identifier -> field_identifier) != (binary_expression "puVar1->begin - sVar9" (field_expression "puVar1->begin" identifier -> field_identifier) - identifier)) )) (compound_statement "{\n        free(pcVar8);\n        add_undo(puVar1->type);\n        return;\n      }" { (expression_statement "free(pcVar8);" (call_expression "free(pcVar8)" identifier (argument_list "(pcVar8)" ( identifier ))) ;) (expression_statement "add_undo(puVar1->type);" (call_expression "add_undo(puVar1->type)" identifier (argument_list "(puVar1->type)" ( (field_expression "puVar1->type" identifier -> field_identifier) ))) ;) (return_statement "return;" return ;) })) (expression_statement "pcVar7 = puVar1->strdata;" (assignment_expression "pcVar7 = puVar1->strdata" identifier = (field_expression "puVar1->strdata" identifier -> field_identifier)) ;) (expression_statement "sVar6 = strlen(pcVar7);" (assignment_expression "sVar6 = strlen(pcVar7)" identifier = (call_expression "strlen(pcVar7)" identifier (argument_list "(pcVar7)" ( identifier )))) ;) (expression_statement "pcVar8 = addstrings(pcVar8,sVar9,pcVar7,sVar6);" (assignment_expression "pcVar8 = addstrings(pcVar8,sVar9,pcVar7,sVar6)" identifier = (call_expression "addstrings(pcVar8,sVar9,pcVar7,sVar6)" identifier (argument_list "(pcVar8,sVar9,pcVar7,sVar6)" ( identifier , identifier , identifier , identifier )))) ;) (expression_statement "puVar1->strdata = pcVar8;" (assignment_expression "puVar1->strdata = pcVar8" (field_expression "puVar1->strdata" identifier -> field_identifier) = identifier) ;) (expression_statement "puVar1->begin = openfile->current_x;" (assignment_expression "puVar1->begin = openfile->current_x" (field_expression "puVar1->begin" identifier -> field_identifier) = (field_expression "openfile->current_x" identifier -> field_identifier)) ;) (return_statement "return;" return ;) })) (expression_statement "pcVar7 = puVar1->strdata;" (assignment_expression "pcVar7 = puVar1->strdata" identifier = (field_expression "puVar1->strdata" identifier -> field_identifier)) ;) (expression_statement "sVar6 = strlen(pcVar7);" (assignment_expression "sVar6 = strlen(pcVar7)" identifier = (call_expression "strlen(pcVar7)" identifier (argument_list "(pcVar7)" ( identifier )))) ;) (expression_statement "pcVar8 = addstrings(pcVar7,sVar6,pcVar8,sVar9);" (assignment_expression "pcVar8 = addstrings(pcVar7,sVar6,pcVar8,sVar9)" identifier = (call_expression "addstrings(pcVar7,sVar6,pcVar8,sVar9)" identifier (argument_list "(pcVar7,sVar6,pcVar8,sVar9)" ( identifier , identifier , identifier , identifier )))) ;) (break_statement "break;" break ;)) (case_statement "case JOIN:" case identifier :) (case_statement "case SPLIT_BEGIN:" case identifier :) (case_statement "case SPLIT_END:" case identifier :) (case_statement "case COUPLE_BEGIN:\n    return;" case identifier : (return_statement "return;" return ;)) (case_statement "case REPLACE:" case identifier :) (case_statement "case PASTE:" case identifier :) (case_statement "case COUPLE_END:\n    sVar4 = poVar5->current->lineno;\n    puVar1->begin = poVar5->current_x;\n    puVar1->lineno = sVar4;\n    return;" case identifier : (expression_statement "sVar4 = poVar5->current->lineno;" (assignment_expression "sVar4 = poVar5->current->lineno" identifier = (field_expression "poVar5->current->lineno" (field_expression "poVar5->current" identifier -> field_identifier) -> field_identifier)) ;) (expression_statement "puVar1->begin = poVar5->current_x;" (assignment_expression "puVar1->begin = poVar5->current_x" (field_expression "puVar1->begin" identifier -> field_identifier) = (field_expression "poVar5->current_x" identifier -> field_identifier)) ;) (expression_statement "puVar1->lineno = sVar4;" (assignment_expression "puVar1->lineno = sVar4" (field_expression "puVar1->lineno" identifier -> field_identifier) = identifier) ;) (return_statement "return;" return ;)) (case_statement "default:\n    statusline(ALERT,"Wrong undo update type -- please report a bug");\n    return;" default : (expression_statement "statusline(ALERT,"Wrong undo update type -- please report a bug");" (call_expression "statusline(ALERT,"Wrong undo update type -- please report a bug")" identifier (argument_list "(ALERT,"Wrong undo update type -- please report a bug")" ( identifier , (string_literal ""Wrong undo update type -- please report a bug"" " string_content ") ))) ;) (return_statement "return;" return ;)) (case_statement "case ZAP:" case identifier :) (case_statement "case CUT:" case identifier :) (case_statement "case CUT_TO_EOF:\n    if (cutbuffer == (filestruct *)0x0) {\n      return;\n    }\n    if (len1 == ZAP) {\n      puVar1->cutbuffer = cutbuffer;\n    }\n    else {\n      free_filestruct(puVar1->cutbuffer);\n      pfVar10 = copy_filestruct(cutbuffer);\n      puVar1->cutbuffer = pfVar10;\n    }\n    iVar2 = puVar1->mark_begin_lineno;\n    if (puVar1->xflags != 0x10) {\n      pfVar3 = pfVar10->next;\n      puVar1->cutbottom = pfVar10;\n      pfVar11 = pfVar10;\n      if (pfVar3 != (filestruct *)0x0) {\n        do {\n          pfVar11 = pfVar3;\n          pfVar3 = pfVar11->next;\n        } while (pfVar11->next != (filestruct *)0x0);\n        puVar1->cutbottom = pfVar11;\n      }\n      iVar14 = (pfVar11->lineno + iVar2) - pfVar10->lineno;\n      puVar1->lineno = iVar14;\n      if (((flags[0] & 0x800) != 0) || (puVar1->type == CUT_TO_EOF)) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        if (iVar14 == iVar2) {\n          puVar1->begin = sVar6 + puVar1->mark_begin_x;\n          return;\n        }\n        return;\n      }\n      if (openfile->current != openfile->filebot) {\n        return;\n      }\n      if ((flags[0] & 0x40000000) != 0) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        return;\n      }\n      return;\n    }\n    iVar14 = puVar1->lineno;\n    if (iVar14 == iVar2) {\n      uVar12 = puVar1->begin;\n      uVar13 = puVar1->mark_begin_x;\n      if (uVar13 <= uVar12) goto LAB_00037d97;\n    }\n    else {\n      if (iVar2 <= iVar14) {\nLAB_00037d97:\n        puVar1->xflags = 0x20;\n        return;\n      }\n      uVar12 = puVar1->begin;\n      uVar13 = puVar1->mark_begin_x;\n    }\n    puVar1->begin = uVar13;\n    puVar1->mark_begin_x = uVar12;\n    puVar1->lineno = iVar2;\n    puVar1->mark_begin_lineno = iVar14;\n    return;" case identifier : (if_statement "if (cutbuffer == (filestruct *)0x0) {\n      return;\n    }" if (parenthesized_expression "(cutbuffer == (filestruct *)0x0)" ( (binary_expression "cutbuffer == (filestruct *)0x0" identifier == (cast_expression "(filestruct *)0x0" ( (type_descriptor "filestruct *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return;\n    }" { (return_statement "return;" return ;) })) (if_statement "if (len1 == ZAP) {\n      puVar1->cutbuffer = cutbuffer;\n    }\n    else {\n      free_filestruct(puVar1->cutbuffer);\n      pfVar10 = copy_filestruct(cutbuffer);\n      puVar1->cutbuffer = pfVar10;\n    }" if (parenthesized_expression "(len1 == ZAP)" ( (binary_expression "len1 == ZAP" identifier == identifier) )) (compound_statement "{\n      puVar1->cutbuffer = cutbuffer;\n    }" { (expression_statement "puVar1->cutbuffer = cutbuffer;" (assignment_expression "puVar1->cutbuffer = cutbuffer" (field_expression "puVar1->cutbuffer" identifier -> field_identifier) = identifier) ;) }) (else_clause "else {\n      free_filestruct(puVar1->cutbuffer);\n      pfVar10 = copy_filestruct(cutbuffer);\n      puVar1->cutbuffer = pfVar10;\n    }" else (compound_statement "{\n      free_filestruct(puVar1->cutbuffer);\n      pfVar10 = copy_filestruct(cutbuffer);\n      puVar1->cutbuffer = pfVar10;\n    }" { (expression_statement "free_filestruct(puVar1->cutbuffer);" (call_expression "free_filestruct(puVar1->cutbuffer)" identifier (argument_list "(puVar1->cutbuffer)" ( (field_expression "puVar1->cutbuffer" identifier -> field_identifier) ))) ;) (expression_statement "pfVar10 = copy_filestruct(cutbuffer);" (assignment_expression "pfVar10 = copy_filestruct(cutbuffer)" identifier = (call_expression "copy_filestruct(cutbuffer)" identifier (argument_list "(cutbuffer)" ( identifier )))) ;) (expression_statement "puVar1->cutbuffer = pfVar10;" (assignment_expression "puVar1->cutbuffer = pfVar10" (field_expression "puVar1->cutbuffer" identifier -> field_identifier) = identifier) ;) }))) (expression_statement "iVar2 = puVar1->mark_begin_lineno;" (assignment_expression "iVar2 = puVar1->mark_begin_lineno" identifier = (field_expression "puVar1->mark_begin_lineno" identifier -> field_identifier)) ;) (if_statement "if (puVar1->xflags != 0x10) {\n      pfVar3 = pfVar10->next;\n      puVar1->cutbottom = pfVar10;\n      pfVar11 = pfVar10;\n      if (pfVar3 != (filestruct *)0x0) {\n        do {\n          pfVar11 = pfVar3;\n          pfVar3 = pfVar11->next;\n        } while (pfVar11->next != (filestruct *)0x0);\n        puVar1->cutbottom = pfVar11;\n      }\n      iVar14 = (pfVar11->lineno + iVar2) - pfVar10->lineno;\n      puVar1->lineno = iVar14;\n      if (((flags[0] & 0x800) != 0) || (puVar1->type == CUT_TO_EOF)) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        if (iVar14 == iVar2) {\n          puVar1->begin = sVar6 + puVar1->mark_begin_x;\n          return;\n        }\n        return;\n      }\n      if (openfile->current != openfile->filebot) {\n        return;\n      }\n      if ((flags[0] & 0x40000000) != 0) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        return;\n      }\n      return;\n    }" if (parenthesized_expression "(puVar1->xflags != 0x10)" ( (binary_expression "puVar1->xflags != 0x10" (field_expression "puVar1->xflags" identifier -> field_identifier) != number_literal) )) (compound_statement "{\n      pfVar3 = pfVar10->next;\n      puVar1->cutbottom = pfVar10;\n      pfVar11 = pfVar10;\n      if (pfVar3 != (filestruct *)0x0) {\n        do {\n          pfVar11 = pfVar3;\n          pfVar3 = pfVar11->next;\n        } while (pfVar11->next != (filestruct *)0x0);\n        puVar1->cutbottom = pfVar11;\n      }\n      iVar14 = (pfVar11->lineno + iVar2) - pfVar10->lineno;\n      puVar1->lineno = iVar14;\n      if (((flags[0] & 0x800) != 0) || (puVar1->type == CUT_TO_EOF)) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        if (iVar14 == iVar2) {\n          puVar1->begin = sVar6 + puVar1->mark_begin_x;\n          return;\n        }\n        return;\n      }\n      if (openfile->current != openfile->filebot) {\n        return;\n      }\n      if ((flags[0] & 0x40000000) != 0) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        return;\n      }\n      return;\n    }" { (expression_statement "pfVar3 = pfVar10->next;" (assignment_expression "pfVar3 = pfVar10->next" identifier = (field_expression "pfVar10->next" identifier -> field_identifier)) ;) (expression_statement "puVar1->cutbottom = pfVar10;" (assignment_expression "puVar1->cutbottom = pfVar10" (field_expression "puVar1->cutbottom" identifier -> field_identifier) = identifier) ;) (expression_statement "pfVar11 = pfVar10;" (assignment_expression "pfVar11 = pfVar10" identifier = identifier) ;) (if_statement "if (pfVar3 != (filestruct *)0x0) {\n        do {\n          pfVar11 = pfVar3;\n          pfVar3 = pfVar11->next;\n        } while (pfVar11->next != (filestruct *)0x0);\n        puVar1->cutbottom = pfVar11;\n      }" if (parenthesized_expression "(pfVar3 != (filestruct *)0x0)" ( (binary_expression "pfVar3 != (filestruct *)0x0" identifier != (cast_expression "(filestruct *)0x0" ( (type_descriptor "filestruct *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        do {\n          pfVar11 = pfVar3;\n          pfVar3 = pfVar11->next;\n        } while (pfVar11->next != (filestruct *)0x0);\n        puVar1->cutbottom = pfVar11;\n      }" { (do_statement "do {\n          pfVar11 = pfVar3;\n          pfVar3 = pfVar11->next;\n        } while (pfVar11->next != (filestruct *)0x0);" do (compound_statement "{\n          pfVar11 = pfVar3;\n          pfVar3 = pfVar11->next;\n        }" { (expression_statement "pfVar11 = pfVar3;" (assignment_expression "pfVar11 = pfVar3" identifier = identifier) ;) (expression_statement "pfVar3 = pfVar11->next;" (assignment_expression "pfVar3 = pfVar11->next" identifier = (field_expression "pfVar11->next" identifier -> field_identifier)) ;) }) while (parenthesized_expression "(pfVar11->next != (filestruct *)0x0)" ( (binary_expression "pfVar11->next != (filestruct *)0x0" (field_expression "pfVar11->next" identifier -> field_identifier) != (cast_expression "(filestruct *)0x0" ( (type_descriptor "filestruct *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) ;) (expression_statement "puVar1->cutbottom = pfVar11;" (assignment_expression "puVar1->cutbottom = pfVar11" (field_expression "puVar1->cutbottom" identifier -> field_identifier) = identifier) ;) })) (expression_statement "iVar14 = (pfVar11->lineno + iVar2) - pfVar10->lineno;" (assignment_expression "iVar14 = (pfVar11->lineno + iVar2) - pfVar10->lineno" identifier = (binary_expression "(pfVar11->lineno + iVar2) - pfVar10->lineno" (parenthesized_expression "(pfVar11->lineno + iVar2)" ( (binary_expression "pfVar11->lineno + iVar2" (field_expression "pfVar11->lineno" identifier -> field_identifier) + identifier) )) - (field_expression "pfVar10->lineno" identifier -> field_identifier))) ;) (expression_statement "puVar1->lineno = iVar14;" (assignment_expression "puVar1->lineno = iVar14" (field_expression "puVar1->lineno" identifier -> field_identifier) = identifier) ;) (if_statement "if (((flags[0] & 0x800) != 0) || (puVar1->type == CUT_TO_EOF)) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        if (iVar14 == iVar2) {\n          puVar1->begin = sVar6 + puVar1->mark_begin_x;\n          return;\n        }\n        return;\n      }" if (parenthesized_expression "(((flags[0] & 0x800) != 0) || (puVar1->type == CUT_TO_EOF))" ( (binary_expression "((flags[0] & 0x800) != 0) || (puVar1->type == CUT_TO_EOF)" (parenthesized_expression "((flags[0] & 0x800) != 0)" ( (binary_expression "(flags[0] & 0x800) != 0" (parenthesized_expression "(flags[0] & 0x800)" ( (binary_expression "flags[0] & 0x800" (subscript_expression "flags[0]" identifier [ number_literal ]) & number_literal) )) != number_literal) )) || (parenthesized_expression "(puVar1->type == CUT_TO_EOF)" ( (binary_expression "puVar1->type == CUT_TO_EOF" (field_expression "puVar1->type" identifier -> field_identifier) == identifier) ))) )) (compound_statement "{\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        if (iVar14 == iVar2) {\n          puVar1->begin = sVar6 + puVar1->mark_begin_x;\n          return;\n        }\n        return;\n      }" { (expression_statement "sVar6 = strlen(pfVar11->data);" (assignment_expression "sVar6 = strlen(pfVar11->data)" identifier = (call_expression "strlen(pfVar11->data)" identifier (argument_list "(pfVar11->data)" ( (field_expression "pfVar11->data" identifier -> field_identifier) )))) ;) (expression_statement "puVar1->begin = sVar6;" (assignment_expression "puVar1->begin = sVar6" (field_expression "puVar1->begin" identifier -> field_identifier) = identifier) ;) (if_statement "if (iVar14 == iVar2) {\n          puVar1->begin = sVar6 + puVar1->mark_begin_x;\n          return;\n        }" if (parenthesized_expression "(iVar14 == iVar2)" ( (binary_expression "iVar14 == iVar2" identifier == identifier) )) (compound_statement "{\n          puVar1->begin = sVar6 + puVar1->mark_begin_x;\n          return;\n        }" { (expression_statement "puVar1->begin = sVar6 + puVar1->mark_begin_x;" (assignment_expression "puVar1->begin = sVar6 + puVar1->mark_begin_x" (field_expression "puVar1->begin" identifier -> field_identifier) = (binary_expression "sVar6 + puVar1->mark_begin_x" identifier + (field_expression "puVar1->mark_begin_x" identifier -> field_identifier))) ;) (return_statement "return;" return ;) })) (return_statement "return;" return ;) })) (if_statement "if (openfile->current != openfile->filebot) {\n        return;\n      }" if (parenthesized_expression "(openfile->current != openfile->filebot)" ( (binary_expression "openfile->current != openfile->filebot" (field_expression "openfile->current" identifier -> field_identifier) != (field_expression "openfile->filebot" identifier -> field_identifier)) )) (compound_statement "{\n        return;\n      }" { (return_statement "return;" return ;) })) (if_statement "if ((flags[0] & 0x40000000) != 0) {\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        return;\n      }" if (parenthesized_expression "((flags[0] & 0x40000000) != 0)" ( (binary_expression "(flags[0] & 0x40000000) != 0" (parenthesized_expression "(flags[0] & 0x40000000)" ( (binary_expression "flags[0] & 0x40000000" (subscript_expression "flags[0]" identifier [ number_literal ]) & number_literal) )) != number_literal) )) (compound_statement "{\n        sVar6 = strlen(pfVar11->data);\n        puVar1->begin = sVar6;\n        return;\n      }" { (expression_statement "sVar6 = strlen(pfVar11->data);" (assignment_expression "sVar6 = strlen(pfVar11->data)" identifier = (call_expression "strlen(pfVar11->data)" identifier (argument_list "(pfVar11->data)" ( (field_expression "pfVar11->data" identifier -> field_identifier) )))) ;) (expression_statement "puVar1->begin = sVar6;" (assignment_expression "puVar1->begin = sVar6" (field_expression "puVar1->begin" identifier -> field_identifier) = identifier) ;) (return_statement "return;" return ;) })) (return_statement "return;" return ;) })) (expression_statement "iVar14 = puVar1->lineno;" (assignment_expression "iVar14 = puVar1->lineno" identifier = (field_expression "puVar1->lineno" identifier -> field_identifier)) ;) (if_statement "if (iVar14 == iVar2) {\n      uVar12 = puVar1->begin;\n      uVar13 = puVar1->mark_begin_x;\n      if (uVar13 <= uVar12) goto LAB_00037d97;\n    }\n    else {\n      if (iVar2 <= iVar14) {\nLAB_00037d97:\n        puVar1->xflags = 0x20;\n        return;\n      }\n      uVar12 = puVar1->begin;\n      uVar13 = puVar1->mark_begin_x;\n    }" if (parenthesized_expression "(iVar14 == iVar2)" ( (binary_expression "iVar14 == iVar2" identifier == identifier) )) (compound_statement "{\n      uVar12 = puVar1->begin;\n      uVar13 = puVar1->mark_begin_x;\n      if (uVar13 <= uVar12) goto LAB_00037d97;\n    }" { (expression_statement "uVar12 = puVar1->begin;" (assignment_expression "uVar12 = puVar1->begin" identifier = (field_expression "puVar1->begin" identifier -> field_identifier)) ;) (expression_statement "uVar13 = puVar1->mark_begin_x;" (assignment_expression "uVar13 = puVar1->mark_begin_x" identifier = (field_expression "puVar1->mark_begin_x" identifier -> field_identifier)) ;) (if_statement "if (uVar13 <= uVar12) goto LAB_00037d97;" if (parenthesized_expression "(uVar13 <= uVar12)" ( (binary_expression "uVar13 <= uVar12" identifier <= identifier) )) (goto_statement "goto LAB_00037d97;" goto statement_identifier ;)) }) (else_clause "else {\n      if (iVar2 <= iVar14) {\nLAB_00037d97:\n        puVar1->xflags = 0x20;\n        return;\n      }\n      uVar12 = puVar1->begin;\n      uVar13 = puVar1->mark_begin_x;\n    }" else (compound_statement "{\n      if (iVar2 <= iVar14) {\nLAB_00037d97:\n        puVar1->xflags = 0x20;\n        return;\n      }\n      uVar12 = puVar1->begin;\n      uVar13 = puVar1->mark_begin_x;\n    }" { (if_statement "if (iVar2 <= iVar14) {\nLAB_00037d97:\n        puVar1->xflags = 0x20;\n        return;\n      }" if (parenthesized_expression "(iVar2 <= iVar14)" ( (binary_expression "iVar2 <= iVar14" identifier <= identifier) )) (compound_statement "{\nLAB_00037d97:\n        puVar1->xflags = 0x20;\n        return;\n      }" { (labeled_statement "LAB_00037d97:\n        puVar1->xflags = 0x20;" statement_identifier : (expression_statement "puVar1->xflags = 0x20;" (assignment_expression "puVar1->xflags = 0x20" (field_expression "puVar1->xflags" identifier -> field_identifier) = number_literal) ;)) (return_statement "return;" return ;) })) (expression_statement "uVar12 = puVar1->begin;" (assignment_expression "uVar12 = puVar1->begin" identifier = (field_expression "puVar1->begin" identifier -> field_identifier)) ;) (expression_statement "uVar13 = puVar1->mark_begin_x;" (assignment_expression "uVar13 = puVar1->mark_begin_x" identifier = (field_expression "puVar1->mark_begin_x" identifier -> field_identifier)) ;) }))) (expression_statement "puVar1->begin = uVar13;" (assignment_expression "puVar1->begin = uVar13" (field_expression "puVar1->begin" identifier -> field_identifier) = identifier) ;) (expression_statement "puVar1->mark_begin_x = uVar12;" (assignment_expression "puVar1->mark_begin_x = uVar12" (field_expression "puVar1->mark_begin_x" identifier -> field_identifier) = identifier) ;) (expression_statement "puVar1->lineno = iVar2;" (assignment_expression "puVar1->lineno = iVar2" (field_expression "puVar1->lineno" identifier -> field_identifier) = identifier) ;) (expression_statement "puVar1->mark_begin_lineno = iVar14;" (assignment_expression "puVar1->mark_begin_lineno = iVar14" (field_expression "puVar1->mark_begin_lineno" identifier -> field_identifier) = identifier) ;) (return_statement "return;" return ;)) (case_statement "case INSERT:\n    sVar4 = poVar5->current->lineno;\n    puVar1->mark_begin_x = poVar5->current_x;\n    puVar1->mark_begin_lineno = sVar4;\n    return;" case identifier : (expression_statement "sVar4 = poVar5->current->lineno;" (assignment_expression "sVar4 = poVar5->current->lineno" identifier = (field_expression "poVar5->current->lineno" (field_expression "poVar5->current" identifier -> field_identifier) -> field_identifier)) ;) (expression_statement "puVar1->mark_begin_x = poVar5->current_x;" (assignment_expression "puVar1->mark_begin_x = poVar5->current_x" (field_expression "puVar1->mark_begin_x" identifier -> field_identifier) = (field_expression "poVar5->current_x" identifier -> field_identifier)) ;) (expression_statement "puVar1->mark_begin_lineno = sVar4;" (assignment_expression "puVar1->mark_begin_lineno = sVar4" (field_expression "puVar1->mark_begin_lineno" identifier -> field_identifier) = identifier) ;) (return_statement "return;" return ;)) })) (expression_statement "puVar1->strdata = pcVar8;" (assignment_expression "puVar1->strdata = pcVar8" (field_expression "puVar1->strdata" identifier -> field_identifier) = identifier) ;) (expression_statement "puVar1->mark_begin_x = openfile->current_x;" (assignment_expression "puVar1->mark_begin_x = openfile->current_x" (field_expression "puVar1->mark_begin_x" identifier -> field_identifier) = (field_expression "openfile->current_x" identifier -> field_identifier)) ;) (return_statement "return;" return ;) })))
(translation_unit "void FUN_00037a60(void)\n\n{\n  int *piVar1;\n  undefined4 *puVar2;\n  char *pcVar3;\n  size_t sVar4;\n  undefined4 uVar5;\n  undefined4 uVar6;\n  void *__ptr;\n  int iVar7;\n  undefined4 *puVar8;\n  undefined4 *puVar9;\n  uint uVar10;\n  uint uVar11;\n  int iVar12;\n  \n  iVar7 = DAT_0007b640;\n  piVar1 = *(int **)(DAT_0007b640 + 0x40);\n  sVar4 = piVar1[1];\n  piVar1[5] = *(int *)(DAT_0007b640 + 0x14);\n  puVar8 = DAT_0007b64c;\n  switch(sVar4) {\n  case 0:\n    uVar5 = FUN_0003da70(6);\n    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);\n    pcVar3 = (char *)piVar1[3];\n    if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }\n    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);\n    piVar1[3] = iVar7;\n    iVar7 = DAT_0007b640;\n    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    return;\n  case 1:\n    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));\n    break;\n  case 2:\n  case 3:\n    __ptr = (void *)FUN_0003da70(6);\n    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);\n    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }\n    pcVar3 = (char *)piVar1[3];\n    sVar4 = strlen(pcVar3);\n    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);\n    break;\n  case 4:\n  case 6:\n  case 7:\n  case 0x12:\n    return;\n  case 5:\n  case 0x10:\n  case 0x13:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[2] = *(int *)(iVar7 + 0x1c);\n    *piVar1 = iVar12;\n    return;\n  default:\n    FUN_00040b60(3,"Wrong undo update type -- please report a bug");\n    return;\n  case 0xd:\n  case 0xe:\n  case 0xf:\n    if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }\n    if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }\n    iVar7 = piVar1[10];\n    if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }\n    iVar12 = *piVar1;\n    if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }\n    piVar1[2] = uVar11;\n    piVar1[0xb] = uVar10;\n    *piVar1 = iVar7;\n    piVar1[10] = iVar12;\n    return;\n  case 0x11:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    piVar1[10] = iVar12;\n    return;\n  }\n  piVar1[3] = iVar7;\n  piVar1[0xb] = *(int *)(DAT_0007b640 + 0x1c);\n  return;\n}\n\n" (function_definition "void FUN_00037a60(void)\n\n{\n  int *piVar1;\n  undefined4 *puVar2;\n  char *pcVar3;\n  size_t sVar4;\n  undefined4 uVar5;\n  undefined4 uVar6;\n  void *__ptr;\n  int iVar7;\n  undefined4 *puVar8;\n  undefined4 *puVar9;\n  uint uVar10;\n  uint uVar11;\n  int iVar12;\n  \n  iVar7 = DAT_0007b640;\n  piVar1 = *(int **)(DAT_0007b640 + 0x40);\n  sVar4 = piVar1[1];\n  piVar1[5] = *(int *)(DAT_0007b640 + 0x14);\n  puVar8 = DAT_0007b64c;\n  switch(sVar4) {\n  case 0:\n    uVar5 = FUN_0003da70(6);\n    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);\n    pcVar3 = (char *)piVar1[3];\n    if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }\n    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);\n    piVar1[3] = iVar7;\n    iVar7 = DAT_0007b640;\n    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    return;\n  case 1:\n    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));\n    break;\n  case 2:\n  case 3:\n    __ptr = (void *)FUN_0003da70(6);\n    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);\n    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }\n    pcVar3 = (char *)piVar1[3];\n    sVar4 = strlen(pcVar3);\n    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);\n    break;\n  case 4:\n  case 6:\n  case 7:\n  case 0x12:\n    return;\n  case 5:\n  case 0x10:\n  case 0x13:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[2] = *(int *)(iVar7 + 0x1c);\n    *piVar1 = iVar12;\n    return;\n  default:\n    FUN_00040b60(3,"Wrong undo update type -- please report a bug");\n    return;\n  case 0xd:\n  case 0xe:\n  case 0xf:\n    if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }\n    if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }\n    iVar7 = piVar1[10];\n    if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }\n    iVar12 = *piVar1;\n    if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }\n    piVar1[2] = uVar11;\n    piVar1[0xb] = uVar10;\n    *piVar1 = iVar7;\n    piVar1[10] = iVar12;\n    return;\n  case 0x11:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    piVar1[10] = iVar12;\n    return;\n  }\n  piVar1[3] = iVar7;\n  piVar1[0xb] = *(int *)(DAT_0007b640 + 0x1c);\n  return;\n}" primitive_type (function_declarator "FUN_00037a60(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  int *piVar1;\n  undefined4 *puVar2;\n  char *pcVar3;\n  size_t sVar4;\n  undefined4 uVar5;\n  undefined4 uVar6;\n  void *__ptr;\n  int iVar7;\n  undefined4 *puVar8;\n  undefined4 *puVar9;\n  uint uVar10;\n  uint uVar11;\n  int iVar12;\n  \n  iVar7 = DAT_0007b640;\n  piVar1 = *(int **)(DAT_0007b640 + 0x40);\n  sVar4 = piVar1[1];\n  piVar1[5] = *(int *)(DAT_0007b640 + 0x14);\n  puVar8 = DAT_0007b64c;\n  switch(sVar4) {\n  case 0:\n    uVar5 = FUN_0003da70(6);\n    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);\n    pcVar3 = (char *)piVar1[3];\n    if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }\n    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);\n    piVar1[3] = iVar7;\n    iVar7 = DAT_0007b640;\n    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    return;\n  case 1:\n    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));\n    break;\n  case 2:\n  case 3:\n    __ptr = (void *)FUN_0003da70(6);\n    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);\n    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }\n    pcVar3 = (char *)piVar1[3];\n    sVar4 = strlen(pcVar3);\n    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);\n    break;\n  case 4:\n  case 6:\n  case 7:\n  case 0x12:\n    return;\n  case 5:\n  case 0x10:\n  case 0x13:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[2] = *(int *)(iVar7 + 0x1c);\n    *piVar1 = iVar12;\n    return;\n  default:\n    FUN_00040b60(3,"Wrong undo update type -- please report a bug");\n    return;\n  case 0xd:\n  case 0xe:\n  case 0xf:\n    if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }\n    if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }\n    iVar7 = piVar1[10];\n    if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }\n    iVar12 = *piVar1;\n    if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }\n    piVar1[2] = uVar11;\n    piVar1[0xb] = uVar10;\n    *piVar1 = iVar7;\n    piVar1[10] = iVar12;\n    return;\n  case 0x11:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    piVar1[10] = iVar12;\n    return;\n  }\n  piVar1[3] = iVar7;\n  piVar1[0xb] = *(int *)(DAT_0007b640 + 0x1c);\n  return;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "undefined4 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "undefined4 uVar6;" type_identifier identifier ;) (declaration "void *__ptr;" primitive_type (pointer_declarator "*__ptr" * identifier) ;) (declaration "int iVar7;" primitive_type identifier ;) (declaration "undefined4 *puVar8;" type_identifier (pointer_declarator "*puVar8" * identifier) ;) (declaration "undefined4 *puVar9;" type_identifier (pointer_declarator "*puVar9" * identifier) ;) (declaration "uint uVar10;" type_identifier identifier ;) (declaration "uint uVar11;" type_identifier identifier ;) (declaration "int iVar12;" primitive_type identifier ;) (expression_statement "iVar7 = DAT_0007b640;" (assignment_expression "iVar7 = DAT_0007b640" identifier = identifier) ;) (expression_statement "piVar1 = *(int **)(DAT_0007b640 + 0x40);" (assignment_expression "piVar1 = *(int **)(DAT_0007b640 + 0x40)" identifier = (pointer_expression "*(int **)(DAT_0007b640 + 0x40)" * (cast_expression "(int **)(DAT_0007b640 + 0x40)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(DAT_0007b640 + 0x40)" ( (binary_expression "DAT_0007b640 + 0x40" identifier + number_literal) ))))) ;) (expression_statement "sVar4 = piVar1[1];" (assignment_expression "sVar4 = piVar1[1]" identifier = (subscript_expression "piVar1[1]" identifier [ number_literal ])) ;) (expression_statement "piVar1[5] = *(int *)(DAT_0007b640 + 0x14);" (assignment_expression "piVar1[5] = *(int *)(DAT_0007b640 + 0x14)" (subscript_expression "piVar1[5]" identifier [ number_literal ]) = (pointer_expression "*(int *)(DAT_0007b640 + 0x14)" * (cast_expression "(int *)(DAT_0007b640 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 0x14)" ( (binary_expression "DAT_0007b640 + 0x14" identifier + number_literal) ))))) ;) (expression_statement "puVar8 = DAT_0007b64c;" (assignment_expression "puVar8 = DAT_0007b64c" identifier = identifier) ;) (switch_statement "switch(sVar4) {\n  case 0:\n    uVar5 = FUN_0003da70(6);\n    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);\n    pcVar3 = (char *)piVar1[3];\n    if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }\n    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);\n    piVar1[3] = iVar7;\n    iVar7 = DAT_0007b640;\n    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    return;\n  case 1:\n    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));\n    break;\n  case 2:\n  case 3:\n    __ptr = (void *)FUN_0003da70(6);\n    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);\n    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }\n    pcVar3 = (char *)piVar1[3];\n    sVar4 = strlen(pcVar3);\n    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);\n    break;\n  case 4:\n  case 6:\n  case 7:\n  case 0x12:\n    return;\n  case 5:\n  case 0x10:\n  case 0x13:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[2] = *(int *)(iVar7 + 0x1c);\n    *piVar1 = iVar12;\n    return;\n  default:\n    FUN_00040b60(3,"Wrong undo update type -- please report a bug");\n    return;\n  case 0xd:\n  case 0xe:\n  case 0xf:\n    if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }\n    if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }\n    iVar7 = piVar1[10];\n    if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }\n    iVar12 = *piVar1;\n    if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }\n    piVar1[2] = uVar11;\n    piVar1[0xb] = uVar10;\n    *piVar1 = iVar7;\n    piVar1[10] = iVar12;\n    return;\n  case 0x11:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    piVar1[10] = iVar12;\n    return;\n  }" switch (parenthesized_expression "(sVar4)" ( identifier )) (compound_statement "{\n  case 0:\n    uVar5 = FUN_0003da70(6);\n    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);\n    pcVar3 = (char *)piVar1[3];\n    if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }\n    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);\n    piVar1[3] = iVar7;\n    iVar7 = DAT_0007b640;\n    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    return;\n  case 1:\n    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));\n    break;\n  case 2:\n  case 3:\n    __ptr = (void *)FUN_0003da70(6);\n    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);\n    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }\n    pcVar3 = (char *)piVar1[3];\n    sVar4 = strlen(pcVar3);\n    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);\n    break;\n  case 4:\n  case 6:\n  case 7:\n  case 0x12:\n    return;\n  case 5:\n  case 0x10:\n  case 0x13:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[2] = *(int *)(iVar7 + 0x1c);\n    *piVar1 = iVar12;\n    return;\n  default:\n    FUN_00040b60(3,"Wrong undo update type -- please report a bug");\n    return;\n  case 0xd:\n  case 0xe:\n  case 0xf:\n    if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }\n    if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }\n    iVar7 = piVar1[10];\n    if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }\n    iVar12 = *piVar1;\n    if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }\n    piVar1[2] = uVar11;\n    piVar1[0xb] = uVar10;\n    *piVar1 = iVar7;\n    piVar1[10] = iVar12;\n    return;\n  case 0x11:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    piVar1[10] = iVar12;\n    return;\n  }" { (case_statement "case 0:\n    uVar5 = FUN_0003da70(6);\n    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);\n    pcVar3 = (char *)piVar1[3];\n    if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }\n    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);\n    piVar1[3] = iVar7;\n    iVar7 = DAT_0007b640;\n    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    return;" case number_literal : (expression_statement "uVar5 = FUN_0003da70(6);" (assignment_expression "uVar5 = FUN_0003da70(6)" identifier = (call_expression "FUN_0003da70(6)" identifier (argument_list "(6)" ( number_literal )))) ;) (expression_statement "uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);" (assignment_expression "uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0)" identifier = (call_expression "FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0)" identifier (argument_list "(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0)" ( (binary_expression "piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10)" (subscript_expression "piVar1[0xb]" identifier [ number_literal ]) + (pointer_expression "**(int **)(DAT_0007b640 + 0x10)" * (pointer_expression "*(int **)(DAT_0007b640 + 0x10)" * (cast_expression "(int **)(DAT_0007b640 + 0x10)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(DAT_0007b640 + 0x10)" ( (binary_expression "DAT_0007b640 + 0x10" identifier + number_literal) )))))) , identifier , number_literal )))) ;) (expression_statement "pcVar3 = (char *)piVar1[3];" (assignment_expression "pcVar3 = (char *)piVar1[3]" identifier = (cast_expression "(char *)piVar1[3]" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar1[3]" identifier [ number_literal ]))) ;) (if_statement "if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }" if (parenthesized_expression "(pcVar3 != (char *)0x0)" ( (binary_expression "pcVar3 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      sVar4 = strlen(pcVar3);\n    }" { (expression_statement "sVar4 = strlen(pcVar3);" (assignment_expression "sVar4 = strlen(pcVar3)" identifier = (call_expression "strlen(pcVar3)" identifier (argument_list "(pcVar3)" ( identifier )))) ;) })) (expression_statement "iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);" (assignment_expression "iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6)" identifier = (call_expression "FUN_00017890(pcVar3,sVar4,uVar5,uVar6)" identifier (argument_list "(pcVar3,sVar4,uVar5,uVar6)" ( identifier , identifier , identifier , identifier )))) ;) (expression_statement "piVar1[3] = iVar7;" (assignment_expression "piVar1[3] = iVar7" (subscript_expression "piVar1[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "iVar7 = DAT_0007b640;" (assignment_expression "iVar7 = DAT_0007b640" identifier = identifier) ;) (expression_statement "piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);" (assignment_expression "piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4)" (subscript_expression "piVar1[10]" identifier [ number_literal ]) = (pointer_expression "*(int *)(*(int *)(DAT_0007b640 + 0x10) + 4)" * (cast_expression "(int *)(*(int *)(DAT_0007b640 + 0x10) + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(DAT_0007b640 + 0x10) + 4)" ( (binary_expression "*(int *)(DAT_0007b640 + 0x10) + 4" (pointer_expression "*(int *)(DAT_0007b640 + 0x10)" * (cast_expression "(int *)(DAT_0007b640 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 0x10)" ( (binary_expression "DAT_0007b640 + 0x10" identifier + number_literal) )))) + number_literal) ))))) ;) (expression_statement "piVar1[0xb] = *(int *)(iVar7 + 0x1c);" (assignment_expression "piVar1[0xb] = *(int *)(iVar7 + 0x1c)" (subscript_expression "piVar1[0xb]" identifier [ number_literal ]) = (pointer_expression "*(int *)(iVar7 + 0x1c)" * (cast_expression "(int *)(iVar7 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 0x1c)" ( (binary_expression "iVar7 + 0x1c" identifier + number_literal) ))))) ;) (return_statement "return;" return ;)) (case_statement "case 1:\n    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));\n    break;" case number_literal : (expression_statement "iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));" (assignment_expression "iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10))" identifier = (call_expression "FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10))" identifier (argument_list "(0,**(undefined4 **)(iVar7 + 0x10))" ( number_literal , (pointer_expression "**(undefined4 **)(iVar7 + 0x10)" * (pointer_expression "*(undefined4 **)(iVar7 + 0x10)" * (cast_expression "(undefined4 **)(iVar7 + 0x10)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar7 + 0x10)" ( (binary_expression "iVar7 + 0x10" identifier + number_literal) ))))) )))) ;) (break_statement "break;" break ;)) (case_statement "case 2:" case number_literal :) (case_statement "case 3:\n    __ptr = (void *)FUN_0003da70(6);\n    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);\n    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }\n    pcVar3 = (char *)piVar1[3];\n    sVar4 = strlen(pcVar3);\n    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);\n    break;" case number_literal : (expression_statement "__ptr = (void *)FUN_0003da70(6);" (assignment_expression "__ptr = (void *)FUN_0003da70(6)" identifier = (cast_expression "(void *)FUN_0003da70(6)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0003da70(6)" identifier (argument_list "(6)" ( number_literal ))))) ;) (expression_statement "iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);" (assignment_expression "iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0)" identifier = (call_expression "FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0)" identifier (argument_list "(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0)" ( (binary_expression "*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10)" (pointer_expression "*(int *)(DAT_0007b640 + 0x1c)" * (cast_expression "(int *)(DAT_0007b640 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 0x1c)" ( (binary_expression "DAT_0007b640 + 0x1c" identifier + number_literal) )))) + (pointer_expression "**(int **)(DAT_0007b640 + 0x10)" * (pointer_expression "*(int **)(DAT_0007b640 + 0x10)" * (cast_expression "(int **)(DAT_0007b640 + 0x10)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(DAT_0007b640 + 0x10)" ( (binary_expression "DAT_0007b640 + 0x10" identifier + number_literal) )))))) , identifier , number_literal )))) ;) (if_statement "if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }" if (parenthesized_expression "(*(int *)(DAT_0007b640 + 0x1c) != piVar1[2])" ( (binary_expression "*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]" (pointer_expression "*(int *)(DAT_0007b640 + 0x1c)" * (cast_expression "(int *)(DAT_0007b640 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 0x1c)" ( (binary_expression "DAT_0007b640 + 0x1c" identifier + number_literal) )))) != (subscript_expression "piVar1[2]" identifier [ number_literal ])) )) (compound_statement "{\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }" { (if_statement "if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }" if (parenthesized_expression "(*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7)" ( (binary_expression "*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7" (pointer_expression "*(int *)(DAT_0007b640 + 0x1c)" * (cast_expression "(int *)(DAT_0007b640 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 0x1c)" ( (binary_expression "DAT_0007b640 + 0x1c" identifier + number_literal) )))) != (binary_expression "piVar1[2] - iVar7" (subscript_expression "piVar1[2]" identifier [ number_literal ]) - identifier)) )) (compound_statement "{\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }" { (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) (expression_statement "FUN_000376d0(piVar1[1]);" (call_expression "FUN_000376d0(piVar1[1])" identifier (argument_list "(piVar1[1])" ( (subscript_expression "piVar1[1]" identifier [ number_literal ]) ))) ;) (return_statement "return;" return ;) })) (expression_statement "pcVar3 = (char *)piVar1[3];" (assignment_expression "pcVar3 = (char *)piVar1[3]" identifier = (cast_expression "(char *)piVar1[3]" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar1[3]" identifier [ number_literal ]))) ;) (expression_statement "sVar4 = strlen(pcVar3);" (assignment_expression "sVar4 = strlen(pcVar3)" identifier = (call_expression "strlen(pcVar3)" identifier (argument_list "(pcVar3)" ( identifier )))) ;) (expression_statement "iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);" (assignment_expression "iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4)" identifier = (call_expression "FUN_00017890(__ptr,iVar7,pcVar3,sVar4)" identifier (argument_list "(__ptr,iVar7,pcVar3,sVar4)" ( identifier , identifier , identifier , identifier )))) ;) (expression_statement "piVar1[3] = iVar7;" (assignment_expression "piVar1[3] = iVar7" (subscript_expression "piVar1[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);" (assignment_expression "piVar1[2] = *(int *)(DAT_0007b640 + 0x1c)" (subscript_expression "piVar1[2]" identifier [ number_literal ]) = (pointer_expression "*(int *)(DAT_0007b640 + 0x1c)" * (cast_expression "(int *)(DAT_0007b640 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 0x1c)" ( (binary_expression "DAT_0007b640 + 0x1c" identifier + number_literal) ))))) ;) (return_statement "return;" return ;) })) (expression_statement "pcVar3 = (char *)piVar1[3];" (assignment_expression "pcVar3 = (char *)piVar1[3]" identifier = (cast_expression "(char *)piVar1[3]" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar1[3]" identifier [ number_literal ]))) ;) (expression_statement "sVar4 = strlen(pcVar3);" (assignment_expression "sVar4 = strlen(pcVar3)" identifier = (call_expression "strlen(pcVar3)" identifier (argument_list "(pcVar3)" ( identifier )))) ;) (expression_statement "iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);" (assignment_expression "iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7)" identifier = (call_expression "FUN_00017890(pcVar3,sVar4,__ptr,iVar7)" identifier (argument_list "(pcVar3,sVar4,__ptr,iVar7)" ( identifier , identifier , identifier , identifier )))) ;) (break_statement "break;" break ;)) (case_statement "case 4:" case number_literal :) (case_statement "case 6:" case number_literal :) (case_statement "case 7:" case number_literal :) (case_statement "case 0x12:\n    return;" case number_literal : (return_statement "return;" return ;)) (case_statement "case 5:" case number_literal :) (case_statement "case 0x10:" case number_literal :) (case_statement "case 0x13:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[2] = *(int *)(iVar7 + 0x1c);\n    *piVar1 = iVar12;\n    return;" case number_literal : (expression_statement "iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);" (assignment_expression "iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4)" identifier = (pointer_expression "*(int *)(*(int *)(iVar7 + 0x10) + 4)" * (cast_expression "(int *)(*(int *)(iVar7 + 0x10) + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(iVar7 + 0x10) + 4)" ( (binary_expression "*(int *)(iVar7 + 0x10) + 4" (pointer_expression "*(int *)(iVar7 + 0x10)" * (cast_expression "(int *)(iVar7 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 0x10)" ( (binary_expression "iVar7 + 0x10" identifier + number_literal) )))) + number_literal) ))))) ;) (expression_statement "piVar1[2] = *(int *)(iVar7 + 0x1c);" (assignment_expression "piVar1[2] = *(int *)(iVar7 + 0x1c)" (subscript_expression "piVar1[2]" identifier [ number_literal ]) = (pointer_expression "*(int *)(iVar7 + 0x1c)" * (cast_expression "(int *)(iVar7 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 0x1c)" ( (binary_expression "iVar7 + 0x1c" identifier + number_literal) ))))) ;) (expression_statement "*piVar1 = iVar12;" (assignment_expression "*piVar1 = iVar12" (pointer_expression "*piVar1" * identifier) = identifier) ;) (return_statement "return;" return ;)) (case_statement "default:\n    FUN_00040b60(3,"Wrong undo update type -- please report a bug");\n    return;" default : (expression_statement "FUN_00040b60(3,"Wrong undo update type -- please report a bug");" (call_expression "FUN_00040b60(3,"Wrong undo update type -- please report a bug")" identifier (argument_list "(3,"Wrong undo update type -- please report a bug")" ( number_literal , (string_literal ""Wrong undo update type -- please report a bug"" " string_content ") ))) ;) (return_statement "return;" return ;)) (case_statement "case 0xd:" case number_literal :) (case_statement "case 0xe:" case number_literal :) (case_statement "case 0xf:\n    if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }\n    if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }\n    iVar7 = piVar1[10];\n    if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }\n    iVar12 = *piVar1;\n    if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }\n    piVar1[2] = uVar11;\n    piVar1[0xb] = uVar10;\n    *piVar1 = iVar7;\n    piVar1[10] = iVar12;\n    return;" case number_literal : (if_statement "if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }" if (parenthesized_expression "(DAT_0007b64c == (undefined4 *)0x0)" ( (binary_expression "DAT_0007b64c == (undefined4 *)0x0" identifier == (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return;\n    }" { (return_statement "return;" return ;) })) (if_statement "if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }" if (parenthesized_expression "(sVar4 == 0xd)" ( (binary_expression "sVar4 == 0xd" identifier == number_literal) )) (compound_statement "{\n      piVar1[8] = (int)DAT_0007b64c;\n    }" { (expression_statement "piVar1[8] = (int)DAT_0007b64c;" (assignment_expression "piVar1[8] = (int)DAT_0007b64c" (subscript_expression "piVar1[8]" identifier [ number_literal ]) = (cast_expression "(int)DAT_0007b64c" ( (type_descriptor "int" primitive_type) ) identifier)) ;) }) (else_clause "else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }" else (compound_statement "{\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }" { (expression_statement "FUN_0002af00(piVar1[8]);" (call_expression "FUN_0002af00(piVar1[8])" identifier (argument_list "(piVar1[8])" ( (subscript_expression "piVar1[8]" identifier [ number_literal ]) ))) ;) (expression_statement "puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);" (assignment_expression "puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c)" identifier = (cast_expression "(undefined4 *)FUN_0002ae40(DAT_0007b64c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0002ae40(DAT_0007b64c)" identifier (argument_list "(DAT_0007b64c)" ( identifier ))))) ;) (expression_statement "piVar1[8] = (int)puVar8;" (assignment_expression "piVar1[8] = (int)puVar8" (subscript_expression "piVar1[8]" identifier [ number_literal ]) = (cast_expression "(int)puVar8" ( (type_descriptor "int" primitive_type) ) identifier)) ;) }))) (expression_statement "iVar7 = piVar1[10];" (assignment_expression "iVar7 = piVar1[10]" identifier = (subscript_expression "piVar1[10]" identifier [ number_literal ])) ;) (if_statement "if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }" if (parenthesized_expression "(piVar1[6] != 0x10)" ( (binary_expression "piVar1[6] != 0x10" (subscript_expression "piVar1[6]" identifier [ number_literal ]) != number_literal) )) (compound_statement "{\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }" { (expression_statement "puVar2 = (undefined4 *)puVar8[2];" (assignment_expression "puVar2 = (undefined4 *)puVar8[2]" identifier = (cast_expression "(undefined4 *)puVar8[2]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "puVar8[2]" identifier [ number_literal ]))) ;) (expression_statement "piVar1[9] = (int)puVar8;" (assignment_expression "piVar1[9] = (int)puVar8" (subscript_expression "piVar1[9]" identifier [ number_literal ]) = (cast_expression "(int)puVar8" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "puVar9 = puVar8;" (assignment_expression "puVar9 = puVar8" identifier = identifier) ;) (if_statement "if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }" if (parenthesized_expression "(puVar2 != (undefined4 *)0x0)" ( (binary_expression "puVar2 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }" { (do_statement "do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);" do (compound_statement "{\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        }" { (expression_statement "puVar9 = puVar2;" (assignment_expression "puVar9 = puVar2" identifier = identifier) ;) (expression_statement "puVar2 = (undefined4 *)puVar9[2];" (assignment_expression "puVar2 = (undefined4 *)puVar9[2]" identifier = (cast_expression "(undefined4 *)puVar9[2]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "puVar9[2]" identifier [ number_literal ]))) ;) }) while (parenthesized_expression "((undefined4 *)puVar9[2] != (undefined4 *)0x0)" ( (binary_expression "(undefined4 *)puVar9[2] != (undefined4 *)0x0" (cast_expression "(undefined4 *)puVar9[2]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "puVar9[2]" identifier [ number_literal ])) != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) ;) (expression_statement "piVar1[9] = (int)puVar9;" (assignment_expression "piVar1[9] = (int)puVar9" (subscript_expression "piVar1[9]" identifier [ number_literal ]) = (cast_expression "(int)puVar9" ( (type_descriptor "int" primitive_type) ) identifier)) ;) })) (expression_statement "iVar12 = (puVar9[1] + iVar7) - puVar8[1];" (assignment_expression "iVar12 = (puVar9[1] + iVar7) - puVar8[1]" identifier = (binary_expression "(puVar9[1] + iVar7) - puVar8[1]" (parenthesized_expression "(puVar9[1] + iVar7)" ( (binary_expression "puVar9[1] + iVar7" (subscript_expression "puVar9[1]" identifier [ number_literal ]) + identifier) )) - (subscript_expression "puVar8[1]" identifier [ number_literal ]))) ;) (expression_statement "*piVar1 = iVar12;" (assignment_expression "*piVar1 = iVar12" (pointer_expression "*piVar1" * identifier) = identifier) ;) (if_statement "if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }" if (parenthesized_expression "(((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf))" ( (binary_expression "((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)" (parenthesized_expression "((DAT_0007b664 & 0x800) != 0)" ( (binary_expression "(DAT_0007b664 & 0x800) != 0" (parenthesized_expression "(DAT_0007b664 & 0x800)" ( (binary_expression "DAT_0007b664 & 0x800" identifier & number_literal) )) != number_literal) )) || (parenthesized_expression "(piVar1[1] == 0xf)" ( (binary_expression "piVar1[1] == 0xf" (subscript_expression "piVar1[1]" identifier [ number_literal ]) == number_literal) ))) )) (compound_statement "{\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }" { (expression_statement "sVar4 = strlen((char *)*puVar9);" (assignment_expression "sVar4 = strlen((char *)*puVar9)" identifier = (call_expression "strlen((char *)*puVar9)" identifier (argument_list "((char *)*puVar9)" ( (cast_expression "(char *)*puVar9" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*puVar9" * identifier)) )))) ;) (expression_statement "piVar1[2] = sVar4;" (assignment_expression "piVar1[2] = sVar4" (subscript_expression "piVar1[2]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }" if (parenthesized_expression "(iVar12 == iVar7)" ( (binary_expression "iVar12 == iVar7" identifier == identifier) )) (compound_statement "{\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }" { (expression_statement "piVar1[2] = sVar4 + piVar1[0xb];" (assignment_expression "piVar1[2] = sVar4 + piVar1[0xb]" (subscript_expression "piVar1[2]" identifier [ number_literal ]) = (binary_expression "sVar4 + piVar1[0xb]" identifier + (subscript_expression "piVar1[0xb]" identifier [ number_literal ]))) ;) (return_statement "return;" return ;) })) (return_statement "return;" return ;) })) (if_statement "if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }" if (parenthesized_expression "(*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8))" ( (binary_expression "*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)" (pointer_expression "*(int *)(DAT_0007b640 + 0x10)" * (cast_expression "(int *)(DAT_0007b640 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 0x10)" ( (binary_expression "DAT_0007b640 + 0x10" identifier + number_literal) )))) != (pointer_expression "*(int *)(DAT_0007b640 + 8)" * (cast_expression "(int *)(DAT_0007b640 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 8)" ( (binary_expression "DAT_0007b640 + 8" identifier + number_literal) ))))) )) (compound_statement "{\n        return;\n      }" { (return_statement "return;" return ;) })) (if_statement "if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }" if (parenthesized_expression "((DAT_0007b664 & 0x40000000) != 0)" ( (binary_expression "(DAT_0007b664 & 0x40000000) != 0" (parenthesized_expression "(DAT_0007b664 & 0x40000000)" ( (binary_expression "DAT_0007b664 & 0x40000000" identifier & number_literal) )) != number_literal) )) (compound_statement "{\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }" { (expression_statement "sVar4 = strlen((char *)*puVar9);" (assignment_expression "sVar4 = strlen((char *)*puVar9)" identifier = (call_expression "strlen((char *)*puVar9)" identifier (argument_list "((char *)*puVar9)" ( (cast_expression "(char *)*puVar9" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*puVar9" * identifier)) )))) ;) (expression_statement "piVar1[2] = sVar4;" (assignment_expression "piVar1[2] = sVar4" (subscript_expression "piVar1[2]" identifier [ number_literal ]) = identifier) ;) (return_statement "return;" return ;) })) (return_statement "return;" return ;) })) (expression_statement "iVar12 = *piVar1;" (assignment_expression "iVar12 = *piVar1" identifier = (pointer_expression "*piVar1" * identifier)) ;) (if_statement "if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }" if (parenthesized_expression "(iVar12 == iVar7)" ( (binary_expression "iVar12 == iVar7" identifier == identifier) )) (compound_statement "{\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }" { (expression_statement "uVar10 = piVar1[2];" (assignment_expression "uVar10 = piVar1[2]" identifier = (subscript_expression "piVar1[2]" identifier [ number_literal ])) ;) (expression_statement "uVar11 = piVar1[0xb];" (assignment_expression "uVar11 = piVar1[0xb]" identifier = (subscript_expression "piVar1[0xb]" identifier [ number_literal ])) ;) (if_statement "if (uVar11 <= uVar10) goto code_r0x00037d97;" if (parenthesized_expression "(uVar11 <= uVar10)" ( (binary_expression "uVar11 <= uVar10" identifier <= identifier) )) (goto_statement "goto code_r0x00037d97;" goto statement_identifier ;)) }) (else_clause "else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }" else (compound_statement "{\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }" { (if_statement "if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }" if (parenthesized_expression "(iVar7 <= iVar12)" ( (binary_expression "iVar7 <= iVar12" identifier <= identifier) )) (compound_statement "{\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }" { (labeled_statement "code_r0x00037d97:\n        piVar1[6] = 0x20;" statement_identifier : (expression_statement "piVar1[6] = 0x20;" (assignment_expression "piVar1[6] = 0x20" (subscript_expression "piVar1[6]" identifier [ number_literal ]) = number_literal) ;)) (return_statement "return;" return ;) })) (expression_statement "uVar10 = piVar1[2];" (assignment_expression "uVar10 = piVar1[2]" identifier = (subscript_expression "piVar1[2]" identifier [ number_literal ])) ;) (expression_statement "uVar11 = piVar1[0xb];" (assignment_expression "uVar11 = piVar1[0xb]" identifier = (subscript_expression "piVar1[0xb]" identifier [ number_literal ])) ;) }))) (expression_statement "piVar1[2] = uVar11;" (assignment_expression "piVar1[2] = uVar11" (subscript_expression "piVar1[2]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar1[0xb] = uVar10;" (assignment_expression "piVar1[0xb] = uVar10" (subscript_expression "piVar1[0xb]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*piVar1 = iVar7;" (assignment_expression "*piVar1 = iVar7" (pointer_expression "*piVar1" * identifier) = identifier) ;) (expression_statement "piVar1[10] = iVar12;" (assignment_expression "piVar1[10] = iVar12" (subscript_expression "piVar1[10]" identifier [ number_literal ]) = identifier) ;) (return_statement "return;" return ;)) (case_statement "case 0x11:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    piVar1[10] = iVar12;\n    return;" case number_literal : (expression_statement "iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);" (assignment_expression "iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4)" identifier = (pointer_expression "*(int *)(*(int *)(iVar7 + 0x10) + 4)" * (cast_expression "(int *)(*(int *)(iVar7 + 0x10) + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(iVar7 + 0x10) + 4)" ( (binary_expression "*(int *)(iVar7 + 0x10) + 4" (pointer_expression "*(int *)(iVar7 + 0x10)" * (cast_expression "(int *)(iVar7 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 0x10)" ( (binary_expression "iVar7 + 0x10" identifier + number_literal) )))) + number_literal) ))))) ;) (expression_statement "piVar1[0xb] = *(int *)(iVar7 + 0x1c);" (assignment_expression "piVar1[0xb] = *(int *)(iVar7 + 0x1c)" (subscript_expression "piVar1[0xb]" identifier [ number_literal ]) = (pointer_expression "*(int *)(iVar7 + 0x1c)" * (cast_expression "(int *)(iVar7 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 0x1c)" ( (binary_expression "iVar7 + 0x1c" identifier + number_literal) ))))) ;) (expression_statement "piVar1[10] = iVar12;" (assignment_expression "piVar1[10] = iVar12" (subscript_expression "piVar1[10]" identifier [ number_literal ]) = identifier) ;) (return_statement "return;" return ;)) })) (expression_statement "piVar1[3] = iVar7;" (assignment_expression "piVar1[3] = iVar7" (subscript_expression "piVar1[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "piVar1[0xb] = *(int *)(DAT_0007b640 + 0x1c);" (assignment_expression "piVar1[0xb] = *(int *)(DAT_0007b640 + 0x1c)" (subscript_expression "piVar1[0xb]" identifier [ number_literal ]) = (pointer_expression "*(int *)(DAT_0007b640 + 0x1c)" * (cast_expression "(int *)(DAT_0007b640 + 0x1c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0007b640 + 0x1c)" ( (binary_expression "DAT_0007b640 + 0x1c" identifier + number_literal) ))))) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (switch_statement switch (parenthesized_expression ( IDENT )) (compound_statement { (case_statement case LIT : (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (binary_expression (subscript_expression IDENT [ LIT ]) + (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))))) , IDENT , LIT )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , IDENT )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + LIT) ))))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (return_statement return ;)) (case_statement case LIT : (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )))) ;) (break_statement break ;)) (case_statement case LIT :) (case_statement case LIT : (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))))) , IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != (subscript_expression IDENT [ LIT ])) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != (binary_expression (subscript_expression IDENT [ LIT ]) - IDENT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( (subscript_expression IDENT [ LIT ]) ))) ;) (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , IDENT )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , IDENT )))) ;) (break_statement break ;)) (case_statement case LIT :) (case_statement case LIT :) (case_statement case LIT :) (case_statement case LIT : (return_statement return ;)) (case_statement case LIT :) (case_statement case LIT :) (case_statement case LIT : (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + LIT) ))))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (return_statement return ;)) (case_statement default : (expression_statement (call_expression IDENT (argument_list ( LIT , (string_literal " string_content ") ))) ;) (return_statement return ;)) (case_statement case LIT :) (case_statement case LIT :) (case_statement case LIT : (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (return_statement return ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (subscript_expression IDENT [ LIT ]) ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT ))))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) }))) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) }) while (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ])) != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) + IDENT) )) - (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) != LIT) )) || (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) == LIT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT)) )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + (subscript_expression IDENT [ LIT ]))) ;) (return_statement return ;) })) (return_statement return ;) })) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + 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 IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT)) )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (return_statement return ;) })) (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (goto_statement goto statement_identifier ;)) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;)) (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) }))) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (return_statement return ;)) (case_statement case LIT : (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + LIT) ))))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (return_statement return ;)) })) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (return_statement return ;) })))
(function_definition "void FUN_00037a60(void)\n\n{\n  int *piVar1;\n  undefined4 *puVar2;\n  char *pcVar3;\n  size_t sVar4;\n  undefined4 uVar5;\n  undefined4 uVar6;\n  void *__ptr;\n  int iVar7;\n  undefined4 *puVar8;\n  undefined4 *puVar9;\n  uint uVar10;\n  uint uVar11;\n  int iVar12;\n  \n  iVar7 = DAT_0007b640;\n  piVar1 = *(int **)(DAT_0007b640 + 0x40);\n  sVar4 = piVar1[1];\n  piVar1[5] = *(int *)(DAT_0007b640 + 0x14);\n  puVar8 = DAT_0007b64c;\n  switch(sVar4) {\n  case 0:\n    uVar5 = FUN_0003da70(6);\n    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);\n    pcVar3 = (char *)piVar1[3];\n    if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }\n    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);\n    piVar1[3] = iVar7;\n    iVar7 = DAT_0007b640;\n    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    return;\n  case 1:\n    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));\n    break;\n  case 2:\n  case 3:\n    __ptr = (void *)FUN_0003da70(6);\n    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);\n    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }\n    pcVar3 = (char *)piVar1[3];\n    sVar4 = strlen(pcVar3);\n    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);\n    break;\n  case 4:\n  case 6:\n  case 7:\n  case 0x12:\n    return;\n  case 5:\n  case 0x10:\n  case 0x13:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[2] = *(int *)(iVar7 + 0x1c);\n    *piVar1 = iVar12;\n    return;\n  default:\n    FUN_00040b60(3,"Wrong undo update type -- please report a bug");\n    return;\n  case 0xd:\n  case 0xe:\n  case 0xf:\n    if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }\n    if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }\n    iVar7 = piVar1[10];\n    if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }\n    iVar12 = *piVar1;\n    if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }\n    piVar1[2] = uVar11;\n    piVar1[0xb] = uVar10;\n    *piVar1 = iVar7;\n    piVar1[10] = iVar12;\n    return;\n  case 0x11:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    piVar1[10] = iVar12;\n    return;\n  }\n  piVar1[3] = iVar7;\n  piVar1[0xb] = *(int *)(DAT_0007b640 + 0x1c);\n  return;\n}" (primitive_type "void") (function_declarator "FUN_00037a60(void)" (identifier "FUN_00037a60") (parameter_list "(void)" (( "(") (parameter_declaration "void" (primitive_type "void")) () ")"))) (compound_statement "{\n  int *piVar1;\n  undefined4 *puVar2;\n  char *pcVar3;\n  size_t sVar4;\n  undefined4 uVar5;\n  undefined4 uVar6;\n  void *__ptr;\n  int iVar7;\n  undefined4 *puVar8;\n  undefined4 *puVar9;\n  uint uVar10;\n  uint uVar11;\n  int iVar12;\n  \n  iVar7 = DAT_0007b640;\n  piVar1 = *(int **)(DAT_0007b640 + 0x40);\n  sVar4 = piVar1[1];\n  piVar1[5] = *(int *)(DAT_0007b640 + 0x14);\n  puVar8 = DAT_0007b64c;\n  switch(sVar4) {\n  case 0:\n    uVar5 = FUN_0003da70(6);\n    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);\n    pcVar3 = (char *)piVar1[3];\n    if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }\n    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);\n    piVar1[3] = iVar7;\n    iVar7 = DAT_0007b640;\n    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    return;\n  case 1:\n    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));\n    break;\n  case 2:\n  case 3:\n    __ptr = (void *)FUN_0003da70(6);\n    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);\n    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }\n    pcVar3 = (char *)piVar1[3];\n    sVar4 = strlen(pcVar3);\n    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);\n    break;\n  case 4:\n  case 6:\n  case 7:\n  case 0x12:\n    return;\n  case 5:\n  case 0x10:\n  case 0x13:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[2] = *(int *)(iVar7 + 0x1c);\n    *piVar1 = iVar12;\n    return;\n  default:\n    FUN_00040b60(3,"Wrong undo update type -- please report a bug");\n    return;\n  case 0xd:\n  case 0xe:\n  case 0xf:\n    if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }\n    if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }\n    iVar7 = piVar1[10];\n    if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }\n    iVar12 = *piVar1;\n    if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }\n    piVar1[2] = uVar11;\n    piVar1[0xb] = uVar10;\n    *piVar1 = iVar7;\n    piVar1[10] = iVar12;\n    return;\n  case 0x11:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    piVar1[10] = iVar12;\n    return;\n  }\n  piVar1[3] = iVar7;\n  piVar1[0xb] = *(int *)(DAT_0007b640 + 0x1c);\n  return;\n}" ({ "{") (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (declaration "undefined4 *puVar2;" (type_identifier "undefined4") (pointer_declarator "*puVar2" (* "*") (identifier "puVar2")) (; ";")) (declaration "char *pcVar3;" (primitive_type "char") (pointer_declarator "*pcVar3" (* "*") (identifier "pcVar3")) (; ";")) (declaration "size_t sVar4;" (primitive_type "size_t") (identifier "sVar4") (; ";")) (declaration "undefined4 uVar5;" (type_identifier "undefined4") (identifier "uVar5") (; ";")) (declaration "undefined4 uVar6;" (type_identifier "undefined4") (identifier "uVar6") (; ";")) (declaration "void *__ptr;" (primitive_type "void") (pointer_declarator "*__ptr" (* "*") (identifier "__ptr")) (; ";")) (declaration "int iVar7;" (primitive_type "int") (identifier "iVar7") (; ";")) (declaration "undefined4 *puVar8;" (type_identifier "undefined4") (pointer_declarator "*puVar8" (* "*") (identifier "puVar8")) (; ";")) (declaration "undefined4 *puVar9;" (type_identifier "undefined4") (pointer_declarator "*puVar9" (* "*") (identifier "puVar9")) (; ";")) (declaration "uint uVar10;" (type_identifier "uint") (identifier "uVar10") (; ";")) (declaration "uint uVar11;" (type_identifier "uint") (identifier "uVar11") (; ";")) (declaration "int iVar12;" (primitive_type "int") (identifier "iVar12") (; ";")) (expression_statement "iVar7 = DAT_0007b640;" (assignment_expression "iVar7 = DAT_0007b640" (identifier "iVar7") (= "=") (identifier "DAT_0007b640")) (; ";")) (expression_statement "piVar1 = *(int **)(DAT_0007b640 + 0x40);" (assignment_expression "piVar1 = *(int **)(DAT_0007b640 + 0x40)" (identifier "piVar1") (= "=") (pointer_expression "*(int **)(DAT_0007b640 + 0x40)" (* "*") (cast_expression "(int **)(DAT_0007b640 + 0x40)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(DAT_0007b640 + 0x40)" (( "(") (binary_expression "DAT_0007b640 + 0x40" (identifier "DAT_0007b640") (+ "+") (number_literal "0x40")) () ")"))))) (; ";")) (expression_statement "sVar4 = piVar1[1];" (assignment_expression "sVar4 = piVar1[1]" (identifier "sVar4") (= "=") (subscript_expression "piVar1[1]" (identifier "piVar1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "piVar1[5] = *(int *)(DAT_0007b640 + 0x14);" (assignment_expression "piVar1[5] = *(int *)(DAT_0007b640 + 0x14)" (subscript_expression "piVar1[5]" (identifier "piVar1") ([ "[") (number_literal "5") (] "]")) (= "=") (pointer_expression "*(int *)(DAT_0007b640 + 0x14)" (* "*") (cast_expression "(int *)(DAT_0007b640 + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(DAT_0007b640 + 0x14)" (( "(") (binary_expression "DAT_0007b640 + 0x14" (identifier "DAT_0007b640") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (expression_statement "puVar8 = DAT_0007b64c;" (assignment_expression "puVar8 = DAT_0007b64c" (identifier "puVar8") (= "=") (identifier "DAT_0007b64c")) (; ";")) (switch_statement "switch(sVar4) {\n  case 0:\n    uVar5 = FUN_0003da70(6);\n    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);\n    pcVar3 = (char *)piVar1[3];\n    if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }\n    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);\n    piVar1[3] = iVar7;\n    iVar7 = DAT_0007b640;\n    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    return;\n  case 1:\n    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));\n    break;\n  case 2:\n  case 3:\n    __ptr = (void *)FUN_0003da70(6);\n    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);\n    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }\n    pcVar3 = (char *)piVar1[3];\n    sVar4 = strlen(pcVar3);\n    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);\n    break;\n  case 4:\n  case 6:\n  case 7:\n  case 0x12:\n    return;\n  case 5:\n  case 0x10:\n  case 0x13:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[2] = *(int *)(iVar7 + 0x1c);\n    *piVar1 = iVar12;\n    return;\n  default:\n    FUN_00040b60(3,"Wrong undo update type -- please report a bug");\n    return;\n  case 0xd:\n  case 0xe:\n  case 0xf:\n    if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }\n    if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }\n    iVar7 = piVar1[10];\n    if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }\n    iVar12 = *piVar1;\n    if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }\n    piVar1[2] = uVar11;\n    piVar1[0xb] = uVar10;\n    *piVar1 = iVar7;\n    piVar1[10] = iVar12;\n    return;\n  case 0x11:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    piVar1[10] = iVar12;\n    return;\n  }" (switch "switch") (parenthesized_expression "(sVar4)" (( "(") (identifier "sVar4") () ")")) (compound_statement "{\n  case 0:\n    uVar5 = FUN_0003da70(6);\n    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);\n    pcVar3 = (char *)piVar1[3];\n    if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }\n    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);\n    piVar1[3] = iVar7;\n    iVar7 = DAT_0007b640;\n    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    return;\n  case 1:\n    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));\n    break;\n  case 2:\n  case 3:\n    __ptr = (void *)FUN_0003da70(6);\n    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);\n    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }\n    pcVar3 = (char *)piVar1[3];\n    sVar4 = strlen(pcVar3);\n    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);\n    break;\n  case 4:\n  case 6:\n  case 7:\n  case 0x12:\n    return;\n  case 5:\n  case 0x10:\n  case 0x13:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[2] = *(int *)(iVar7 + 0x1c);\n    *piVar1 = iVar12;\n    return;\n  default:\n    FUN_00040b60(3,"Wrong undo update type -- please report a bug");\n    return;\n  case 0xd:\n  case 0xe:\n  case 0xf:\n    if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }\n    if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }\n    iVar7 = piVar1[10];\n    if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }\n    iVar12 = *piVar1;\n    if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }\n    piVar1[2] = uVar11;\n    piVar1[0xb] = uVar10;\n    *piVar1 = iVar7;\n    piVar1[10] = iVar12;\n    return;\n  case 0x11:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    piVar1[10] = iVar12;\n    return;\n  }" ({ "{") (case_statement "case 0:\n    uVar5 = FUN_0003da70(6);\n    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);\n    pcVar3 = (char *)piVar1[3];\n    if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }\n    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);\n    piVar1[3] = iVar7;\n    iVar7 = DAT_0007b640;\n    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    return;" (case "case") (number_literal "0") (: ":") (expression_statement "uVar5 = FUN_0003da70(6);" (assignment_expression "uVar5 = FUN_0003da70(6)" (identifier "uVar5") (= "=") (call_expression "FUN_0003da70(6)" (identifier "FUN_0003da70") (argument_list "(6)" (( "(") (number_literal "6") () ")")))) (; ";")) (expression_statement "uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);" (assignment_expression "uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0)" (identifier "uVar6") (= "=") (call_expression "FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0)" (identifier "FUN_00018090") (argument_list "(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0)" (( "(") (binary_expression "piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10)" (subscript_expression "piVar1[0xb]" (identifier "piVar1") ([ "[") (number_literal "0xb") (] "]")) (+ "+") (pointer_expression "**(int **)(DAT_0007b640 + 0x10)" (* "*") (pointer_expression "*(int **)(DAT_0007b640 + 0x10)" (* "*") (cast_expression "(int **)(DAT_0007b640 + 0x10)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(DAT_0007b640 + 0x10)" (( "(") (binary_expression "DAT_0007b640 + 0x10" (identifier "DAT_0007b640") (+ "+") (number_literal "0x10")) () ")")))))) (, ",") (identifier "uVar5") (, ",") (number_literal "0") () ")")))) (; ";")) (expression_statement "pcVar3 = (char *)piVar1[3];" (assignment_expression "pcVar3 = (char *)piVar1[3]" (identifier "pcVar3") (= "=") (cast_expression "(char *)piVar1[3]" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "piVar1[3]" (identifier "piVar1") ([ "[") (number_literal "3") (] "]")))) (; ";")) (if_statement "if (pcVar3 != (char *)0x0) {\n      sVar4 = strlen(pcVar3);\n    }" (if "if") (parenthesized_expression "(pcVar3 != (char *)0x0)" (( "(") (binary_expression "pcVar3 != (char *)0x0" (identifier "pcVar3") (!= "!=") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      sVar4 = strlen(pcVar3);\n    }" ({ "{") (expression_statement "sVar4 = strlen(pcVar3);" (assignment_expression "sVar4 = strlen(pcVar3)" (identifier "sVar4") (= "=") (call_expression "strlen(pcVar3)" (identifier "strlen") (argument_list "(pcVar3)" (( "(") (identifier "pcVar3") () ")")))) (; ";")) (} "}"))) (expression_statement "iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);" (assignment_expression "iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6)" (identifier "iVar7") (= "=") (call_expression "FUN_00017890(pcVar3,sVar4,uVar5,uVar6)" (identifier "FUN_00017890") (argument_list "(pcVar3,sVar4,uVar5,uVar6)" (( "(") (identifier "pcVar3") (, ",") (identifier "sVar4") (, ",") (identifier "uVar5") (, ",") (identifier "uVar6") () ")")))) (; ";")) (expression_statement "piVar1[3] = iVar7;" (assignment_expression "piVar1[3] = iVar7" (subscript_expression "piVar1[3]" (identifier "piVar1") ([ "[") (number_literal "3") (] "]")) (= "=") (identifier "iVar7")) (; ";")) (expression_statement "iVar7 = DAT_0007b640;" (assignment_expression "iVar7 = DAT_0007b640" (identifier "iVar7") (= "=") (identifier "DAT_0007b640")) (; ";")) (expression_statement "piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);" (assignment_expression "piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4)" (subscript_expression "piVar1[10]" (identifier "piVar1") ([ "[") (number_literal "10") (] "]")) (= "=") (pointer_expression "*(int *)(*(int *)(DAT_0007b640 + 0x10) + 4)" (* "*") (cast_expression "(int *)(*(int *)(DAT_0007b640 + 0x10) + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*(int *)(DAT_0007b640 + 0x10) + 4)" (( "(") (binary_expression "*(int *)(DAT_0007b640 + 0x10) + 4" (pointer_expression "*(int *)(DAT_0007b640 + 0x10)" (* "*") (cast_expression "(int *)(DAT_0007b640 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(DAT_0007b640 + 0x10)" (( "(") (binary_expression "DAT_0007b640 + 0x10" (identifier "DAT_0007b640") (+ "+") (number_literal "0x10")) () ")")))) (+ "+") (number_literal "4")) () ")"))))) (; ";")) (expression_statement "piVar1[0xb] = *(int *)(iVar7 + 0x1c);" (assignment_expression "piVar1[0xb] = *(int *)(iVar7 + 0x1c)" (subscript_expression "piVar1[0xb]" (identifier "piVar1") ([ "[") (number_literal "0xb") (] "]")) (= "=") (pointer_expression "*(int *)(iVar7 + 0x1c)" (* "*") (cast_expression "(int *)(iVar7 + 0x1c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar7 + 0x1c)" (( "(") (binary_expression "iVar7 + 0x1c" (identifier "iVar7") (+ "+") (number_literal "0x1c")) () ")"))))) (; ";")) (return_statement "return;" (return "return") (; ";"))) (case_statement "case 1:\n    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));\n    break;" (case "case") (number_literal "1") (: ":") (expression_statement "iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));" (assignment_expression "iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10))" (identifier "iVar7") (= "=") (call_expression "FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10))" (identifier "FUN_0003dbd0") (argument_list "(0,**(undefined4 **)(iVar7 + 0x10))" (( "(") (number_literal "0") (, ",") (pointer_expression "**(undefined4 **)(iVar7 + 0x10)" (* "*") (pointer_expression "*(undefined4 **)(iVar7 + 0x10)" (* "*") (cast_expression "(undefined4 **)(iVar7 + 0x10)" (( "(") (type_descriptor "undefined4 **" (type_identifier "undefined4") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(iVar7 + 0x10)" (( "(") (binary_expression "iVar7 + 0x10" (identifier "iVar7") (+ "+") (number_literal "0x10")) () ")"))))) () ")")))) (; ";")) (break_statement "break;" (break "break") (; ";"))) (case_statement "case 2:" (case "case") (number_literal "2") (: ":")) (case_statement "case 3:\n    __ptr = (void *)FUN_0003da70(6);\n    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);\n    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }\n    pcVar3 = (char *)piVar1[3];\n    sVar4 = strlen(pcVar3);\n    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);\n    break;" (case "case") (number_literal "3") (: ":") (expression_statement "__ptr = (void *)FUN_0003da70(6);" (assignment_expression "__ptr = (void *)FUN_0003da70(6)" (identifier "__ptr") (= "=") (cast_expression "(void *)FUN_0003da70(6)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0003da70(6)" (identifier "FUN_0003da70") (argument_list "(6)" (( "(") (number_literal "6") () ")"))))) (; ";")) (expression_statement "iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);" (assignment_expression "iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0)" (identifier "iVar7") (= "=") (call_expression "FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0)" (identifier "FUN_00018090") (argument_list "(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0)" (( "(") (binary_expression "*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10)" (pointer_expression "*(int *)(DAT_0007b640 + 0x1c)" (* "*") (cast_expression "(int *)(DAT_0007b640 + 0x1c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(DAT_0007b640 + 0x1c)" (( "(") (binary_expression "DAT_0007b640 + 0x1c" (identifier "DAT_0007b640") (+ "+") (number_literal "0x1c")) () ")")))) (+ "+") (pointer_expression "**(int **)(DAT_0007b640 + 0x10)" (* "*") (pointer_expression "*(int **)(DAT_0007b640 + 0x10)" (* "*") (cast_expression "(int **)(DAT_0007b640 + 0x10)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(DAT_0007b640 + 0x10)" (( "(") (binary_expression "DAT_0007b640 + 0x10" (identifier "DAT_0007b640") (+ "+") (number_literal "0x10")) () ")")))))) (, ",") (identifier "__ptr") (, ",") (number_literal "0") () ")")))) (; ";")) (if_statement "if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }" (if "if") (parenthesized_expression "(*(int *)(DAT_0007b640 + 0x1c) != piVar1[2])" (( "(") (binary_expression "*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]" (pointer_expression "*(int *)(DAT_0007b640 + 0x1c)" (* "*") (cast_expression "(int *)(DAT_0007b640 + 0x1c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(DAT_0007b640 + 0x1c)" (( "(") (binary_expression "DAT_0007b640 + 0x1c" (identifier "DAT_0007b640") (+ "+") (number_literal "0x1c")) () ")")))) (!= "!=") (subscript_expression "piVar1[2]" (identifier "piVar1") ([ "[") (number_literal "2") (] "]"))) () ")")) (compound_statement "{\n      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }\n      pcVar3 = (char *)piVar1[3];\n      sVar4 = strlen(pcVar3);\n      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);\n      piVar1[3] = iVar7;\n      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);\n      return;\n    }" ({ "{") (if_statement "if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }" (if "if") (parenthesized_expression "(*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7)" (( "(") (binary_expression "*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7" (pointer_expression "*(int *)(DAT_0007b640 + 0x1c)" (* "*") (cast_expression "(int *)(DAT_0007b640 + 0x1c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(DAT_0007b640 + 0x1c)" (( "(") (binary_expression "DAT_0007b640 + 0x1c" (identifier "DAT_0007b640") (+ "+") (number_literal "0x1c")) () ")")))) (!= "!=") (binary_expression "piVar1[2] - iVar7" (subscript_expression "piVar1[2]" (identifier "piVar1") ([ "[") (number_literal "2") (] "]")) (- "-") (identifier "iVar7"))) () ")")) (compound_statement "{\n        free(__ptr);\n        FUN_000376d0(piVar1[1]);\n        return;\n      }" ({ "{") (expression_statement "free(__ptr);" (call_expression "free(__ptr)" (identifier "free") (argument_list "(__ptr)" (( "(") (identifier "__ptr") () ")"))) (; ";")) (expression_statement "FUN_000376d0(piVar1[1]);" (call_expression "FUN_000376d0(piVar1[1])" (identifier "FUN_000376d0") (argument_list "(piVar1[1])" (( "(") (subscript_expression "piVar1[1]" (identifier "piVar1") ([ "[") (number_literal "1") (] "]")) () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "pcVar3 = (char *)piVar1[3];" (assignment_expression "pcVar3 = (char *)piVar1[3]" (identifier "pcVar3") (= "=") (cast_expression "(char *)piVar1[3]" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "piVar1[3]" (identifier "piVar1") ([ "[") (number_literal "3") (] "]")))) (; ";")) (expression_statement "sVar4 = strlen(pcVar3);" (assignment_expression "sVar4 = strlen(pcVar3)" (identifier "sVar4") (= "=") (call_expression "strlen(pcVar3)" (identifier "strlen") (argument_list "(pcVar3)" (( "(") (identifier "pcVar3") () ")")))) (; ";")) (expression_statement "iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);" (assignment_expression "iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4)" (identifier "iVar7") (= "=") (call_expression "FUN_00017890(__ptr,iVar7,pcVar3,sVar4)" (identifier "FUN_00017890") (argument_list "(__ptr,iVar7,pcVar3,sVar4)" (( "(") (identifier "__ptr") (, ",") (identifier "iVar7") (, ",") (identifier "pcVar3") (, ",") (identifier "sVar4") () ")")))) (; ";")) (expression_statement "piVar1[3] = iVar7;" (assignment_expression "piVar1[3] = iVar7" (subscript_expression "piVar1[3]" (identifier "piVar1") ([ "[") (number_literal "3") (] "]")) (= "=") (identifier "iVar7")) (; ";")) (expression_statement "piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);" (assignment_expression "piVar1[2] = *(int *)(DAT_0007b640 + 0x1c)" (subscript_expression "piVar1[2]" (identifier "piVar1") ([ "[") (number_literal "2") (] "]")) (= "=") (pointer_expression "*(int *)(DAT_0007b640 + 0x1c)" (* "*") (cast_expression "(int *)(DAT_0007b640 + 0x1c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(DAT_0007b640 + 0x1c)" (( "(") (binary_expression "DAT_0007b640 + 0x1c" (identifier "DAT_0007b640") (+ "+") (number_literal "0x1c")) () ")"))))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "pcVar3 = (char *)piVar1[3];" (assignment_expression "pcVar3 = (char *)piVar1[3]" (identifier "pcVar3") (= "=") (cast_expression "(char *)piVar1[3]" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "piVar1[3]" (identifier "piVar1") ([ "[") (number_literal "3") (] "]")))) (; ";")) (expression_statement "sVar4 = strlen(pcVar3);" (assignment_expression "sVar4 = strlen(pcVar3)" (identifier "sVar4") (= "=") (call_expression "strlen(pcVar3)" (identifier "strlen") (argument_list "(pcVar3)" (( "(") (identifier "pcVar3") () ")")))) (; ";")) (expression_statement "iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);" (assignment_expression "iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7)" (identifier "iVar7") (= "=") (call_expression "FUN_00017890(pcVar3,sVar4,__ptr,iVar7)" (identifier "FUN_00017890") (argument_list "(pcVar3,sVar4,__ptr,iVar7)" (( "(") (identifier "pcVar3") (, ",") (identifier "sVar4") (, ",") (identifier "__ptr") (, ",") (identifier "iVar7") () ")")))) (; ";")) (break_statement "break;" (break "break") (; ";"))) (case_statement "case 4:" (case "case") (number_literal "4") (: ":")) (case_statement "case 6:" (case "case") (number_literal "6") (: ":")) (case_statement "case 7:" (case "case") (number_literal "7") (: ":")) (case_statement "case 0x12:\n    return;" (case "case") (number_literal "0x12") (: ":") (return_statement "return;" (return "return") (; ";"))) (case_statement "case 5:" (case "case") (number_literal "5") (: ":")) (case_statement "case 0x10:" (case "case") (number_literal "0x10") (: ":")) (case_statement "case 0x13:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[2] = *(int *)(iVar7 + 0x1c);\n    *piVar1 = iVar12;\n    return;" (case "case") (number_literal "0x13") (: ":") (expression_statement "iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);" (assignment_expression "iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4)" (identifier "iVar12") (= "=") (pointer_expression "*(int *)(*(int *)(iVar7 + 0x10) + 4)" (* "*") (cast_expression "(int *)(*(int *)(iVar7 + 0x10) + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*(int *)(iVar7 + 0x10) + 4)" (( "(") (binary_expression "*(int *)(iVar7 + 0x10) + 4" (pointer_expression "*(int *)(iVar7 + 0x10)" (* "*") (cast_expression "(int *)(iVar7 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar7 + 0x10)" (( "(") (binary_expression "iVar7 + 0x10" (identifier "iVar7") (+ "+") (number_literal "0x10")) () ")")))) (+ "+") (number_literal "4")) () ")"))))) (; ";")) (expression_statement "piVar1[2] = *(int *)(iVar7 + 0x1c);" (assignment_expression "piVar1[2] = *(int *)(iVar7 + 0x1c)" (subscript_expression "piVar1[2]" (identifier "piVar1") ([ "[") (number_literal "2") (] "]")) (= "=") (pointer_expression "*(int *)(iVar7 + 0x1c)" (* "*") (cast_expression "(int *)(iVar7 + 0x1c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar7 + 0x1c)" (( "(") (binary_expression "iVar7 + 0x1c" (identifier "iVar7") (+ "+") (number_literal "0x1c")) () ")"))))) (; ";")) (expression_statement "*piVar1 = iVar12;" (assignment_expression "*piVar1 = iVar12" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (= "=") (identifier "iVar12")) (; ";")) (return_statement "return;" (return "return") (; ";"))) (case_statement "default:\n    FUN_00040b60(3,"Wrong undo update type -- please report a bug");\n    return;" (default "default") (: ":") (expression_statement "FUN_00040b60(3,"Wrong undo update type -- please report a bug");" (call_expression "FUN_00040b60(3,"Wrong undo update type -- please report a bug")" (identifier "FUN_00040b60") (argument_list "(3,"Wrong undo update type -- please report a bug")" (( "(") (number_literal "3") (, ",") (string_literal ""Wrong undo update type -- please report a bug"" (" """) (string_content "Wrong undo update type -- please report a bug") (" """)) () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";"))) (case_statement "case 0xd:" (case "case") (number_literal "0xd") (: ":")) (case_statement "case 0xe:" (case "case") (number_literal "0xe") (: ":")) (case_statement "case 0xf:\n    if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }\n    if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }\n    iVar7 = piVar1[10];\n    if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }\n    iVar12 = *piVar1;\n    if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }\n    piVar1[2] = uVar11;\n    piVar1[0xb] = uVar10;\n    *piVar1 = iVar7;\n    piVar1[10] = iVar12;\n    return;" (case "case") (number_literal "0xf") (: ":") (if_statement "if (DAT_0007b64c == (undefined4 *)0x0) {\n      return;\n    }" (if "if") (parenthesized_expression "(DAT_0007b64c == (undefined4 *)0x0)" (( "(") (binary_expression "DAT_0007b64c == (undefined4 *)0x0" (identifier "DAT_0007b64c") (== "==") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      return;\n    }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (if_statement "if (sVar4 == 0xd) {\n      piVar1[8] = (int)DAT_0007b64c;\n    }\n    else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }" (if "if") (parenthesized_expression "(sVar4 == 0xd)" (( "(") (binary_expression "sVar4 == 0xd" (identifier "sVar4") (== "==") (number_literal "0xd")) () ")")) (compound_statement "{\n      piVar1[8] = (int)DAT_0007b64c;\n    }" ({ "{") (expression_statement "piVar1[8] = (int)DAT_0007b64c;" (assignment_expression "piVar1[8] = (int)DAT_0007b64c" (subscript_expression "piVar1[8]" (identifier "piVar1") ([ "[") (number_literal "8") (] "]")) (= "=") (cast_expression "(int)DAT_0007b64c" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "DAT_0007b64c"))) (; ";")) (} "}")) (else_clause "else {\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }" (else "else") (compound_statement "{\n      FUN_0002af00(piVar1[8]);\n      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);\n      piVar1[8] = (int)puVar8;\n    }" ({ "{") (expression_statement "FUN_0002af00(piVar1[8]);" (call_expression "FUN_0002af00(piVar1[8])" (identifier "FUN_0002af00") (argument_list "(piVar1[8])" (( "(") (subscript_expression "piVar1[8]" (identifier "piVar1") ([ "[") (number_literal "8") (] "]")) () ")"))) (; ";")) (expression_statement "puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);" (assignment_expression "puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c)" (identifier "puVar8") (= "=") (cast_expression "(undefined4 *)FUN_0002ae40(DAT_0007b64c)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0002ae40(DAT_0007b64c)" (identifier "FUN_0002ae40") (argument_list "(DAT_0007b64c)" (( "(") (identifier "DAT_0007b64c") () ")"))))) (; ";")) (expression_statement "piVar1[8] = (int)puVar8;" (assignment_expression "piVar1[8] = (int)puVar8" (subscript_expression "piVar1[8]" (identifier "piVar1") ([ "[") (number_literal "8") (] "]")) (= "=") (cast_expression "(int)puVar8" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "puVar8"))) (; ";")) (} "}")))) (expression_statement "iVar7 = piVar1[10];" (assignment_expression "iVar7 = piVar1[10]" (identifier "iVar7") (= "=") (subscript_expression "piVar1[10]" (identifier "piVar1") ([ "[") (number_literal "10") (] "]"))) (; ";")) (if_statement "if (piVar1[6] != 0x10) {\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }" (if "if") (parenthesized_expression "(piVar1[6] != 0x10)" (( "(") (binary_expression "piVar1[6] != 0x10" (subscript_expression "piVar1[6]" (identifier "piVar1") ([ "[") (number_literal "6") (] "]")) (!= "!=") (number_literal "0x10")) () ")")) (compound_statement "{\n      puVar2 = (undefined4 *)puVar8[2];\n      piVar1[9] = (int)puVar8;\n      puVar9 = puVar8;\n      if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }\n      iVar12 = (puVar9[1] + iVar7) - puVar8[1];\n      *piVar1 = iVar12;\n      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }\n      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }\n      if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }\n      return;\n    }" ({ "{") (expression_statement "puVar2 = (undefined4 *)puVar8[2];" (assignment_expression "puVar2 = (undefined4 *)puVar8[2]" (identifier "puVar2") (= "=") (cast_expression "(undefined4 *)puVar8[2]" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "puVar8[2]" (identifier "puVar8") ([ "[") (number_literal "2") (] "]")))) (; ";")) (expression_statement "piVar1[9] = (int)puVar8;" (assignment_expression "piVar1[9] = (int)puVar8" (subscript_expression "piVar1[9]" (identifier "piVar1") ([ "[") (number_literal "9") (] "]")) (= "=") (cast_expression "(int)puVar8" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "puVar8"))) (; ";")) (expression_statement "puVar9 = puVar8;" (assignment_expression "puVar9 = puVar8" (identifier "puVar9") (= "=") (identifier "puVar8")) (; ";")) (if_statement "if (puVar2 != (undefined4 *)0x0) {\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }" (if "if") (parenthesized_expression "(puVar2 != (undefined4 *)0x0)" (( "(") (binary_expression "puVar2 != (undefined4 *)0x0" (identifier "puVar2") (!= "!=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);\n        piVar1[9] = (int)puVar9;\n      }" ({ "{") (do_statement "do {\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);" (do "do") (compound_statement "{\n          puVar9 = puVar2;\n          puVar2 = (undefined4 *)puVar9[2];\n        }" ({ "{") (expression_statement "puVar9 = puVar2;" (assignment_expression "puVar9 = puVar2" (identifier "puVar9") (= "=") (identifier "puVar2")) (; ";")) (expression_statement "puVar2 = (undefined4 *)puVar9[2];" (assignment_expression "puVar2 = (undefined4 *)puVar9[2]" (identifier "puVar2") (= "=") (cast_expression "(undefined4 *)puVar9[2]" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "puVar9[2]" (identifier "puVar9") ([ "[") (number_literal "2") (] "]")))) (; ";")) (} "}")) (while "while") (parenthesized_expression "((undefined4 *)puVar9[2] != (undefined4 *)0x0)" (( "(") (binary_expression "(undefined4 *)puVar9[2] != (undefined4 *)0x0" (cast_expression "(undefined4 *)puVar9[2]" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "puVar9[2]" (identifier "puVar9") ([ "[") (number_literal "2") (] "]"))) (!= "!=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (; ";")) (expression_statement "piVar1[9] = (int)puVar9;" (assignment_expression "piVar1[9] = (int)puVar9" (subscript_expression "piVar1[9]" (identifier "piVar1") ([ "[") (number_literal "9") (] "]")) (= "=") (cast_expression "(int)puVar9" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "puVar9"))) (; ";")) (} "}"))) (expression_statement "iVar12 = (puVar9[1] + iVar7) - puVar8[1];" (assignment_expression "iVar12 = (puVar9[1] + iVar7) - puVar8[1]" (identifier "iVar12") (= "=") (binary_expression "(puVar9[1] + iVar7) - puVar8[1]" (parenthesized_expression "(puVar9[1] + iVar7)" (( "(") (binary_expression "puVar9[1] + iVar7" (subscript_expression "puVar9[1]" (identifier "puVar9") ([ "[") (number_literal "1") (] "]")) (+ "+") (identifier "iVar7")) () ")")) (- "-") (subscript_expression "puVar8[1]" (identifier "puVar8") ([ "[") (number_literal "1") (] "]")))) (; ";")) (expression_statement "*piVar1 = iVar12;" (assignment_expression "*piVar1 = iVar12" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (= "=") (identifier "iVar12")) (; ";")) (if_statement "if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }" (if "if") (parenthesized_expression "(((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf))" (( "(") (binary_expression "((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)" (parenthesized_expression "((DAT_0007b664 & 0x800) != 0)" (( "(") (binary_expression "(DAT_0007b664 & 0x800) != 0" (parenthesized_expression "(DAT_0007b664 & 0x800)" (( "(") (binary_expression "DAT_0007b664 & 0x800" (identifier "DAT_0007b664") (& "&") (number_literal "0x800")) () ")")) (!= "!=") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(piVar1[1] == 0xf)" (( "(") (binary_expression "piVar1[1] == 0xf" (subscript_expression "piVar1[1]" (identifier "piVar1") ([ "[") (number_literal "1") (] "]")) (== "==") (number_literal "0xf")) () ")"))) () ")")) (compound_statement "{\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }\n        return;\n      }" ({ "{") (expression_statement "sVar4 = strlen((char *)*puVar9);" (assignment_expression "sVar4 = strlen((char *)*puVar9)" (identifier "sVar4") (= "=") (call_expression "strlen((char *)*puVar9)" (identifier "strlen") (argument_list "((char *)*puVar9)" (( "(") (cast_expression "(char *)*puVar9" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*puVar9" (* "*") (identifier "puVar9"))) () ")")))) (; ";")) (expression_statement "piVar1[2] = sVar4;" (assignment_expression "piVar1[2] = sVar4" (subscript_expression "piVar1[2]" (identifier "piVar1") ([ "[") (number_literal "2") (] "]")) (= "=") (identifier "sVar4")) (; ";")) (if_statement "if (iVar12 == iVar7) {\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }" (if "if") (parenthesized_expression "(iVar12 == iVar7)" (( "(") (binary_expression "iVar12 == iVar7" (identifier "iVar12") (== "==") (identifier "iVar7")) () ")")) (compound_statement "{\n          piVar1[2] = sVar4 + piVar1[0xb];\n          return;\n        }" ({ "{") (expression_statement "piVar1[2] = sVar4 + piVar1[0xb];" (assignment_expression "piVar1[2] = sVar4 + piVar1[0xb]" (subscript_expression "piVar1[2]" (identifier "piVar1") ([ "[") (number_literal "2") (] "]")) (= "=") (binary_expression "sVar4 + piVar1[0xb]" (identifier "sVar4") (+ "+") (subscript_expression "piVar1[0xb]" (identifier "piVar1") ([ "[") (number_literal "0xb") (] "]")))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}"))) (if_statement "if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {\n        return;\n      }" (if "if") (parenthesized_expression "(*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8))" (( "(") (binary_expression "*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)" (pointer_expression "*(int *)(DAT_0007b640 + 0x10)" (* "*") (cast_expression "(int *)(DAT_0007b640 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(DAT_0007b640 + 0x10)" (( "(") (binary_expression "DAT_0007b640 + 0x10" (identifier "DAT_0007b640") (+ "+") (number_literal "0x10")) () ")")))) (!= "!=") (pointer_expression "*(int *)(DAT_0007b640 + 8)" (* "*") (cast_expression "(int *)(DAT_0007b640 + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(DAT_0007b640 + 8)" (( "(") (binary_expression "DAT_0007b640 + 8" (identifier "DAT_0007b640") (+ "+") (number_literal "8")) () ")"))))) () ")")) (compound_statement "{\n        return;\n      }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (if_statement "if ((DAT_0007b664 & 0x40000000) != 0) {\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }" (if "if") (parenthesized_expression "((DAT_0007b664 & 0x40000000) != 0)" (( "(") (binary_expression "(DAT_0007b664 & 0x40000000) != 0" (parenthesized_expression "(DAT_0007b664 & 0x40000000)" (( "(") (binary_expression "DAT_0007b664 & 0x40000000" (identifier "DAT_0007b664") (& "&") (number_literal "0x40000000")) () ")")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        sVar4 = strlen((char *)*puVar9);\n        piVar1[2] = sVar4;\n        return;\n      }" ({ "{") (expression_statement "sVar4 = strlen((char *)*puVar9);" (assignment_expression "sVar4 = strlen((char *)*puVar9)" (identifier "sVar4") (= "=") (call_expression "strlen((char *)*puVar9)" (identifier "strlen") (argument_list "((char *)*puVar9)" (( "(") (cast_expression "(char *)*puVar9" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*puVar9" (* "*") (identifier "puVar9"))) () ")")))) (; ";")) (expression_statement "piVar1[2] = sVar4;" (assignment_expression "piVar1[2] = sVar4" (subscript_expression "piVar1[2]" (identifier "piVar1") ([ "[") (number_literal "2") (] "]")) (= "=") (identifier "sVar4")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "iVar12 = *piVar1;" (assignment_expression "iVar12 = *piVar1" (identifier "iVar12") (= "=") (pointer_expression "*piVar1" (* "*") (identifier "piVar1"))) (; ";")) (if_statement "if (iVar12 == iVar7) {\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }\n    else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }" (if "if") (parenthesized_expression "(iVar12 == iVar7)" (( "(") (binary_expression "iVar12 == iVar7" (identifier "iVar12") (== "==") (identifier "iVar7")) () ")")) (compound_statement "{\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n      if (uVar11 <= uVar10) goto code_r0x00037d97;\n    }" ({ "{") (expression_statement "uVar10 = piVar1[2];" (assignment_expression "uVar10 = piVar1[2]" (identifier "uVar10") (= "=") (subscript_expression "piVar1[2]" (identifier "piVar1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (expression_statement "uVar11 = piVar1[0xb];" (assignment_expression "uVar11 = piVar1[0xb]" (identifier "uVar11") (= "=") (subscript_expression "piVar1[0xb]" (identifier "piVar1") ([ "[") (number_literal "0xb") (] "]"))) (; ";")) (if_statement "if (uVar11 <= uVar10) goto code_r0x00037d97;" (if "if") (parenthesized_expression "(uVar11 <= uVar10)" (( "(") (binary_expression "uVar11 <= uVar10" (identifier "uVar11") (<= "<=") (identifier "uVar10")) () ")")) (goto_statement "goto code_r0x00037d97;" (goto "goto") (statement_identifier "code_r0x00037d97") (; ";"))) (} "}")) (else_clause "else {\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }" (else "else") (compound_statement "{\n      if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }\n      uVar10 = piVar1[2];\n      uVar11 = piVar1[0xb];\n    }" ({ "{") (if_statement "if (iVar7 <= iVar12) {\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }" (if "if") (parenthesized_expression "(iVar7 <= iVar12)" (( "(") (binary_expression "iVar7 <= iVar12" (identifier "iVar7") (<= "<=") (identifier "iVar12")) () ")")) (compound_statement "{\ncode_r0x00037d97:\n        piVar1[6] = 0x20;\n        return;\n      }" ({ "{") (labeled_statement "code_r0x00037d97:\n        piVar1[6] = 0x20;" (statement_identifier "code_r0x00037d97") (: ":") (expression_statement "piVar1[6] = 0x20;" (assignment_expression "piVar1[6] = 0x20" (subscript_expression "piVar1[6]" (identifier "piVar1") ([ "[") (number_literal "6") (] "]")) (= "=") (number_literal "0x20")) (; ";"))) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "uVar10 = piVar1[2];" (assignment_expression "uVar10 = piVar1[2]" (identifier "uVar10") (= "=") (subscript_expression "piVar1[2]" (identifier "piVar1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (expression_statement "uVar11 = piVar1[0xb];" (assignment_expression "uVar11 = piVar1[0xb]" (identifier "uVar11") (= "=") (subscript_expression "piVar1[0xb]" (identifier "piVar1") ([ "[") (number_literal "0xb") (] "]"))) (; ";")) (} "}")))) (expression_statement "piVar1[2] = uVar11;" (assignment_expression "piVar1[2] = uVar11" (subscript_expression "piVar1[2]" (identifier "piVar1") ([ "[") (number_literal "2") (] "]")) (= "=") (identifier "uVar11")) (; ";")) (expression_statement "piVar1[0xb] = uVar10;" (assignment_expression "piVar1[0xb] = uVar10" (subscript_expression "piVar1[0xb]" (identifier "piVar1") ([ "[") (number_literal "0xb") (] "]")) (= "=") (identifier "uVar10")) (; ";")) (expression_statement "*piVar1 = iVar7;" (assignment_expression "*piVar1 = iVar7" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (= "=") (identifier "iVar7")) (; ";")) (expression_statement "piVar1[10] = iVar12;" (assignment_expression "piVar1[10] = iVar12" (subscript_expression "piVar1[10]" (identifier "piVar1") ([ "[") (number_literal "10") (] "]")) (= "=") (identifier "iVar12")) (; ";")) (return_statement "return;" (return "return") (; ";"))) (case_statement "case 0x11:\n    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);\n    piVar1[0xb] = *(int *)(iVar7 + 0x1c);\n    piVar1[10] = iVar12;\n    return;" (case "case") (number_literal "0x11") (: ":") (expression_statement "iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);" (assignment_expression "iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4)" (identifier "iVar12") (= "=") (pointer_expression "*(int *)(*(int *)(iVar7 + 0x10) + 4)" (* "*") (cast_expression "(int *)(*(int *)(iVar7 + 0x10) + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*(int *)(iVar7 + 0x10) + 4)" (( "(") (binary_expression "*(int *)(iVar7 + 0x10) + 4" (pointer_expression "*(int *)(iVar7 + 0x10)" (* "*") (cast_expression "(int *)(iVar7 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar7 + 0x10)" (( "(") (binary_expression "iVar7 + 0x10" (identifier "iVar7") (+ "+") (number_literal "0x10")) () ")")))) (+ "+") (number_literal "4")) () ")"))))) (; ";")) (expression_statement "piVar1[0xb] = *(int *)(iVar7 + 0x1c);" (assignment_expression "piVar1[0xb] = *(int *)(iVar7 + 0x1c)" (subscript_expression "piVar1[0xb]" (identifier "piVar1") ([ "[") (number_literal "0xb") (] "]")) (= "=") (pointer_expression "*(int *)(iVar7 + 0x1c)" (* "*") (cast_expression "(int *)(iVar7 + 0x1c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar7 + 0x1c)" (( "(") (binary_expression "iVar7 + 0x1c" (identifier "iVar7") (+ "+") (number_literal "0x1c")) () ")"))))) (; ";")) (expression_statement "piVar1[10] = iVar12;" (assignment_expression "piVar1[10] = iVar12" (subscript_expression "piVar1[10]" (identifier "piVar1") ([ "[") (number_literal "10") (] "]")) (= "=") (identifier "iVar12")) (; ";")) (return_statement "return;" (return "return") (; ";"))) (} "}"))) (expression_statement "piVar1[3] = iVar7;" (assignment_expression "piVar1[3] = iVar7" (subscript_expression "piVar1[3]" (identifier "piVar1") ([ "[") (number_literal "3") (] "]")) (= "=") (identifier "iVar7")) (; ";")) (expression_statement "piVar1[0xb] = *(int *)(DAT_0007b640 + 0x1c);" (assignment_expression "piVar1[0xb] = *(int *)(DAT_0007b640 + 0x1c)" (subscript_expression "piVar1[0xb]" (identifier "piVar1") ([ "[") (number_literal "0xb") (] "]")) (= "=") (pointer_expression "*(int *)(DAT_0007b640 + 0x1c)" (* "*") (cast_expression "(int *)(DAT_0007b640 + 0x1c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(DAT_0007b640 + 0x1c)" (( "(") (binary_expression "DAT_0007b640 + 0x1c" (identifier "DAT_0007b640") (+ "+") (number_literal "0x1c")) () ")"))))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void function_1(type_1 action)

{
  type_2 *puVar1;
  int var_17;
  type_3 *var_16;
  ssize_t sVar4;
  type_4 *poVar5;
  size_t var_20;
  char *pcVar7;
  type_1 var_12;
  char *var_3;
  size_t var_7;
  type_3 *pfVar10;
  type_3 *pfVar11;
  type_5 var_22;
  type_5 var_21;
  int var_19;
  
  poVar5 = openfile;
  puVar1 = openfile->undotop;
  var_12 = puVar1->type;
  puVar1->newsize = openfile->totsize;
  pfVar10 = var_11;
  switch(var_12) {
  case ADD:
    pcVar7 = (char *)var_1(6);
    var_7 = var_2(openfile->current->data + puVar1->mark_begin_x,pcVar7,(size_t *)0x0);
    var_3 = puVar1->strdata;
    if (var_3 != (char *)0x0) {
      var_12 = var_4(var_3);
    }
    var_3 = var_5(var_3,var_12,pcVar7,var_7);
    puVar1->strdata = var_3;
    poVar5 = openfile;
    puVar1->mark_begin_lineno = openfile->current->lineno;
    puVar1->mark_begin_x = poVar5->current_x;
    return;
  case ENTER:
    var_3 = var_6((char *)0x0,poVar5->current->data);
    break;
  case BACK:
  case DEL:
    var_3 = (char *)var_1(6);
    var_7 = var_2(openfile->current->data + openfile->current_x,var_3,(size_t *)0x0);
    if (openfile->current_x != puVar1->begin) {
      if (openfile->current_x != puVar1->begin - var_7) {
        var_8(var_3);
        var_9(puVar1->type);
        return;
      }
      pcVar7 = puVar1->strdata;
      var_20 = var_4(pcVar7);
      var_3 = var_5(var_3,var_7,pcVar7,var_20);
      puVar1->strdata = var_3;
      puVar1->begin = openfile->current_x;
      return;
    }
    pcVar7 = puVar1->strdata;
    var_20 = var_4(pcVar7);
    var_3 = var_5(pcVar7,var_20,var_3,var_7);
    break;
  case JOIN:
  case SPLIT_BEGIN:
  case SPLIT_END:
  case COUPLE_BEGIN:
    return;
  case REPLACE:
  case PASTE:
  case COUPLE_END:
    sVar4 = poVar5->current->lineno;
    puVar1->begin = poVar5->current_x;
    puVar1->lineno = sVar4;
    return;
  default:
    var_10(ALERT,"Wrong undo update type -- please report a bug");
    return;
  case var_13:
  case CUT:
  case var_18:
    if (var_11 == (type_3 *)0x0) {
      return;
    }
    if (var_12 == var_13) {
      puVar1->var_11 = var_11;
    }
    else {
      var_14(puVar1->var_11);
      pfVar10 = var_15(var_11);
      puVar1->var_11 = pfVar10;
    }
    var_17 = puVar1->mark_begin_lineno;
    if (puVar1->xflags != 0x10) {
      var_16 = pfVar10->next;
      puVar1->cutbottom = pfVar10;
      pfVar11 = pfVar10;
      if (var_16 != (type_3 *)0x0) {
        do {
          pfVar11 = var_16;
          var_16 = pfVar11->next;
        } while (pfVar11->next != (type_3 *)0x0);
        puVar1->cutbottom = pfVar11;
      }
      var_19 = (pfVar11->lineno + var_17) - pfVar10->lineno;
      puVar1->lineno = var_19;
      if (((flags[0] & 0x800) != 0) || (puVar1->type == var_18)) {
        var_20 = var_4(pfVar11->data);
        puVar1->begin = var_20;
        if (var_19 == var_17) {
          puVar1->begin = var_20 + puVar1->mark_begin_x;
          return;
        }
        return;
      }
      if (openfile->current != openfile->filebot) {
        return;
      }
      if ((flags[0] & 0x40000000) != 0) {
        var_20 = var_4(pfVar11->data);
        puVar1->begin = var_20;
        return;
      }
      return;
    }
    var_19 = puVar1->lineno;
    if (var_19 == var_17) {
      var_22 = puVar1->begin;
      var_21 = puVar1->mark_begin_x;
      if (var_21 <= var_22) goto LAB_00037d97;
    }
    else {
      if (var_17 <= var_19) {
LAB_00037d97:
        puVar1->xflags = 0x20;
        return;
      }
      var_22 = puVar1->begin;
      var_21 = puVar1->mark_begin_x;
    }
    puVar1->begin = var_21;
    puVar1->mark_begin_x = var_22;
    puVar1->lineno = var_17;
    puVar1->mark_begin_lineno = var_19;
    return;
  case INSERT:
    sVar4 = poVar5->current->lineno;
    puVar1->mark_begin_x = poVar5->current_x;
    puVar1->mark_begin_lineno = sVar4;
    return;
  }
  puVar1->strdata = var_3;
  puVar1->mark_begin_x = openfile->current_x;
  return;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type)))) body: (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (switch_statement condition: (parenthesized_expression (identifier)) body: (compound_statement (case_statement value: (number_literal) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (pointer_expression argument: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (identifier) (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (return_statement)) (case_statement value: (number_literal) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (number_literal) (pointer_expression argument: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))))))) (break_statement)) (case_statement value: (number_literal)) (case_statement value: (number_literal) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (pointer_expression argument: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (identifier) (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (subscript_expression argument: (identifier) index: (number_literal)))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier)))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (subscript_expression argument: (identifier) index: (number_literal))))) (return_statement))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (return_statement))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier))))) (break_statement)) (case_statement value: (number_literal)) (case_statement value: (number_literal)) (case_statement value: (number_literal)) (case_statement value: (number_literal) (return_statement)) (case_statement value: (number_literal)) (case_statement value: (number_literal)) (case_statement value: (number_literal) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (return_statement)) (case_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (number_literal) (string_literal (string_content))))) (return_statement)) (case_statement value: (number_literal)) (case_statement value: (number_literal)) (case_statement value: (number_literal) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (return_statement))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier))))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (subscript_expression argument: (identifier) index: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal)))))) condition: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) right: (subscript_expression argument: (identifier) index: (number_literal))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (binary_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal))))) (return_statement))) (return_statement))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) 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: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (return_statement))) (return_statement))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (goto_statement label: (statement_identifier)))) alternative: (else_clause (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (labeled_statement label: (statement_identifier) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal)))) (return_statement))) (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal))))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (return_statement)) (case_statement value: (number_literal) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (return_statement)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (return_statement))))

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void MASKED(void)

{
  int *piVar1;
  undefined4 *puVar2;
  char *pcVar3;
  size_t sVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  void *__ptr;
  int iVar7;
  undefined4 *puVar8;
  undefined4 *puVar9;
  uint uVar10;
  uint uVar11;
  int iVar12;
  
  iVar7 = DAT_0007b640;
  piVar1 = *(int **)(DAT_0007b640 + 0x40);
  sVar4 = piVar1[1];
  piVar1[5] = *(int *)(DAT_0007b640 + 0x14);
  puVar8 = DAT_0007b64c;
  switch(sVar4) {
  case 0:
    uVar5 = FUN_0003da70(6);
    uVar6 = FUN_00018090(piVar1[0xb] + **(int **)(DAT_0007b640 + 0x10),uVar5,0);
    pcVar3 = (char *)piVar1[3];
    if (pcVar3 != (char *)0x0) {
      sVar4 = strlen(pcVar3);
    }
    iVar7 = FUN_00017890(pcVar3,sVar4,uVar5,uVar6);
    piVar1[3] = iVar7;
    iVar7 = DAT_0007b640;
    piVar1[10] = *(int *)(*(int *)(DAT_0007b640 + 0x10) + 4);
    piVar1[0xb] = *(int *)(iVar7 + 0x1c);
    return;
  case 1:
    iVar7 = FUN_0003dbd0(0,**(undefined4 **)(iVar7 + 0x10));
    break;
  case 2:
  case 3:
    __ptr = (void *)FUN_0003da70(6);
    iVar7 = FUN_00018090(*(int *)(DAT_0007b640 + 0x1c) + **(int **)(DAT_0007b640 + 0x10),__ptr,0);
    if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2]) {
      if (*(int *)(DAT_0007b640 + 0x1c) != piVar1[2] - iVar7) {
        free(__ptr);
        FUN_000376d0(piVar1[1]);
        return;
      }
      pcVar3 = (char *)piVar1[3];
      sVar4 = strlen(pcVar3);
      iVar7 = FUN_00017890(__ptr,iVar7,pcVar3,sVar4);
      piVar1[3] = iVar7;
      piVar1[2] = *(int *)(DAT_0007b640 + 0x1c);
      return;
    }
    pcVar3 = (char *)piVar1[3];
    sVar4 = strlen(pcVar3);
    iVar7 = FUN_00017890(pcVar3,sVar4,__ptr,iVar7);
    break;
  case 4:
  case 6:
  case 7:
  case 0x12:
    return;
  case 5:
  case 0x10:
  case 0x13:
    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);
    piVar1[2] = *(int *)(iVar7 + 0x1c);
    *piVar1 = iVar12;
    return;
  default:
    FUN_00040b60(3,"Wrong undo update type -- please report a bug");
    return;
  case 0xd:
  case 0xe:
  case 0xf:
    if (DAT_0007b64c == (undefined4 *)0x0) {
      return;
    }
    if (sVar4 == 0xd) {
      piVar1[8] = (int)DAT_0007b64c;
    }
    else {
      FUN_0002af00(piVar1[8]);
      puVar8 = (undefined4 *)FUN_0002ae40(DAT_0007b64c);
      piVar1[8] = (int)puVar8;
    }
    iVar7 = piVar1[10];
    if (piVar1[6] != 0x10) {
      puVar2 = (undefined4 *)puVar8[2];
      piVar1[9] = (int)puVar8;
      puVar9 = puVar8;
      if (puVar2 != (undefined4 *)0x0) {
        do {
          puVar9 = puVar2;
          puVar2 = (undefined4 *)puVar9[2];
        } while ((undefined4 *)puVar9[2] != (undefined4 *)0x0);
        piVar1[9] = (int)puVar9;
      }
      iVar12 = (puVar9[1] + iVar7) - puVar8[1];
      *piVar1 = iVar12;
      if (((DAT_0007b664 & 0x800) != 0) || (piVar1[1] == 0xf)) {
        sVar4 = strlen((char *)*puVar9);
        piVar1[2] = sVar4;
        if (iVar12 == iVar7) {
          piVar1[2] = sVar4 + piVar1[0xb];
          return;
        }
        return;
      }
      if (*(int *)(DAT_0007b640 + 0x10) != *(int *)(DAT_0007b640 + 8)) {
        return;
      }
      if ((DAT_0007b664 & 0x40000000) != 0) {
        sVar4 = strlen((char *)*puVar9);
        piVar1[2] = sVar4;
        return;
      }
      return;
    }
    iVar12 = *piVar1;
    if (iVar12 == iVar7) {
      uVar10 = piVar1[2];
      uVar11 = piVar1[0xb];
      if (uVar11 <= uVar10) goto code_r0x00037d97;
    }
    else {
      if (iVar7 <= iVar12) {
code_r0x00037d97:
        piVar1[6] = 0x20;
        return;
      }
      uVar10 = piVar1[2];
      uVar11 = piVar1[0xb];
    }
    piVar1[2] = uVar11;
    piVar1[0xb] = uVar10;
    *piVar1 = iVar7;
    piVar1[10] = iVar12;
    return;
  case 0x11:
    iVar12 = *(int *)(*(int *)(iVar7 + 0x10) + 4);
    piVar1[0xb] = *(int *)(iVar7 + 0x1c);
    piVar1[10] = iVar12;
    return;
  }
  piVar1[3] = iVar7;
  piVar1[0xb] = *(int *)(DAT_0007b640 + 0x1c);
  return;
}

