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

int duplicate_buffered_stream(int fd1,int fd2)

{
  int iVar1;
  int iVar2;
  BUFFERED_STREAM **ppBVar3;
  BUFFERED_STREAM *pBVar4;
  BUFFERED_STREAM **ppBVar5;
  BUFFERED_STREAM **ppBVar6;
  BUFFERED_STREAM *s;
  bool bVar7;
  bool bVar8;
  
  iVar1 = nbuffers;
  if (fd1 == fd2) {
    return 0;
  }
  iVar2 = fd2;
  if (fd2 <= fd1) {
    iVar2 = fd1;
  }
  ppBVar6 = buffers;
  if (nbuffers <= iVar2) {
    nbuffers = iVar2 + 0x14;
    ppBVar6 = (BUFFERED_STREAM **)xrealloc(buffers,nbuffers * 4);
    buffers = ppBVar6;
    if (iVar1 < nbuffers) {
      memset(ppBVar6 + iVar1,0,(nbuffers - iVar1) * 4);
    }
  }
  bVar7 = bash_input.type != st_bstream;
  bVar8 = bash_input.location.file != (FILE *)fd2;
  ppBVar3 = ppBVar6 + fd2;
  pBVar4 = *ppBVar3;
  ppBVar5 = ppBVar6 + fd1;
  s = *ppBVar5;
  if (pBVar4 != (BUFFERED_STREAM *)0x0) {
    if (((s == (BUFFERED_STREAM *)0x0) || (s->b_buffer == (char *)0x0)) ||
       (s->b_buffer != pBVar4->b_buffer)) {
      iVar1 = pBVar4->b_fd;
      if (((pBVar4->b_flag & 0x20) == 0) && (pBVar4->b_buffer != (char *)0x0)) {
        free(pBVar4->b_buffer);
      }
      free(pBVar4);
      ppBVar6[iVar1] = (BUFFERED_STREAM *)0x0;
      s = *ppBVar5;
    }
    else {
      *ppBVar3 = (BUFFERED_STREAM *)0x0;
      s = *ppBVar5;
    }
  }
  if (s == (BUFFERED_STREAM *)0x0) {
    pBVar4 = (BUFFERED_STREAM *)0x0;
    ppBVar5 = ppBVar3;
  }
  else {
    pBVar4 = (BUFFERED_STREAM *)xmalloc(0x18);
    xbcopy((char *)s,(char *)pBVar4,0x18);
    ppBVar5 = buffers + fd2;
    ppBVar6 = buffers;
  }
  *ppBVar3 = pBVar4;
  pBVar4 = *ppBVar5;
  if (pBVar4 == (BUFFERED_STREAM *)0x0) {
    if (bVar7 || bVar8) goto LAB_0008d159;
    fd_to_buffered_stream(fd2);
    pBVar4 = buffers[fd2];
    ppBVar6 = buffers;
  }
  else {
    pBVar4->b_fd = fd2;
    if (bVar7 || bVar8) goto LAB_0008d159;
  }
  pBVar4->b_flag = pBVar4->b_flag | 8;
LAB_0008d159:
  if ((((bash_input.type == st_bstream) && ((FILE *)fd1 == bash_input.location.file)) ||
      ((interactive_shell == 0 && (fd1 == default_buffered_input)))) ||
     ((ppBVar6[fd1] != (BUFFERED_STREAM *)0x0 && ((ppBVar6[fd1]->b_flag & 0x20) != 0)))) {
    pBVar4->b_flag = pBVar4->b_flag | 0x20;
  }
  return fd2;
}



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

int duplicate_buffered_stream(int param_1,int param_2)

{
  int *__ptr;
  int iVar1;
  int *piVar2;
  int iVar3;
  int *piVar4;
  int iVar5;
  int iVar6;
  bool bVar7;
  bool bVar8;
  
  iVar6 = DAT_00179200;
  if (param_1 == param_2) {
    return 0;
  }
  iVar1 = param_2;
  if (param_2 <= param_1) {
    iVar1 = param_1;
  }
  iVar5 = DAT_00179204;
  if (DAT_00179200 <= iVar1) {
    DAT_00179200 = iVar1 + 0x14;
    iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);
    DAT_00179204 = iVar5;
    if (iVar6 < DAT_00179200) {
      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);
    }
  }
  bVar7 = bash_input != 4;
  bVar8 = DAT_0017ac84 != param_2;
  iVar1 = param_2 * 4;
  piVar2 = (int *)(iVar1 + iVar5);
  __ptr = (int *)*piVar2;
  piVar4 = (int *)(iVar5 + param_1 * 4);
  iVar6 = *piVar4;
  if (__ptr != (int *)0x0) {
    if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {
      iVar6 = *__ptr;
      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {
        free((void *)__ptr[1]);
      }
      free(__ptr);
      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;
      iVar6 = *piVar4;
    }
    else {
      *piVar2 = 0;
      iVar6 = *piVar4;
    }
  }
  if (iVar6 == 0) {
    iVar3 = 0;
    piVar4 = piVar2;
  }
  else {
    iVar3 = xmalloc(0x18);
    xbcopy(iVar6,iVar3,0x18);
    piVar4 = (int *)(iVar1 + DAT_00179204);
    iVar5 = DAT_00179204;
  }
  *piVar2 = iVar3;
  piVar4 = (int *)*piVar4;
  if (piVar4 == (int *)0x0) {
    if (bVar7 || bVar8) goto LAB_0008d159;
    fd_to_buffered_stream(param_2);
    piVar4 = *(int **)(DAT_00179204 + iVar1);
    iVar5 = DAT_00179204;
  }
  else {
    *piVar4 = param_2;
    if (bVar7 || bVar8) goto LAB_0008d159;
  }
  piVar4[4] = piVar4[4] | 8;
LAB_0008d159:
  if ((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||
      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||
     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))
     )) {
    piVar4[4] = piVar4[4] | 0x20;
  }
  return param_2;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x000312b0
