
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

void ssh2_msg_channel_close(Ssh_conflict ssh,Packet *pktin)

{
  outstanding_channel_request *ptr;
  int iVar1;
  ssh_channel *c;
  uint uVar2;
  
  c = ssh_channel_msg(ssh,pktin);
  if (c != (ssh_channel *)0x0) {
    ssh_channel_got_eof(c);
    if ((ssh->remote_bugs & 0x800) == 0) {
      ptr = (c->v).v2.chanreq_head;
      while (ptr != (outstanding_channel_request *)0x0) {
        (*ptr->handler)(c,(Packet *)0x0,ptr->ctx);
        (c->v).v2.chanreq_head = ptr->next;
        safefree(ptr);
        ptr = (c->v).v2.chanreq_head;
      }
    }
    uVar2 = c->closes;
    if ((uVar2 & 1) == 0) {
      iVar1 = c->type;
      if (iVar1 == 1) {
        x11_override_throttle((c->u).x11.xconn,1);
      }
      else if (iVar1 == 3) {
        pfd_override_throttle((PortForwarding *)(c->u).a.inbuffer.head,1);
      }
      else if (iVar1 == 0) {
        ssh->send_ok = 0;
      }
      bufchain_clear(&(c->v).v2.outbuffer);
      uVar2 = c->closes;
      if ((c->ssh->state != CHAN_SHARING) && ((uVar2 & 1) == 0)) {
        c->pending_eof = 1;
        ssh_channel_try_eof(c);
        uVar2 = c->closes;
        if ((uVar2 & 8) != 0) {
          return;
        }
        goto LAB_000473f0;
      }
    }
    if ((uVar2 & 8) == 0) {
LAB_000473f0:
      c->closes = uVar2 | 8;
      ssh2_channel_check_close(c);
      return;
    }
  }
  return;
}



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

void FUN_00047340(int param_1)