ADD EBX,0xe4fd7
SUB ESP,0x2c
MOV EAX,dword ptr [ESP + 0x44]
CMP dword ptr [ESP + 0x40],EAX
JZ 0x0008d238
CMOVGE EAX,dword ptr [ESP + 0x40]
MOV EDI,dword ptr [EBX + 0x7200]
MOV ESI,dword ptr [EBX + 0x7204]
CMP EDI,EAX
JLE 0x0008d1d0
LEA ECX,[EBX + 0x8c7c]
MOV dword ptr [ESP + 0xc],0x0
CMP dword ptr [ECX],0x4
JNZ 0x0008d07d
MOV EAX,dword ptr [ESP + 0x44]
CMP dword ptr [ECX + 0x8],EAX
SETZ AL
MOVZX EAX,AL
MOV dword ptr [ESP + 0xc],EAX
MOV EAX,dword ptr [ESP + 0x44]
SHL EAX,0x2
MOV dword ptr [ESP + 0x14],EAX
ADD EAX,ESI
MOV dword ptr [ESP + 0x10],EAX
MOV EBP,dword ptr [EAX]
MOV EAX,dword ptr [ESP + 0x40]
LEA EAX,[ESI + EAX*0x4]
MOV EDI,dword ptr [EAX]
TEST EBP,EBP
JZ 0x0008d104
TEST EDI,EDI
JZ 0x0008d0b1
MOV EDX,dword ptr [EDI + 0x4]
TEST EDX,EDX
JZ 0x0008d0b1
CMP EDX,dword ptr [EBP + 0x4]
JZ 0x0008d250
MOV EDX,dword ptr [EBP]
LEA EDI,[ESI + EDX*0x4]
TEST byte ptr [EBP + 0x10],0x20
JNZ 0x0008d0e0
MOV EDX,dword ptr [EBP + 0x4]
TEST EDX,EDX
JZ 0x0008d0e0
MOV dword ptr [ESP + 0x1c],ECX
SUB ESP,0xc
MOV dword ptr [ESP + 0x24],EAX
PUSH EDX
CALL 0x0002e200
ADD ESP,0x10
MOV ECX,dword ptr [ESP + 0x1c]
MOV EAX,dword ptr [ESP + 0x18]
MOV dword ptr [ESP + 0x1c],ECX
SUB ESP,0xc
MOV dword ptr [ESP + 0x24],EAX
PUSH EBP
CALL 0x0002e200
MOV EAX,dword ptr [ESP + 0x28]
ADD ESP,0x10
MOV ECX,dword ptr [ESP + 0x1c]
MOV dword ptr [EDI],0x0
MOV EDI,dword ptr [EAX]
TEST EDI,EDI
JZ 0x0008d268
MOV dword ptr [ESP + 0x18],ECX
SUB ESP,0xc
PUSH 0x18
CALL 0x000ad700
ADD ESP,0xc
PUSH 0x18
MOV EBP,EAX
PUSH EAX
PUSH EDI
CALL 0x000a4f80
MOV EAX,dword ptr [ESP + 0x24]
ADD ESP,0x10
MOV ECX,dword ptr [ESP + 0x18]
MOV ESI,dword ptr [EBX + 0x7204]
ADD EAX,ESI
MOV EDX,dword ptr [ESP + 0x10]
MOV dword ptr [EDX],EBP
MOV EAX,dword ptr [EAX]
TEST EAX,EAX
JZ 0x0008d1a0
MOV EDI,dword ptr [ESP + 0x44]
MOV dword ptr [EAX],EDI
MOV EDI,dword ptr [ESP + 0xc]
TEST EDI,EDI
JZ 0x0008d159
OR dword ptr [EAX + 0x10],0x8
CMP dword ptr [ECX],0x4
JZ 0x0008d220
LEA EDX,[EBX + 0x4848]
MOV ECX,dword ptr [EDX]
TEST ECX,ECX
JNZ 0x0008d17c
LEA EDX,[EBX + 0x388]
MOV ECX,dword ptr [EDX]
CMP dword ptr [ESP + 0x40],ECX
JZ 0x0008d18d
MOV ECX,dword ptr [ESP + 0x40]
MOV EDX,dword ptr [ESI + ECX*0x4]
TEST EDX,EDX
JZ 0x0008d191
TEST byte ptr [EDX + 0x10],0x20
JZ 0x0008d191
OR dword ptr [EAX + 0x10],0x20
MOV EAX,dword ptr [ESP + 0x44]
ADD ESP,0x2c
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EDX,dword ptr [ESP + 0xc]
TEST EDX,EDX
JZ 0x0008d159
MOV dword ptr [ESP + 0xc],ECX
SUB ESP,0xc
PUSH dword ptr [ESP + 0x50]
CALL 0x0008ceb0
MOV EAX,dword ptr [ESP + 0x24]
ADD ESP,0x10
MOV ECX,dword ptr [ESP + 0xc]
MOV ESI,dword ptr [EBX + 0x7204]
MOV EAX,dword ptr [ESI + EAX*0x1]
JMP 0x0008d155
ADD EAX,0x14
SUB ESP,0x8
MOV dword ptr [EBX + 0x7200],EAX
SHL EAX,0x2
PUSH EAX
PUSH ESI
CALL 0x000ad760
ADD ESP,0x10
MOV ESI,EAX
MOV dword ptr [EBX + 0x7204],EAX
MOV EAX,dword ptr [EBX + 0x7200]
CMP EDI,EAX
JGE 0x0008d059
SUB EAX,EDI
SUB ESP,0x4
LEA EDX,[ESI + EDI*0x4]
SHL EAX,0x2
PUSH EAX
PUSH 0x0
PUSH EDX
CALL 0x0002e870
ADD ESP,0x10
JMP 0x0008d059
MOV ECX,dword ptr [ECX + 0x8]
CMP dword ptr [ESP + 0x40],ECX
JNZ 0x0008d162
JMP 0x0008d18d
MOV dword ptr [ESP + 0x44],0x0
MOV EAX,dword ptr [ESP + 0x44]
ADD ESP,0x2c
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EDX,dword ptr [ESP + 0x10]
MOV dword ptr [EDX],0x0
MOV EDI,dword ptr [EAX]
JMP 0x0008d104
MOV EAX,dword ptr [ESP + 0x10]
XOR EBP,EBP
JMP 0x0008d13b
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint duplicate_buffered_stream(int param_1,int param_2)\n\n{\n  int *__ptr;\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  int *piVar4;\n  int iVar5;\n  int iVar6;\n  bool bVar7;\n  bool bVar8;\n  \n  iVar6 = DAT_00179200;\n  if (param_1 == param_2) {\n    return 0;\n  }\n  iVar1 = param_2;\n  if (param_2 <= param_1) {\n    iVar1 = param_1;\n  }\n  iVar5 = DAT_00179204;\n  if (DAT_00179200 <= iVar1) {\n    DAT_00179200 = iVar1 + 0x14;\n    iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);\n    DAT_00179204 = iVar5;\n    if (iVar6 < DAT_00179200) {\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }\n  }\n  bVar7 = bash_input != 4;\n  bVar8 = DAT_0017ac84 != param_2;\n  iVar1 = param_2 * 4;\n  piVar2 = (int *)(iVar1 + iVar5);\n  __ptr = (int *)*piVar2;\n  piVar4 = (int *)(iVar5 + param_1 * 4);\n  iVar6 = *piVar4;\n  if (__ptr != (int *)0x0) {\n    if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }\n    else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }\n  }\n  if (iVar6 == 0) {\n    iVar3 = 0;\n    piVar4 = piVar2;\n  }\n  else {\n    iVar3 = xmalloc(0x18);\n    xbcopy(iVar6,iVar3,0x18);\n    piVar4 = (int *)(iVar1 + DAT_00179204);\n    iVar5 = DAT_00179204;\n  }\n  *piVar2 = iVar3;\n  piVar4 = (int *)*piVar4;\n  if (piVar4 == (int *)0x0) {\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(param_2);\n    piVar4 = *(int **)(DAT_00179204 + iVar1);\n    iVar5 = DAT_00179204;\n  }\n  else {\n    *piVar4 = param_2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }\n  piVar4[4] = piVar4[4] | 8;\nLAB_0008d159:\n  if ((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )) {\n    piVar4[4] = piVar4[4] | 0x20;\n  }\n  return param_2;\n}\n\n" comment (function_definition "int duplicate_buffered_stream(int param_1,int param_2)\n\n{\n  int *__ptr;\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  int *piVar4;\n  int iVar5;\n  int iVar6;\n  bool bVar7;\n  bool bVar8;\n  \n  iVar6 = DAT_00179200;\n  if (param_1 == param_2) {\n    return 0;\n  }\n  iVar1 = param_2;\n  if (param_2 <= param_1) {\n    iVar1 = param_1;\n  }\n  iVar5 = DAT_00179204;\n  if (DAT_00179200 <= iVar1) {\n    DAT_00179200 = iVar1 + 0x14;\n    iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);\n    DAT_00179204 = iVar5;\n    if (iVar6 < DAT_00179200) {\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }\n  }\n  bVar7 = bash_input != 4;\n  bVar8 = DAT_0017ac84 != param_2;\n  iVar1 = param_2 * 4;\n  piVar2 = (int *)(iVar1 + iVar5);\n  __ptr = (int *)*piVar2;\n  piVar4 = (int *)(iVar5 + param_1 * 4);\n  iVar6 = *piVar4;\n  if (__ptr != (int *)0x0) {\n    if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }\n    else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }\n  }\n  if (iVar6 == 0) {\n    iVar3 = 0;\n    piVar4 = piVar2;\n  }\n  else {\n    iVar3 = xmalloc(0x18);\n    xbcopy(iVar6,iVar3,0x18);\n    piVar4 = (int *)(iVar1 + DAT_00179204);\n    iVar5 = DAT_00179204;\n  }\n  *piVar2 = iVar3;\n  piVar4 = (int *)*piVar4;\n  if (piVar4 == (int *)0x0) {\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(param_2);\n    piVar4 = *(int **)(DAT_00179204 + iVar1);\n    iVar5 = DAT_00179204;\n  }\n  else {\n    *piVar4 = param_2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }\n  piVar4[4] = piVar4[4] | 8;\nLAB_0008d159:\n  if ((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )) {\n    piVar4[4] = piVar4[4] | 0x20;\n  }\n  return param_2;\n}" primitive_type (function_declarator "duplicate_buffered_stream(int param_1,int param_2)" identifier (parameter_list "(int param_1,int param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int *__ptr;\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  int *piVar4;\n  int iVar5;\n  int iVar6;\n  bool bVar7;\n  bool bVar8;\n  \n  iVar6 = DAT_00179200;\n  if (param_1 == param_2) {\n    return 0;\n  }\n  iVar1 = param_2;\n  if (param_2 <= param_1) {\n    iVar1 = param_1;\n  }\n  iVar5 = DAT_00179204;\n  if (DAT_00179200 <= iVar1) {\n    DAT_00179200 = iVar1 + 0x14;\n    iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);\n    DAT_00179204 = iVar5;\n    if (iVar6 < DAT_00179200) {\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }\n  }\n  bVar7 = bash_input != 4;\n  bVar8 = DAT_0017ac84 != param_2;\n  iVar1 = param_2 * 4;\n  piVar2 = (int *)(iVar1 + iVar5);\n  __ptr = (int *)*piVar2;\n  piVar4 = (int *)(iVar5 + param_1 * 4);\n  iVar6 = *piVar4;\n  if (__ptr != (int *)0x0) {\n    if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }\n    else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }\n  }\n  if (iVar6 == 0) {\n    iVar3 = 0;\n    piVar4 = piVar2;\n  }\n  else {\n    iVar3 = xmalloc(0x18);\n    xbcopy(iVar6,iVar3,0x18);\n    piVar4 = (int *)(iVar1 + DAT_00179204);\n    iVar5 = DAT_00179204;\n  }\n  *piVar2 = iVar3;\n  piVar4 = (int *)*piVar4;\n  if (piVar4 == (int *)0x0) {\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(param_2);\n    piVar4 = *(int **)(DAT_00179204 + iVar1);\n    iVar5 = DAT_00179204;\n  }\n  else {\n    *piVar4 = param_2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }\n  piVar4[4] = piVar4[4] | 8;\nLAB_0008d159:\n  if ((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )) {\n    piVar4[4] = piVar4[4] | 0x20;\n  }\n  return param_2;\n}" { (declaration "int *__ptr;" primitive_type (pointer_declarator "*__ptr" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "bool bVar7;" primitive_type identifier ;) (declaration "bool bVar8;" primitive_type identifier ;) (expression_statement "iVar6 = DAT_00179200;" (assignment_expression "iVar6 = DAT_00179200" identifier = identifier) ;) (if_statement "if (param_1 == param_2) {\n    return 0;\n  }" if (parenthesized_expression "(param_1 == param_2)" ( (binary_expression "param_1 == param_2" identifier == identifier) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar1 = param_2;" (assignment_expression "iVar1 = param_2" identifier = identifier) ;) (if_statement "if (param_2 <= param_1) {\n    iVar1 = param_1;\n  }" if (parenthesized_expression "(param_2 <= param_1)" ( (binary_expression "param_2 <= param_1" identifier <= identifier) )) (compound_statement "{\n    iVar1 = param_1;\n  }" { (expression_statement "iVar1 = param_1;" (assignment_expression "iVar1 = param_1" identifier = identifier) ;) })) (expression_statement "iVar5 = DAT_00179204;" (assignment_expression "iVar5 = DAT_00179204" identifier = identifier) ;) (if_statement "if (DAT_00179200 <= iVar1) {\n    DAT_00179200 = iVar1 + 0x14;\n    iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);\n    DAT_00179204 = iVar5;\n    if (iVar6 < DAT_00179200) {\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }\n  }" if (parenthesized_expression "(DAT_00179200 <= iVar1)" ( (binary_expression "DAT_00179200 <= iVar1" identifier <= identifier) )) (compound_statement "{\n    DAT_00179200 = iVar1 + 0x14;\n    iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);\n    DAT_00179204 = iVar5;\n    if (iVar6 < DAT_00179200) {\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }\n  }" { (expression_statement "DAT_00179200 = iVar1 + 0x14;" (assignment_expression "DAT_00179200 = iVar1 + 0x14" identifier = (binary_expression "iVar1 + 0x14" identifier + number_literal)) ;) (expression_statement "iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);" (assignment_expression "iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4)" identifier = (call_expression "xrealloc(DAT_00179204,DAT_00179200 * 4)" identifier (argument_list "(DAT_00179204,DAT_00179200 * 4)" ( identifier , (binary_expression "DAT_00179200 * 4" identifier * number_literal) )))) ;) (expression_statement "DAT_00179204 = iVar5;" (assignment_expression "DAT_00179204 = iVar5" identifier = identifier) ;) (if_statement "if (iVar6 < DAT_00179200) {\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }" if (parenthesized_expression "(iVar6 < DAT_00179200)" ( (binary_expression "iVar6 < DAT_00179200" identifier < identifier) )) (compound_statement "{\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }" { (expression_statement "memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);" (call_expression "memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4)" identifier (argument_list "((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4)" ( (cast_expression "(void *)(iVar5 + iVar6 * 4)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + iVar6 * 4)" ( (binary_expression "iVar5 + iVar6 * 4" identifier + (binary_expression "iVar6 * 4" identifier * number_literal)) ))) , number_literal , (binary_expression "(DAT_00179200 - iVar6) * 4" (parenthesized_expression "(DAT_00179200 - iVar6)" ( (binary_expression "DAT_00179200 - iVar6" identifier - identifier) )) * number_literal) ))) ;) })) })) (expression_statement "bVar7 = bash_input != 4;" (assignment_expression "bVar7 = bash_input != 4" identifier = (binary_expression "bash_input != 4" identifier != number_literal)) ;) (expression_statement "bVar8 = DAT_0017ac84 != param_2;" (assignment_expression "bVar8 = DAT_0017ac84 != param_2" identifier = (binary_expression "DAT_0017ac84 != param_2" identifier != identifier)) ;) (expression_statement "iVar1 = param_2 * 4;" (assignment_expression "iVar1 = param_2 * 4" identifier = (binary_expression "param_2 * 4" identifier * number_literal)) ;) (expression_statement "piVar2 = (int *)(iVar1 + iVar5);" (assignment_expression "piVar2 = (int *)(iVar1 + iVar5)" identifier = (cast_expression "(int *)(iVar1 + iVar5)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + iVar5)" ( (binary_expression "iVar1 + iVar5" identifier + identifier) )))) ;) (expression_statement "__ptr = (int *)*piVar2;" (assignment_expression "__ptr = (int *)*piVar2" identifier = (cast_expression "(int *)*piVar2" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*piVar2" * identifier))) ;) (expression_statement "piVar4 = (int *)(iVar5 + param_1 * 4);" (assignment_expression "piVar4 = (int *)(iVar5 + param_1 * 4)" identifier = (cast_expression "(int *)(iVar5 + param_1 * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + param_1 * 4)" ( (binary_expression "iVar5 + param_1 * 4" identifier + (binary_expression "param_1 * 4" identifier * number_literal)) )))) ;) (expression_statement "iVar6 = *piVar4;" (assignment_expression "iVar6 = *piVar4" identifier = (pointer_expression "*piVar4" * identifier)) ;) (if_statement "if (__ptr != (int *)0x0) {\n    if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }\n    else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }\n  }" if (parenthesized_expression "(__ptr != (int *)0x0)" ( (binary_expression "__ptr != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }\n    else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }\n  }" { (if_statement "if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }\n    else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }" if (parenthesized_expression "(((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1]))" ( (binary_expression "((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])" (parenthesized_expression "((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0))" ( (binary_expression "(iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)" (parenthesized_expression "(iVar6 == 0)" ( (binary_expression "iVar6 == 0" identifier == number_literal) )) || (parenthesized_expression "(*(int *)(iVar6 + 4) == 0)" ( (binary_expression "*(int *)(iVar6 + 4) == 0" (pointer_expression "*(int *)(iVar6 + 4)" * (cast_expression "(int *)(iVar6 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar6 + 4)" ( (binary_expression "iVar6 + 4" identifier + number_literal) )))) == number_literal) ))) )) || (parenthesized_expression "(*(int *)(iVar6 + 4) != __ptr[1])" ( (binary_expression "*(int *)(iVar6 + 4) != __ptr[1]" (pointer_expression "*(int *)(iVar6 + 4)" * (cast_expression "(int *)(iVar6 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar6 + 4)" ( (binary_expression "iVar6 + 4" identifier + number_literal) )))) != (subscript_expression "__ptr[1]" identifier [ number_literal ])) ))) )) (compound_statement "{\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }" { (expression_statement "iVar6 = *__ptr;" (assignment_expression "iVar6 = *__ptr" identifier = (pointer_expression "*__ptr" * identifier)) ;) (if_statement "if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }" if (parenthesized_expression "(((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0))" ( (binary_expression "((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)" (parenthesized_expression "((*(byte *)(__ptr + 4) & 0x20) == 0)" ( (binary_expression "(*(byte *)(__ptr + 4) & 0x20) == 0" (parenthesized_expression "(*(byte *)(__ptr + 4) & 0x20)" ( (binary_expression "*(byte *)(__ptr + 4) & 0x20" (pointer_expression "*(byte *)(__ptr + 4)" * (cast_expression "(byte *)(__ptr + 4)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__ptr + 4)" ( (binary_expression "__ptr + 4" identifier + number_literal) )))) & number_literal) )) == number_literal) )) && (parenthesized_expression "((void *)__ptr[1] != (void *)0x0)" ( (binary_expression "(void *)__ptr[1] != (void *)0x0" (cast_expression "(void *)__ptr[1]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "__ptr[1]" identifier [ number_literal ])) != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ))) )) (compound_statement "{\n        free((void *)__ptr[1]);\n      }" { (expression_statement "free((void *)__ptr[1]);" (call_expression "free((void *)__ptr[1])" identifier (argument_list "((void *)__ptr[1])" ( (cast_expression "(void *)__ptr[1]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "__ptr[1]" identifier [ number_literal ])) ))) ;) })) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) (expression_statement "*(undefined4 *)(iVar5 + iVar6 * 4) = 0;" (assignment_expression "*(undefined4 *)(iVar5 + iVar6 * 4) = 0" (pointer_expression "*(undefined4 *)(iVar5 + iVar6 * 4)" * (cast_expression "(undefined4 *)(iVar5 + iVar6 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + iVar6 * 4)" ( (binary_expression "iVar5 + iVar6 * 4" identifier + (binary_expression "iVar6 * 4" identifier * number_literal)) )))) = number_literal) ;) (expression_statement "iVar6 = *piVar4;" (assignment_expression "iVar6 = *piVar4" identifier = (pointer_expression "*piVar4" * identifier)) ;) }) (else_clause "else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }" else (compound_statement "{\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }" { (expression_statement "*piVar2 = 0;" (assignment_expression "*piVar2 = 0" (pointer_expression "*piVar2" * identifier) = number_literal) ;) (expression_statement "iVar6 = *piVar4;" (assignment_expression "iVar6 = *piVar4" identifier = (pointer_expression "*piVar4" * identifier)) ;) }))) })) (if_statement "if (iVar6 == 0) {\n    iVar3 = 0;\n    piVar4 = piVar2;\n  }\n  else {\n    iVar3 = xmalloc(0x18);\n    xbcopy(iVar6,iVar3,0x18);\n    piVar4 = (int *)(iVar1 + DAT_00179204);\n    iVar5 = DAT_00179204;\n  }" if (parenthesized_expression "(iVar6 == 0)" ( (binary_expression "iVar6 == 0" identifier == number_literal) )) (compound_statement "{\n    iVar3 = 0;\n    piVar4 = piVar2;\n  }" { (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (expression_statement "piVar4 = piVar2;" (assignment_expression "piVar4 = piVar2" identifier = identifier) ;) }) (else_clause "else {\n    iVar3 = xmalloc(0x18);\n    xbcopy(iVar6,iVar3,0x18);\n    piVar4 = (int *)(iVar1 + DAT_00179204);\n    iVar5 = DAT_00179204;\n  }" else (compound_statement "{\n    iVar3 = xmalloc(0x18);\n    xbcopy(iVar6,iVar3,0x18);\n    piVar4 = (int *)(iVar1 + DAT_00179204);\n    iVar5 = DAT_00179204;\n  }" { (expression_statement "iVar3 = xmalloc(0x18);" (assignment_expression "iVar3 = xmalloc(0x18)" identifier = (call_expression "xmalloc(0x18)" identifier (argument_list "(0x18)" ( number_literal )))) ;) (expression_statement "xbcopy(iVar6,iVar3,0x18);" (call_expression "xbcopy(iVar6,iVar3,0x18)" identifier (argument_list "(iVar6,iVar3,0x18)" ( identifier , identifier , number_literal ))) ;) (expression_statement "piVar4 = (int *)(iVar1 + DAT_00179204);" (assignment_expression "piVar4 = (int *)(iVar1 + DAT_00179204)" identifier = (cast_expression "(int *)(iVar1 + DAT_00179204)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + DAT_00179204)" ( (binary_expression "iVar1 + DAT_00179204" identifier + identifier) )))) ;) (expression_statement "iVar5 = DAT_00179204;" (assignment_expression "iVar5 = DAT_00179204" identifier = identifier) ;) }))) (expression_statement "*piVar2 = iVar3;" (assignment_expression "*piVar2 = iVar3" (pointer_expression "*piVar2" * identifier) = identifier) ;) (expression_statement "piVar4 = (int *)*piVar4;" (assignment_expression "piVar4 = (int *)*piVar4" identifier = (cast_expression "(int *)*piVar4" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*piVar4" * identifier))) ;) (if_statement "if (piVar4 == (int *)0x0) {\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(param_2);\n    piVar4 = *(int **)(DAT_00179204 + iVar1);\n    iVar5 = DAT_00179204;\n  }\n  else {\n    *piVar4 = param_2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }" if (parenthesized_expression "(piVar4 == (int *)0x0)" ( (binary_expression "piVar4 == (int *)0x0" identifier == (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(param_2);\n    piVar4 = *(int **)(DAT_00179204 + iVar1);\n    iVar5 = DAT_00179204;\n  }" { (if_statement "if (bVar7 || bVar8) goto LAB_0008d159;" if (parenthesized_expression "(bVar7 || bVar8)" ( (binary_expression "bVar7 || bVar8" identifier || identifier) )) (goto_statement "goto LAB_0008d159;" goto statement_identifier ;)) (expression_statement "fd_to_buffered_stream(param_2);" (call_expression "fd_to_buffered_stream(param_2)" identifier (argument_list "(param_2)" ( identifier ))) ;) (expression_statement "piVar4 = *(int **)(DAT_00179204 + iVar1);" (assignment_expression "piVar4 = *(int **)(DAT_00179204 + iVar1)" identifier = (pointer_expression "*(int **)(DAT_00179204 + iVar1)" * (cast_expression "(int **)(DAT_00179204 + iVar1)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(DAT_00179204 + iVar1)" ( (binary_expression "DAT_00179204 + iVar1" identifier + identifier) ))))) ;) (expression_statement "iVar5 = DAT_00179204;" (assignment_expression "iVar5 = DAT_00179204" identifier = identifier) ;) }) (else_clause "else {\n    *piVar4 = param_2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }" else (compound_statement "{\n    *piVar4 = param_2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }" { (expression_statement "*piVar4 = param_2;" (assignment_expression "*piVar4 = param_2" (pointer_expression "*piVar4" * identifier) = identifier) ;) (if_statement "if (bVar7 || bVar8) goto LAB_0008d159;" if (parenthesized_expression "(bVar7 || bVar8)" ( (binary_expression "bVar7 || bVar8" identifier || identifier) )) (goto_statement "goto LAB_0008d159;" goto statement_identifier ;)) }))) (expression_statement "piVar4[4] = piVar4[4] | 8;" (assignment_expression "piVar4[4] = piVar4[4] | 8" (subscript_expression "piVar4[4]" identifier [ number_literal ]) = (binary_expression "piVar4[4] | 8" (subscript_expression "piVar4[4]" identifier [ number_literal ]) | number_literal)) ;) (labeled_statement "LAB_0008d159:\n  if ((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )) {\n    piVar4[4] = piVar4[4] | 0x20;\n  }" statement_identifier : (if_statement "if ((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )) {\n    piVar4[4] = piVar4[4] | 0x20;\n  }" if (parenthesized_expression "((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     ))" ( (binary_expression "(((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )" (parenthesized_expression "(((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input))))" ( (binary_expression "((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))" (parenthesized_expression "((bash_input == 4) && (param_1 == DAT_0017ac84))" ( (binary_expression "(bash_input == 4) && (param_1 == DAT_0017ac84)" (parenthesized_expression "(bash_input == 4)" ( (binary_expression "bash_input == 4" identifier == number_literal) )) && (parenthesized_expression "(param_1 == DAT_0017ac84)" ( (binary_expression "param_1 == DAT_0017ac84" identifier == identifier) ))) )) || (parenthesized_expression "((interactive_shell == 0 && (param_1 == default_buffered_input)))" ( (parenthesized_expression "(interactive_shell == 0 && (param_1 == default_buffered_input))" ( (binary_expression "interactive_shell == 0 && (param_1 == default_buffered_input)" (binary_expression "interactive_shell == 0" identifier == number_literal) && (parenthesized_expression "(param_1 == default_buffered_input)" ( (binary_expression "param_1 == default_buffered_input" identifier == identifier) ))) )) ))) )) || (parenthesized_expression "((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )" ( (parenthesized_expression "(iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))" ( (comma_expression "iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0)" (assignment_expression "iVar6 = *(int *)(iVar5 + param_1 * 4)" identifier = (pointer_expression "*(int *)(iVar5 + param_1 * 4)" * (cast_expression "(int *)(iVar5 + param_1 * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + param_1 * 4)" ( (binary_expression "iVar5 + param_1 * 4" identifier + (binary_expression "param_1 * 4" identifier * number_literal)) ))))) , (binary_expression "iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0)" (binary_expression "iVar6 != 0" identifier != number_literal) && (parenthesized_expression "((*(byte *)(iVar6 + 0x10) & 0x20) != 0)" ( (binary_expression "(*(byte *)(iVar6 + 0x10) & 0x20) != 0" (parenthesized_expression "(*(byte *)(iVar6 + 0x10) & 0x20)" ( (binary_expression "*(byte *)(iVar6 + 0x10) & 0x20" (pointer_expression "*(byte *)(iVar6 + 0x10)" * (cast_expression "(byte *)(iVar6 + 0x10)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar6 + 0x10)" ( (binary_expression "iVar6 + 0x10" identifier + number_literal) )))) & number_literal) )) != number_literal) )))) )) ))) )) (compound_statement "{\n    piVar4[4] = piVar4[4] | 0x20;\n  }" { (expression_statement "piVar4[4] = piVar4[4] | 0x20;" (assignment_expression "piVar4[4] = piVar4[4] | 0x20" (subscript_expression "piVar4[4]" identifier [ number_literal ]) = (binary_expression "piVar4[4] | 0x20" (subscript_expression "piVar4[4]" identifier [ number_literal ]) | number_literal)) ;) }))) (return_statement "return param_2;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint duplicate_buffered_stream(int fd1,int fd2)\n\n{\n  int iVar1;\n  int iVar2;\n  BUFFERED_STREAM **ppBVar3;\n  BUFFERED_STREAM *pBVar4;\n  BUFFERED_STREAM **ppBVar5;\n  BUFFERED_STREAM **ppBVar6;\n  BUFFERED_STREAM *s;\n  bool bVar7;\n  bool bVar8;\n  \n  iVar1 = nbuffers;\n  if (fd1 == fd2) {\n    return 0;\n  }\n  iVar2 = fd2;\n  if (fd2 <= fd1) {\n    iVar2 = fd1;\n  }\n  ppBVar6 = buffers;\n  if (nbuffers <= iVar2) {\n    nbuffers = iVar2 + 0x14;\n    ppBVar6 = (BUFFERED_STREAM **)xrealloc(buffers,nbuffers * 4);\n    buffers = ppBVar6;\n    if (iVar1 < nbuffers) {\n      memset(ppBVar6 + iVar1,0,(nbuffers - iVar1) * 4);\n    }\n  }\n  bVar7 = bash_input.type != st_bstream;\n  bVar8 = bash_input.location.file != (FILE *)fd2;\n  ppBVar3 = ppBVar6 + fd2;\n  pBVar4 = *ppBVar3;\n  ppBVar5 = ppBVar6 + fd1;\n  s = *ppBVar5;\n  if (pBVar4 != (BUFFERED_STREAM *)0x0) {\n    if (((s == (BUFFERED_STREAM *)0x0) || (s->b_buffer == (char *)0x0)) ||\n       (s->b_buffer != pBVar4->b_buffer)) {\n      iVar1 = pBVar4->b_fd;\n      if (((pBVar4->b_flag & 0x20) == 0) && (pBVar4->b_buffer != (char *)0x0)) {\n        free(pBVar4->b_buffer);\n      }\n      free(pBVar4);\n      ppBVar6[iVar1] = (BUFFERED_STREAM *)0x0;\n      s = *ppBVar5;\n    }\n    else {\n      *ppBVar3 = (BUFFERED_STREAM *)0x0;\n      s = *ppBVar5;\n    }\n  }\n  if (s == (BUFFERED_STREAM *)0x0) {\n    pBVar4 = (BUFFERED_STREAM *)0x0;\n    ppBVar5 = ppBVar3;\n  }\n  else {\n    pBVar4 = (BUFFERED_STREAM *)xmalloc(0x18);\n    xbcopy((char *)s,(char *)pBVar4,0x18);\n    ppBVar5 = buffers + fd2;\n    ppBVar6 = buffers;\n  }\n  *ppBVar3 = pBVar4;\n  pBVar4 = *ppBVar5;\n  if (pBVar4 == (BUFFERED_STREAM *)0x0) {\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(fd2);\n    pBVar4 = buffers[fd2];\n    ppBVar6 = buffers;\n  }\n  else {\n    pBVar4->b_fd = fd2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }\n  pBVar4->b_flag = pBVar4->b_flag | 8;\nLAB_0008d159:\n  if ((((bash_input.type == st_bstream) && ((FILE *)fd1 == bash_input.location.file)) ||\n      ((interactive_shell == 0 && (fd1 == default_buffered_input)))) ||\n     ((ppBVar6[fd1] != (BUFFERED_STREAM *)0x0 && ((ppBVar6[fd1]->b_flag & 0x20) != 0)))) {\n    pBVar4->b_flag = pBVar4->b_flag | 0x20;\n  }\n  return fd2;\n}\n\n" comment (function_definition "int duplicate_buffered_stream(int fd1,int fd2)\n\n{\n  int iVar1;\n  int iVar2;\n  BUFFERED_STREAM **ppBVar3;\n  BUFFERED_STREAM *pBVar4;\n  BUFFERED_STREAM **ppBVar5;\n  BUFFERED_STREAM **ppBVar6;\n  BUFFERED_STREAM *s;\n  bool bVar7;\n  bool bVar8;\n  \n  iVar1 = nbuffers;\n  if (fd1 == fd2) {\n    return 0;\n  }\n  iVar2 = fd2;\n  if (fd2 <= fd1) {\n    iVar2 = fd1;\n  }\n  ppBVar6 = buffers;\n  if (nbuffers <= iVar2) {\n    nbuffers = iVar2 + 0x14;\n    ppBVar6 = (BUFFERED_STREAM **)xrealloc(buffers,nbuffers * 4);\n    buffers = ppBVar6;\n    if (iVar1 < nbuffers) {\n      memset(ppBVar6 + iVar1,0,(nbuffers - iVar1) * 4);\n    }\n  }\n  bVar7 = bash_input.type != st_bstream;\n  bVar8 = bash_input.location.file != (FILE *)fd2;\n  ppBVar3 = ppBVar6 + fd2;\n  pBVar4 = *ppBVar3;\n  ppBVar5 = ppBVar6 + fd1;\n  s = *ppBVar5;\n  if (pBVar4 != (BUFFERED_STREAM *)0x0) {\n    if (((s == (BUFFERED_STREAM *)0x0) || (s->b_buffer == (char *)0x0)) ||\n       (s->b_buffer != pBVar4->b_buffer)) {\n      iVar1 = pBVar4->b_fd;\n      if (((pBVar4->b_flag & 0x20) == 0) && (pBVar4->b_buffer != (char *)0x0)) {\n        free(pBVar4->b_buffer);\n      }\n      free(pBVar4);\n      ppBVar6[iVar1] = (BUFFERED_STREAM *)0x0;\n      s = *ppBVar5;\n    }\n    else {\n      *ppBVar3 = (BUFFERED_STREAM *)0x0;\n      s = *ppBVar5;\n    }\n  }\n  if (s == (BUFFERED_STREAM *)0x0) {\n    pBVar4 = (BUFFERED_STREAM *)0x0;\n    ppBVar5 = ppBVar3;\n  }\n  else {\n    pBVar4 = (BUFFERED_STREAM *)xmalloc(0x18);\n    xbcopy((char *)s,(char *)pBVar4,0x18);\n    ppBVar5 = buffers + fd2;\n    ppBVar6 = buffers;\n  }\n  *ppBVar3 = pBVar4;\n  pBVar4 = *ppBVar5;\n  if (pBVar4 == (BUFFERED_STREAM *)0x0) {\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(fd2);\n    pBVar4 = buffers[fd2];\n    ppBVar6 = buffers;\n  }\n  else {\n    pBVar4->b_fd = fd2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }\n  pBVar4->b_flag = pBVar4->b_flag | 8;\nLAB_0008d159:\n  if ((((bash_input.type == st_bstream) && ((FILE *)fd1 == bash_input.location.file)) ||\n      ((interactive_shell == 0 && (fd1 == default_buffered_input)))) ||\n     ((ppBVar6[fd1] != (BUFFERED_STREAM *)0x0 && ((ppBVar6[fd1]->b_flag & 0x20) != 0)))) {\n    pBVar4->b_flag = pBVar4->b_flag | 0x20;\n  }\n  return fd2;\n}" primitive_type (function_declarator "duplicate_buffered_stream(int fd1,int fd2)" identifier (parameter_list "(int fd1,int fd2)" ( (parameter_declaration "int fd1" primitive_type identifier) , (parameter_declaration "int fd2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  BUFFERED_STREAM **ppBVar3;\n  BUFFERED_STREAM *pBVar4;\n  BUFFERED_STREAM **ppBVar5;\n  BUFFERED_STREAM **ppBVar6;\n  BUFFERED_STREAM *s;\n  bool bVar7;\n  bool bVar8;\n  \n  iVar1 = nbuffers;\n  if (fd1 == fd2) {\n    return 0;\n  }\n  iVar2 = fd2;\n  if (fd2 <= fd1) {\n    iVar2 = fd1;\n  }\n  ppBVar6 = buffers;\n  if (nbuffers <= iVar2) {\n    nbuffers = iVar2 + 0x14;\n    ppBVar6 = (BUFFERED_STREAM **)xrealloc(buffers,nbuffers * 4);\n    buffers = ppBVar6;\n    if (iVar1 < nbuffers) {\n      memset(ppBVar6 + iVar1,0,(nbuffers - iVar1) * 4);\n    }\n  }\n  bVar7 = bash_input.type != st_bstream;\n  bVar8 = bash_input.location.file != (FILE *)fd2;\n  ppBVar3 = ppBVar6 + fd2;\n  pBVar4 = *ppBVar3;\n  ppBVar5 = ppBVar6 + fd1;\n  s = *ppBVar5;\n  if (pBVar4 != (BUFFERED_STREAM *)0x0) {\n    if (((s == (BUFFERED_STREAM *)0x0) || (s->b_buffer == (char *)0x0)) ||\n       (s->b_buffer != pBVar4->b_buffer)) {\n      iVar1 = pBVar4->b_fd;\n      if (((pBVar4->b_flag & 0x20) == 0) && (pBVar4->b_buffer != (char *)0x0)) {\n        free(pBVar4->b_buffer);\n      }\n      free(pBVar4);\n      ppBVar6[iVar1] = (BUFFERED_STREAM *)0x0;\n      s = *ppBVar5;\n    }\n    else {\n      *ppBVar3 = (BUFFERED_STREAM *)0x0;\n      s = *ppBVar5;\n    }\n  }\n  if (s == (BUFFERED_STREAM *)0x0) {\n    pBVar4 = (BUFFERED_STREAM *)0x0;\n    ppBVar5 = ppBVar3;\n  }\n  else {\n    pBVar4 = (BUFFERED_STREAM *)xmalloc(0x18);\n    xbcopy((char *)s,(char *)pBVar4,0x18);\n    ppBVar5 = buffers + fd2;\n    ppBVar6 = buffers;\n  }\n  *ppBVar3 = pBVar4;\n  pBVar4 = *ppBVar5;\n  if (pBVar4 == (BUFFERED_STREAM *)0x0) {\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(fd2);\n    pBVar4 = buffers[fd2];\n    ppBVar6 = buffers;\n  }\n  else {\n    pBVar4->b_fd = fd2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }\n  pBVar4->b_flag = pBVar4->b_flag | 8;\nLAB_0008d159:\n  if ((((bash_input.type == st_bstream) && ((FILE *)fd1 == bash_input.location.file)) ||\n      ((interactive_shell == 0 && (fd1 == default_buffered_input)))) ||\n     ((ppBVar6[fd1] != (BUFFERED_STREAM *)0x0 && ((ppBVar6[fd1]->b_flag & 0x20) != 0)))) {\n    pBVar4->b_flag = pBVar4->b_flag | 0x20;\n  }\n  return fd2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "BUFFERED_STREAM **ppBVar3;" type_identifier (pointer_declarator "**ppBVar3" * (pointer_declarator "*ppBVar3" * identifier)) ;) (declaration "BUFFERED_STREAM *pBVar4;" type_identifier (pointer_declarator "*pBVar4" * identifier) ;) (declaration "BUFFERED_STREAM **ppBVar5;" type_identifier (pointer_declarator "**ppBVar5" * (pointer_declarator "*ppBVar5" * identifier)) ;) (declaration "BUFFERED_STREAM **ppBVar6;" type_identifier (pointer_declarator "**ppBVar6" * (pointer_declarator "*ppBVar6" * identifier)) ;) (declaration "BUFFERED_STREAM *s;" type_identifier (pointer_declarator "*s" * identifier) ;) (declaration "bool bVar7;" primitive_type identifier ;) (declaration "bool bVar8;" primitive_type identifier ;) (expression_statement "iVar1 = nbuffers;" (assignment_expression "iVar1 = nbuffers" identifier = identifier) ;) (if_statement "if (fd1 == fd2) {\n    return 0;\n  }" if (parenthesized_expression "(fd1 == fd2)" ( (binary_expression "fd1 == fd2" identifier == identifier) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar2 = fd2;" (assignment_expression "iVar2 = fd2" identifier = identifier) ;) (if_statement "if (fd2 <= fd1) {\n    iVar2 = fd1;\n  }" if (parenthesized_expression "(fd2 <= fd1)" ( (binary_expression "fd2 <= fd1" identifier <= identifier) )) (compound_statement "{\n    iVar2 = fd1;\n  }" { (expression_statement "iVar2 = fd1;" (assignment_expression "iVar2 = fd1" identifier = identifier) ;) })) (expression_statement "ppBVar6 = buffers;" (assignment_expression "ppBVar6 = buffers" identifier = identifier) ;) (if_statement "if (nbuffers <= iVar2) {\n    nbuffers = iVar2 + 0x14;\n    ppBVar6 = (BUFFERED_STREAM **)xrealloc(buffers,nbuffers * 4);\n    buffers = ppBVar6;\n    if (iVar1 < nbuffers) {\n      memset(ppBVar6 + iVar1,0,(nbuffers - iVar1) * 4);\n    }\n  }" if (parenthesized_expression "(nbuffers <= iVar2)" ( (binary_expression "nbuffers <= iVar2" identifier <= identifier) )) (compound_statement "{\n    nbuffers = iVar2 + 0x14;\n    ppBVar6 = (BUFFERED_STREAM **)xrealloc(buffers,nbuffers * 4);\n    buffers = ppBVar6;\n    if (iVar1 < nbuffers) {\n      memset(ppBVar6 + iVar1,0,(nbuffers - iVar1) * 4);\n    }\n  }" { (expression_statement "nbuffers = iVar2 + 0x14;" (assignment_expression "nbuffers = iVar2 + 0x14" identifier = (binary_expression "iVar2 + 0x14" identifier + number_literal)) ;) (expression_statement "ppBVar6 = (BUFFERED_STREAM **)xrealloc(buffers,nbuffers * 4);" (assignment_expression "ppBVar6 = (BUFFERED_STREAM **)xrealloc(buffers,nbuffers * 4)" identifier = (cast_expression "(BUFFERED_STREAM **)xrealloc(buffers,nbuffers * 4)" ( (type_descriptor "BUFFERED_STREAM **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (call_expression "xrealloc(buffers,nbuffers * 4)" identifier (argument_list "(buffers,nbuffers * 4)" ( identifier , (binary_expression "nbuffers * 4" identifier * number_literal) ))))) ;) (expression_statement "buffers = ppBVar6;" (assignment_expression "buffers = ppBVar6" identifier = identifier) ;) (if_statement "if (iVar1 < nbuffers) {\n      memset(ppBVar6 + iVar1,0,(nbuffers - iVar1) * 4);\n    }" if (parenthesized_expression "(iVar1 < nbuffers)" ( (binary_expression "iVar1 < nbuffers" identifier < identifier) )) (compound_statement "{\n      memset(ppBVar6 + iVar1,0,(nbuffers - iVar1) * 4);\n    }" { (expression_statement "memset(ppBVar6 + iVar1,0,(nbuffers - iVar1) * 4);" (call_expression "memset(ppBVar6 + iVar1,0,(nbuffers - iVar1) * 4)" identifier (argument_list "(ppBVar6 + iVar1,0,(nbuffers - iVar1) * 4)" ( (binary_expression "ppBVar6 + iVar1" identifier + identifier) , number_literal , (binary_expression "(nbuffers - iVar1) * 4" (parenthesized_expression "(nbuffers - iVar1)" ( (binary_expression "nbuffers - iVar1" identifier - identifier) )) * number_literal) ))) ;) })) })) (expression_statement "bVar7 = bash_input.type != st_bstream;" (assignment_expression "bVar7 = bash_input.type != st_bstream" identifier = (binary_expression "bash_input.type != st_bstream" (field_expression "bash_input.type" identifier . field_identifier) != identifier)) ;) (expression_statement "bVar8 = bash_input.location.file != (FILE *)fd2;" (assignment_expression "bVar8 = bash_input.location.file != (FILE *)fd2" identifier = (binary_expression "bash_input.location.file != (FILE *)fd2" (field_expression "bash_input.location.file" (field_expression "bash_input.location" identifier . field_identifier) . field_identifier) != (cast_expression "(FILE *)fd2" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "ppBVar3 = ppBVar6 + fd2;" (assignment_expression "ppBVar3 = ppBVar6 + fd2" identifier = (binary_expression "ppBVar6 + fd2" identifier + identifier)) ;) (expression_statement "pBVar4 = *ppBVar3;" (assignment_expression "pBVar4 = *ppBVar3" identifier = (pointer_expression "*ppBVar3" * identifier)) ;) (expression_statement "ppBVar5 = ppBVar6 + fd1;" (assignment_expression "ppBVar5 = ppBVar6 + fd1" identifier = (binary_expression "ppBVar6 + fd1" identifier + identifier)) ;) (expression_statement "s = *ppBVar5;" (assignment_expression "s = *ppBVar5" identifier = (pointer_expression "*ppBVar5" * identifier)) ;) (if_statement "if (pBVar4 != (BUFFERED_STREAM *)0x0) {\n    if (((s == (BUFFERED_STREAM *)0x0) || (s->b_buffer == (char *)0x0)) ||\n       (s->b_buffer != pBVar4->b_buffer)) {\n      iVar1 = pBVar4->b_fd;\n      if (((pBVar4->b_flag & 0x20) == 0) && (pBVar4->b_buffer != (char *)0x0)) {\n        free(pBVar4->b_buffer);\n      }\n      free(pBVar4);\n      ppBVar6[iVar1] = (BUFFERED_STREAM *)0x0;\n      s = *ppBVar5;\n    }\n    else {\n      *ppBVar3 = (BUFFERED_STREAM *)0x0;\n      s = *ppBVar5;\n    }\n  }" if (parenthesized_expression "(pBVar4 != (BUFFERED_STREAM *)0x0)" ( (binary_expression "pBVar4 != (BUFFERED_STREAM *)0x0" identifier != (cast_expression "(BUFFERED_STREAM *)0x0" ( (type_descriptor "BUFFERED_STREAM *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (((s == (BUFFERED_STREAM *)0x0) || (s->b_buffer == (char *)0x0)) ||\n       (s->b_buffer != pBVar4->b_buffer)) {\n      iVar1 = pBVar4->b_fd;\n      if (((pBVar4->b_flag & 0x20) == 0) && (pBVar4->b_buffer != (char *)0x0)) {\n        free(pBVar4->b_buffer);\n      }\n      free(pBVar4);\n      ppBVar6[iVar1] = (BUFFERED_STREAM *)0x0;\n      s = *ppBVar5;\n    }\n    else {\n      *ppBVar3 = (BUFFERED_STREAM *)0x0;\n      s = *ppBVar5;\n    }\n  }" { (if_statement "if (((s == (BUFFERED_STREAM *)0x0) || (s->b_buffer == (char *)0x0)) ||\n       (s->b_buffer != pBVar4->b_buffer)) {\n      iVar1 = pBVar4->b_fd;\n      if (((pBVar4->b_flag & 0x20) == 0) && (pBVar4->b_buffer != (char *)0x0)) {\n        free(pBVar4->b_buffer);\n      }\n      free(pBVar4);\n      ppBVar6[iVar1] = (BUFFERED_STREAM *)0x0;\n      s = *ppBVar5;\n    }\n    else {\n      *ppBVar3 = (BUFFERED_STREAM *)0x0;\n      s = *ppBVar5;\n    }" if (parenthesized_expression "(((s == (BUFFERED_STREAM *)0x0) || (s->b_buffer == (char *)0x0)) ||\n       (s->b_buffer != pBVar4->b_buffer))" ( (binary_expression "((s == (BUFFERED_STREAM *)0x0) || (s->b_buffer == (char *)0x0)) ||\n       (s->b_buffer != pBVar4->b_buffer)" (parenthesized_expression "((s == (BUFFERED_STREAM *)0x0) || (s->b_buffer == (char *)0x0))" ( (binary_expression "(s == (BUFFERED_STREAM *)0x0) || (s->b_buffer == (char *)0x0)" (parenthesized_expression "(s == (BUFFERED_STREAM *)0x0)" ( (binary_expression "s == (BUFFERED_STREAM *)0x0" identifier == (cast_expression "(BUFFERED_STREAM *)0x0" ( (type_descriptor "BUFFERED_STREAM *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) || (parenthesized_expression "(s->b_buffer == (char *)0x0)" ( (binary_expression "s->b_buffer == (char *)0x0" (field_expression "s->b_buffer" identifier -> field_identifier) == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ))) )) || (parenthesized_expression "(s->b_buffer != pBVar4->b_buffer)" ( (binary_expression "s->b_buffer != pBVar4->b_buffer" (field_expression "s->b_buffer" identifier -> field_identifier) != (field_expression "pBVar4->b_buffer" identifier -> field_identifier)) ))) )) (compound_statement "{\n      iVar1 = pBVar4->b_fd;\n      if (((pBVar4->b_flag & 0x20) == 0) && (pBVar4->b_buffer != (char *)0x0)) {\n        free(pBVar4->b_buffer);\n      }\n      free(pBVar4);\n      ppBVar6[iVar1] = (BUFFERED_STREAM *)0x0;\n      s = *ppBVar5;\n    }" { (expression_statement "iVar1 = pBVar4->b_fd;" (assignment_expression "iVar1 = pBVar4->b_fd" identifier = (field_expression "pBVar4->b_fd" identifier -> field_identifier)) ;) (if_statement "if (((pBVar4->b_flag & 0x20) == 0) && (pBVar4->b_buffer != (char *)0x0)) {\n        free(pBVar4->b_buffer);\n      }" if (parenthesized_expression "(((pBVar4->b_flag & 0x20) == 0) && (pBVar4->b_buffer != (char *)0x0))" ( (binary_expression "((pBVar4->b_flag & 0x20) == 0) && (pBVar4->b_buffer != (char *)0x0)" (parenthesized_expression "((pBVar4->b_flag & 0x20) == 0)" ( (binary_expression "(pBVar4->b_flag & 0x20) == 0" (parenthesized_expression "(pBVar4->b_flag & 0x20)" ( (binary_expression "pBVar4->b_flag & 0x20" (field_expression "pBVar4->b_flag" identifier -> field_identifier) & number_literal) )) == number_literal) )) && (parenthesized_expression "(pBVar4->b_buffer != (char *)0x0)" ( (binary_expression "pBVar4->b_buffer != (char *)0x0" (field_expression "pBVar4->b_buffer" identifier -> field_identifier) != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ))) )) (compound_statement "{\n        free(pBVar4->b_buffer);\n      }" { (expression_statement "free(pBVar4->b_buffer);" (call_expression "free(pBVar4->b_buffer)" identifier (argument_list "(pBVar4->b_buffer)" ( (field_expression "pBVar4->b_buffer" identifier -> field_identifier) ))) ;) })) (expression_statement "free(pBVar4);" (call_expression "free(pBVar4)" identifier (argument_list "(pBVar4)" ( identifier ))) ;) (expression_statement "ppBVar6[iVar1] = (BUFFERED_STREAM *)0x0;" (assignment_expression "ppBVar6[iVar1] = (BUFFERED_STREAM *)0x0" (subscript_expression "ppBVar6[iVar1]" identifier [ identifier ]) = (cast_expression "(BUFFERED_STREAM *)0x0" ( (type_descriptor "BUFFERED_STREAM *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "s = *ppBVar5;" (assignment_expression "s = *ppBVar5" identifier = (pointer_expression "*ppBVar5" * identifier)) ;) }) (else_clause "else {\n      *ppBVar3 = (BUFFERED_STREAM *)0x0;\n      s = *ppBVar5;\n    }" else (compound_statement "{\n      *ppBVar3 = (BUFFERED_STREAM *)0x0;\n      s = *ppBVar5;\n    }" { (expression_statement "*ppBVar3 = (BUFFERED_STREAM *)0x0;" (assignment_expression "*ppBVar3 = (BUFFERED_STREAM *)0x0" (pointer_expression "*ppBVar3" * identifier) = (cast_expression "(BUFFERED_STREAM *)0x0" ( (type_descriptor "BUFFERED_STREAM *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "s = *ppBVar5;" (assignment_expression "s = *ppBVar5" identifier = (pointer_expression "*ppBVar5" * identifier)) ;) }))) })) (if_statement "if (s == (BUFFERED_STREAM *)0x0) {\n    pBVar4 = (BUFFERED_STREAM *)0x0;\n    ppBVar5 = ppBVar3;\n  }\n  else {\n    pBVar4 = (BUFFERED_STREAM *)xmalloc(0x18);\n    xbcopy((char *)s,(char *)pBVar4,0x18);\n    ppBVar5 = buffers + fd2;\n    ppBVar6 = buffers;\n  }" if (parenthesized_expression "(s == (BUFFERED_STREAM *)0x0)" ( (binary_expression "s == (BUFFERED_STREAM *)0x0" identifier == (cast_expression "(BUFFERED_STREAM *)0x0" ( (type_descriptor "BUFFERED_STREAM *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    pBVar4 = (BUFFERED_STREAM *)0x0;\n    ppBVar5 = ppBVar3;\n  }" { (expression_statement "pBVar4 = (BUFFERED_STREAM *)0x0;" (assignment_expression "pBVar4 = (BUFFERED_STREAM *)0x0" identifier = (cast_expression "(BUFFERED_STREAM *)0x0" ( (type_descriptor "BUFFERED_STREAM *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "ppBVar5 = ppBVar3;" (assignment_expression "ppBVar5 = ppBVar3" identifier = identifier) ;) }) (else_clause "else {\n    pBVar4 = (BUFFERED_STREAM *)xmalloc(0x18);\n    xbcopy((char *)s,(char *)pBVar4,0x18);\n    ppBVar5 = buffers + fd2;\n    ppBVar6 = buffers;\n  }" else (compound_statement "{\n    pBVar4 = (BUFFERED_STREAM *)xmalloc(0x18);\n    xbcopy((char *)s,(char *)pBVar4,0x18);\n    ppBVar5 = buffers + fd2;\n    ppBVar6 = buffers;\n  }" { (expression_statement "pBVar4 = (BUFFERED_STREAM *)xmalloc(0x18);" (assignment_expression "pBVar4 = (BUFFERED_STREAM *)xmalloc(0x18)" identifier = (cast_expression "(BUFFERED_STREAM *)xmalloc(0x18)" ( (type_descriptor "BUFFERED_STREAM *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(0x18)" identifier (argument_list "(0x18)" ( number_literal ))))) ;) (expression_statement "xbcopy((char *)s,(char *)pBVar4,0x18);" (call_expression "xbcopy((char *)s,(char *)pBVar4,0x18)" identifier (argument_list "((char *)s,(char *)pBVar4,0x18)" ( (cast_expression "(char *)s" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier) , (cast_expression "(char *)pBVar4" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier) , number_literal ))) ;) (expression_statement "ppBVar5 = buffers + fd2;" (assignment_expression "ppBVar5 = buffers + fd2" identifier = (binary_expression "buffers + fd2" identifier + identifier)) ;) (expression_statement "ppBVar6 = buffers;" (assignment_expression "ppBVar6 = buffers" identifier = identifier) ;) }))) (expression_statement "*ppBVar3 = pBVar4;" (assignment_expression "*ppBVar3 = pBVar4" (pointer_expression "*ppBVar3" * identifier) = identifier) ;) (expression_statement "pBVar4 = *ppBVar5;" (assignment_expression "pBVar4 = *ppBVar5" identifier = (pointer_expression "*ppBVar5" * identifier)) ;) (if_statement "if (pBVar4 == (BUFFERED_STREAM *)0x0) {\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(fd2);\n    pBVar4 = buffers[fd2];\n    ppBVar6 = buffers;\n  }\n  else {\n    pBVar4->b_fd = fd2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }" if (parenthesized_expression "(pBVar4 == (BUFFERED_STREAM *)0x0)" ( (binary_expression "pBVar4 == (BUFFERED_STREAM *)0x0" identifier == (cast_expression "(BUFFERED_STREAM *)0x0" ( (type_descriptor "BUFFERED_STREAM *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(fd2);\n    pBVar4 = buffers[fd2];\n    ppBVar6 = buffers;\n  }" { (if_statement "if (bVar7 || bVar8) goto LAB_0008d159;" if (parenthesized_expression "(bVar7 || bVar8)" ( (binary_expression "bVar7 || bVar8" identifier || identifier) )) (goto_statement "goto LAB_0008d159;" goto statement_identifier ;)) (expression_statement "fd_to_buffered_stream(fd2);" (call_expression "fd_to_buffered_stream(fd2)" identifier (argument_list "(fd2)" ( identifier ))) ;) (expression_statement "pBVar4 = buffers[fd2];" (assignment_expression "pBVar4 = buffers[fd2]" identifier = (subscript_expression "buffers[fd2]" identifier [ identifier ])) ;) (expression_statement "ppBVar6 = buffers;" (assignment_expression "ppBVar6 = buffers" identifier = identifier) ;) }) (else_clause "else {\n    pBVar4->b_fd = fd2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }" else (compound_statement "{\n    pBVar4->b_fd = fd2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }" { (expression_statement "pBVar4->b_fd = fd2;" (assignment_expression "pBVar4->b_fd = fd2" (field_expression "pBVar4->b_fd" identifier -> field_identifier) = identifier) ;) (if_statement "if (bVar7 || bVar8) goto LAB_0008d159;" if (parenthesized_expression "(bVar7 || bVar8)" ( (binary_expression "bVar7 || bVar8" identifier || identifier) )) (goto_statement "goto LAB_0008d159;" goto statement_identifier ;)) }))) (expression_statement "pBVar4->b_flag = pBVar4->b_flag | 8;" (assignment_expression "pBVar4->b_flag = pBVar4->b_flag | 8" (field_expression "pBVar4->b_flag" identifier -> field_identifier) = (binary_expression "pBVar4->b_flag | 8" (field_expression "pBVar4->b_flag" identifier -> field_identifier) | number_literal)) ;) (labeled_statement "LAB_0008d159:\n  if ((((bash_input.type == st_bstream) && ((FILE *)fd1 == bash_input.location.file)) ||\n      ((interactive_shell == 0 && (fd1 == default_buffered_input)))) ||\n     ((ppBVar6[fd1] != (BUFFERED_STREAM *)0x0 && ((ppBVar6[fd1]->b_flag & 0x20) != 0)))) {\n    pBVar4->b_flag = pBVar4->b_flag | 0x20;\n  }" statement_identifier : (if_statement "if ((((bash_input.type == st_bstream) && ((FILE *)fd1 == bash_input.location.file)) ||\n      ((interactive_shell == 0 && (fd1 == default_buffered_input)))) ||\n     ((ppBVar6[fd1] != (BUFFERED_STREAM *)0x0 && ((ppBVar6[fd1]->b_flag & 0x20) != 0)))) {\n    pBVar4->b_flag = pBVar4->b_flag | 0x20;\n  }" if (parenthesized_expression "((((bash_input.type == st_bstream) && ((FILE *)fd1 == bash_input.location.file)) ||\n      ((interactive_shell == 0 && (fd1 == default_buffered_input)))) ||\n     ((ppBVar6[fd1] != (BUFFERED_STREAM *)0x0 && ((ppBVar6[fd1]->b_flag & 0x20) != 0))))" ( (binary_expression "(((bash_input.type == st_bstream) && ((FILE *)fd1 == bash_input.location.file)) ||\n      ((interactive_shell == 0 && (fd1 == default_buffered_input)))) ||\n     ((ppBVar6[fd1] != (BUFFERED_STREAM *)0x0 && ((ppBVar6[fd1]->b_flag & 0x20) != 0)))" (parenthesized_expression "(((bash_input.type == st_bstream) && ((FILE *)fd1 == bash_input.location.file)) ||\n      ((interactive_shell == 0 && (fd1 == default_buffered_input))))" ( (binary_expression "((bash_input.type == st_bstream) && ((FILE *)fd1 == bash_input.location.file)) ||\n      ((interactive_shell == 0 && (fd1 == default_buffered_input)))" (parenthesized_expression "((bash_input.type == st_bstream) && ((FILE *)fd1 == bash_input.location.file))" ( (binary_expression "(bash_input.type == st_bstream) && ((FILE *)fd1 == bash_input.location.file)" (parenthesized_expression "(bash_input.type == st_bstream)" ( (binary_expression "bash_input.type == st_bstream" (field_expression "bash_input.type" identifier . field_identifier) == identifier) )) && (parenthesized_expression "((FILE *)fd1 == bash_input.location.file)" ( (binary_expression "(FILE *)fd1 == bash_input.location.file" (cast_expression "(FILE *)fd1" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) == (field_expression "bash_input.location.file" (field_expression "bash_input.location" identifier . field_identifier) . field_identifier)) ))) )) || (parenthesized_expression "((interactive_shell == 0 && (fd1 == default_buffered_input)))" ( (parenthesized_expression "(interactive_shell == 0 && (fd1 == default_buffered_input))" ( (binary_expression "interactive_shell == 0 && (fd1 == default_buffered_input)" (binary_expression "interactive_shell == 0" identifier == number_literal) && (parenthesized_expression "(fd1 == default_buffered_input)" ( (binary_expression "fd1 == default_buffered_input" identifier == identifier) ))) )) ))) )) || (parenthesized_expression "((ppBVar6[fd1] != (BUFFERED_STREAM *)0x0 && ((ppBVar6[fd1]->b_flag & 0x20) != 0)))" ( (parenthesized_expression "(ppBVar6[fd1] != (BUFFERED_STREAM *)0x0 && ((ppBVar6[fd1]->b_flag & 0x20) != 0))" ( (binary_expression "ppBVar6[fd1] != (BUFFERED_STREAM *)0x0 && ((ppBVar6[fd1]->b_flag & 0x20) != 0)" (binary_expression "ppBVar6[fd1] != (BUFFERED_STREAM *)0x0" (subscript_expression "ppBVar6[fd1]" identifier [ identifier ]) != (cast_expression "(BUFFERED_STREAM *)0x0" ( (type_descriptor "BUFFERED_STREAM *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) && (parenthesized_expression "((ppBVar6[fd1]->b_flag & 0x20) != 0)" ( (binary_expression "(ppBVar6[fd1]->b_flag & 0x20) != 0" (parenthesized_expression "(ppBVar6[fd1]->b_flag & 0x20)" ( (binary_expression "ppBVar6[fd1]->b_flag & 0x20" (field_expression "ppBVar6[fd1]->b_flag" (subscript_expression "ppBVar6[fd1]" identifier [ identifier ]) -> field_identifier) & number_literal) )) != number_literal) ))) )) ))) )) (compound_statement "{\n    pBVar4->b_flag = pBVar4->b_flag | 0x20;\n  }" { (expression_statement "pBVar4->b_flag = pBVar4->b_flag | 0x20;" (assignment_expression "pBVar4->b_flag = pBVar4->b_flag | 0x20" (field_expression "pBVar4->b_flag" identifier -> field_identifier) = (binary_expression "pBVar4->b_flag | 0x20" (field_expression "pBVar4->b_flag" identifier -> field_identifier) | number_literal)) ;) }))) (return_statement "return fd2;" return identifier ;) })))
(translation_unit "int duplicate_buffered_stream(int param_1,int param_2)\n\n{\n  int *__ptr;\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  int *piVar4;\n  int iVar5;\n  int iVar6;\n  bool bVar7;\n  bool bVar8;\n  \n  iVar6 = DAT_00179200;\n  if (param_1 == param_2) {\n    return 0;\n  }\n  iVar1 = param_2;\n  if (param_2 <= param_1) {\n    iVar1 = param_1;\n  }\n  iVar5 = DAT_00179204;\n  if (DAT_00179200 <= iVar1) {\n    DAT_00179200 = iVar1 + 0x14;\n    iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);\n    DAT_00179204 = iVar5;\n    if (iVar6 < DAT_00179200) {\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }\n  }\n  bVar7 = bash_input != 4;\n  bVar8 = DAT_0017ac84 != param_2;\n  iVar1 = param_2 * 4;\n  piVar2 = (int *)(iVar1 + iVar5);\n  __ptr = (int *)*piVar2;\n  piVar4 = (int *)(iVar5 + param_1 * 4);\n  iVar6 = *piVar4;\n  if (__ptr != (int *)0x0) {\n    if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }\n    else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }\n  }\n  if (iVar6 == 0) {\n    iVar3 = 0;\n    piVar4 = piVar2;\n  }\n  else {\n    iVar3 = xmalloc(0x18);\n    xbcopy(iVar6,iVar3,0x18);\n    piVar4 = (int *)(iVar1 + DAT_00179204);\n    iVar5 = DAT_00179204;\n  }\n  *piVar2 = iVar3;\n  piVar4 = (int *)*piVar4;\n  if (piVar4 == (int *)0x0) {\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(param_2);\n    piVar4 = *(int **)(DAT_00179204 + iVar1);\n    iVar5 = DAT_00179204;\n  }\n  else {\n    *piVar4 = param_2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }\n  piVar4[4] = piVar4[4] | 8;\nLAB_0008d159:\n  if ((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )) {\n    piVar4[4] = piVar4[4] | 0x20;\n  }\n  return param_2;\n}\n\n" (function_definition "int duplicate_buffered_stream(int param_1,int param_2)\n\n{\n  int *__ptr;\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  int *piVar4;\n  int iVar5;\n  int iVar6;\n  bool bVar7;\n  bool bVar8;\n  \n  iVar6 = DAT_00179200;\n  if (param_1 == param_2) {\n    return 0;\n  }\n  iVar1 = param_2;\n  if (param_2 <= param_1) {\n    iVar1 = param_1;\n  }\n  iVar5 = DAT_00179204;\n  if (DAT_00179200 <= iVar1) {\n    DAT_00179200 = iVar1 + 0x14;\n    iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);\n    DAT_00179204 = iVar5;\n    if (iVar6 < DAT_00179200) {\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }\n  }\n  bVar7 = bash_input != 4;\n  bVar8 = DAT_0017ac84 != param_2;\n  iVar1 = param_2 * 4;\n  piVar2 = (int *)(iVar1 + iVar5);\n  __ptr = (int *)*piVar2;\n  piVar4 = (int *)(iVar5 + param_1 * 4);\n  iVar6 = *piVar4;\n  if (__ptr != (int *)0x0) {\n    if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }\n    else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }\n  }\n  if (iVar6 == 0) {\n    iVar3 = 0;\n    piVar4 = piVar2;\n  }\n  else {\n    iVar3 = xmalloc(0x18);\n    xbcopy(iVar6,iVar3,0x18);\n    piVar4 = (int *)(iVar1 + DAT_00179204);\n    iVar5 = DAT_00179204;\n  }\n  *piVar2 = iVar3;\n  piVar4 = (int *)*piVar4;\n  if (piVar4 == (int *)0x0) {\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(param_2);\n    piVar4 = *(int **)(DAT_00179204 + iVar1);\n    iVar5 = DAT_00179204;\n  }\n  else {\n    *piVar4 = param_2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }\n  piVar4[4] = piVar4[4] | 8;\nLAB_0008d159:\n  if ((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )) {\n    piVar4[4] = piVar4[4] | 0x20;\n  }\n  return param_2;\n}" primitive_type (function_declarator "duplicate_buffered_stream(int param_1,int param_2)" identifier (parameter_list "(int param_1,int param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int *__ptr;\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  int *piVar4;\n  int iVar5;\n  int iVar6;\n  bool bVar7;\n  bool bVar8;\n  \n  iVar6 = DAT_00179200;\n  if (param_1 == param_2) {\n    return 0;\n  }\n  iVar1 = param_2;\n  if (param_2 <= param_1) {\n    iVar1 = param_1;\n  }\n  iVar5 = DAT_00179204;\n  if (DAT_00179200 <= iVar1) {\n    DAT_00179200 = iVar1 + 0x14;\n    iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);\n    DAT_00179204 = iVar5;\n    if (iVar6 < DAT_00179200) {\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }\n  }\n  bVar7 = bash_input != 4;\n  bVar8 = DAT_0017ac84 != param_2;\n  iVar1 = param_2 * 4;\n  piVar2 = (int *)(iVar1 + iVar5);\n  __ptr = (int *)*piVar2;\n  piVar4 = (int *)(iVar5 + param_1 * 4);\n  iVar6 = *piVar4;\n  if (__ptr != (int *)0x0) {\n    if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }\n    else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }\n  }\n  if (iVar6 == 0) {\n    iVar3 = 0;\n    piVar4 = piVar2;\n  }\n  else {\n    iVar3 = xmalloc(0x18);\n    xbcopy(iVar6,iVar3,0x18);\n    piVar4 = (int *)(iVar1 + DAT_00179204);\n    iVar5 = DAT_00179204;\n  }\n  *piVar2 = iVar3;\n  piVar4 = (int *)*piVar4;\n  if (piVar4 == (int *)0x0) {\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(param_2);\n    piVar4 = *(int **)(DAT_00179204 + iVar1);\n    iVar5 = DAT_00179204;\n  }\n  else {\n    *piVar4 = param_2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }\n  piVar4[4] = piVar4[4] | 8;\nLAB_0008d159:\n  if ((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )) {\n    piVar4[4] = piVar4[4] | 0x20;\n  }\n  return param_2;\n}" { (declaration "int *__ptr;" primitive_type (pointer_declarator "*__ptr" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "bool bVar7;" primitive_type identifier ;) (declaration "bool bVar8;" primitive_type identifier ;) (expression_statement "iVar6 = DAT_00179200;" (assignment_expression "iVar6 = DAT_00179200" identifier = identifier) ;) (if_statement "if (param_1 == param_2) {\n    return 0;\n  }" if (parenthesized_expression "(param_1 == param_2)" ( (binary_expression "param_1 == param_2" identifier == identifier) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar1 = param_2;" (assignment_expression "iVar1 = param_2" identifier = identifier) ;) (if_statement "if (param_2 <= param_1) {\n    iVar1 = param_1;\n  }" if (parenthesized_expression "(param_2 <= param_1)" ( (binary_expression "param_2 <= param_1" identifier <= identifier) )) (compound_statement "{\n    iVar1 = param_1;\n  }" { (expression_statement "iVar1 = param_1;" (assignment_expression "iVar1 = param_1" identifier = identifier) ;) })) (expression_statement "iVar5 = DAT_00179204;" (assignment_expression "iVar5 = DAT_00179204" identifier = identifier) ;) (if_statement "if (DAT_00179200 <= iVar1) {\n    DAT_00179200 = iVar1 + 0x14;\n    iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);\n    DAT_00179204 = iVar5;\n    if (iVar6 < DAT_00179200) {\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }\n  }" if (parenthesized_expression "(DAT_00179200 <= iVar1)" ( (binary_expression "DAT_00179200 <= iVar1" identifier <= identifier) )) (compound_statement "{\n    DAT_00179200 = iVar1 + 0x14;\n    iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);\n    DAT_00179204 = iVar5;\n    if (iVar6 < DAT_00179200) {\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }\n  }" { (expression_statement "DAT_00179200 = iVar1 + 0x14;" (assignment_expression "DAT_00179200 = iVar1 + 0x14" identifier = (binary_expression "iVar1 + 0x14" identifier + number_literal)) ;) (expression_statement "iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);" (assignment_expression "iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4)" identifier = (call_expression "xrealloc(DAT_00179204,DAT_00179200 * 4)" identifier (argument_list "(DAT_00179204,DAT_00179200 * 4)" ( identifier , (binary_expression "DAT_00179200 * 4" identifier * number_literal) )))) ;) (expression_statement "DAT_00179204 = iVar5;" (assignment_expression "DAT_00179204 = iVar5" identifier = identifier) ;) (if_statement "if (iVar6 < DAT_00179200) {\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }" if (parenthesized_expression "(iVar6 < DAT_00179200)" ( (binary_expression "iVar6 < DAT_00179200" identifier < identifier) )) (compound_statement "{\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }" { (expression_statement "memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);" (call_expression "memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4)" identifier (argument_list "((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4)" ( (cast_expression "(void *)(iVar5 + iVar6 * 4)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + iVar6 * 4)" ( (binary_expression "iVar5 + iVar6 * 4" identifier + (binary_expression "iVar6 * 4" identifier * number_literal)) ))) , number_literal , (binary_expression "(DAT_00179200 - iVar6) * 4" (parenthesized_expression "(DAT_00179200 - iVar6)" ( (binary_expression "DAT_00179200 - iVar6" identifier - identifier) )) * number_literal) ))) ;) })) })) (expression_statement "bVar7 = bash_input != 4;" (assignment_expression "bVar7 = bash_input != 4" identifier = (binary_expression "bash_input != 4" identifier != number_literal)) ;) (expression_statement "bVar8 = DAT_0017ac84 != param_2;" (assignment_expression "bVar8 = DAT_0017ac84 != param_2" identifier = (binary_expression "DAT_0017ac84 != param_2" identifier != identifier)) ;) (expression_statement "iVar1 = param_2 * 4;" (assignment_expression "iVar1 = param_2 * 4" identifier = (binary_expression "param_2 * 4" identifier * number_literal)) ;) (expression_statement "piVar2 = (int *)(iVar1 + iVar5);" (assignment_expression "piVar2 = (int *)(iVar1 + iVar5)" identifier = (cast_expression "(int *)(iVar1 + iVar5)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + iVar5)" ( (binary_expression "iVar1 + iVar5" identifier + identifier) )))) ;) (expression_statement "__ptr = (int *)*piVar2;" (assignment_expression "__ptr = (int *)*piVar2" identifier = (cast_expression "(int *)*piVar2" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*piVar2" * identifier))) ;) (expression_statement "piVar4 = (int *)(iVar5 + param_1 * 4);" (assignment_expression "piVar4 = (int *)(iVar5 + param_1 * 4)" identifier = (cast_expression "(int *)(iVar5 + param_1 * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + param_1 * 4)" ( (binary_expression "iVar5 + param_1 * 4" identifier + (binary_expression "param_1 * 4" identifier * number_literal)) )))) ;) (expression_statement "iVar6 = *piVar4;" (assignment_expression "iVar6 = *piVar4" identifier = (pointer_expression "*piVar4" * identifier)) ;) (if_statement "if (__ptr != (int *)0x0) {\n    if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }\n    else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }\n  }" if (parenthesized_expression "(__ptr != (int *)0x0)" ( (binary_expression "__ptr != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }\n    else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }\n  }" { (if_statement "if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }\n    else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }" if (parenthesized_expression "(((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1]))" ( (binary_expression "((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])" (parenthesized_expression "((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0))" ( (binary_expression "(iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)" (parenthesized_expression "(iVar6 == 0)" ( (binary_expression "iVar6 == 0" identifier == number_literal) )) || (parenthesized_expression "(*(int *)(iVar6 + 4) == 0)" ( (binary_expression "*(int *)(iVar6 + 4) == 0" (pointer_expression "*(int *)(iVar6 + 4)" * (cast_expression "(int *)(iVar6 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar6 + 4)" ( (binary_expression "iVar6 + 4" identifier + number_literal) )))) == number_literal) ))) )) || (parenthesized_expression "(*(int *)(iVar6 + 4) != __ptr[1])" ( (binary_expression "*(int *)(iVar6 + 4) != __ptr[1]" (pointer_expression "*(int *)(iVar6 + 4)" * (cast_expression "(int *)(iVar6 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar6 + 4)" ( (binary_expression "iVar6 + 4" identifier + number_literal) )))) != (subscript_expression "__ptr[1]" identifier [ number_literal ])) ))) )) (compound_statement "{\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }" { (expression_statement "iVar6 = *__ptr;" (assignment_expression "iVar6 = *__ptr" identifier = (pointer_expression "*__ptr" * identifier)) ;) (if_statement "if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }" if (parenthesized_expression "(((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0))" ( (binary_expression "((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)" (parenthesized_expression "((*(byte *)(__ptr + 4) & 0x20) == 0)" ( (binary_expression "(*(byte *)(__ptr + 4) & 0x20) == 0" (parenthesized_expression "(*(byte *)(__ptr + 4) & 0x20)" ( (binary_expression "*(byte *)(__ptr + 4) & 0x20" (pointer_expression "*(byte *)(__ptr + 4)" * (cast_expression "(byte *)(__ptr + 4)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__ptr + 4)" ( (binary_expression "__ptr + 4" identifier + number_literal) )))) & number_literal) )) == number_literal) )) && (parenthesized_expression "((void *)__ptr[1] != (void *)0x0)" ( (binary_expression "(void *)__ptr[1] != (void *)0x0" (cast_expression "(void *)__ptr[1]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "__ptr[1]" identifier [ number_literal ])) != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ))) )) (compound_statement "{\n        free((void *)__ptr[1]);\n      }" { (expression_statement "free((void *)__ptr[1]);" (call_expression "free((void *)__ptr[1])" identifier (argument_list "((void *)__ptr[1])" ( (cast_expression "(void *)__ptr[1]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "__ptr[1]" identifier [ number_literal ])) ))) ;) })) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" identifier (argument_list "(__ptr)" ( identifier ))) ;) (expression_statement "*(undefined4 *)(iVar5 + iVar6 * 4) = 0;" (assignment_expression "*(undefined4 *)(iVar5 + iVar6 * 4) = 0" (pointer_expression "*(undefined4 *)(iVar5 + iVar6 * 4)" * (cast_expression "(undefined4 *)(iVar5 + iVar6 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + iVar6 * 4)" ( (binary_expression "iVar5 + iVar6 * 4" identifier + (binary_expression "iVar6 * 4" identifier * number_literal)) )))) = number_literal) ;) (expression_statement "iVar6 = *piVar4;" (assignment_expression "iVar6 = *piVar4" identifier = (pointer_expression "*piVar4" * identifier)) ;) }) (else_clause "else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }" else (compound_statement "{\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }" { (expression_statement "*piVar2 = 0;" (assignment_expression "*piVar2 = 0" (pointer_expression "*piVar2" * identifier) = number_literal) ;) (expression_statement "iVar6 = *piVar4;" (assignment_expression "iVar6 = *piVar4" identifier = (pointer_expression "*piVar4" * identifier)) ;) }))) })) (if_statement "if (iVar6 == 0) {\n    iVar3 = 0;\n    piVar4 = piVar2;\n  }\n  else {\n    iVar3 = xmalloc(0x18);\n    xbcopy(iVar6,iVar3,0x18);\n    piVar4 = (int *)(iVar1 + DAT_00179204);\n    iVar5 = DAT_00179204;\n  }" if (parenthesized_expression "(iVar6 == 0)" ( (binary_expression "iVar6 == 0" identifier == number_literal) )) (compound_statement "{\n    iVar3 = 0;\n    piVar4 = piVar2;\n  }" { (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (expression_statement "piVar4 = piVar2;" (assignment_expression "piVar4 = piVar2" identifier = identifier) ;) }) (else_clause "else {\n    iVar3 = xmalloc(0x18);\n    xbcopy(iVar6,iVar3,0x18);\n    piVar4 = (int *)(iVar1 + DAT_00179204);\n    iVar5 = DAT_00179204;\n  }" else (compound_statement "{\n    iVar3 = xmalloc(0x18);\n    xbcopy(iVar6,iVar3,0x18);\n    piVar4 = (int *)(iVar1 + DAT_00179204);\n    iVar5 = DAT_00179204;\n  }" { (expression_statement "iVar3 = xmalloc(0x18);" (assignment_expression "iVar3 = xmalloc(0x18)" identifier = (call_expression "xmalloc(0x18)" identifier (argument_list "(0x18)" ( number_literal )))) ;) (expression_statement "xbcopy(iVar6,iVar3,0x18);" (call_expression "xbcopy(iVar6,iVar3,0x18)" identifier (argument_list "(iVar6,iVar3,0x18)" ( identifier , identifier , number_literal ))) ;) (expression_statement "piVar4 = (int *)(iVar1 + DAT_00179204);" (assignment_expression "piVar4 = (int *)(iVar1 + DAT_00179204)" identifier = (cast_expression "(int *)(iVar1 + DAT_00179204)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + DAT_00179204)" ( (binary_expression "iVar1 + DAT_00179204" identifier + identifier) )))) ;) (expression_statement "iVar5 = DAT_00179204;" (assignment_expression "iVar5 = DAT_00179204" identifier = identifier) ;) }))) (expression_statement "*piVar2 = iVar3;" (assignment_expression "*piVar2 = iVar3" (pointer_expression "*piVar2" * identifier) = identifier) ;) (expression_statement "piVar4 = (int *)*piVar4;" (assignment_expression "piVar4 = (int *)*piVar4" identifier = (cast_expression "(int *)*piVar4" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*piVar4" * identifier))) ;) (if_statement "if (piVar4 == (int *)0x0) {\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(param_2);\n    piVar4 = *(int **)(DAT_00179204 + iVar1);\n    iVar5 = DAT_00179204;\n  }\n  else {\n    *piVar4 = param_2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }" if (parenthesized_expression "(piVar4 == (int *)0x0)" ( (binary_expression "piVar4 == (int *)0x0" identifier == (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(param_2);\n    piVar4 = *(int **)(DAT_00179204 + iVar1);\n    iVar5 = DAT_00179204;\n  }" { (if_statement "if (bVar7 || bVar8) goto LAB_0008d159;" if (parenthesized_expression "(bVar7 || bVar8)" ( (binary_expression "bVar7 || bVar8" identifier || identifier) )) (goto_statement "goto LAB_0008d159;" goto statement_identifier ;)) (expression_statement "fd_to_buffered_stream(param_2);" (call_expression "fd_to_buffered_stream(param_2)" identifier (argument_list "(param_2)" ( identifier ))) ;) (expression_statement "piVar4 = *(int **)(DAT_00179204 + iVar1);" (assignment_expression "piVar4 = *(int **)(DAT_00179204 + iVar1)" identifier = (pointer_expression "*(int **)(DAT_00179204 + iVar1)" * (cast_expression "(int **)(DAT_00179204 + iVar1)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(DAT_00179204 + iVar1)" ( (binary_expression "DAT_00179204 + iVar1" identifier + identifier) ))))) ;) (expression_statement "iVar5 = DAT_00179204;" (assignment_expression "iVar5 = DAT_00179204" identifier = identifier) ;) }) (else_clause "else {\n    *piVar4 = param_2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }" else (compound_statement "{\n    *piVar4 = param_2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }" { (expression_statement "*piVar4 = param_2;" (assignment_expression "*piVar4 = param_2" (pointer_expression "*piVar4" * identifier) = identifier) ;) (if_statement "if (bVar7 || bVar8) goto LAB_0008d159;" if (parenthesized_expression "(bVar7 || bVar8)" ( (binary_expression "bVar7 || bVar8" identifier || identifier) )) (goto_statement "goto LAB_0008d159;" goto statement_identifier ;)) }))) (expression_statement "piVar4[4] = piVar4[4] | 8;" (assignment_expression "piVar4[4] = piVar4[4] | 8" (subscript_expression "piVar4[4]" identifier [ number_literal ]) = (binary_expression "piVar4[4] | 8" (subscript_expression "piVar4[4]" identifier [ number_literal ]) | number_literal)) ;) (labeled_statement "LAB_0008d159:\n  if ((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )) {\n    piVar4[4] = piVar4[4] | 0x20;\n  }" statement_identifier : (if_statement "if ((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )) {\n    piVar4[4] = piVar4[4] | 0x20;\n  }" if (parenthesized_expression "((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     ))" ( (binary_expression "(((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )" (parenthesized_expression "(((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input))))" ( (binary_expression "((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))" (parenthesized_expression "((bash_input == 4) && (param_1 == DAT_0017ac84))" ( (binary_expression "(bash_input == 4) && (param_1 == DAT_0017ac84)" (parenthesized_expression "(bash_input == 4)" ( (binary_expression "bash_input == 4" identifier == number_literal) )) && (parenthesized_expression "(param_1 == DAT_0017ac84)" ( (binary_expression "param_1 == DAT_0017ac84" identifier == identifier) ))) )) || (parenthesized_expression "((interactive_shell == 0 && (param_1 == default_buffered_input)))" ( (parenthesized_expression "(interactive_shell == 0 && (param_1 == default_buffered_input))" ( (binary_expression "interactive_shell == 0 && (param_1 == default_buffered_input)" (binary_expression "interactive_shell == 0" identifier == number_literal) && (parenthesized_expression "(param_1 == default_buffered_input)" ( (binary_expression "param_1 == default_buffered_input" identifier == identifier) ))) )) ))) )) || (parenthesized_expression "((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )" ( (parenthesized_expression "(iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))" ( (comma_expression "iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0)" (assignment_expression "iVar6 = *(int *)(iVar5 + param_1 * 4)" identifier = (pointer_expression "*(int *)(iVar5 + param_1 * 4)" * (cast_expression "(int *)(iVar5 + param_1 * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + param_1 * 4)" ( (binary_expression "iVar5 + param_1 * 4" identifier + (binary_expression "param_1 * 4" identifier * number_literal)) ))))) , (binary_expression "iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0)" (binary_expression "iVar6 != 0" identifier != number_literal) && (parenthesized_expression "((*(byte *)(iVar6 + 0x10) & 0x20) != 0)" ( (binary_expression "(*(byte *)(iVar6 + 0x10) & 0x20) != 0" (parenthesized_expression "(*(byte *)(iVar6 + 0x10) & 0x20)" ( (binary_expression "*(byte *)(iVar6 + 0x10) & 0x20" (pointer_expression "*(byte *)(iVar6 + 0x10)" * (cast_expression "(byte *)(iVar6 + 0x10)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar6 + 0x10)" ( (binary_expression "iVar6 + 0x10" identifier + number_literal) )))) & number_literal) )) != number_literal) )))) )) ))) )) (compound_statement "{\n    piVar4[4] = piVar4[4] | 0x20;\n  }" { (expression_statement "piVar4[4] = piVar4[4] | 0x20;" (assignment_expression "piVar4[4] = piVar4[4] | 0x20" (subscript_expression "piVar4[4]" identifier [ number_literal ]) = (binary_expression "piVar4[4] | 0x20" (subscript_expression "piVar4[4]" identifier [ number_literal ]) | number_literal)) ;) }))) (return_statement "return param_2;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (binary_expression IDENT * LIT) )))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) ))) , LIT , (binary_expression (parenthesized_expression ( (binary_expression IDENT - IDENT) )) * LIT) ))) ;) })) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT != LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT != IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT * LIT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == LIT) )) || (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == LIT) ))) )) || (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 { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) & LIT) )) == LIT) )) && (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)) ))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ])) ))) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) )))) = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) }))) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , LIT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }))) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT || IDENT) )) (goto_statement goto statement_identifier ;)) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT || IDENT) )) (goto_statement goto statement_identifier ;)) }))) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (subscript_expression IDENT [ LIT ]) | LIT)) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == LIT) )) && (parenthesized_expression ( (binary_expression IDENT == IDENT) ))) )) || (parenthesized_expression ( (parenthesized_expression ( (binary_expression (binary_expression IDENT == LIT) && (parenthesized_expression ( (binary_expression IDENT == IDENT) ))) )) ))) )) || (parenthesized_expression ( (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) ))))) , (binary_expression (binary_expression IDENT != LIT) && (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) & LIT) )) != LIT) )))) )) ))) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (subscript_expression IDENT [ LIT ]) | LIT)) ;) }))) (return_statement return IDENT ;) })))
(function_definition "int duplicate_buffered_stream(int param_1,int param_2)\n\n{\n  int *__ptr;\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  int *piVar4;\n  int iVar5;\n  int iVar6;\n  bool bVar7;\n  bool bVar8;\n  \n  iVar6 = DAT_00179200;\n  if (param_1 == param_2) {\n    return 0;\n  }\n  iVar1 = param_2;\n  if (param_2 <= param_1) {\n    iVar1 = param_1;\n  }\n  iVar5 = DAT_00179204;\n  if (DAT_00179200 <= iVar1) {\n    DAT_00179200 = iVar1 + 0x14;\n    iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);\n    DAT_00179204 = iVar5;\n    if (iVar6 < DAT_00179200) {\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }\n  }\n  bVar7 = bash_input != 4;\n  bVar8 = DAT_0017ac84 != param_2;\n  iVar1 = param_2 * 4;\n  piVar2 = (int *)(iVar1 + iVar5);\n  __ptr = (int *)*piVar2;\n  piVar4 = (int *)(iVar5 + param_1 * 4);\n  iVar6 = *piVar4;\n  if (__ptr != (int *)0x0) {\n    if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }\n    else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }\n  }\n  if (iVar6 == 0) {\n    iVar3 = 0;\n    piVar4 = piVar2;\n  }\n  else {\n    iVar3 = xmalloc(0x18);\n    xbcopy(iVar6,iVar3,0x18);\n    piVar4 = (int *)(iVar1 + DAT_00179204);\n    iVar5 = DAT_00179204;\n  }\n  *piVar2 = iVar3;\n  piVar4 = (int *)*piVar4;\n  if (piVar4 == (int *)0x0) {\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(param_2);\n    piVar4 = *(int **)(DAT_00179204 + iVar1);\n    iVar5 = DAT_00179204;\n  }\n  else {\n    *piVar4 = param_2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }\n  piVar4[4] = piVar4[4] | 8;\nLAB_0008d159:\n  if ((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )) {\n    piVar4[4] = piVar4[4] | 0x20;\n  }\n  return param_2;\n}" (primitive_type "int") (function_declarator "duplicate_buffered_stream(int param_1,int param_2)" (identifier "duplicate_buffered_stream") (parameter_list "(int param_1,int param_2)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  int *__ptr;\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  int *piVar4;\n  int iVar5;\n  int iVar6;\n  bool bVar7;\n  bool bVar8;\n  \n  iVar6 = DAT_00179200;\n  if (param_1 == param_2) {\n    return 0;\n  }\n  iVar1 = param_2;\n  if (param_2 <= param_1) {\n    iVar1 = param_1;\n  }\n  iVar5 = DAT_00179204;\n  if (DAT_00179200 <= iVar1) {\n    DAT_00179200 = iVar1 + 0x14;\n    iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);\n    DAT_00179204 = iVar5;\n    if (iVar6 < DAT_00179200) {\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }\n  }\n  bVar7 = bash_input != 4;\n  bVar8 = DAT_0017ac84 != param_2;\n  iVar1 = param_2 * 4;\n  piVar2 = (int *)(iVar1 + iVar5);\n  __ptr = (int *)*piVar2;\n  piVar4 = (int *)(iVar5 + param_1 * 4);\n  iVar6 = *piVar4;\n  if (__ptr != (int *)0x0) {\n    if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }\n    else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }\n  }\n  if (iVar6 == 0) {\n    iVar3 = 0;\n    piVar4 = piVar2;\n  }\n  else {\n    iVar3 = xmalloc(0x18);\n    xbcopy(iVar6,iVar3,0x18);\n    piVar4 = (int *)(iVar1 + DAT_00179204);\n    iVar5 = DAT_00179204;\n  }\n  *piVar2 = iVar3;\n  piVar4 = (int *)*piVar4;\n  if (piVar4 == (int *)0x0) {\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(param_2);\n    piVar4 = *(int **)(DAT_00179204 + iVar1);\n    iVar5 = DAT_00179204;\n  }\n  else {\n    *piVar4 = param_2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }\n  piVar4[4] = piVar4[4] | 8;\nLAB_0008d159:\n  if ((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )) {\n    piVar4[4] = piVar4[4] | 0x20;\n  }\n  return param_2;\n}" ({ "{") (declaration "int *__ptr;" (primitive_type "int") (pointer_declarator "*__ptr" (* "*") (identifier "__ptr")) (; ";")) (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "int *piVar4;" (primitive_type "int") (pointer_declarator "*piVar4" (* "*") (identifier "piVar4")) (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (declaration "int iVar6;" (primitive_type "int") (identifier "iVar6") (; ";")) (declaration "bool bVar7;" (primitive_type "bool") (identifier "bVar7") (; ";")) (declaration "bool bVar8;" (primitive_type "bool") (identifier "bVar8") (; ";")) (expression_statement "iVar6 = DAT_00179200;" (assignment_expression "iVar6 = DAT_00179200" (identifier "iVar6") (= "=") (identifier "DAT_00179200")) (; ";")) (if_statement "if (param_1 == param_2) {\n    return 0;\n  }" (if "if") (parenthesized_expression "(param_1 == param_2)" (( "(") (binary_expression "param_1 == param_2" (identifier "param_1") (== "==") (identifier "param_2")) () ")")) (compound_statement "{\n    return 0;\n  }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "iVar1 = param_2;" (assignment_expression "iVar1 = param_2" (identifier "iVar1") (= "=") (identifier "param_2")) (; ";")) (if_statement "if (param_2 <= param_1) {\n    iVar1 = param_1;\n  }" (if "if") (parenthesized_expression "(param_2 <= param_1)" (( "(") (binary_expression "param_2 <= param_1" (identifier "param_2") (<= "<=") (identifier "param_1")) () ")")) (compound_statement "{\n    iVar1 = param_1;\n  }" ({ "{") (expression_statement "iVar1 = param_1;" (assignment_expression "iVar1 = param_1" (identifier "iVar1") (= "=") (identifier "param_1")) (; ";")) (} "}"))) (expression_statement "iVar5 = DAT_00179204;" (assignment_expression "iVar5 = DAT_00179204" (identifier "iVar5") (= "=") (identifier "DAT_00179204")) (; ";")) (if_statement "if (DAT_00179200 <= iVar1) {\n    DAT_00179200 = iVar1 + 0x14;\n    iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);\n    DAT_00179204 = iVar5;\n    if (iVar6 < DAT_00179200) {\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }\n  }" (if "if") (parenthesized_expression "(DAT_00179200 <= iVar1)" (( "(") (binary_expression "DAT_00179200 <= iVar1" (identifier "DAT_00179200") (<= "<=") (identifier "iVar1")) () ")")) (compound_statement "{\n    DAT_00179200 = iVar1 + 0x14;\n    iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);\n    DAT_00179204 = iVar5;\n    if (iVar6 < DAT_00179200) {\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }\n  }" ({ "{") (expression_statement "DAT_00179200 = iVar1 + 0x14;" (assignment_expression "DAT_00179200 = iVar1 + 0x14" (identifier "DAT_00179200") (= "=") (binary_expression "iVar1 + 0x14" (identifier "iVar1") (+ "+") (number_literal "0x14"))) (; ";")) (expression_statement "iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);" (assignment_expression "iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4)" (identifier "iVar5") (= "=") (call_expression "xrealloc(DAT_00179204,DAT_00179200 * 4)" (identifier "xrealloc") (argument_list "(DAT_00179204,DAT_00179200 * 4)" (( "(") (identifier "DAT_00179204") (, ",") (binary_expression "DAT_00179200 * 4" (identifier "DAT_00179200") (* "*") (number_literal "4")) () ")")))) (; ";")) (expression_statement "DAT_00179204 = iVar5;" (assignment_expression "DAT_00179204 = iVar5" (identifier "DAT_00179204") (= "=") (identifier "iVar5")) (; ";")) (if_statement "if (iVar6 < DAT_00179200) {\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }" (if "if") (parenthesized_expression "(iVar6 < DAT_00179200)" (( "(") (binary_expression "iVar6 < DAT_00179200" (identifier "iVar6") (< "<") (identifier "DAT_00179200")) () ")")) (compound_statement "{\n      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);\n    }" ({ "{") (expression_statement "memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);" (call_expression "memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4)" (identifier "memset") (argument_list "((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4)" (( "(") (cast_expression "(void *)(iVar5 + iVar6 * 4)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar5 + iVar6 * 4)" (( "(") (binary_expression "iVar5 + iVar6 * 4" (identifier "iVar5") (+ "+") (binary_expression "iVar6 * 4" (identifier "iVar6") (* "*") (number_literal "4"))) () ")"))) (, ",") (number_literal "0") (, ",") (binary_expression "(DAT_00179200 - iVar6) * 4" (parenthesized_expression "(DAT_00179200 - iVar6)" (( "(") (binary_expression "DAT_00179200 - iVar6" (identifier "DAT_00179200") (- "-") (identifier "iVar6")) () ")")) (* "*") (number_literal "4")) () ")"))) (; ";")) (} "}"))) (} "}"))) (expression_statement "bVar7 = bash_input != 4;" (assignment_expression "bVar7 = bash_input != 4" (identifier "bVar7") (= "=") (binary_expression "bash_input != 4" (identifier "bash_input") (!= "!=") (number_literal "4"))) (; ";")) (expression_statement "bVar8 = DAT_0017ac84 != param_2;" (assignment_expression "bVar8 = DAT_0017ac84 != param_2" (identifier "bVar8") (= "=") (binary_expression "DAT_0017ac84 != param_2" (identifier "DAT_0017ac84") (!= "!=") (identifier "param_2"))) (; ";")) (expression_statement "iVar1 = param_2 * 4;" (assignment_expression "iVar1 = param_2 * 4" (identifier "iVar1") (= "=") (binary_expression "param_2 * 4" (identifier "param_2") (* "*") (number_literal "4"))) (; ";")) (expression_statement "piVar2 = (int *)(iVar1 + iVar5);" (assignment_expression "piVar2 = (int *)(iVar1 + iVar5)" (identifier "piVar2") (= "=") (cast_expression "(int *)(iVar1 + iVar5)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + iVar5)" (( "(") (binary_expression "iVar1 + iVar5" (identifier "iVar1") (+ "+") (identifier "iVar5")) () ")")))) (; ";")) (expression_statement "__ptr = (int *)*piVar2;" (assignment_expression "__ptr = (int *)*piVar2" (identifier "__ptr") (= "=") (cast_expression "(int *)*piVar2" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*piVar2" (* "*") (identifier "piVar2")))) (; ";")) (expression_statement "piVar4 = (int *)(iVar5 + param_1 * 4);" (assignment_expression "piVar4 = (int *)(iVar5 + param_1 * 4)" (identifier "piVar4") (= "=") (cast_expression "(int *)(iVar5 + param_1 * 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar5 + param_1 * 4)" (( "(") (binary_expression "iVar5 + param_1 * 4" (identifier "iVar5") (+ "+") (binary_expression "param_1 * 4" (identifier "param_1") (* "*") (number_literal "4"))) () ")")))) (; ";")) (expression_statement "iVar6 = *piVar4;" (assignment_expression "iVar6 = *piVar4" (identifier "iVar6") (= "=") (pointer_expression "*piVar4" (* "*") (identifier "piVar4"))) (; ";")) (if_statement "if (__ptr != (int *)0x0) {\n    if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }\n    else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }\n  }" (if "if") (parenthesized_expression "(__ptr != (int *)0x0)" (( "(") (binary_expression "__ptr != (int *)0x0" (identifier "__ptr") (!= "!=") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }\n    else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }\n  }" ({ "{") (if_statement "if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }\n    else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }" (if "if") (parenthesized_expression "(((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1]))" (( "(") (binary_expression "((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])" (parenthesized_expression "((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0))" (( "(") (binary_expression "(iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)" (parenthesized_expression "(iVar6 == 0)" (( "(") (binary_expression "iVar6 == 0" (identifier "iVar6") (== "==") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(*(int *)(iVar6 + 4) == 0)" (( "(") (binary_expression "*(int *)(iVar6 + 4) == 0" (pointer_expression "*(int *)(iVar6 + 4)" (* "*") (cast_expression "(int *)(iVar6 + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar6 + 4)" (( "(") (binary_expression "iVar6 + 4" (identifier "iVar6") (+ "+") (number_literal "4")) () ")")))) (== "==") (number_literal "0")) () ")"))) () ")")) (|| "||") (parenthesized_expression "(*(int *)(iVar6 + 4) != __ptr[1])" (( "(") (binary_expression "*(int *)(iVar6 + 4) != __ptr[1]" (pointer_expression "*(int *)(iVar6 + 4)" (* "*") (cast_expression "(int *)(iVar6 + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar6 + 4)" (( "(") (binary_expression "iVar6 + 4" (identifier "iVar6") (+ "+") (number_literal "4")) () ")")))) (!= "!=") (subscript_expression "__ptr[1]" (identifier "__ptr") ([ "[") (number_literal "1") (] "]"))) () ")"))) () ")")) (compound_statement "{\n      iVar6 = *__ptr;\n      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }\n      free(__ptr);\n      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;\n      iVar6 = *piVar4;\n    }" ({ "{") (expression_statement "iVar6 = *__ptr;" (assignment_expression "iVar6 = *__ptr" (identifier "iVar6") (= "=") (pointer_expression "*__ptr" (* "*") (identifier "__ptr"))) (; ";")) (if_statement "if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {\n        free((void *)__ptr[1]);\n      }" (if "if") (parenthesized_expression "(((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0))" (( "(") (binary_expression "((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)" (parenthesized_expression "((*(byte *)(__ptr + 4) & 0x20) == 0)" (( "(") (binary_expression "(*(byte *)(__ptr + 4) & 0x20) == 0" (parenthesized_expression "(*(byte *)(__ptr + 4) & 0x20)" (( "(") (binary_expression "*(byte *)(__ptr + 4) & 0x20" (pointer_expression "*(byte *)(__ptr + 4)" (* "*") (cast_expression "(byte *)(__ptr + 4)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(__ptr + 4)" (( "(") (binary_expression "__ptr + 4" (identifier "__ptr") (+ "+") (number_literal "4")) () ")")))) (& "&") (number_literal "0x20")) () ")")) (== "==") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "((void *)__ptr[1] != (void *)0x0)" (( "(") (binary_expression "(void *)__ptr[1] != (void *)0x0" (cast_expression "(void *)__ptr[1]" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "__ptr[1]" (identifier "__ptr") ([ "[") (number_literal "1") (] "]"))) (!= "!=") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")"))) () ")")) (compound_statement "{\n        free((void *)__ptr[1]);\n      }" ({ "{") (expression_statement "free((void *)__ptr[1]);" (call_expression "free((void *)__ptr[1])" (identifier "free") (argument_list "((void *)__ptr[1])" (( "(") (cast_expression "(void *)__ptr[1]" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "__ptr[1]" (identifier "__ptr") ([ "[") (number_literal "1") (] "]"))) () ")"))) (; ";")) (} "}"))) (expression_statement "free(__ptr);" (call_expression "free(__ptr)" (identifier "free") (argument_list "(__ptr)" (( "(") (identifier "__ptr") () ")"))) (; ";")) (expression_statement "*(undefined4 *)(iVar5 + iVar6 * 4) = 0;" (assignment_expression "*(undefined4 *)(iVar5 + iVar6 * 4) = 0" (pointer_expression "*(undefined4 *)(iVar5 + iVar6 * 4)" (* "*") (cast_expression "(undefined4 *)(iVar5 + iVar6 * 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar5 + iVar6 * 4)" (( "(") (binary_expression "iVar5 + iVar6 * 4" (identifier "iVar5") (+ "+") (binary_expression "iVar6 * 4" (identifier "iVar6") (* "*") (number_literal "4"))) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar6 = *piVar4;" (assignment_expression "iVar6 = *piVar4" (identifier "iVar6") (= "=") (pointer_expression "*piVar4" (* "*") (identifier "piVar4"))) (; ";")) (} "}")) (else_clause "else {\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }" (else "else") (compound_statement "{\n      *piVar2 = 0;\n      iVar6 = *piVar4;\n    }" ({ "{") (expression_statement "*piVar2 = 0;" (assignment_expression "*piVar2 = 0" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar6 = *piVar4;" (assignment_expression "iVar6 = *piVar4" (identifier "iVar6") (= "=") (pointer_expression "*piVar4" (* "*") (identifier "piVar4"))) (; ";")) (} "}")))) (} "}"))) (if_statement "if (iVar6 == 0) {\n    iVar3 = 0;\n    piVar4 = piVar2;\n  }\n  else {\n    iVar3 = xmalloc(0x18);\n    xbcopy(iVar6,iVar3,0x18);\n    piVar4 = (int *)(iVar1 + DAT_00179204);\n    iVar5 = DAT_00179204;\n  }" (if "if") (parenthesized_expression "(iVar6 == 0)" (( "(") (binary_expression "iVar6 == 0" (identifier "iVar6") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    iVar3 = 0;\n    piVar4 = piVar2;\n  }" ({ "{") (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" (identifier "iVar3") (= "=") (number_literal "0")) (; ";")) (expression_statement "piVar4 = piVar2;" (assignment_expression "piVar4 = piVar2" (identifier "piVar4") (= "=") (identifier "piVar2")) (; ";")) (} "}")) (else_clause "else {\n    iVar3 = xmalloc(0x18);\n    xbcopy(iVar6,iVar3,0x18);\n    piVar4 = (int *)(iVar1 + DAT_00179204);\n    iVar5 = DAT_00179204;\n  }" (else "else") (compound_statement "{\n    iVar3 = xmalloc(0x18);\n    xbcopy(iVar6,iVar3,0x18);\n    piVar4 = (int *)(iVar1 + DAT_00179204);\n    iVar5 = DAT_00179204;\n  }" ({ "{") (expression_statement "iVar3 = xmalloc(0x18);" (assignment_expression "iVar3 = xmalloc(0x18)" (identifier "iVar3") (= "=") (call_expression "xmalloc(0x18)" (identifier "xmalloc") (argument_list "(0x18)" (( "(") (number_literal "0x18") () ")")))) (; ";")) (expression_statement "xbcopy(iVar6,iVar3,0x18);" (call_expression "xbcopy(iVar6,iVar3,0x18)" (identifier "xbcopy") (argument_list "(iVar6,iVar3,0x18)" (( "(") (identifier "iVar6") (, ",") (identifier "iVar3") (, ",") (number_literal "0x18") () ")"))) (; ";")) (expression_statement "piVar4 = (int *)(iVar1 + DAT_00179204);" (assignment_expression "piVar4 = (int *)(iVar1 + DAT_00179204)" (identifier "piVar4") (= "=") (cast_expression "(int *)(iVar1 + DAT_00179204)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + DAT_00179204)" (( "(") (binary_expression "iVar1 + DAT_00179204" (identifier "iVar1") (+ "+") (identifier "DAT_00179204")) () ")")))) (; ";")) (expression_statement "iVar5 = DAT_00179204;" (assignment_expression "iVar5 = DAT_00179204" (identifier "iVar5") (= "=") (identifier "DAT_00179204")) (; ";")) (} "}")))) (expression_statement "*piVar2 = iVar3;" (assignment_expression "*piVar2 = iVar3" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (identifier "iVar3")) (; ";")) (expression_statement "piVar4 = (int *)*piVar4;" (assignment_expression "piVar4 = (int *)*piVar4" (identifier "piVar4") (= "=") (cast_expression "(int *)*piVar4" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*piVar4" (* "*") (identifier "piVar4")))) (; ";")) (if_statement "if (piVar4 == (int *)0x0) {\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(param_2);\n    piVar4 = *(int **)(DAT_00179204 + iVar1);\n    iVar5 = DAT_00179204;\n  }\n  else {\n    *piVar4 = param_2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }" (if "if") (parenthesized_expression "(piVar4 == (int *)0x0)" (( "(") (binary_expression "piVar4 == (int *)0x0" (identifier "piVar4") (== "==") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    if (bVar7 || bVar8) goto LAB_0008d159;\n    fd_to_buffered_stream(param_2);\n    piVar4 = *(int **)(DAT_00179204 + iVar1);\n    iVar5 = DAT_00179204;\n  }" ({ "{") (if_statement "if (bVar7 || bVar8) goto LAB_0008d159;" (if "if") (parenthesized_expression "(bVar7 || bVar8)" (( "(") (binary_expression "bVar7 || bVar8" (identifier "bVar7") (|| "||") (identifier "bVar8")) () ")")) (goto_statement "goto LAB_0008d159;" (goto "goto") (statement_identifier "LAB_0008d159") (; ";"))) (expression_statement "fd_to_buffered_stream(param_2);" (call_expression "fd_to_buffered_stream(param_2)" (identifier "fd_to_buffered_stream") (argument_list "(param_2)" (( "(") (identifier "param_2") () ")"))) (; ";")) (expression_statement "piVar4 = *(int **)(DAT_00179204 + iVar1);" (assignment_expression "piVar4 = *(int **)(DAT_00179204 + iVar1)" (identifier "piVar4") (= "=") (pointer_expression "*(int **)(DAT_00179204 + iVar1)" (* "*") (cast_expression "(int **)(DAT_00179204 + iVar1)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(DAT_00179204 + iVar1)" (( "(") (binary_expression "DAT_00179204 + iVar1" (identifier "DAT_00179204") (+ "+") (identifier "iVar1")) () ")"))))) (; ";")) (expression_statement "iVar5 = DAT_00179204;" (assignment_expression "iVar5 = DAT_00179204" (identifier "iVar5") (= "=") (identifier "DAT_00179204")) (; ";")) (} "}")) (else_clause "else {\n    *piVar4 = param_2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }" (else "else") (compound_statement "{\n    *piVar4 = param_2;\n    if (bVar7 || bVar8) goto LAB_0008d159;\n  }" ({ "{") (expression_statement "*piVar4 = param_2;" (assignment_expression "*piVar4 = param_2" (pointer_expression "*piVar4" (* "*") (identifier "piVar4")) (= "=") (identifier "param_2")) (; ";")) (if_statement "if (bVar7 || bVar8) goto LAB_0008d159;" (if "if") (parenthesized_expression "(bVar7 || bVar8)" (( "(") (binary_expression "bVar7 || bVar8" (identifier "bVar7") (|| "||") (identifier "bVar8")) () ")")) (goto_statement "goto LAB_0008d159;" (goto "goto") (statement_identifier "LAB_0008d159") (; ";"))) (} "}")))) (expression_statement "piVar4[4] = piVar4[4] | 8;" (assignment_expression "piVar4[4] = piVar4[4] | 8" (subscript_expression "piVar4[4]" (identifier "piVar4") ([ "[") (number_literal "4") (] "]")) (= "=") (binary_expression "piVar4[4] | 8" (subscript_expression "piVar4[4]" (identifier "piVar4") ([ "[") (number_literal "4") (] "]")) (| "|") (number_literal "8"))) (; ";")) (labeled_statement "LAB_0008d159:\n  if ((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )) {\n    piVar4[4] = piVar4[4] | 0x20;\n  }" (statement_identifier "LAB_0008d159") (: ":") (if_statement "if ((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )) {\n    piVar4[4] = piVar4[4] | 0x20;\n  }" (if "if") (parenthesized_expression "((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     ))" (( "(") (binary_expression "(((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||\n     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )" (parenthesized_expression "(((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input))))" (( "(") (binary_expression "((bash_input == 4) && (param_1 == DAT_0017ac84)) ||\n      ((interactive_shell == 0 && (param_1 == default_buffered_input)))" (parenthesized_expression "((bash_input == 4) && (param_1 == DAT_0017ac84))" (( "(") (binary_expression "(bash_input == 4) && (param_1 == DAT_0017ac84)" (parenthesized_expression "(bash_input == 4)" (( "(") (binary_expression "bash_input == 4" (identifier "bash_input") (== "==") (number_literal "4")) () ")")) (&& "&&") (parenthesized_expression "(param_1 == DAT_0017ac84)" (( "(") (binary_expression "param_1 == DAT_0017ac84" (identifier "param_1") (== "==") (identifier "DAT_0017ac84")) () ")"))) () ")")) (|| "||") (parenthesized_expression "((interactive_shell == 0 && (param_1 == default_buffered_input)))" (( "(") (parenthesized_expression "(interactive_shell == 0 && (param_1 == default_buffered_input))" (( "(") (binary_expression "interactive_shell == 0 && (param_1 == default_buffered_input)" (binary_expression "interactive_shell == 0" (identifier "interactive_shell") (== "==") (number_literal "0")) (&& "&&") (parenthesized_expression "(param_1 == default_buffered_input)" (( "(") (binary_expression "param_1 == default_buffered_input" (identifier "param_1") (== "==") (identifier "default_buffered_input")) () ")"))) () ")")) () ")"))) () ")")) (|| "||") (parenthesized_expression "((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))\n     )" (( "(") (parenthesized_expression "(iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))" (( "(") (comma_expression "iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0)" (assignment_expression "iVar6 = *(int *)(iVar5 + param_1 * 4)" (identifier "iVar6") (= "=") (pointer_expression "*(int *)(iVar5 + param_1 * 4)" (* "*") (cast_expression "(int *)(iVar5 + param_1 * 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar5 + param_1 * 4)" (( "(") (binary_expression "iVar5 + param_1 * 4" (identifier "iVar5") (+ "+") (binary_expression "param_1 * 4" (identifier "param_1") (* "*") (number_literal "4"))) () ")"))))) (, ",") (binary_expression "iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0)" (binary_expression "iVar6 != 0" (identifier "iVar6") (!= "!=") (number_literal "0")) (&& "&&") (parenthesized_expression "((*(byte *)(iVar6 + 0x10) & 0x20) != 0)" (( "(") (binary_expression "(*(byte *)(iVar6 + 0x10) & 0x20) != 0" (parenthesized_expression "(*(byte *)(iVar6 + 0x10) & 0x20)" (( "(") (binary_expression "*(byte *)(iVar6 + 0x10) & 0x20" (pointer_expression "*(byte *)(iVar6 + 0x10)" (* "*") (cast_expression "(byte *)(iVar6 + 0x10)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar6 + 0x10)" (( "(") (binary_expression "iVar6 + 0x10" (identifier "iVar6") (+ "+") (number_literal "0x10")) () ")")))) (& "&") (number_literal "0x20")) () ")")) (!= "!=") (number_literal "0")) () ")")))) () ")")) () ")"))) () ")")) (compound_statement "{\n    piVar4[4] = piVar4[4] | 0x20;\n  }" ({ "{") (expression_statement "piVar4[4] = piVar4[4] | 0x20;" (assignment_expression "piVar4[4] = piVar4[4] | 0x20" (subscript_expression "piVar4[4]" (identifier "piVar4") ([ "[") (number_literal "4") (] "]")) (= "=") (binary_expression "piVar4[4] | 0x20" (subscript_expression "piVar4[4]" (identifier "piVar4") ([ "[") (number_literal "4") (] "]")) (| "|") (number_literal "0x20"))) (; ";")) (} "}")))) (return_statement "return param_2;" (return "return") (identifier "param_2") (; ";")) (} "}")))

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

int function_1(int var_1,int var_2)

{
  int var_6;
  int var_4;
  type_1 **ppBVar3;
  type_1 *var_10;
  type_1 **ppBVar5;
  type_1 **var_8;
  type_1 *var_11;
  bool var_16;
  bool var_17;
  
  var_6 = var_3;
  if (var_1 == var_2) {
    return 0;
  }
  var_4 = var_2;
  if (var_2 <= var_1) {
    var_4 = var_1;
  }
  var_8 = var_15;
  if (var_3 <= var_4) {
    var_3 = var_4 + 0x14;
    var_8 = (type_1 **)var_5(var_15,var_3 * 4);
    var_15 = var_8;
    if (var_6 < var_3) {
      var_7(var_8 + var_6,0,(var_3 - var_6) * 4);
    }
  }
  var_16 = bash_input.type != var_9;
  var_17 = bash_input.location.file != (type_2 *)var_2;
  ppBVar3 = var_8 + var_2;
  var_10 = *ppBVar3;
  ppBVar5 = var_8 + var_1;
  var_11 = *ppBVar5;
  if (var_10 != (type_1 *)0x0) {
    if (((var_11 == (type_1 *)0x0) || (var_11->b_buffer == (char *)0x0)) ||
       (var_11->b_buffer != var_10->b_buffer)) {
      var_6 = var_10->b_fd;
      if (((var_10->b_flag & 0x20) == 0) && (var_10->b_buffer != (char *)0x0)) {
        var_12(var_10->b_buffer);
      }
      var_12(var_10);
      var_8[var_6] = (type_1 *)0x0;
      var_11 = *ppBVar5;
    }
    else {
      *ppBVar3 = (type_1 *)0x0;
      var_11 = *ppBVar5;
    }
  }
  if (var_11 == (type_1 *)0x0) {
    var_10 = (type_1 *)0x0;
    ppBVar5 = ppBVar3;
  }
  else {
    var_10 = (type_1 *)var_13(0x18);
    var_14((char *)var_11,(char *)var_10,0x18);
    ppBVar5 = var_15 + var_2;
    var_8 = var_15;
  }
  *ppBVar3 = var_10;
  var_10 = *ppBVar5;
  if (var_10 == (type_1 *)0x0) {
    if (var_16 || var_17) goto LAB_0008d159;
    var_18(var_2);
    var_10 = var_15[var_2];
    var_8 = var_15;
  }
  else {
    var_10->b_fd = var_2;
    if (var_16 || var_17) goto LAB_0008d159;
  }
  var_10->b_flag = var_10->b_flag | 8;
LAB_0008d159:
  if ((((bash_input.type == var_9) && ((type_2 *)var_1 == bash_input.location.file)) ||
      ((var_19 == 0 && (var_1 == var_20)))) ||
     ((var_8[var_1] != (type_1 *)0x0 && ((var_8[var_1]->b_flag & 0x20) != 0)))) {
    var_10->b_flag = var_10->b_flag | 0x20;
  }
  return var_2;
}


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

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