{
  undefined4 *puVar1;
  int iVar2;
  int *piVar3;
  uint uVar4;
  
  piVar3 = (int *)FUN_00043d00();
  if (piVar3 != (int *)0x0) {
    FUN_00047210();
    if ((*(byte *)(param_1 + 0x51) & 8) == 0) {
      puVar1 = (undefined4 *)piVar3[0x10];
      while (puVar1 != (undefined4 *)0x0) {
        (*(code *)*puVar1)(piVar3,0,puVar1[1]);
        piVar3[0x10] = puVar1[2];
        FUN_0001dd30(puVar1);
        puVar1 = (undefined4 *)piVar3[0x10];
      }
    }
    uVar4 = piVar3[5];
    if ((uVar4 & 1) == 0) {
      iVar2 = piVar3[3];
      if (iVar2 == 1) {
        FUN_0008c7d0(piVar3[0x13],1);
      }
      else if (iVar2 == 3) {
        FUN_0001f630(piVar3[0x13],1);
      }
      else if (iVar2 == 0) {
        *(undefined4 *)(param_1 + 0x100) = 0;
      }
      FUN_0001d840(piVar3 + 8);
      uVar4 = piVar3[5];
      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {
        piVar3[6] = 1;
        FUN_000467d0();
        uVar4 = piVar3[5];
        if ((uVar4 & 8) != 0) {
          return;
        }
        goto LAB_000473f0;
      }
    }
    if ((uVar4 & 8) == 0) {
LAB_000473f0:
      piVar3[5] = uVar4 | 8;
      FUN_00044960();
      return;
    }
  }
  return;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x000149a0
ADD EBX,0x85a27
SUB ESP,0xc
MOV EBP,dword ptr [ESP + 0x20]
MOV EDX,dword ptr [ESP + 0x24]
MOV EAX,EBP
CALL 0x00043d00
TEST EAX,EAX
JZ 0x000473e4
MOV EDI,EAX
CALL 0x00047210
TEST byte ptr [EBP + 0x51],0x8
JNZ 0x000473a3
MOV ESI,dword ptr [EDI + 0x40]
TEST ESI,ESI
JZ 0x000473a3
LEA ESI,[ESI]
SUB ESP,0x4
PUSH dword ptr [ESI + 0x4]
PUSH 0x0
PUSH EDI
CALL dword ptr [ESI]
MOV EAX,dword ptr [ESI + 0x8]
MOV dword ptr [EDI + 0x40],EAX
MOV dword ptr [ESP],ESI
CALL 0x0001dd30
MOV ESI,dword ptr [EDI + 0x40]
ADD ESP,0x10
TEST ESI,ESI
JNZ 0x00047380
MOV EAX,dword ptr [EDI + 0x14]
TEST AL,0x1
JNZ 0x000473e0
MOV EAX,dword ptr [EDI + 0xc]
CMP EAX,0x1
JZ 0x00047448
CMP EAX,0x3
JZ 0x00047430
TEST EAX,EAX
JZ 0x00047420
SUB ESP,0xc
LEA EAX,[EDI + 0x20]
PUSH EAX
CALL 0x0001d840
MOV EAX,dword ptr [EDI]
ADD ESP,0x10
CMP dword ptr [EAX + 0x144],0x4
MOV EAX,dword ptr [EDI + 0x14]
JZ 0x000473e0
TEST AL,0x1
JZ 0x00047408
TEST AL,0x8
JZ 0x000473f0
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
OR EAX,0x8
MOV dword ptr [EDI + 0x14],EAX
ADD ESP,0xc
MOV EAX,EDI
POP EBX
POP ESI
POP EDI
POP EBP
JMP 0x00044960
MOV dword ptr [EDI + 0x18],0x1
MOV EAX,EDI
CALL 0x000467d0
MOV EAX,dword ptr [EDI + 0x14]
TEST AL,0x8
JNZ 0x000473e4
JMP 0x000473f0
MOV dword ptr [EBP + 0x100],0x0
JMP 0x000473bf
SUB ESP,0x8
PUSH 0x1
PUSH dword ptr [EDI + 0x4c]
CALL 0x0001f630
ADD ESP,0x10
JMP 0x000473bf
SUB ESP,0x8
PUSH 0x1
PUSH dword ptr [EDI + 0x4c]
CALL 0x0008c7d0
ADD ESP,0x10
JMP 0x000473bf
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_00047340(int param_1)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  int *piVar3;\n  uint uVar4;\n  \n  piVar3 = (int *)FUN_00043d00();\n  if (piVar3 != (int *)0x0) {\n    FUN_00047210();\n    if ((*(byte *)(param_1 + 0x51) & 8) == 0) {\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }\n    uVar4 = piVar3[5];\n    if ((uVar4 & 1) == 0) {\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar4 & 8) == 0) {\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }\n  }\n  return;\n}\n\n" comment (function_definition "void FUN_00047340(int param_1)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  int *piVar3;\n  uint uVar4;\n  \n  piVar3 = (int *)FUN_00043d00();\n  if (piVar3 != (int *)0x0) {\n    FUN_00047210();\n    if ((*(byte *)(param_1 + 0x51) & 8) == 0) {\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }\n    uVar4 = piVar3[5];\n    if ((uVar4 & 1) == 0) {\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar4 & 8) == 0) {\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }\n  }\n  return;\n}" primitive_type (function_declarator "FUN_00047340(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  int iVar2;\n  int *piVar3;\n  uint uVar4;\n  \n  piVar3 = (int *)FUN_00043d00();\n  if (piVar3 != (int *)0x0) {\n    FUN_00047210();\n    if ((*(byte *)(param_1 + 0x51) & 8) == 0) {\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }\n    uVar4 = piVar3[5];\n    if ((uVar4 & 1) == 0) {\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar4 & 8) == 0) {\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }\n  }\n  return;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "piVar3 = (int *)FUN_00043d00();" (assignment_expression "piVar3 = (int *)FUN_00043d00()" identifier = (cast_expression "(int *)FUN_00043d00()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00043d00()" identifier (argument_list "()" ( ))))) ;) (if_statement "if (piVar3 != (int *)0x0) {\n    FUN_00047210();\n    if ((*(byte *)(param_1 + 0x51) & 8) == 0) {\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }\n    uVar4 = piVar3[5];\n    if ((uVar4 & 1) == 0) {\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar4 & 8) == 0) {\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }\n  }" if (parenthesized_expression "(piVar3 != (int *)0x0)" ( (binary_expression "piVar3 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    FUN_00047210();\n    if ((*(byte *)(param_1 + 0x51) & 8) == 0) {\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }\n    uVar4 = piVar3[5];\n    if ((uVar4 & 1) == 0) {\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar4 & 8) == 0) {\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }\n  }" { (expression_statement "FUN_00047210();" (call_expression "FUN_00047210()" identifier (argument_list "()" ( ))) ;) (if_statement "if ((*(byte *)(param_1 + 0x51) & 8) == 0) {\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }" if (parenthesized_expression "((*(byte *)(param_1 + 0x51) & 8) == 0)" ( (binary_expression "(*(byte *)(param_1 + 0x51) & 8) == 0" (parenthesized_expression "(*(byte *)(param_1 + 0x51) & 8)" ( (binary_expression "*(byte *)(param_1 + 0x51) & 8" (pointer_expression "*(byte *)(param_1 + 0x51)" * (cast_expression "(byte *)(param_1 + 0x51)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x51)" ( (binary_expression "param_1 + 0x51" identifier + number_literal) )))) & number_literal) )) == number_literal) )) (compound_statement "{\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }" { (expression_statement "puVar1 = (undefined4 *)piVar3[0x10];" (assignment_expression "puVar1 = (undefined4 *)piVar3[0x10]" identifier = (cast_expression "(undefined4 *)piVar3[0x10]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar3[0x10]" identifier [ number_literal ]))) ;) (while_statement "while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }" while (parenthesized_expression "(puVar1 != (undefined4 *)0x0)" ( (binary_expression "puVar1 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }" { (expression_statement "(*(code *)*puVar1)(piVar3,0,puVar1[1]);" (call_expression "(*(code *)*puVar1)(piVar3,0,puVar1[1])" (parenthesized_expression "(*(code *)*puVar1)" ( (pointer_expression "*(code *)*puVar1" * (cast_expression "(code *)*puVar1" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*puVar1" * identifier))) )) (argument_list "(piVar3,0,puVar1[1])" ( identifier , number_literal , (subscript_expression "puVar1[1]" identifier [ number_literal ]) ))) ;) (expression_statement "piVar3[0x10] = puVar1[2];" (assignment_expression "piVar3[0x10] = puVar1[2]" (subscript_expression "piVar3[0x10]" identifier [ number_literal ]) = (subscript_expression "puVar1[2]" identifier [ number_literal ])) ;) (expression_statement "FUN_0001dd30(puVar1);" (call_expression "FUN_0001dd30(puVar1)" identifier (argument_list "(puVar1)" ( identifier ))) ;) (expression_statement "puVar1 = (undefined4 *)piVar3[0x10];" (assignment_expression "puVar1 = (undefined4 *)piVar3[0x10]" identifier = (cast_expression "(undefined4 *)piVar3[0x10]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar3[0x10]" identifier [ number_literal ]))) ;) })) })) (expression_statement "uVar4 = piVar3[5];" (assignment_expression "uVar4 = piVar3[5]" identifier = (subscript_expression "piVar3[5]" identifier [ number_literal ])) ;) (if_statement "if ((uVar4 & 1) == 0) {\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }" if (parenthesized_expression "((uVar4 & 1) == 0)" ( (binary_expression "(uVar4 & 1) == 0" (parenthesized_expression "(uVar4 & 1)" ( (binary_expression "uVar4 & 1" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }" { (expression_statement "iVar2 = piVar3[3];" (assignment_expression "iVar2 = piVar3[3]" identifier = (subscript_expression "piVar3[3]" identifier [ number_literal ])) ;) (if_statement "if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" if (parenthesized_expression "(iVar2 == 1)" ( (binary_expression "iVar2 == 1" identifier == number_literal) )) (compound_statement "{\n        FUN_0008c7d0(piVar3[0x13],1);\n      }" { (expression_statement "FUN_0008c7d0(piVar3[0x13],1);" (call_expression "FUN_0008c7d0(piVar3[0x13],1)" identifier (argument_list "(piVar3[0x13],1)" ( (subscript_expression "piVar3[0x13]" identifier [ number_literal ]) , number_literal ))) ;) }) (else_clause "else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" else (if_statement "if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" if (parenthesized_expression "(iVar2 == 3)" ( (binary_expression "iVar2 == 3" identifier == number_literal) )) (compound_statement "{\n        FUN_0001f630(piVar3[0x13],1);\n      }" { (expression_statement "FUN_0001f630(piVar3[0x13],1);" (call_expression "FUN_0001f630(piVar3[0x13],1)" identifier (argument_list "(piVar3[0x13],1)" ( (subscript_expression "piVar3[0x13]" identifier [ number_literal ]) , number_literal ))) ;) }) (else_clause "else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" else (if_statement "if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" { (expression_statement "*(undefined4 *)(param_1 + 0x100) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x100) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x100)" * (cast_expression "(undefined4 *)(param_1 + 0x100)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x100)" ( (binary_expression "param_1 + 0x100" identifier + number_literal) )))) = number_literal) ;) })))))) (expression_statement "FUN_0001d840(piVar3 + 8);" (call_expression "FUN_0001d840(piVar3 + 8)" identifier (argument_list "(piVar3 + 8)" ( (binary_expression "piVar3 + 8" identifier + number_literal) ))) ;) (expression_statement "uVar4 = piVar3[5];" (assignment_expression "uVar4 = piVar3[5]" identifier = (subscript_expression "piVar3[5]" identifier [ number_literal ])) ;) (if_statement "if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }" if (parenthesized_expression "((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0))" ( (binary_expression "(*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)" (parenthesized_expression "(*(int *)(*piVar3 + 0x144) != 4)" ( (binary_expression "*(int *)(*piVar3 + 0x144) != 4" (pointer_expression "*(int *)(*piVar3 + 0x144)" * (cast_expression "(int *)(*piVar3 + 0x144)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*piVar3 + 0x144)" ( (binary_expression "*piVar3 + 0x144" (pointer_expression "*piVar3" * identifier) + number_literal) )))) != number_literal) )) && (parenthesized_expression "((uVar4 & 1) == 0)" ( (binary_expression "(uVar4 & 1) == 0" (parenthesized_expression "(uVar4 & 1)" ( (binary_expression "uVar4 & 1" identifier & number_literal) )) == number_literal) ))) )) (compound_statement "{\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }" { (expression_statement "piVar3[6] = 1;" (assignment_expression "piVar3[6] = 1" (subscript_expression "piVar3[6]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "FUN_000467d0();" (call_expression "FUN_000467d0()" identifier (argument_list "()" ( ))) ;) (expression_statement "uVar4 = piVar3[5];" (assignment_expression "uVar4 = piVar3[5]" identifier = (subscript_expression "piVar3[5]" identifier [ number_literal ])) ;) (if_statement "if ((uVar4 & 8) != 0) {\n          return;\n        }" if (parenthesized_expression "((uVar4 & 8) != 0)" ( (binary_expression "(uVar4 & 8) != 0" (parenthesized_expression "(uVar4 & 8)" ( (binary_expression "uVar4 & 8" identifier & number_literal) )) != number_literal) )) (compound_statement "{\n          return;\n        }" { (return_statement "return;" return ;) })) (goto_statement "goto LAB_000473f0;" goto statement_identifier ;) })) })) (if_statement "if ((uVar4 & 8) == 0) {\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }" if (parenthesized_expression "((uVar4 & 8) == 0)" ( (binary_expression "(uVar4 & 8) == 0" (parenthesized_expression "(uVar4 & 8)" ( (binary_expression "uVar4 & 8" identifier & number_literal) )) == number_literal) )) (compound_statement "{\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }" { (labeled_statement "LAB_000473f0:\n      piVar3[5] = uVar4 | 8;" statement_identifier : (expression_statement "piVar3[5] = uVar4 | 8;" (assignment_expression "piVar3[5] = uVar4 | 8" (subscript_expression "piVar3[5]" identifier [ number_literal ]) = (binary_expression "uVar4 | 8" identifier | number_literal)) ;)) (expression_statement "FUN_00044960();" (call_expression "FUN_00044960()" identifier (argument_list "()" ( ))) ;) (return_statement "return;" return ;) })) })) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n/* WARNING: Enum "anon_enum_32": Some values do not have unique names */\n\nvoid ssh2_msg_channel_close(Ssh_conflict ssh,Packet *pktin)\n\n{\n  outstanding_channel_request *ptr;\n  int iVar1;\n  ssh_channel *c;\n  uint uVar2;\n  \n  c = ssh_channel_msg(ssh,pktin);\n  if (c != (ssh_channel *)0x0) {\n    ssh_channel_got_eof(c);\n    if ((ssh->remote_bugs & 0x800) == 0) {\n      ptr = (c->v).v2.chanreq_head;\n      while (ptr != (outstanding_channel_request *)0x0) {\n        (*ptr->handler)(c,(Packet *)0x0,ptr->ctx);\n        (c->v).v2.chanreq_head = ptr->next;\n        safefree(ptr);\n        ptr = (c->v).v2.chanreq_head;\n      }\n    }\n    uVar2 = c->closes;\n    if ((uVar2 & 1) == 0) {\n      iVar1 = c->type;\n      if (iVar1 == 1) {\n        x11_override_throttle((c->u).x11.xconn,1);\n      }\n      else if (iVar1 == 3) {\n        pfd_override_throttle((PortForwarding *)(c->u).a.inbuffer.head,1);\n      }\n      else if (iVar1 == 0) {\n        ssh->send_ok = 0;\n      }\n      bufchain_clear(&(c->v).v2.outbuffer);\n      uVar2 = c->closes;\n      if ((c->ssh->state != CHAN_SHARING) && ((uVar2 & 1) == 0)) {\n        c->pending_eof = 1;\n        ssh_channel_try_eof(c);\n        uVar2 = c->closes;\n        if ((uVar2 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar2 & 8) == 0) {\nLAB_000473f0:\n      c->closes = uVar2 | 8;\n      ssh2_channel_check_close(c);\n      return;\n    }\n  }\n  return;\n}\n\n" comment comment comment (function_definition "void ssh2_msg_channel_close(Ssh_conflict ssh,Packet *pktin)\n\n{\n  outstanding_channel_request *ptr;\n  int iVar1;\n  ssh_channel *c;\n  uint uVar2;\n  \n  c = ssh_channel_msg(ssh,pktin);\n  if (c != (ssh_channel *)0x0) {\n    ssh_channel_got_eof(c);\n    if ((ssh->remote_bugs & 0x800) == 0) {\n      ptr = (c->v).v2.chanreq_head;\n      while (ptr != (outstanding_channel_request *)0x0) {\n        (*ptr->handler)(c,(Packet *)0x0,ptr->ctx);\n        (c->v).v2.chanreq_head = ptr->next;\n        safefree(ptr);\n        ptr = (c->v).v2.chanreq_head;\n      }\n    }\n    uVar2 = c->closes;\n    if ((uVar2 & 1) == 0) {\n      iVar1 = c->type;\n      if (iVar1 == 1) {\n        x11_override_throttle((c->u).x11.xconn,1);\n      }\n      else if (iVar1 == 3) {\n        pfd_override_throttle((PortForwarding *)(c->u).a.inbuffer.head,1);\n      }\n      else if (iVar1 == 0) {\n        ssh->send_ok = 0;\n      }\n      bufchain_clear(&(c->v).v2.outbuffer);\n      uVar2 = c->closes;\n      if ((c->ssh->state != CHAN_SHARING) && ((uVar2 & 1) == 0)) {\n        c->pending_eof = 1;\n        ssh_channel_try_eof(c);\n        uVar2 = c->closes;\n        if ((uVar2 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar2 & 8) == 0) {\nLAB_000473f0:\n      c->closes = uVar2 | 8;\n      ssh2_channel_check_close(c);\n      return;\n    }\n  }\n  return;\n}" primitive_type (function_declarator "ssh2_msg_channel_close(Ssh_conflict ssh,Packet *pktin)" identifier (parameter_list "(Ssh_conflict ssh,Packet *pktin)" ( (parameter_declaration "Ssh_conflict ssh" type_identifier identifier) , (parameter_declaration "Packet *pktin" type_identifier (pointer_declarator "*pktin" * identifier)) ))) (compound_statement "{\n  outstanding_channel_request *ptr;\n  int iVar1;\n  ssh_channel *c;\n  uint uVar2;\n  \n  c = ssh_channel_msg(ssh,pktin);\n  if (c != (ssh_channel *)0x0) {\n    ssh_channel_got_eof(c);\n    if ((ssh->remote_bugs & 0x800) == 0) {\n      ptr = (c->v).v2.chanreq_head;\n      while (ptr != (outstanding_channel_request *)0x0) {\n        (*ptr->handler)(c,(Packet *)0x0,ptr->ctx);\n        (c->v).v2.chanreq_head = ptr->next;\n        safefree(ptr);\n        ptr = (c->v).v2.chanreq_head;\n      }\n    }\n    uVar2 = c->closes;\n    if ((uVar2 & 1) == 0) {\n      iVar1 = c->type;\n      if (iVar1 == 1) {\n        x11_override_throttle((c->u).x11.xconn,1);\n      }\n      else if (iVar1 == 3) {\n        pfd_override_throttle((PortForwarding *)(c->u).a.inbuffer.head,1);\n      }\n      else if (iVar1 == 0) {\n        ssh->send_ok = 0;\n      }\n      bufchain_clear(&(c->v).v2.outbuffer);\n      uVar2 = c->closes;\n      if ((c->ssh->state != CHAN_SHARING) && ((uVar2 & 1) == 0)) {\n        c->pending_eof = 1;\n        ssh_channel_try_eof(c);\n        uVar2 = c->closes;\n        if ((uVar2 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar2 & 8) == 0) {\nLAB_000473f0:\n      c->closes = uVar2 | 8;\n      ssh2_channel_check_close(c);\n      return;\n    }\n  }\n  return;\n}" { (declaration "outstanding_channel_request *ptr;" type_identifier (pointer_declarator "*ptr" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "ssh_channel *c;" type_identifier (pointer_declarator "*c" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (expression_statement "c = ssh_channel_msg(ssh,pktin);" (assignment_expression "c = ssh_channel_msg(ssh,pktin)" identifier = (call_expression "ssh_channel_msg(ssh,pktin)" identifier (argument_list "(ssh,pktin)" ( identifier , identifier )))) ;) (if_statement "if (c != (ssh_channel *)0x0) {\n    ssh_channel_got_eof(c);\n    if ((ssh->remote_bugs & 0x800) == 0) {\n      ptr = (c->v).v2.chanreq_head;\n      while (ptr != (outstanding_channel_request *)0x0) {\n        (*ptr->handler)(c,(Packet *)0x0,ptr->ctx);\n        (c->v).v2.chanreq_head = ptr->next;\n        safefree(ptr);\n        ptr = (c->v).v2.chanreq_head;\n      }\n    }\n    uVar2 = c->closes;\n    if ((uVar2 & 1) == 0) {\n      iVar1 = c->type;\n      if (iVar1 == 1) {\n        x11_override_throttle((c->u).x11.xconn,1);\n      }\n      else if (iVar1 == 3) {\n        pfd_override_throttle((PortForwarding *)(c->u).a.inbuffer.head,1);\n      }\n      else if (iVar1 == 0) {\n        ssh->send_ok = 0;\n      }\n      bufchain_clear(&(c->v).v2.outbuffer);\n      uVar2 = c->closes;\n      if ((c->ssh->state != CHAN_SHARING) && ((uVar2 & 1) == 0)) {\n        c->pending_eof = 1;\n        ssh_channel_try_eof(c);\n        uVar2 = c->closes;\n        if ((uVar2 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar2 & 8) == 0) {\nLAB_000473f0:\n      c->closes = uVar2 | 8;\n      ssh2_channel_check_close(c);\n      return;\n    }\n  }" if (parenthesized_expression "(c != (ssh_channel *)0x0)" ( (binary_expression "c != (ssh_channel *)0x0" identifier != (cast_expression "(ssh_channel *)0x0" ( (type_descriptor "ssh_channel *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    ssh_channel_got_eof(c);\n    if ((ssh->remote_bugs & 0x800) == 0) {\n      ptr = (c->v).v2.chanreq_head;\n      while (ptr != (outstanding_channel_request *)0x0) {\n        (*ptr->handler)(c,(Packet *)0x0,ptr->ctx);\n        (c->v).v2.chanreq_head = ptr->next;\n        safefree(ptr);\n        ptr = (c->v).v2.chanreq_head;\n      }\n    }\n    uVar2 = c->closes;\n    if ((uVar2 & 1) == 0) {\n      iVar1 = c->type;\n      if (iVar1 == 1) {\n        x11_override_throttle((c->u).x11.xconn,1);\n      }\n      else if (iVar1 == 3) {\n        pfd_override_throttle((PortForwarding *)(c->u).a.inbuffer.head,1);\n      }\n      else if (iVar1 == 0) {\n        ssh->send_ok = 0;\n      }\n      bufchain_clear(&(c->v).v2.outbuffer);\n      uVar2 = c->closes;\n      if ((c->ssh->state != CHAN_SHARING) && ((uVar2 & 1) == 0)) {\n        c->pending_eof = 1;\n        ssh_channel_try_eof(c);\n        uVar2 = c->closes;\n        if ((uVar2 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar2 & 8) == 0) {\nLAB_000473f0:\n      c->closes = uVar2 | 8;\n      ssh2_channel_check_close(c);\n      return;\n    }\n  }" { (expression_statement "ssh_channel_got_eof(c);" (call_expression "ssh_channel_got_eof(c)" identifier (argument_list "(c)" ( identifier ))) ;) (if_statement "if ((ssh->remote_bugs & 0x800) == 0) {\n      ptr = (c->v).v2.chanreq_head;\n      while (ptr != (outstanding_channel_request *)0x0) {\n        (*ptr->handler)(c,(Packet *)0x0,ptr->ctx);\n        (c->v).v2.chanreq_head = ptr->next;\n        safefree(ptr);\n        ptr = (c->v).v2.chanreq_head;\n      }\n    }" if (parenthesized_expression "((ssh->remote_bugs & 0x800) == 0)" ( (binary_expression "(ssh->remote_bugs & 0x800) == 0" (parenthesized_expression "(ssh->remote_bugs & 0x800)" ( (binary_expression "ssh->remote_bugs & 0x800" (field_expression "ssh->remote_bugs" identifier -> field_identifier) & number_literal) )) == number_literal) )) (compound_statement "{\n      ptr = (c->v).v2.chanreq_head;\n      while (ptr != (outstanding_channel_request *)0x0) {\n        (*ptr->handler)(c,(Packet *)0x0,ptr->ctx);\n        (c->v).v2.chanreq_head = ptr->next;\n        safefree(ptr);\n        ptr = (c->v).v2.chanreq_head;\n      }\n    }" { (expression_statement "ptr = (c->v).v2.chanreq_head;" (assignment_expression "ptr = (c->v).v2.chanreq_head" identifier = (field_expression "(c->v).v2.chanreq_head" (field_expression "(c->v).v2" (parenthesized_expression "(c->v)" ( (field_expression "c->v" identifier -> field_identifier) )) . field_identifier) . field_identifier)) ;) (while_statement "while (ptr != (outstanding_channel_request *)0x0) {\n        (*ptr->handler)(c,(Packet *)0x0,ptr->ctx);\n        (c->v).v2.chanreq_head = ptr->next;\n        safefree(ptr);\n        ptr = (c->v).v2.chanreq_head;\n      }" while (parenthesized_expression "(ptr != (outstanding_channel_request *)0x0)" ( (binary_expression "ptr != (outstanding_channel_request *)0x0" identifier != (cast_expression "(outstanding_channel_request *)0x0" ( (type_descriptor "outstanding_channel_request *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        (*ptr->handler)(c,(Packet *)0x0,ptr->ctx);\n        (c->v).v2.chanreq_head = ptr->next;\n        safefree(ptr);\n        ptr = (c->v).v2.chanreq_head;\n      }" { (expression_statement "(*ptr->handler)(c,(Packet *)0x0,ptr->ctx);" (call_expression "(*ptr->handler)(c,(Packet *)0x0,ptr->ctx)" (parenthesized_expression "(*ptr->handler)" ( (pointer_expression "*ptr->handler" * (field_expression "ptr->handler" identifier -> field_identifier)) )) (argument_list "(c,(Packet *)0x0,ptr->ctx)" ( identifier , (cast_expression "(Packet *)0x0" ( (type_descriptor "Packet *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) , (field_expression "ptr->ctx" identifier -> field_identifier) ))) ;) (expression_statement "(c->v).v2.chanreq_head = ptr->next;" (assignment_expression "(c->v).v2.chanreq_head = ptr->next" (field_expression "(c->v).v2.chanreq_head" (field_expression "(c->v).v2" (parenthesized_expression "(c->v)" ( (field_expression "c->v" identifier -> field_identifier) )) . field_identifier) . field_identifier) = (field_expression "ptr->next" identifier -> field_identifier)) ;) (expression_statement "safefree(ptr);" (call_expression "safefree(ptr)" identifier (argument_list "(ptr)" ( identifier ))) ;) (expression_statement "ptr = (c->v).v2.chanreq_head;" (assignment_expression "ptr = (c->v).v2.chanreq_head" identifier = (field_expression "(c->v).v2.chanreq_head" (field_expression "(c->v).v2" (parenthesized_expression "(c->v)" ( (field_expression "c->v" identifier -> field_identifier) )) . field_identifier) . field_identifier)) ;) })) })) (expression_statement "uVar2 = c->closes;" (assignment_expression "uVar2 = c->closes" identifier = (field_expression "c->closes" identifier -> field_identifier)) ;) (if_statement "if ((uVar2 & 1) == 0) {\n      iVar1 = c->type;\n      if (iVar1 == 1) {\n        x11_override_throttle((c->u).x11.xconn,1);\n      }\n      else if (iVar1 == 3) {\n        pfd_override_throttle((PortForwarding *)(c->u).a.inbuffer.head,1);\n      }\n      else if (iVar1 == 0) {\n        ssh->send_ok = 0;\n      }\n      bufchain_clear(&(c->v).v2.outbuffer);\n      uVar2 = c->closes;\n      if ((c->ssh->state != CHAN_SHARING) && ((uVar2 & 1) == 0)) {\n        c->pending_eof = 1;\n        ssh_channel_try_eof(c);\n        uVar2 = c->closes;\n        if ((uVar2 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }" if (parenthesized_expression "((uVar2 & 1) == 0)" ( (binary_expression "(uVar2 & 1) == 0" (parenthesized_expression "(uVar2 & 1)" ( (binary_expression "uVar2 & 1" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n      iVar1 = c->type;\n      if (iVar1 == 1) {\n        x11_override_throttle((c->u).x11.xconn,1);\n      }\n      else if (iVar1 == 3) {\n        pfd_override_throttle((PortForwarding *)(c->u).a.inbuffer.head,1);\n      }\n      else if (iVar1 == 0) {\n        ssh->send_ok = 0;\n      }\n      bufchain_clear(&(c->v).v2.outbuffer);\n      uVar2 = c->closes;\n      if ((c->ssh->state != CHAN_SHARING) && ((uVar2 & 1) == 0)) {\n        c->pending_eof = 1;\n        ssh_channel_try_eof(c);\n        uVar2 = c->closes;\n        if ((uVar2 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }" { (expression_statement "iVar1 = c->type;" (assignment_expression "iVar1 = c->type" identifier = (field_expression "c->type" identifier -> field_identifier)) ;) (if_statement "if (iVar1 == 1) {\n        x11_override_throttle((c->u).x11.xconn,1);\n      }\n      else if (iVar1 == 3) {\n        pfd_override_throttle((PortForwarding *)(c->u).a.inbuffer.head,1);\n      }\n      else if (iVar1 == 0) {\n        ssh->send_ok = 0;\n      }" if (parenthesized_expression "(iVar1 == 1)" ( (binary_expression "iVar1 == 1" identifier == number_literal) )) (compound_statement "{\n        x11_override_throttle((c->u).x11.xconn,1);\n      }" { (expression_statement "x11_override_throttle((c->u).x11.xconn,1);" (call_expression "x11_override_throttle((c->u).x11.xconn,1)" identifier (argument_list "((c->u).x11.xconn,1)" ( (field_expression "(c->u).x11.xconn" (field_expression "(c->u).x11" (parenthesized_expression "(c->u)" ( (field_expression "c->u" identifier -> field_identifier) )) . field_identifier) . field_identifier) , number_literal ))) ;) }) (else_clause "else if (iVar1 == 3) {\n        pfd_override_throttle((PortForwarding *)(c->u).a.inbuffer.head,1);\n      }\n      else if (iVar1 == 0) {\n        ssh->send_ok = 0;\n      }" else (if_statement "if (iVar1 == 3) {\n        pfd_override_throttle((PortForwarding *)(c->u).a.inbuffer.head,1);\n      }\n      else if (iVar1 == 0) {\n        ssh->send_ok = 0;\n      }" if (parenthesized_expression "(iVar1 == 3)" ( (binary_expression "iVar1 == 3" identifier == number_literal) )) (compound_statement "{\n        pfd_override_throttle((PortForwarding *)(c->u).a.inbuffer.head,1);\n      }" { (expression_statement "pfd_override_throttle((PortForwarding *)(c->u).a.inbuffer.head,1);" (call_expression "pfd_override_throttle((PortForwarding *)(c->u).a.inbuffer.head,1)" identifier (argument_list "((PortForwarding *)(c->u).a.inbuffer.head,1)" ( (cast_expression "(PortForwarding *)(c->u).a.inbuffer.head" ( (type_descriptor "PortForwarding *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "(c->u).a.inbuffer.head" (field_expression "(c->u).a.inbuffer" (field_expression "(c->u).a" (parenthesized_expression "(c->u)" ( (field_expression "c->u" identifier -> field_identifier) )) . field_identifier) . field_identifier) . field_identifier)) , number_literal ))) ;) }) (else_clause "else if (iVar1 == 0) {\n        ssh->send_ok = 0;\n      }" else (if_statement "if (iVar1 == 0) {\n        ssh->send_ok = 0;\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        ssh->send_ok = 0;\n      }" { (expression_statement "ssh->send_ok = 0;" (assignment_expression "ssh->send_ok = 0" (field_expression "ssh->send_ok" identifier -> field_identifier) = number_literal) ;) })))))) (expression_statement "bufchain_clear(&(c->v).v2.outbuffer);" (call_expression "bufchain_clear(&(c->v).v2.outbuffer)" identifier (argument_list "(&(c->v).v2.outbuffer)" ( (pointer_expression "&(c->v).v2.outbuffer" & (field_expression "(c->v).v2.outbuffer" (field_expression "(c->v).v2" (parenthesized_expression "(c->v)" ( (field_expression "c->v" identifier -> field_identifier) )) . field_identifier) . field_identifier)) ))) ;) (expression_statement "uVar2 = c->closes;" (assignment_expression "uVar2 = c->closes" identifier = (field_expression "c->closes" identifier -> field_identifier)) ;) (if_statement "if ((c->ssh->state != CHAN_SHARING) && ((uVar2 & 1) == 0)) {\n        c->pending_eof = 1;\n        ssh_channel_try_eof(c);\n        uVar2 = c->closes;\n        if ((uVar2 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }" if (parenthesized_expression "((c->ssh->state != CHAN_SHARING) && ((uVar2 & 1) == 0))" ( (binary_expression "(c->ssh->state != CHAN_SHARING) && ((uVar2 & 1) == 0)" (parenthesized_expression "(c->ssh->state != CHAN_SHARING)" ( (binary_expression "c->ssh->state != CHAN_SHARING" (field_expression "c->ssh->state" (field_expression "c->ssh" identifier -> field_identifier) -> field_identifier) != identifier) )) && (parenthesized_expression "((uVar2 & 1) == 0)" ( (binary_expression "(uVar2 & 1) == 0" (parenthesized_expression "(uVar2 & 1)" ( (binary_expression "uVar2 & 1" identifier & number_literal) )) == number_literal) ))) )) (compound_statement "{\n        c->pending_eof = 1;\n        ssh_channel_try_eof(c);\n        uVar2 = c->closes;\n        if ((uVar2 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }" { (expression_statement "c->pending_eof = 1;" (assignment_expression "c->pending_eof = 1" (field_expression "c->pending_eof" identifier -> field_identifier) = number_literal) ;) (expression_statement "ssh_channel_try_eof(c);" (call_expression "ssh_channel_try_eof(c)" identifier (argument_list "(c)" ( identifier ))) ;) (expression_statement "uVar2 = c->closes;" (assignment_expression "uVar2 = c->closes" identifier = (field_expression "c->closes" identifier -> field_identifier)) ;) (if_statement "if ((uVar2 & 8) != 0) {\n          return;\n        }" if (parenthesized_expression "((uVar2 & 8) != 0)" ( (binary_expression "(uVar2 & 8) != 0" (parenthesized_expression "(uVar2 & 8)" ( (binary_expression "uVar2 & 8" identifier & number_literal) )) != number_literal) )) (compound_statement "{\n          return;\n        }" { (return_statement "return;" return ;) })) (goto_statement "goto LAB_000473f0;" goto statement_identifier ;) })) })) (if_statement "if ((uVar2 & 8) == 0) {\nLAB_000473f0:\n      c->closes = uVar2 | 8;\n      ssh2_channel_check_close(c);\n      return;\n    }" if (parenthesized_expression "((uVar2 & 8) == 0)" ( (binary_expression "(uVar2 & 8) == 0" (parenthesized_expression "(uVar2 & 8)" ( (binary_expression "uVar2 & 8" identifier & number_literal) )) == number_literal) )) (compound_statement "{\nLAB_000473f0:\n      c->closes = uVar2 | 8;\n      ssh2_channel_check_close(c);\n      return;\n    }" { (labeled_statement "LAB_000473f0:\n      c->closes = uVar2 | 8;" statement_identifier : (expression_statement "c->closes = uVar2 | 8;" (assignment_expression "c->closes = uVar2 | 8" (field_expression "c->closes" identifier -> field_identifier) = (binary_expression "uVar2 | 8" identifier | number_literal)) ;)) (expression_statement "ssh2_channel_check_close(c);" (call_expression "ssh2_channel_check_close(c)" identifier (argument_list "(c)" ( identifier ))) ;) (return_statement "return;" return ;) })) })) (return_statement "return;" return ;) })))
(translation_unit "void FUN_00047340(int param_1)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  int *piVar3;\n  uint uVar4;\n  \n  piVar3 = (int *)FUN_00043d00();\n  if (piVar3 != (int *)0x0) {\n    FUN_00047210();\n    if ((*(byte *)(param_1 + 0x51) & 8) == 0) {\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }\n    uVar4 = piVar3[5];\n    if ((uVar4 & 1) == 0) {\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar4 & 8) == 0) {\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }\n  }\n  return;\n}\n\n" (function_definition "void FUN_00047340(int param_1)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  int *piVar3;\n  uint uVar4;\n  \n  piVar3 = (int *)FUN_00043d00();\n  if (piVar3 != (int *)0x0) {\n    FUN_00047210();\n    if ((*(byte *)(param_1 + 0x51) & 8) == 0) {\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }\n    uVar4 = piVar3[5];\n    if ((uVar4 & 1) == 0) {\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar4 & 8) == 0) {\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }\n  }\n  return;\n}" primitive_type (function_declarator "FUN_00047340(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  int iVar2;\n  int *piVar3;\n  uint uVar4;\n  \n  piVar3 = (int *)FUN_00043d00();\n  if (piVar3 != (int *)0x0) {\n    FUN_00047210();\n    if ((*(byte *)(param_1 + 0x51) & 8) == 0) {\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }\n    uVar4 = piVar3[5];\n    if ((uVar4 & 1) == 0) {\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar4 & 8) == 0) {\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }\n  }\n  return;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "piVar3 = (int *)FUN_00043d00();" (assignment_expression "piVar3 = (int *)FUN_00043d00()" identifier = (cast_expression "(int *)FUN_00043d00()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00043d00()" identifier (argument_list "()" ( ))))) ;) (if_statement "if (piVar3 != (int *)0x0) {\n    FUN_00047210();\n    if ((*(byte *)(param_1 + 0x51) & 8) == 0) {\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }\n    uVar4 = piVar3[5];\n    if ((uVar4 & 1) == 0) {\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar4 & 8) == 0) {\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }\n  }" if (parenthesized_expression "(piVar3 != (int *)0x0)" ( (binary_expression "piVar3 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    FUN_00047210();\n    if ((*(byte *)(param_1 + 0x51) & 8) == 0) {\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }\n    uVar4 = piVar3[5];\n    if ((uVar4 & 1) == 0) {\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar4 & 8) == 0) {\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }\n  }" { (expression_statement "FUN_00047210();" (call_expression "FUN_00047210()" identifier (argument_list "()" ( ))) ;) (if_statement "if ((*(byte *)(param_1 + 0x51) & 8) == 0) {\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }" if (parenthesized_expression "((*(byte *)(param_1 + 0x51) & 8) == 0)" ( (binary_expression "(*(byte *)(param_1 + 0x51) & 8) == 0" (parenthesized_expression "(*(byte *)(param_1 + 0x51) & 8)" ( (binary_expression "*(byte *)(param_1 + 0x51) & 8" (pointer_expression "*(byte *)(param_1 + 0x51)" * (cast_expression "(byte *)(param_1 + 0x51)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x51)" ( (binary_expression "param_1 + 0x51" identifier + number_literal) )))) & number_literal) )) == number_literal) )) (compound_statement "{\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }" { (expression_statement "puVar1 = (undefined4 *)piVar3[0x10];" (assignment_expression "puVar1 = (undefined4 *)piVar3[0x10]" identifier = (cast_expression "(undefined4 *)piVar3[0x10]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar3[0x10]" identifier [ number_literal ]))) ;) (while_statement "while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }" while (parenthesized_expression "(puVar1 != (undefined4 *)0x0)" ( (binary_expression "puVar1 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }" { (expression_statement "(*(code *)*puVar1)(piVar3,0,puVar1[1]);" (call_expression "(*(code *)*puVar1)(piVar3,0,puVar1[1])" (parenthesized_expression "(*(code *)*puVar1)" ( (pointer_expression "*(code *)*puVar1" * (cast_expression "(code *)*puVar1" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*puVar1" * identifier))) )) (argument_list "(piVar3,0,puVar1[1])" ( identifier , number_literal , (subscript_expression "puVar1[1]" identifier [ number_literal ]) ))) ;) (expression_statement "piVar3[0x10] = puVar1[2];" (assignment_expression "piVar3[0x10] = puVar1[2]" (subscript_expression "piVar3[0x10]" identifier [ number_literal ]) = (subscript_expression "puVar1[2]" identifier [ number_literal ])) ;) (expression_statement "FUN_0001dd30(puVar1);" (call_expression "FUN_0001dd30(puVar1)" identifier (argument_list "(puVar1)" ( identifier ))) ;) (expression_statement "puVar1 = (undefined4 *)piVar3[0x10];" (assignment_expression "puVar1 = (undefined4 *)piVar3[0x10]" identifier = (cast_expression "(undefined4 *)piVar3[0x10]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar3[0x10]" identifier [ number_literal ]))) ;) })) })) (expression_statement "uVar4 = piVar3[5];" (assignment_expression "uVar4 = piVar3[5]" identifier = (subscript_expression "piVar3[5]" identifier [ number_literal ])) ;) (if_statement "if ((uVar4 & 1) == 0) {\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }" if (parenthesized_expression "((uVar4 & 1) == 0)" ( (binary_expression "(uVar4 & 1) == 0" (parenthesized_expression "(uVar4 & 1)" ( (binary_expression "uVar4 & 1" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }" { (expression_statement "iVar2 = piVar3[3];" (assignment_expression "iVar2 = piVar3[3]" identifier = (subscript_expression "piVar3[3]" identifier [ number_literal ])) ;) (if_statement "if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" if (parenthesized_expression "(iVar2 == 1)" ( (binary_expression "iVar2 == 1" identifier == number_literal) )) (compound_statement "{\n        FUN_0008c7d0(piVar3[0x13],1);\n      }" { (expression_statement "FUN_0008c7d0(piVar3[0x13],1);" (call_expression "FUN_0008c7d0(piVar3[0x13],1)" identifier (argument_list "(piVar3[0x13],1)" ( (subscript_expression "piVar3[0x13]" identifier [ number_literal ]) , number_literal ))) ;) }) (else_clause "else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" else (if_statement "if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" if (parenthesized_expression "(iVar2 == 3)" ( (binary_expression "iVar2 == 3" identifier == number_literal) )) (compound_statement "{\n        FUN_0001f630(piVar3[0x13],1);\n      }" { (expression_statement "FUN_0001f630(piVar3[0x13],1);" (call_expression "FUN_0001f630(piVar3[0x13],1)" identifier (argument_list "(piVar3[0x13],1)" ( (subscript_expression "piVar3[0x13]" identifier [ number_literal ]) , number_literal ))) ;) }) (else_clause "else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" else (if_statement "if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" { (expression_statement "*(undefined4 *)(param_1 + 0x100) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x100) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x100)" * (cast_expression "(undefined4 *)(param_1 + 0x100)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x100)" ( (binary_expression "param_1 + 0x100" identifier + number_literal) )))) = number_literal) ;) })))))) (expression_statement "FUN_0001d840(piVar3 + 8);" (call_expression "FUN_0001d840(piVar3 + 8)" identifier (argument_list "(piVar3 + 8)" ( (binary_expression "piVar3 + 8" identifier + number_literal) ))) ;) (expression_statement "uVar4 = piVar3[5];" (assignment_expression "uVar4 = piVar3[5]" identifier = (subscript_expression "piVar3[5]" identifier [ number_literal ])) ;) (if_statement "if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }" if (parenthesized_expression "((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0))" ( (binary_expression "(*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)" (parenthesized_expression "(*(int *)(*piVar3 + 0x144) != 4)" ( (binary_expression "*(int *)(*piVar3 + 0x144) != 4" (pointer_expression "*(int *)(*piVar3 + 0x144)" * (cast_expression "(int *)(*piVar3 + 0x144)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*piVar3 + 0x144)" ( (binary_expression "*piVar3 + 0x144" (pointer_expression "*piVar3" * identifier) + number_literal) )))) != number_literal) )) && (parenthesized_expression "((uVar4 & 1) == 0)" ( (binary_expression "(uVar4 & 1) == 0" (parenthesized_expression "(uVar4 & 1)" ( (binary_expression "uVar4 & 1" identifier & number_literal) )) == number_literal) ))) )) (compound_statement "{\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }" { (expression_statement "piVar3[6] = 1;" (assignment_expression "piVar3[6] = 1" (subscript_expression "piVar3[6]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "FUN_000467d0();" (call_expression "FUN_000467d0()" identifier (argument_list "()" ( ))) ;) (expression_statement "uVar4 = piVar3[5];" (assignment_expression "uVar4 = piVar3[5]" identifier = (subscript_expression "piVar3[5]" identifier [ number_literal ])) ;) (if_statement "if ((uVar4 & 8) != 0) {\n          return;\n        }" if (parenthesized_expression "((uVar4 & 8) != 0)" ( (binary_expression "(uVar4 & 8) != 0" (parenthesized_expression "(uVar4 & 8)" ( (binary_expression "uVar4 & 8" identifier & number_literal) )) != number_literal) )) (compound_statement "{\n          return;\n        }" { (return_statement "return;" return ;) })) (goto_statement "goto LAB_000473f0;" goto statement_identifier ;) })) })) (if_statement "if ((uVar4 & 8) == 0) {\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }" if (parenthesized_expression "((uVar4 & 8) == 0)" ( (binary_expression "(uVar4 & 8) == 0" (parenthesized_expression "(uVar4 & 8)" ( (binary_expression "uVar4 & 8" identifier & number_literal) )) == number_literal) )) (compound_statement "{\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }" { (labeled_statement "LAB_000473f0:\n      piVar3[5] = uVar4 | 8;" statement_identifier : (expression_statement "piVar3[5] = uVar4 | 8;" (assignment_expression "piVar3[5] = uVar4 | 8" (subscript_expression "piVar3[5]" identifier [ number_literal ]) = (binary_expression "uVar4 | 8" identifier | number_literal)) ;)) (expression_statement "FUN_00044960();" (call_expression "FUN_00044960()" identifier (argument_list "()" ( ))) ;) (return_statement "return;" return ;) })) })) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) (if_statement if (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 IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (while_statement while (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) )) (argument_list ( IDENT , LIT , (subscript_expression IDENT [ LIT ]) ))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) })) })) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (subscript_expression IDENT [ LIT ]) , LIT ))) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (subscript_expression IDENT [ LIT ]) , LIT ))) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) })))))) (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) ))) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) )))) != LIT) )) && (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) ))) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) != LIT) )) (compound_statement { (return_statement return ;) })) (goto_statement goto statement_identifier ;) })) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT | LIT)) ;)) (expression_statement (call_expression IDENT (argument_list ( ))) ;) (return_statement return ;) })) })) (return_statement return ;) })))
(function_definition "void FUN_00047340(int param_1)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  int *piVar3;\n  uint uVar4;\n  \n  piVar3 = (int *)FUN_00043d00();\n  if (piVar3 != (int *)0x0) {\n    FUN_00047210();\n    if ((*(byte *)(param_1 + 0x51) & 8) == 0) {\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }\n    uVar4 = piVar3[5];\n    if ((uVar4 & 1) == 0) {\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar4 & 8) == 0) {\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }\n  }\n  return;\n}" (primitive_type "void") (function_declarator "FUN_00047340(int param_1)" (identifier "FUN_00047340") (parameter_list "(int param_1)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) () ")"))) (compound_statement "{\n  undefined4 *puVar1;\n  int iVar2;\n  int *piVar3;\n  uint uVar4;\n  \n  piVar3 = (int *)FUN_00043d00();\n  if (piVar3 != (int *)0x0) {\n    FUN_00047210();\n    if ((*(byte *)(param_1 + 0x51) & 8) == 0) {\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }\n    uVar4 = piVar3[5];\n    if ((uVar4 & 1) == 0) {\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar4 & 8) == 0) {\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }\n  }\n  return;\n}" ({ "{") (declaration "undefined4 *puVar1;" (type_identifier "undefined4") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (expression_statement "piVar3 = (int *)FUN_00043d00();" (assignment_expression "piVar3 = (int *)FUN_00043d00()" (identifier "piVar3") (= "=") (cast_expression "(int *)FUN_00043d00()" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_00043d00()" (identifier "FUN_00043d00") (argument_list "()" (( "(") () ")"))))) (; ";")) (if_statement "if (piVar3 != (int *)0x0) {\n    FUN_00047210();\n    if ((*(byte *)(param_1 + 0x51) & 8) == 0) {\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }\n    uVar4 = piVar3[5];\n    if ((uVar4 & 1) == 0) {\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar4 & 8) == 0) {\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }\n  }" (if "if") (parenthesized_expression "(piVar3 != (int *)0x0)" (( "(") (binary_expression "piVar3 != (int *)0x0" (identifier "piVar3") (!= "!=") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    FUN_00047210();\n    if ((*(byte *)(param_1 + 0x51) & 8) == 0) {\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }\n    uVar4 = piVar3[5];\n    if ((uVar4 & 1) == 0) {\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }\n    if ((uVar4 & 8) == 0) {\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }\n  }" ({ "{") (expression_statement "FUN_00047210();" (call_expression "FUN_00047210()" (identifier "FUN_00047210") (argument_list "()" (( "(") () ")"))) (; ";")) (if_statement "if ((*(byte *)(param_1 + 0x51) & 8) == 0) {\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }" (if "if") (parenthesized_expression "((*(byte *)(param_1 + 0x51) & 8) == 0)" (( "(") (binary_expression "(*(byte *)(param_1 + 0x51) & 8) == 0" (parenthesized_expression "(*(byte *)(param_1 + 0x51) & 8)" (( "(") (binary_expression "*(byte *)(param_1 + 0x51) & 8" (pointer_expression "*(byte *)(param_1 + 0x51)" (* "*") (cast_expression "(byte *)(param_1 + 0x51)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x51)" (( "(") (binary_expression "param_1 + 0x51" (identifier "param_1") (+ "+") (number_literal "0x51")) () ")")))) (& "&") (number_literal "8")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      puVar1 = (undefined4 *)piVar3[0x10];\n      while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }\n    }" ({ "{") (expression_statement "puVar1 = (undefined4 *)piVar3[0x10];" (assignment_expression "puVar1 = (undefined4 *)piVar3[0x10]" (identifier "puVar1") (= "=") (cast_expression "(undefined4 *)piVar3[0x10]" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "piVar3[0x10]" (identifier "piVar3") ([ "[") (number_literal "0x10") (] "]")))) (; ";")) (while_statement "while (puVar1 != (undefined4 *)0x0) {\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }" (while "while") (parenthesized_expression "(puVar1 != (undefined4 *)0x0)" (( "(") (binary_expression "puVar1 != (undefined4 *)0x0" (identifier "puVar1") (!= "!=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        (*(code *)*puVar1)(piVar3,0,puVar1[1]);\n        piVar3[0x10] = puVar1[2];\n        FUN_0001dd30(puVar1);\n        puVar1 = (undefined4 *)piVar3[0x10];\n      }" ({ "{") (expression_statement "(*(code *)*puVar1)(piVar3,0,puVar1[1]);" (call_expression "(*(code *)*puVar1)(piVar3,0,puVar1[1])" (parenthesized_expression "(*(code *)*puVar1)" (( "(") (pointer_expression "*(code *)*puVar1" (* "*") (cast_expression "(code *)*puVar1" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*puVar1" (* "*") (identifier "puVar1")))) () ")")) (argument_list "(piVar3,0,puVar1[1])" (( "(") (identifier "piVar3") (, ",") (number_literal "0") (, ",") (subscript_expression "puVar1[1]" (identifier "puVar1") ([ "[") (number_literal "1") (] "]")) () ")"))) (; ";")) (expression_statement "piVar3[0x10] = puVar1[2];" (assignment_expression "piVar3[0x10] = puVar1[2]" (subscript_expression "piVar3[0x10]" (identifier "piVar3") ([ "[") (number_literal "0x10") (] "]")) (= "=") (subscript_expression "puVar1[2]" (identifier "puVar1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (expression_statement "FUN_0001dd30(puVar1);" (call_expression "FUN_0001dd30(puVar1)" (identifier "FUN_0001dd30") (argument_list "(puVar1)" (( "(") (identifier "puVar1") () ")"))) (; ";")) (expression_statement "puVar1 = (undefined4 *)piVar3[0x10];" (assignment_expression "puVar1 = (undefined4 *)piVar3[0x10]" (identifier "puVar1") (= "=") (cast_expression "(undefined4 *)piVar3[0x10]" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "piVar3[0x10]" (identifier "piVar3") ([ "[") (number_literal "0x10") (] "]")))) (; ";")) (} "}"))) (} "}"))) (expression_statement "uVar4 = piVar3[5];" (assignment_expression "uVar4 = piVar3[5]" (identifier "uVar4") (= "=") (subscript_expression "piVar3[5]" (identifier "piVar3") ([ "[") (number_literal "5") (] "]"))) (; ";")) (if_statement "if ((uVar4 & 1) == 0) {\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }" (if "if") (parenthesized_expression "((uVar4 & 1) == 0)" (( "(") (binary_expression "(uVar4 & 1) == 0" (parenthesized_expression "(uVar4 & 1)" (( "(") (binary_expression "uVar4 & 1" (identifier "uVar4") (& "&") (number_literal "1")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      iVar2 = piVar3[3];\n      if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }\n      FUN_0001d840(piVar3 + 8);\n      uVar4 = piVar3[5];\n      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }\n    }" ({ "{") (expression_statement "iVar2 = piVar3[3];" (assignment_expression "iVar2 = piVar3[3]" (identifier "iVar2") (= "=") (subscript_expression "piVar3[3]" (identifier "piVar3") ([ "[") (number_literal "3") (] "]"))) (; ";")) (if_statement "if (iVar2 == 1) {\n        FUN_0008c7d0(piVar3[0x13],1);\n      }\n      else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" (if "if") (parenthesized_expression "(iVar2 == 1)" (( "(") (binary_expression "iVar2 == 1" (identifier "iVar2") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        FUN_0008c7d0(piVar3[0x13],1);\n      }" ({ "{") (expression_statement "FUN_0008c7d0(piVar3[0x13],1);" (call_expression "FUN_0008c7d0(piVar3[0x13],1)" (identifier "FUN_0008c7d0") (argument_list "(piVar3[0x13],1)" (( "(") (subscript_expression "piVar3[0x13]" (identifier "piVar3") ([ "[") (number_literal "0x13") (] "]")) (, ",") (number_literal "1") () ")"))) (; ";")) (} "}")) (else_clause "else if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" (else "else") (if_statement "if (iVar2 == 3) {\n        FUN_0001f630(piVar3[0x13],1);\n      }\n      else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" (if "if") (parenthesized_expression "(iVar2 == 3)" (( "(") (binary_expression "iVar2 == 3" (identifier "iVar2") (== "==") (number_literal "3")) () ")")) (compound_statement "{\n        FUN_0001f630(piVar3[0x13],1);\n      }" ({ "{") (expression_statement "FUN_0001f630(piVar3[0x13],1);" (call_expression "FUN_0001f630(piVar3[0x13],1)" (identifier "FUN_0001f630") (argument_list "(piVar3[0x13],1)" (( "(") (subscript_expression "piVar3[0x13]" (identifier "piVar3") ([ "[") (number_literal "0x13") (] "]")) (, ",") (number_literal "1") () ")"))) (; ";")) (} "}")) (else_clause "else if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" (else "else") (if_statement "if (iVar2 == 0) {\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        *(undefined4 *)(param_1 + 0x100) = 0;\n      }" ({ "{") (expression_statement "*(undefined4 *)(param_1 + 0x100) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x100) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x100)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x100)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x100)" (( "(") (binary_expression "param_1 + 0x100" (identifier "param_1") (+ "+") (number_literal "0x100")) () ")")))) (= "=") (number_literal "0")) (; ";")) (} "}"))))))) (expression_statement "FUN_0001d840(piVar3 + 8);" (call_expression "FUN_0001d840(piVar3 + 8)" (identifier "FUN_0001d840") (argument_list "(piVar3 + 8)" (( "(") (binary_expression "piVar3 + 8" (identifier "piVar3") (+ "+") (number_literal "8")) () ")"))) (; ";")) (expression_statement "uVar4 = piVar3[5];" (assignment_expression "uVar4 = piVar3[5]" (identifier "uVar4") (= "=") (subscript_expression "piVar3[5]" (identifier "piVar3") ([ "[") (number_literal "5") (] "]"))) (; ";")) (if_statement "if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }" (if "if") (parenthesized_expression "((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0))" (( "(") (binary_expression "(*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)" (parenthesized_expression "(*(int *)(*piVar3 + 0x144) != 4)" (( "(") (binary_expression "*(int *)(*piVar3 + 0x144) != 4" (pointer_expression "*(int *)(*piVar3 + 0x144)" (* "*") (cast_expression "(int *)(*piVar3 + 0x144)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*piVar3 + 0x144)" (( "(") (binary_expression "*piVar3 + 0x144" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (+ "+") (number_literal "0x144")) () ")")))) (!= "!=") (number_literal "4")) () ")")) (&& "&&") (parenthesized_expression "((uVar4 & 1) == 0)" (( "(") (binary_expression "(uVar4 & 1) == 0" (parenthesized_expression "(uVar4 & 1)" (( "(") (binary_expression "uVar4 & 1" (identifier "uVar4") (& "&") (number_literal "1")) () ")")) (== "==") (number_literal "0")) () ")"))) () ")")) (compound_statement "{\n        piVar3[6] = 1;\n        FUN_000467d0();\n        uVar4 = piVar3[5];\n        if ((uVar4 & 8) != 0) {\n          return;\n        }\n        goto LAB_000473f0;\n      }" ({ "{") (expression_statement "piVar3[6] = 1;" (assignment_expression "piVar3[6] = 1" (subscript_expression "piVar3[6]" (identifier "piVar3") ([ "[") (number_literal "6") (] "]")) (= "=") (number_literal "1")) (; ";")) (expression_statement "FUN_000467d0();" (call_expression "FUN_000467d0()" (identifier "FUN_000467d0") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "uVar4 = piVar3[5];" (assignment_expression "uVar4 = piVar3[5]" (identifier "uVar4") (= "=") (subscript_expression "piVar3[5]" (identifier "piVar3") ([ "[") (number_literal "5") (] "]"))) (; ";")) (if_statement "if ((uVar4 & 8) != 0) {\n          return;\n        }" (if "if") (parenthesized_expression "((uVar4 & 8) != 0)" (( "(") (binary_expression "(uVar4 & 8) != 0" (parenthesized_expression "(uVar4 & 8)" (( "(") (binary_expression "uVar4 & 8" (identifier "uVar4") (& "&") (number_literal "8")) () ")")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n          return;\n        }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (goto_statement "goto LAB_000473f0;" (goto "goto") (statement_identifier "LAB_000473f0") (; ";")) (} "}"))) (} "}"))) (if_statement "if ((uVar4 & 8) == 0) {\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }" (if "if") (parenthesized_expression "((uVar4 & 8) == 0)" (( "(") (binary_expression "(uVar4 & 8) == 0" (parenthesized_expression "(uVar4 & 8)" (( "(") (binary_expression "uVar4 & 8" (identifier "uVar4") (& "&") (number_literal "8")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\nLAB_000473f0:\n      piVar3[5] = uVar4 | 8;\n      FUN_00044960();\n      return;\n    }" ({ "{") (labeled_statement "LAB_000473f0:\n      piVar3[5] = uVar4 | 8;" (statement_identifier "LAB_000473f0") (: ":") (expression_statement "piVar3[5] = uVar4 | 8;" (assignment_expression "piVar3[5] = uVar4 | 8" (subscript_expression "piVar3[5]" (identifier "piVar3") ([ "[") (number_literal "5") (] "]")) (= "=") (binary_expression "uVar4 | 8" (identifier "uVar4") (| "|") (number_literal "8"))) (; ";"))) (expression_statement "FUN_00044960();" (call_expression "FUN_00044960()" (identifier "FUN_00044960") (argument_list "()" (( "(") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

void function_1(type_1 ssh,type_2 *pktin)

{
  type_3 *var_4;
  int var_7;
  type_4 *var_2;
  type_5 var_6;
  
  var_2 = var_1(ssh,pktin);
  if (var_2 != (type_4 *)0x0) {
    var_3(var_2);
    if ((ssh->remote_bugs & 0x800) == 0) {
      var_4 = (var_2->v).v2.chanreq_head;
      while (var_4 != (type_3 *)0x0) {
        (*var_4->handler)(var_2,(type_2 *)0x0,var_4->ctx);
        (var_2->v).v2.chanreq_head = var_4->next;
        var_5(var_4);
        var_4 = (var_2->v).v2.chanreq_head;
      }
    }
    var_6 = var_2->closes;
    if ((var_6 & 1) == 0) {
      var_7 = var_2->type;
      if (var_7 == 1) {
        var_8((var_2->u).x11.xconn,1);
      }
      else if (var_7 == 3) {
        var_9((type_6 *)(var_2->u).a.inbuffer.head,1);
      }
      else if (var_7 == 0) {
        ssh->send_ok = 0;
      }
      var_10(&(var_2->v).v2.outbuffer);
      var_6 = var_2->closes;
      if ((var_2->ssh->state != var_11) && ((var_6 & 1) == 0)) {
        var_2->pending_eof = 1;
        var_12(var_2);
        var_6 = var_2->closes;
        if ((var_6 & 8) != 0) {
          return;
        }
        goto LAB_000473f0;
      }
    }
    if ((var_6 & 8) == 0) {
LAB_000473f0:
      var_2->closes = var_6 | 8;
      var_13(var_2);
      return;
    }
  }
  return;
}


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

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

void MASKED(int param_1)

{
  undefined4 *puVar1;
  int iVar2;
  int *piVar3;
  uint uVar4;
  
  piVar3 = (int *)FUN_00043d00();
  if (piVar3 != (int *)0x0) {
    FUN_00047210();
    if ((*(byte *)(param_1 + 0x51) & 8) == 0) {
      puVar1 = (undefined4 *)piVar3[0x10];
      while (puVar1 != (undefined4 *)0x0) {
        (*(code *)*puVar1)(piVar3,0,puVar1[1]);
        piVar3[0x10] = puVar1[2];
        FUN_0001dd30(puVar1);
        puVar1 = (undefined4 *)piVar3[0x10];
      }
    }
    uVar4 = piVar3[5];
    if ((uVar4 & 1) == 0) {
      iVar2 = piVar3[3];
      if (iVar2 == 1) {
        FUN_0008c7d0(piVar3[0x13],1);
      }
      else if (iVar2 == 3) {
        FUN_0001f630(piVar3[0x13],1);
      }
      else if (iVar2 == 0) {
        *(undefined4 *)(param_1 + 0x100) = 0;
      }
      FUN_0001d840(piVar3 + 8);
      uVar4 = piVar3[5];
      if ((*(int *)(*piVar3 + 0x144) != 4) && ((uVar4 & 1) == 0)) {
        piVar3[6] = 1;
        FUN_000467d0();
        uVar4 = piVar3[5];
        if ((uVar4 & 8) != 0) {
          return;
        }
        goto LAB_000473f0;
      }
    }
    if ((uVar4 & 8) == 0) {
LAB_000473f0:
      piVar3[5] = uVar4 | 8;
      FUN_00044960();
      return;
    }
  }
  return;
}