int MASKED(int param_1,int param_2)

{
  int *__ptr;
  int iVar1;
  int *piVar2;
  int iVar3;
  int *piVar4;
  int iVar5;
  int iVar6;
  bool bVar7;
  bool bVar8;
  
  iVar6 = DAT_00179200;
  if (param_1 == param_2) {
    return 0;
  }
  iVar1 = param_2;
  if (param_2 <= param_1) {
    iVar1 = param_1;
  }
  iVar5 = DAT_00179204;
  if (DAT_00179200 <= iVar1) {
    DAT_00179200 = iVar1 + 0x14;
    iVar5 = xrealloc(DAT_00179204,DAT_00179200 * 4);
    DAT_00179204 = iVar5;
    if (iVar6 < DAT_00179200) {
      memset((void *)(iVar5 + iVar6 * 4),0,(DAT_00179200 - iVar6) * 4);
    }
  }
  bVar7 = bash_input != 4;
  bVar8 = DAT_0017ac84 != param_2;
  iVar1 = param_2 * 4;
  piVar2 = (int *)(iVar1 + iVar5);
  __ptr = (int *)*piVar2;
  piVar4 = (int *)(iVar5 + param_1 * 4);
  iVar6 = *piVar4;
  if (__ptr != (int *)0x0) {
    if (((iVar6 == 0) || (*(int *)(iVar6 + 4) == 0)) || (*(int *)(iVar6 + 4) != __ptr[1])) {
      iVar6 = *__ptr;
      if (((*(byte *)(__ptr + 4) & 0x20) == 0) && ((void *)__ptr[1] != (void *)0x0)) {
        free((void *)__ptr[1]);
      }
      free(__ptr);
      *(undefined4 *)(iVar5 + iVar6 * 4) = 0;
      iVar6 = *piVar4;
    }
    else {
      *piVar2 = 0;
      iVar6 = *piVar4;
    }
  }
  if (iVar6 == 0) {
    iVar3 = 0;
    piVar4 = piVar2;
  }
  else {
    iVar3 = xmalloc(0x18);
    xbcopy(iVar6,iVar3,0x18);
    piVar4 = (int *)(iVar1 + DAT_00179204);
    iVar5 = DAT_00179204;
  }
  *piVar2 = iVar3;
  piVar4 = (int *)*piVar4;
  if (piVar4 == (int *)0x0) {
    if (bVar7 || bVar8) goto LAB_0008d159;
    fd_to_buffered_stream(param_2);
    piVar4 = *(int **)(DAT_00179204 + iVar1);
    iVar5 = DAT_00179204;
  }
  else {
    *piVar4 = param_2;
    if (bVar7 || bVar8) goto LAB_0008d159;
  }
  piVar4[4] = piVar4[4] | 8;
LAB_0008d159:
  if ((((bash_input == 4) && (param_1 == DAT_0017ac84)) ||
      ((interactive_shell == 0 && (param_1 == default_buffered_input)))) ||
     ((iVar6 = *(int *)(iVar5 + param_1 * 4), iVar6 != 0 && ((*(byte *)(iVar6 + 0x10) & 0x20) != 0))
     )) {
    piVar4[4] = piVar4[4] | 0x20;
  }
  return param_2;
}

