
char * canonify(char *name)

{
  char cVar1;
  int iVar2;
  sftp_request *psVar3;
  sftp_packet *psVar4;
  char *pcVar5;
  char *s1;
  int iVar6;
  undefined *puVar7;
  char *pcVar8;
  
  if (*name == '/') {
                    /* WARNING: Subroutine does not return */
    dupstr(name);
  }
  pcVar8 = *(char **)PTR_pwd_000be5b4;
  iVar2 = (*(code *)PTR_strlen_000bee74)(pcVar8);
  if (pcVar8[iVar2 + -1] == '/') {
    puVar7 = PTR_s_1_0_000be3a8 + 0x884;
  }
  else {
    puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;
  }
  pcVar8 = dupcat(pcVar8,puVar7,name,0);
  psVar3 = fxp_realpath_send(pcVar8);
  psVar4 = sftp_wait_for_reply(psVar3);
  pcVar5 = fxp_realpath_recv(psVar4,psVar3);
  if (pcVar5 != (char *)0x0) {
    safefree(pcVar8);
    return pcVar5;
  }
  iVar2 = (*(code *)PTR_strlen_000bee74)(pcVar8);
  if (iVar2 < 3) {
    if (iVar2 < 1) {
LAB_0002a370:
      pcVar5 = pcVar8 + iVar2;
      if (*pcVar5 != '/') {
        return pcVar8;
      }
      goto LAB_0002a234;
    }
  }
  else {
    iVar6 = iVar2 + -1;
    if (pcVar8[iVar6] == '/') {
      iVar2 = iVar2 + -1;
      pcVar8[iVar6] = '\0';
    }
  }
  iVar2 = iVar2 + -1;
  cVar1 = pcVar8[iVar2];
  while (cVar1 != '/') {
    if (iVar2 < 1) goto LAB_0002a370;
    iVar2 = iVar2 + -1;
    cVar1 = pcVar8[iVar2];
  }
  pcVar5 = pcVar8 + iVar2;
LAB_0002a234:
  iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46d0);
  if (((iVar6 != 0) &&
      (iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46cc), iVar6 != 0)) &&
     (iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar8,PTR_s_1_0_000be3a8 + -0x46d4), iVar6 != 0)) {
    *pcVar5 = '\0';
    if (iVar2 == 0) {
      psVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);
    }
    else {
      psVar3 = fxp_realpath_send(pcVar8);
    }
    psVar4 = sftp_wait_for_reply(psVar3);
    s1 = fxp_realpath_recv(psVar4,psVar3);
    if (s1 == (char *)0x0) {
      *pcVar5 = '/';
    }
    else {
      iVar6 = (*(code *)PTR_strlen_000bee74)(s1);
      if (s1[iVar6 + -1] == '/') {
        puVar7 = PTR_s_1_0_000be3a8 + 0x884;
      }
      else {
        puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;
      }
      pcVar5 = dupcat(s1,puVar7,pcVar8 + iVar2 + 1,0);
      safefree(pcVar8);
      safefree(s1);
      pcVar8 = pcVar5;
    }
  }
  return pcVar8;
}



int canonify(char *param_1)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  int iVar5;
  int iVar6;
  char *pcVar7;
  undefined *puVar8;
  int iVar9;
  
  if (*param_1 == '/') {
    iVar2 = dupstr();
  }
  else {
    iVar9 = *(int *)PTR_pwd_000be5b4;
    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);
    if (*(char *)(iVar9 + iVar2 + -1) == '/') {
      puVar8 = PTR_s_1_0_000be3a8 + 0x884;
    }
    else {
      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;
    }
    iVar2 = dupcat(iVar9,puVar8,param_1,0);
  }
  uVar3 = fxp_realpath_send(iVar2);
  uVar4 = sftp_wait_for_reply(uVar3);
  iVar9 = fxp_realpath_recv(uVar4,uVar3);
  if (iVar9 != 0) {
    safefree(iVar2);
    return iVar9;
  }
  iVar9 = (*(code *)PTR_strlen_000bee74)(iVar2);
  if (iVar9 < 3) {
    if (iVar9 < 1) {
LAB_0002a370:
      pcVar7 = (char *)(iVar2 + iVar9);
      if (*pcVar7 != '/') {
        return iVar2;
      }
      goto LAB_0002a234;
    }
  }
  else {
    pcVar7 = (char *)(iVar2 + iVar9 + -1);
    if (*pcVar7 == '/') {
      iVar9 = iVar9 + -1;
      *pcVar7 = '\0';
    }
  }
  iVar9 = iVar9 + -1;
  cVar1 = *(char *)(iVar2 + iVar9);
  while (cVar1 != '/') {
    if (iVar9 < 1) goto LAB_0002a370;
    iVar9 = iVar9 + -1;
    cVar1 = *(char *)(iVar2 + iVar9);
  }
  pcVar7 = (char *)(iVar2 + iVar9);
LAB_0002a234:
  iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0);
  if (((iVar5 != 0) &&
      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&
     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)) {
    *pcVar7 = '\0';
    if (iVar9 == 0) {
      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);
    }
    else {
      uVar3 = fxp_realpath_send(iVar2);
    }
    uVar4 = sftp_wait_for_reply(uVar3);
    iVar5 = fxp_realpath_recv(uVar4,uVar3);
    if (iVar5 == 0) {
      *pcVar7 = '/';
    }
    else {
      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);
      if (*(char *)(iVar5 + iVar6 + -1) == '/') {
        puVar8 = PTR_s_1_0_000be3a8 + 0x884;
      }
      else {
        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;
      }
      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);
      safefree(iVar2);
      safefree(iVar5);
      iVar2 = iVar9;
    }
  }
  return iVar2;
}


lui gp,0xa
addiu gp,gp,-0x3d04
addu gp,gp,t9
addiu sp,sp,-0x30
sw ra,0x2c(sp)
sw s3,0x28(sp)
sw s2,0x24(sp)
sw s1,0x20(sp)
sw s0,0x1c(sp)
sw gp,0x10(sp)
lb v1,0x0(a0)
li v0,0x2f
beq v1,v0,0x0002a194
_or s1,a0,zero
lw v0,-0x7dbc(gp)
lw s0,0x0(v0)
or a0,s0,zero
lw t9,-0x74fc(gp)
jalr t9
_nop
lw gp,0x10(sp)
addu v0,s0,v0
lb v1,-0x1(v0)
li v0,0x2f
beq v1,v0,0x0002a1ac
_lw a1,-0x7fc8(gp)
lw a1,-0x7fc8(gp)
addiu a1,a1,-0x46d4
or a3,zero,zero
or a2,s1,zero
or a0,s0,zero
lw t9,-0x7d64(gp)
bal 0x000219c0
_nop
lw gp,0x10(sp)
or s1,v0,zero
or a0,s1,zero
lw t9,-0x7d4c(gp)
bal 0x000376d4
_nop
lw gp,0x10(sp)
or s0,v0,zero
or a0,v0,zero
lw t9,-0x7d48(gp)
bal 0x00029fa4
_nop
lw gp,0x10(sp)
or a1,s0,zero
or a0,v0,zero
lw t9,-0x7d44(gp)
bal 0x000377b0
_nop
lw gp,0x10(sp)
bne v0,zero,0x0002a1b4
_or s0,v0,zero
or a0,s1,zero
lw t9,-0x74fc(gp)
jalr t9
_nop
lw gp,0x10(sp)
slti v1,v0,0x3
bne v1,zero,0x0002a1ec
_or s0,v0,zero
addiu v1,v0,-0x1
addu v1,s1,v1
lb a1,0x0(v1)
li a0,0x2f
bne a1,a0,0x0002a1f4
_nop
addiu s0,v0,-0x1
b 0x0002a1f4
_sb zero,0x0(v1)
lw t9,-0x7f74(gp)
bal 0x00021934
_nop
lw gp,0x10(sp)
b 0x0002a104
_or s1,v0,zero
b 0x0002a0e4
_addiu a1,a1,0x884
or a0,s1,zero
lw t9,-0x7fac(gp)
bal 0x000222f8
_nop
lw gp,0x10(sp)
or s1,s0,zero
or v0,s1,zero
lw ra,0x2c(sp)
lw s3,0x28(sp)
lw s2,0x24(sp)
lw s1,0x20(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x30
blez v0,0x0002a370
_addu s2,s1,s0
addiu s0,s0,-0x1
addu v0,s1,s0
lb a0,0x0(v0)
li v0,0x2f
beq a0,v0,0x0002a228
_li v1,0x2f
blez s0,0x0002a370
_addu s2,s1,s0
addiu s0,s0,-0x1
addu v0,s1,s0
lb v0,0x0(v0)
bne v0,v1,0x0002a20c
_nop
or s3,s0,zero
addu s2,s1,s0
lw a1,-0x7fc8(gp)
addiu a1,a1,-0x46d0
or a0,s2,zero
lw t9,-0x7408(gp)
jalr t9
_nop
lw gp,0x10(sp)
beq v0,zero,0x0002a1cc
_lw a1,-0x7fc8(gp)
addiu a1,a1,-0x46cc
or a0,s2,zero
lw t9,-0x7408(gp)
jalr t9
_nop
lw gp,0x10(sp)
beq v0,zero,0x0002a1cc
_lw a1,-0x7fc8(gp)
addiu a1,a1,-0x46d4
or a0,s1,zero
lw t9,-0x7408(gp)
jalr t9
_nop
lw gp,0x10(sp)
beq v0,zero,0x0002a1d0
_or v0,s1,zero
bne s0,zero,0x0002a388
_sb zero,0x0(s2)
lw a0,-0x7fc8(gp)
addiu a0,a0,-0x46d4
lw t9,-0x7d4c(gp)
bal 0x000376d4
_nop
lw gp,0x10(sp)
or s0,v0,zero
or a0,s0,zero
lw t9,-0x7d48(gp)
bal 0x00029fa4
_nop
lw gp,0x10(sp)
or a1,s0,zero
or a0,v0,zero
lw t9,-0x7d44(gp)
bal 0x000377b0
_nop
lw gp,0x10(sp)
beq v0,zero,0x0002a3a4
_or s0,v0,zero
or a0,v0,zero
lw t9,-0x74fc(gp)
jalr t9
_nop
lw gp,0x10(sp)
addu v0,s0,v0
lb v1,-0x1(v0)
li v0,0x2f
beq v1,v0,0x0002a3b0
_lw a1,-0x7fc8(gp)
lw a1,-0x7fc8(gp)
addiu a1,a1,-0x46d4
addiu a2,s3,0x1
or a3,zero,zero
addu a2,s1,a2
or a0,s0,zero
lw t9,-0x7d64(gp)
bal 0x000219c0
_nop
lw gp,0x10(sp)
or s2,v0,zero
or a0,s1,zero
lw t9,-0x7fac(gp)
bal 0x000222f8
_nop
lw gp,0x10(sp)
or a0,s0,zero
lw t9,-0x7fac(gp)
bal 0x000222f8
_nop
lw gp,0x10(sp)
b 0x0002a1cc
_or s1,s2,zero
lb v1,0x0(s2)
li v0,0x2f
bne v1,v0,0x0002a1cc
_or s3,s0,zero
b 0x0002a234
_lw a1,-0x7fc8(gp)
or a0,s1,zero
lw t9,-0x7d4c(gp)
bal 0x000376d4
_nop
lw gp,0x10(sp)
b 0x0002a2b8
_or s0,v0,zero
li v0,0x2f
b 0x0002a1cc
_sb v0,0x0(s2)
b 0x0002a31c
_addiu a1,a1,0x884
(translation_unit "int canonify(char *param_1)\n\n{\n  char cVar1;\n  int iVar2;\n  undefined4 uVar3;\n  undefined4 uVar4;\n  int iVar5;\n  int iVar6;\n  char *pcVar7;\n  undefined *puVar8;\n  int iVar9;\n  \n  if (*param_1 == '/') {\n    iVar2 = dupstr();\n  }\n  else {\n    iVar9 = *(int *)PTR_pwd_000be5b4;\n    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);\n    if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }\n    iVar2 = dupcat(iVar9,puVar8,param_1,0);\n  }\n  uVar3 = fxp_realpath_send(iVar2);\n  uVar4 = sftp_wait_for_reply(uVar3);\n  iVar9 = fxp_realpath_recv(uVar4,uVar3);\n  if (iVar9 != 0) {\n    safefree(iVar2);\n    return iVar9;\n  }\n  iVar9 = (*(code *)PTR_strlen_000bee74)(iVar2);\n  if (iVar9 < 3) {\n    if (iVar9 < 1) {\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }\n  }\n  else {\n    pcVar7 = (char *)(iVar2 + iVar9 + -1);\n    if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }\n  }\n  iVar9 = iVar9 + -1;\n  cVar1 = *(char *)(iVar2 + iVar9);\n  while (cVar1 != '/') {\n    if (iVar9 < 1) goto LAB_0002a370;\n    iVar9 = iVar9 + -1;\n    cVar1 = *(char *)(iVar2 + iVar9);\n  }\n  pcVar7 = (char *)(iVar2 + iVar9);\nLAB_0002a234:\n  iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0);\n  if (((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&\n     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)) {\n    *pcVar7 = '\0';\n    if (iVar9 == 0) {\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }\n    uVar4 = sftp_wait_for_reply(uVar3);\n    iVar5 = fxp_realpath_recv(uVar4,uVar3);\n    if (iVar5 == 0) {\n      *pcVar7 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }\n  }\n  return iVar2;\n}\n\n" (function_definition "int canonify(char *param_1)\n\n{\n  char cVar1;\n  int iVar2;\n  undefined4 uVar3;\n  undefined4 uVar4;\n  int iVar5;\n  int iVar6;\n  char *pcVar7;\n  undefined *puVar8;\n  int iVar9;\n  \n  if (*param_1 == '/') {\n    iVar2 = dupstr();\n  }\n  else {\n    iVar9 = *(int *)PTR_pwd_000be5b4;\n    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);\n    if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }\n    iVar2 = dupcat(iVar9,puVar8,param_1,0);\n  }\n  uVar3 = fxp_realpath_send(iVar2);\n  uVar4 = sftp_wait_for_reply(uVar3);\n  iVar9 = fxp_realpath_recv(uVar4,uVar3);\n  if (iVar9 != 0) {\n    safefree(iVar2);\n    return iVar9;\n  }\n  iVar9 = (*(code *)PTR_strlen_000bee74)(iVar2);\n  if (iVar9 < 3) {\n    if (iVar9 < 1) {\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }\n  }\n  else {\n    pcVar7 = (char *)(iVar2 + iVar9 + -1);\n    if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }\n  }\n  iVar9 = iVar9 + -1;\n  cVar1 = *(char *)(iVar2 + iVar9);\n  while (cVar1 != '/') {\n    if (iVar9 < 1) goto LAB_0002a370;\n    iVar9 = iVar9 + -1;\n    cVar1 = *(char *)(iVar2 + iVar9);\n  }\n  pcVar7 = (char *)(iVar2 + iVar9);\nLAB_0002a234:\n  iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0);\n  if (((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&\n     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)) {\n    *pcVar7 = '\0';\n    if (iVar9 == 0) {\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }\n    uVar4 = sftp_wait_for_reply(uVar3);\n    iVar5 = fxp_realpath_recv(uVar4,uVar3);\n    if (iVar5 == 0) {\n      *pcVar7 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }\n  }\n  return iVar2;\n}" primitive_type (function_declarator "canonify(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  undefined4 uVar3;\n  undefined4 uVar4;\n  int iVar5;\n  int iVar6;\n  char *pcVar7;\n  undefined *puVar8;\n  int iVar9;\n  \n  if (*param_1 == '/') {\n    iVar2 = dupstr();\n  }\n  else {\n    iVar9 = *(int *)PTR_pwd_000be5b4;\n    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);\n    if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }\n    iVar2 = dupcat(iVar9,puVar8,param_1,0);\n  }\n  uVar3 = fxp_realpath_send(iVar2);\n  uVar4 = sftp_wait_for_reply(uVar3);\n  iVar9 = fxp_realpath_recv(uVar4,uVar3);\n  if (iVar9 != 0) {\n    safefree(iVar2);\n    return iVar9;\n  }\n  iVar9 = (*(code *)PTR_strlen_000bee74)(iVar2);\n  if (iVar9 < 3) {\n    if (iVar9 < 1) {\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }\n  }\n  else {\n    pcVar7 = (char *)(iVar2 + iVar9 + -1);\n    if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }\n  }\n  iVar9 = iVar9 + -1;\n  cVar1 = *(char *)(iVar2 + iVar9);\n  while (cVar1 != '/') {\n    if (iVar9 < 1) goto LAB_0002a370;\n    iVar9 = iVar9 + -1;\n    cVar1 = *(char *)(iVar2 + iVar9);\n  }\n  pcVar7 = (char *)(iVar2 + iVar9);\nLAB_0002a234:\n  iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0);\n  if (((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&\n     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)) {\n    *pcVar7 = '\0';\n    if (iVar9 == 0) {\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }\n    uVar4 = sftp_wait_for_reply(uVar3);\n    iVar5 = fxp_realpath_recv(uVar4,uVar3);\n    if (iVar5 == 0) {\n      *pcVar7 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }\n  }\n  return iVar2;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "undefined4 uVar4;" type_identifier identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "char *pcVar7;" primitive_type (pointer_declarator "*pcVar7" * identifier) ;) (declaration "undefined *puVar8;" type_identifier (pointer_declarator "*puVar8" * identifier) ;) (declaration "int iVar9;" primitive_type identifier ;) (if_statement "if (*param_1 == '/') {\n    iVar2 = dupstr();\n  }\n  else {\n    iVar9 = *(int *)PTR_pwd_000be5b4;\n    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);\n    if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }\n    iVar2 = dupcat(iVar9,puVar8,param_1,0);\n  }" if (parenthesized_expression "(*param_1 == '/')" ( (binary_expression "*param_1 == '/'" (pointer_expression "*param_1" * identifier) == (char_literal "'/'" ' character ')) )) (compound_statement "{\n    iVar2 = dupstr();\n  }" { (expression_statement "iVar2 = dupstr();" (assignment_expression "iVar2 = dupstr()" identifier = (call_expression "dupstr()" identifier (argument_list "()" ( )))) ;) }) (else_clause "else {\n    iVar9 = *(int *)PTR_pwd_000be5b4;\n    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);\n    if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }\n    iVar2 = dupcat(iVar9,puVar8,param_1,0);\n  }" else (compound_statement "{\n    iVar9 = *(int *)PTR_pwd_000be5b4;\n    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);\n    if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }\n    iVar2 = dupcat(iVar9,puVar8,param_1,0);\n  }" { (expression_statement "iVar9 = *(int *)PTR_pwd_000be5b4;" (assignment_expression "iVar9 = *(int *)PTR_pwd_000be5b4" identifier = (pointer_expression "*(int *)PTR_pwd_000be5b4" * (cast_expression "(int *)PTR_pwd_000be5b4" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);" (assignment_expression "iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9)" identifier = (call_expression "(*(code *)PTR_strlen_000bee74)(iVar9)" (parenthesized_expression "(*(code *)PTR_strlen_000bee74)" ( (pointer_expression "*(code *)PTR_strlen_000bee74" * (cast_expression "(code *)PTR_strlen_000bee74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar9)" ( identifier )))) ;) (if_statement "if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }" if (parenthesized_expression "(*(char *)(iVar9 + iVar2 + -1) == '/')" ( (binary_expression "*(char *)(iVar9 + iVar2 + -1) == '/'" (pointer_expression "*(char *)(iVar9 + iVar2 + -1)" * (cast_expression "(char *)(iVar9 + iVar2 + -1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar9 + iVar2 + -1)" ( (binary_expression "iVar9 + iVar2 + -1" (binary_expression "iVar9 + iVar2" identifier + identifier) + number_literal) )))) == (char_literal "'/'" ' character ')) )) (compound_statement "{\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }" { (expression_statement "puVar8 = PTR_s_1_0_000be3a8 + 0x884;" (assignment_expression "puVar8 = PTR_s_1_0_000be3a8 + 0x884" identifier = (binary_expression "PTR_s_1_0_000be3a8 + 0x884" identifier + number_literal)) ;) }) (else_clause "else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }" else (compound_statement "{\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }" { (expression_statement "puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;" (assignment_expression "puVar8 = PTR_s_1_0_000be3a8 + -0x46d4" identifier = (binary_expression "PTR_s_1_0_000be3a8 + -0x46d4" identifier + number_literal)) ;) }))) (expression_statement "iVar2 = dupcat(iVar9,puVar8,param_1,0);" (assignment_expression "iVar2 = dupcat(iVar9,puVar8,param_1,0)" identifier = (call_expression "dupcat(iVar9,puVar8,param_1,0)" identifier (argument_list "(iVar9,puVar8,param_1,0)" ( identifier , identifier , identifier , number_literal )))) ;) }))) (expression_statement "uVar3 = fxp_realpath_send(iVar2);" (assignment_expression "uVar3 = fxp_realpath_send(iVar2)" identifier = (call_expression "fxp_realpath_send(iVar2)" identifier (argument_list "(iVar2)" ( identifier )))) ;) (expression_statement "uVar4 = sftp_wait_for_reply(uVar3);" (assignment_expression "uVar4 = sftp_wait_for_reply(uVar3)" identifier = (call_expression "sftp_wait_for_reply(uVar3)" identifier (argument_list "(uVar3)" ( identifier )))) ;) (expression_statement "iVar9 = fxp_realpath_recv(uVar4,uVar3);" (assignment_expression "iVar9 = fxp_realpath_recv(uVar4,uVar3)" identifier = (call_expression "fxp_realpath_recv(uVar4,uVar3)" identifier (argument_list "(uVar4,uVar3)" ( identifier , identifier )))) ;) (if_statement "if (iVar9 != 0) {\n    safefree(iVar2);\n    return iVar9;\n  }" if (parenthesized_expression "(iVar9 != 0)" ( (binary_expression "iVar9 != 0" identifier != number_literal) )) (compound_statement "{\n    safefree(iVar2);\n    return iVar9;\n  }" { (expression_statement "safefree(iVar2);" (call_expression "safefree(iVar2)" identifier (argument_list "(iVar2)" ( identifier ))) ;) (return_statement "return iVar9;" return identifier ;) })) (expression_statement "iVar9 = (*(code *)PTR_strlen_000bee74)(iVar2);" (assignment_expression "iVar9 = (*(code *)PTR_strlen_000bee74)(iVar2)" identifier = (call_expression "(*(code *)PTR_strlen_000bee74)(iVar2)" (parenthesized_expression "(*(code *)PTR_strlen_000bee74)" ( (pointer_expression "*(code *)PTR_strlen_000bee74" * (cast_expression "(code *)PTR_strlen_000bee74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2)" ( identifier )))) ;) (if_statement "if (iVar9 < 3) {\n    if (iVar9 < 1) {\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }\n  }\n  else {\n    pcVar7 = (char *)(iVar2 + iVar9 + -1);\n    if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }\n  }" if (parenthesized_expression "(iVar9 < 3)" ( (binary_expression "iVar9 < 3" identifier < number_literal) )) (compound_statement "{\n    if (iVar9 < 1) {\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }\n  }" { (if_statement "if (iVar9 < 1) {\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }" if (parenthesized_expression "(iVar9 < 1)" ( (binary_expression "iVar9 < 1" identifier < number_literal) )) (compound_statement "{\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }" { (labeled_statement "LAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);" statement_identifier : (expression_statement "pcVar7 = (char *)(iVar2 + iVar9);" (assignment_expression "pcVar7 = (char *)(iVar2 + iVar9)" identifier = (cast_expression "(char *)(iVar2 + iVar9)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + iVar9)" ( (binary_expression "iVar2 + iVar9" identifier + identifier) )))) ;)) (if_statement "if (*pcVar7 != '/') {\n        return iVar2;\n      }" if (parenthesized_expression "(*pcVar7 != '/')" ( (binary_expression "*pcVar7 != '/'" (pointer_expression "*pcVar7" * identifier) != (char_literal "'/'" ' character ')) )) (compound_statement "{\n        return iVar2;\n      }" { (return_statement "return iVar2;" return identifier ;) })) (goto_statement "goto LAB_0002a234;" goto statement_identifier ;) })) }) (else_clause "else {\n    pcVar7 = (char *)(iVar2 + iVar9 + -1);\n    if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }\n  }" else (compound_statement "{\n    pcVar7 = (char *)(iVar2 + iVar9 + -1);\n    if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }\n  }" { (expression_statement "pcVar7 = (char *)(iVar2 + iVar9 + -1);" (assignment_expression "pcVar7 = (char *)(iVar2 + iVar9 + -1)" identifier = (cast_expression "(char *)(iVar2 + iVar9 + -1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + iVar9 + -1)" ( (binary_expression "iVar2 + iVar9 + -1" (binary_expression "iVar2 + iVar9" identifier + identifier) + number_literal) )))) ;) (if_statement "if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }" if (parenthesized_expression "(*pcVar7 == '/')" ( (binary_expression "*pcVar7 == '/'" (pointer_expression "*pcVar7" * identifier) == (char_literal "'/'" ' character ')) )) (compound_statement "{\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }" { (expression_statement "iVar9 = iVar9 + -1;" (assignment_expression "iVar9 = iVar9 + -1" identifier = (binary_expression "iVar9 + -1" identifier + number_literal)) ;) (expression_statement "*pcVar7 = '\0';" (assignment_expression "*pcVar7 = '\0'" (pointer_expression "*pcVar7" * identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) })) }))) (expression_statement "iVar9 = iVar9 + -1;" (assignment_expression "iVar9 = iVar9 + -1" identifier = (binary_expression "iVar9 + -1" identifier + number_literal)) ;) (expression_statement "cVar1 = *(char *)(iVar2 + iVar9);" (assignment_expression "cVar1 = *(char *)(iVar2 + iVar9)" identifier = (pointer_expression "*(char *)(iVar2 + iVar9)" * (cast_expression "(char *)(iVar2 + iVar9)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + iVar9)" ( (binary_expression "iVar2 + iVar9" identifier + identifier) ))))) ;) (while_statement "while (cVar1 != '/') {\n    if (iVar9 < 1) goto LAB_0002a370;\n    iVar9 = iVar9 + -1;\n    cVar1 = *(char *)(iVar2 + iVar9);\n  }" while (parenthesized_expression "(cVar1 != '/')" ( (binary_expression "cVar1 != '/'" identifier != (char_literal "'/'" ' character ')) )) (compound_statement "{\n    if (iVar9 < 1) goto LAB_0002a370;\n    iVar9 = iVar9 + -1;\n    cVar1 = *(char *)(iVar2 + iVar9);\n  }" { (if_statement "if (iVar9 < 1) goto LAB_0002a370;" if (parenthesized_expression "(iVar9 < 1)" ( (binary_expression "iVar9 < 1" identifier < number_literal) )) (goto_statement "goto LAB_0002a370;" goto statement_identifier ;)) (expression_statement "iVar9 = iVar9 + -1;" (assignment_expression "iVar9 = iVar9 + -1" identifier = (binary_expression "iVar9 + -1" identifier + number_literal)) ;) (expression_statement "cVar1 = *(char *)(iVar2 + iVar9);" (assignment_expression "cVar1 = *(char *)(iVar2 + iVar9)" identifier = (pointer_expression "*(char *)(iVar2 + iVar9)" * (cast_expression "(char *)(iVar2 + iVar9)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + iVar9)" ( (binary_expression "iVar2 + iVar9" identifier + identifier) ))))) ;) })) (expression_statement "pcVar7 = (char *)(iVar2 + iVar9);" (assignment_expression "pcVar7 = (char *)(iVar2 + iVar9)" identifier = (cast_expression "(char *)(iVar2 + iVar9)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + iVar9)" ( (binary_expression "iVar2 + iVar9" identifier + identifier) )))) ;) (labeled_statement "LAB_0002a234:\n  iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0);" statement_identifier : (expression_statement "iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0);" (assignment_expression "iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0)" identifier = (call_expression "(*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0)" (parenthesized_expression "(*(code *)PTR_strcmp_000bef68)" ( (pointer_expression "*(code *)PTR_strcmp_000bef68" * (cast_expression "(code *)PTR_strcmp_000bef68" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0)" ( identifier , (binary_expression "PTR_s_1_0_000be3a8 + -0x46d0" identifier + number_literal) )))) ;)) (if_statement "if (((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&\n     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)) {\n    *pcVar7 = '\0';\n    if (iVar9 == 0) {\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }\n    uVar4 = sftp_wait_for_reply(uVar3);\n    iVar5 = fxp_realpath_recv(uVar4,uVar3);\n    if (iVar5 == 0) {\n      *pcVar7 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }\n  }" if (parenthesized_expression "(((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&\n     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0))" ( (binary_expression "((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&\n     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)" (parenthesized_expression "((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0))" ( (binary_expression "(iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)" (parenthesized_expression "(iVar5 != 0)" ( (binary_expression "iVar5 != 0" identifier != number_literal) )) && (parenthesized_expression "(iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)" ( (comma_expression "iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0" (assignment_expression "iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc)" identifier = (call_expression "(*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc)" (parenthesized_expression "(*(code *)PTR_strcmp_000bef68)" ( (pointer_expression "*(code *)PTR_strcmp_000bef68" * (cast_expression "(code *)PTR_strcmp_000bef68" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc)" ( identifier , (binary_expression "PTR_s_1_0_000be3a8 + -0x46cc" identifier + number_literal) )))) , (binary_expression "iVar5 != 0" identifier != number_literal)) ))) )) && (parenthesized_expression "(iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)" ( (comma_expression "iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0" (assignment_expression "iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4)" identifier = (call_expression "(*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4)" (parenthesized_expression "(*(code *)PTR_strcmp_000bef68)" ( (pointer_expression "*(code *)PTR_strcmp_000bef68" * (cast_expression "(code *)PTR_strcmp_000bef68" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2,PTR_s_1_0_000be3a8 + -0x46d4)" ( identifier , (binary_expression "PTR_s_1_0_000be3a8 + -0x46d4" identifier + number_literal) )))) , (binary_expression "iVar5 != 0" identifier != number_literal)) ))) )) (compound_statement "{\n    *pcVar7 = '\0';\n    if (iVar9 == 0) {\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }\n    uVar4 = sftp_wait_for_reply(uVar3);\n    iVar5 = fxp_realpath_recv(uVar4,uVar3);\n    if (iVar5 == 0) {\n      *pcVar7 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }\n  }" { (expression_statement "*pcVar7 = '\0';" (assignment_expression "*pcVar7 = '\0'" (pointer_expression "*pcVar7" * identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) (if_statement "if (iVar9 == 0) {\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }" if (parenthesized_expression "(iVar9 == 0)" ( (binary_expression "iVar9 == 0" identifier == number_literal) )) (compound_statement "{\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }" { (expression_statement "uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);" (assignment_expression "uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4)" identifier = (call_expression "fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4)" identifier (argument_list "(PTR_s_1_0_000be3a8 + -0x46d4)" ( (binary_expression "PTR_s_1_0_000be3a8 + -0x46d4" identifier + number_literal) )))) ;) }) (else_clause "else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }" else (compound_statement "{\n      uVar3 = fxp_realpath_send(iVar2);\n    }" { (expression_statement "uVar3 = fxp_realpath_send(iVar2);" (assignment_expression "uVar3 = fxp_realpath_send(iVar2)" identifier = (call_expression "fxp_realpath_send(iVar2)" identifier (argument_list "(iVar2)" ( identifier )))) ;) }))) (expression_statement "uVar4 = sftp_wait_for_reply(uVar3);" (assignment_expression "uVar4 = sftp_wait_for_reply(uVar3)" identifier = (call_expression "sftp_wait_for_reply(uVar3)" identifier (argument_list "(uVar3)" ( identifier )))) ;) (expression_statement "iVar5 = fxp_realpath_recv(uVar4,uVar3);" (assignment_expression "iVar5 = fxp_realpath_recv(uVar4,uVar3)" identifier = (call_expression "fxp_realpath_recv(uVar4,uVar3)" identifier (argument_list "(uVar4,uVar3)" ( identifier , identifier )))) ;) (if_statement "if (iVar5 == 0) {\n      *pcVar7 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }" if (parenthesized_expression "(iVar5 == 0)" ( (binary_expression "iVar5 == 0" identifier == number_literal) )) (compound_statement "{\n      *pcVar7 = '/';\n    }" { (expression_statement "*pcVar7 = '/';" (assignment_expression "*pcVar7 = '/'" (pointer_expression "*pcVar7" * identifier) = (char_literal "'/'" ' character ')) ;) }) (else_clause "else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }" else (compound_statement "{\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }" { (expression_statement "iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);" (assignment_expression "iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5)" identifier = (call_expression "(*(code *)PTR_strlen_000bee74)(iVar5)" (parenthesized_expression "(*(code *)PTR_strlen_000bee74)" ( (pointer_expression "*(code *)PTR_strlen_000bee74" * (cast_expression "(code *)PTR_strlen_000bee74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar5)" ( identifier )))) ;) (if_statement "if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }" if (parenthesized_expression "(*(char *)(iVar5 + iVar6 + -1) == '/')" ( (binary_expression "*(char *)(iVar5 + iVar6 + -1) == '/'" (pointer_expression "*(char *)(iVar5 + iVar6 + -1)" * (cast_expression "(char *)(iVar5 + iVar6 + -1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + iVar6 + -1)" ( (binary_expression "iVar5 + iVar6 + -1" (binary_expression "iVar5 + iVar6" identifier + identifier) + number_literal) )))) == (char_literal "'/'" ' character ')) )) (compound_statement "{\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }" { (expression_statement "puVar8 = PTR_s_1_0_000be3a8 + 0x884;" (assignment_expression "puVar8 = PTR_s_1_0_000be3a8 + 0x884" identifier = (binary_expression "PTR_s_1_0_000be3a8 + 0x884" identifier + number_literal)) ;) }) (else_clause "else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }" else (compound_statement "{\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }" { (expression_statement "puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;" (assignment_expression "puVar8 = PTR_s_1_0_000be3a8 + -0x46d4" identifier = (binary_expression "PTR_s_1_0_000be3a8 + -0x46d4" identifier + number_literal)) ;) }))) (expression_statement "iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);" (assignment_expression "iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0)" identifier = (call_expression "dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0)" identifier (argument_list "(iVar5,puVar8,iVar2 + iVar9 + 1,0)" ( identifier , identifier , (binary_expression "iVar2 + iVar9 + 1" (binary_expression "iVar2 + iVar9" identifier + identifier) + number_literal) , number_literal )))) ;) (expression_statement "safefree(iVar2);" (call_expression "safefree(iVar2)" identifier (argument_list "(iVar2)" ( identifier ))) ;) (expression_statement "safefree(iVar5);" (call_expression "safefree(iVar5)" identifier (argument_list "(iVar5)" ( identifier ))) ;) (expression_statement "iVar2 = iVar9;" (assignment_expression "iVar2 = iVar9" identifier = identifier) ;) }))) })) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "char * canonify(char *name)\n\n{\n  char cVar1;\n  int iVar2;\n  sftp_request *psVar3;\n  sftp_packet *psVar4;\n  char *pcVar5;\n  char *s1;\n  int iVar6;\n  undefined *puVar7;\n  char *pcVar8;\n  \n  if (*name == '/') {\n                    /* WARNING: Subroutine does not return */\n    dupstr(name);\n  }\n  pcVar8 = *(char **)PTR_pwd_000be5b4;\n  iVar2 = (*(code *)PTR_strlen_000bee74)(pcVar8);\n  if (pcVar8[iVar2 + -1] == '/') {\n    puVar7 = PTR_s_1_0_000be3a8 + 0x884;\n  }\n  else {\n    puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;\n  }\n  pcVar8 = dupcat(pcVar8,puVar7,name,0);\n  psVar3 = fxp_realpath_send(pcVar8);\n  psVar4 = sftp_wait_for_reply(psVar3);\n  pcVar5 = fxp_realpath_recv(psVar4,psVar3);\n  if (pcVar5 != (char *)0x0) {\n    safefree(pcVar8);\n    return pcVar5;\n  }\n  iVar2 = (*(code *)PTR_strlen_000bee74)(pcVar8);\n  if (iVar2 < 3) {\n    if (iVar2 < 1) {\nLAB_0002a370:\n      pcVar5 = pcVar8 + iVar2;\n      if (*pcVar5 != '/') {\n        return pcVar8;\n      }\n      goto LAB_0002a234;\n    }\n  }\n  else {\n    iVar6 = iVar2 + -1;\n    if (pcVar8[iVar6] == '/') {\n      iVar2 = iVar2 + -1;\n      pcVar8[iVar6] = '\0';\n    }\n  }\n  iVar2 = iVar2 + -1;\n  cVar1 = pcVar8[iVar2];\n  while (cVar1 != '/') {\n    if (iVar2 < 1) goto LAB_0002a370;\n    iVar2 = iVar2 + -1;\n    cVar1 = pcVar8[iVar2];\n  }\n  pcVar5 = pcVar8 + iVar2;\nLAB_0002a234:\n  iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46d0);\n  if (((iVar6 != 0) &&\n      (iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46cc), iVar6 != 0)) &&\n     (iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar8,PTR_s_1_0_000be3a8 + -0x46d4), iVar6 != 0)) {\n    *pcVar5 = '\0';\n    if (iVar2 == 0) {\n      psVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      psVar3 = fxp_realpath_send(pcVar8);\n    }\n    psVar4 = sftp_wait_for_reply(psVar3);\n    s1 = fxp_realpath_recv(psVar4,psVar3);\n    if (s1 == (char *)0x0) {\n      *pcVar5 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(s1);\n      if (s1[iVar6 + -1] == '/') {\n        puVar7 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      pcVar5 = dupcat(s1,puVar7,pcVar8 + iVar2 + 1,0);\n      safefree(pcVar8);\n      safefree(s1);\n      pcVar8 = pcVar5;\n    }\n  }\n  return pcVar8;\n}\n\n" (function_definition "char * canonify(char *name)\n\n{\n  char cVar1;\n  int iVar2;\n  sftp_request *psVar3;\n  sftp_packet *psVar4;\n  char *pcVar5;\n  char *s1;\n  int iVar6;\n  undefined *puVar7;\n  char *pcVar8;\n  \n  if (*name == '/') {\n                    /* WARNING: Subroutine does not return */\n    dupstr(name);\n  }\n  pcVar8 = *(char **)PTR_pwd_000be5b4;\n  iVar2 = (*(code *)PTR_strlen_000bee74)(pcVar8);\n  if (pcVar8[iVar2 + -1] == '/') {\n    puVar7 = PTR_s_1_0_000be3a8 + 0x884;\n  }\n  else {\n    puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;\n  }\n  pcVar8 = dupcat(pcVar8,puVar7,name,0);\n  psVar3 = fxp_realpath_send(pcVar8);\n  psVar4 = sftp_wait_for_reply(psVar3);\n  pcVar5 = fxp_realpath_recv(psVar4,psVar3);\n  if (pcVar5 != (char *)0x0) {\n    safefree(pcVar8);\n    return pcVar5;\n  }\n  iVar2 = (*(code *)PTR_strlen_000bee74)(pcVar8);\n  if (iVar2 < 3) {\n    if (iVar2 < 1) {\nLAB_0002a370:\n      pcVar5 = pcVar8 + iVar2;\n      if (*pcVar5 != '/') {\n        return pcVar8;\n      }\n      goto LAB_0002a234;\n    }\n  }\n  else {\n    iVar6 = iVar2 + -1;\n    if (pcVar8[iVar6] == '/') {\n      iVar2 = iVar2 + -1;\n      pcVar8[iVar6] = '\0';\n    }\n  }\n  iVar2 = iVar2 + -1;\n  cVar1 = pcVar8[iVar2];\n  while (cVar1 != '/') {\n    if (iVar2 < 1) goto LAB_0002a370;\n    iVar2 = iVar2 + -1;\n    cVar1 = pcVar8[iVar2];\n  }\n  pcVar5 = pcVar8 + iVar2;\nLAB_0002a234:\n  iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46d0);\n  if (((iVar6 != 0) &&\n      (iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46cc), iVar6 != 0)) &&\n     (iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar8,PTR_s_1_0_000be3a8 + -0x46d4), iVar6 != 0)) {\n    *pcVar5 = '\0';\n    if (iVar2 == 0) {\n      psVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      psVar3 = fxp_realpath_send(pcVar8);\n    }\n    psVar4 = sftp_wait_for_reply(psVar3);\n    s1 = fxp_realpath_recv(psVar4,psVar3);\n    if (s1 == (char *)0x0) {\n      *pcVar5 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(s1);\n      if (s1[iVar6 + -1] == '/') {\n        puVar7 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      pcVar5 = dupcat(s1,puVar7,pcVar8 + iVar2 + 1,0);\n      safefree(pcVar8);\n      safefree(s1);\n      pcVar8 = pcVar5;\n    }\n  }\n  return pcVar8;\n}" primitive_type (pointer_declarator "* canonify(char *name)" * (function_declarator "canonify(char *name)" identifier (parameter_list "(char *name)" ( (parameter_declaration "char *name" primitive_type (pointer_declarator "*name" * identifier)) )))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  sftp_request *psVar3;\n  sftp_packet *psVar4;\n  char *pcVar5;\n  char *s1;\n  int iVar6;\n  undefined *puVar7;\n  char *pcVar8;\n  \n  if (*name == '/') {\n                    /* WARNING: Subroutine does not return */\n    dupstr(name);\n  }\n  pcVar8 = *(char **)PTR_pwd_000be5b4;\n  iVar2 = (*(code *)PTR_strlen_000bee74)(pcVar8);\n  if (pcVar8[iVar2 + -1] == '/') {\n    puVar7 = PTR_s_1_0_000be3a8 + 0x884;\n  }\n  else {\n    puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;\n  }\n  pcVar8 = dupcat(pcVar8,puVar7,name,0);\n  psVar3 = fxp_realpath_send(pcVar8);\n  psVar4 = sftp_wait_for_reply(psVar3);\n  pcVar5 = fxp_realpath_recv(psVar4,psVar3);\n  if (pcVar5 != (char *)0x0) {\n    safefree(pcVar8);\n    return pcVar5;\n  }\n  iVar2 = (*(code *)PTR_strlen_000bee74)(pcVar8);\n  if (iVar2 < 3) {\n    if (iVar2 < 1) {\nLAB_0002a370:\n      pcVar5 = pcVar8 + iVar2;\n      if (*pcVar5 != '/') {\n        return pcVar8;\n      }\n      goto LAB_0002a234;\n    }\n  }\n  else {\n    iVar6 = iVar2 + -1;\n    if (pcVar8[iVar6] == '/') {\n      iVar2 = iVar2 + -1;\n      pcVar8[iVar6] = '\0';\n    }\n  }\n  iVar2 = iVar2 + -1;\n  cVar1 = pcVar8[iVar2];\n  while (cVar1 != '/') {\n    if (iVar2 < 1) goto LAB_0002a370;\n    iVar2 = iVar2 + -1;\n    cVar1 = pcVar8[iVar2];\n  }\n  pcVar5 = pcVar8 + iVar2;\nLAB_0002a234:\n  iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46d0);\n  if (((iVar6 != 0) &&\n      (iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46cc), iVar6 != 0)) &&\n     (iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar8,PTR_s_1_0_000be3a8 + -0x46d4), iVar6 != 0)) {\n    *pcVar5 = '\0';\n    if (iVar2 == 0) {\n      psVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      psVar3 = fxp_realpath_send(pcVar8);\n    }\n    psVar4 = sftp_wait_for_reply(psVar3);\n    s1 = fxp_realpath_recv(psVar4,psVar3);\n    if (s1 == (char *)0x0) {\n      *pcVar5 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(s1);\n      if (s1[iVar6 + -1] == '/') {\n        puVar7 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      pcVar5 = dupcat(s1,puVar7,pcVar8 + iVar2 + 1,0);\n      safefree(pcVar8);\n      safefree(s1);\n      pcVar8 = pcVar5;\n    }\n  }\n  return pcVar8;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "sftp_request *psVar3;" type_identifier (pointer_declarator "*psVar3" * identifier) ;) (declaration "sftp_packet *psVar4;" type_identifier (pointer_declarator "*psVar4" * identifier) ;) (declaration "char *pcVar5;" primitive_type (pointer_declarator "*pcVar5" * identifier) ;) (declaration "char *s1;" primitive_type (pointer_declarator "*s1" * identifier) ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "undefined *puVar7;" type_identifier (pointer_declarator "*puVar7" * identifier) ;) (declaration "char *pcVar8;" primitive_type (pointer_declarator "*pcVar8" * identifier) ;) (if_statement "if (*name == '/') {\n                    /* WARNING: Subroutine does not return */\n    dupstr(name);\n  }" if (parenthesized_expression "(*name == '/')" ( (binary_expression "*name == '/'" (pointer_expression "*name" * identifier) == (char_literal "'/'" ' character ')) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    dupstr(name);\n  }" { comment (expression_statement "dupstr(name);" (call_expression "dupstr(name)" identifier (argument_list "(name)" ( identifier ))) ;) })) (expression_statement "pcVar8 = *(char **)PTR_pwd_000be5b4;" (assignment_expression "pcVar8 = *(char **)PTR_pwd_000be5b4" identifier = (pointer_expression "*(char **)PTR_pwd_000be5b4" * (cast_expression "(char **)PTR_pwd_000be5b4" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "iVar2 = (*(code *)PTR_strlen_000bee74)(pcVar8);" (assignment_expression "iVar2 = (*(code *)PTR_strlen_000bee74)(pcVar8)" identifier = (call_expression "(*(code *)PTR_strlen_000bee74)(pcVar8)" (parenthesized_expression "(*(code *)PTR_strlen_000bee74)" ( (pointer_expression "*(code *)PTR_strlen_000bee74" * (cast_expression "(code *)PTR_strlen_000bee74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar8)" ( identifier )))) ;) (if_statement "if (pcVar8[iVar2 + -1] == '/') {\n    puVar7 = PTR_s_1_0_000be3a8 + 0x884;\n  }\n  else {\n    puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;\n  }" if (parenthesized_expression "(pcVar8[iVar2 + -1] == '/')" ( (binary_expression "pcVar8[iVar2 + -1] == '/'" (subscript_expression "pcVar8[iVar2 + -1]" identifier [ (binary_expression "iVar2 + -1" identifier + number_literal) ]) == (char_literal "'/'" ' character ')) )) (compound_statement "{\n    puVar7 = PTR_s_1_0_000be3a8 + 0x884;\n  }" { (expression_statement "puVar7 = PTR_s_1_0_000be3a8 + 0x884;" (assignment_expression "puVar7 = PTR_s_1_0_000be3a8 + 0x884" identifier = (binary_expression "PTR_s_1_0_000be3a8 + 0x884" identifier + number_literal)) ;) }) (else_clause "else {\n    puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;\n  }" else (compound_statement "{\n    puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;\n  }" { (expression_statement "puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;" (assignment_expression "puVar7 = PTR_s_1_0_000be3a8 + -0x46d4" identifier = (binary_expression "PTR_s_1_0_000be3a8 + -0x46d4" identifier + number_literal)) ;) }))) (expression_statement "pcVar8 = dupcat(pcVar8,puVar7,name,0);" (assignment_expression "pcVar8 = dupcat(pcVar8,puVar7,name,0)" identifier = (call_expression "dupcat(pcVar8,puVar7,name,0)" identifier (argument_list "(pcVar8,puVar7,name,0)" ( identifier , identifier , identifier , number_literal )))) ;) (expression_statement "psVar3 = fxp_realpath_send(pcVar8);" (assignment_expression "psVar3 = fxp_realpath_send(pcVar8)" identifier = (call_expression "fxp_realpath_send(pcVar8)" identifier (argument_list "(pcVar8)" ( identifier )))) ;) (expression_statement "psVar4 = sftp_wait_for_reply(psVar3);" (assignment_expression "psVar4 = sftp_wait_for_reply(psVar3)" identifier = (call_expression "sftp_wait_for_reply(psVar3)" identifier (argument_list "(psVar3)" ( identifier )))) ;) (expression_statement "pcVar5 = fxp_realpath_recv(psVar4,psVar3);" (assignment_expression "pcVar5 = fxp_realpath_recv(psVar4,psVar3)" identifier = (call_expression "fxp_realpath_recv(psVar4,psVar3)" identifier (argument_list "(psVar4,psVar3)" ( identifier , identifier )))) ;) (if_statement "if (pcVar5 != (char *)0x0) {\n    safefree(pcVar8);\n    return pcVar5;\n  }" if (parenthesized_expression "(pcVar5 != (char *)0x0)" ( (binary_expression "pcVar5 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    safefree(pcVar8);\n    return pcVar5;\n  }" { (expression_statement "safefree(pcVar8);" (call_expression "safefree(pcVar8)" identifier (argument_list "(pcVar8)" ( identifier ))) ;) (return_statement "return pcVar5;" return identifier ;) })) (expression_statement "iVar2 = (*(code *)PTR_strlen_000bee74)(pcVar8);" (assignment_expression "iVar2 = (*(code *)PTR_strlen_000bee74)(pcVar8)" identifier = (call_expression "(*(code *)PTR_strlen_000bee74)(pcVar8)" (parenthesized_expression "(*(code *)PTR_strlen_000bee74)" ( (pointer_expression "*(code *)PTR_strlen_000bee74" * (cast_expression "(code *)PTR_strlen_000bee74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar8)" ( identifier )))) ;) (if_statement "if (iVar2 < 3) {\n    if (iVar2 < 1) {\nLAB_0002a370:\n      pcVar5 = pcVar8 + iVar2;\n      if (*pcVar5 != '/') {\n        return pcVar8;\n      }\n      goto LAB_0002a234;\n    }\n  }\n  else {\n    iVar6 = iVar2 + -1;\n    if (pcVar8[iVar6] == '/') {\n      iVar2 = iVar2 + -1;\n      pcVar8[iVar6] = '\0';\n    }\n  }" if (parenthesized_expression "(iVar2 < 3)" ( (binary_expression "iVar2 < 3" identifier < number_literal) )) (compound_statement "{\n    if (iVar2 < 1) {\nLAB_0002a370:\n      pcVar5 = pcVar8 + iVar2;\n      if (*pcVar5 != '/') {\n        return pcVar8;\n      }\n      goto LAB_0002a234;\n    }\n  }" { (if_statement "if (iVar2 < 1) {\nLAB_0002a370:\n      pcVar5 = pcVar8 + iVar2;\n      if (*pcVar5 != '/') {\n        return pcVar8;\n      }\n      goto LAB_0002a234;\n    }" if (parenthesized_expression "(iVar2 < 1)" ( (binary_expression "iVar2 < 1" identifier < number_literal) )) (compound_statement "{\nLAB_0002a370:\n      pcVar5 = pcVar8 + iVar2;\n      if (*pcVar5 != '/') {\n        return pcVar8;\n      }\n      goto LAB_0002a234;\n    }" { (labeled_statement "LAB_0002a370:\n      pcVar5 = pcVar8 + iVar2;" statement_identifier : (expression_statement "pcVar5 = pcVar8 + iVar2;" (assignment_expression "pcVar5 = pcVar8 + iVar2" identifier = (binary_expression "pcVar8 + iVar2" identifier + identifier)) ;)) (if_statement "if (*pcVar5 != '/') {\n        return pcVar8;\n      }" if (parenthesized_expression "(*pcVar5 != '/')" ( (binary_expression "*pcVar5 != '/'" (pointer_expression "*pcVar5" * identifier) != (char_literal "'/'" ' character ')) )) (compound_statement "{\n        return pcVar8;\n      }" { (return_statement "return pcVar8;" return identifier ;) })) (goto_statement "goto LAB_0002a234;" goto statement_identifier ;) })) }) (else_clause "else {\n    iVar6 = iVar2 + -1;\n    if (pcVar8[iVar6] == '/') {\n      iVar2 = iVar2 + -1;\n      pcVar8[iVar6] = '\0';\n    }\n  }" else (compound_statement "{\n    iVar6 = iVar2 + -1;\n    if (pcVar8[iVar6] == '/') {\n      iVar2 = iVar2 + -1;\n      pcVar8[iVar6] = '\0';\n    }\n  }" { (expression_statement "iVar6 = iVar2 + -1;" (assignment_expression "iVar6 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (if_statement "if (pcVar8[iVar6] == '/') {\n      iVar2 = iVar2 + -1;\n      pcVar8[iVar6] = '\0';\n    }" if (parenthesized_expression "(pcVar8[iVar6] == '/')" ( (binary_expression "pcVar8[iVar6] == '/'" (subscript_expression "pcVar8[iVar6]" identifier [ identifier ]) == (char_literal "'/'" ' character ')) )) (compound_statement "{\n      iVar2 = iVar2 + -1;\n      pcVar8[iVar6] = '\0';\n    }" { (expression_statement "iVar2 = iVar2 + -1;" (assignment_expression "iVar2 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (expression_statement "pcVar8[iVar6] = '\0';" (assignment_expression "pcVar8[iVar6] = '\0'" (subscript_expression "pcVar8[iVar6]" identifier [ identifier ]) = (char_literal "'\0'" ' escape_sequence ')) ;) })) }))) (expression_statement "iVar2 = iVar2 + -1;" (assignment_expression "iVar2 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (expression_statement "cVar1 = pcVar8[iVar2];" (assignment_expression "cVar1 = pcVar8[iVar2]" identifier = (subscript_expression "pcVar8[iVar2]" identifier [ identifier ])) ;) (while_statement "while (cVar1 != '/') {\n    if (iVar2 < 1) goto LAB_0002a370;\n    iVar2 = iVar2 + -1;\n    cVar1 = pcVar8[iVar2];\n  }" while (parenthesized_expression "(cVar1 != '/')" ( (binary_expression "cVar1 != '/'" identifier != (char_literal "'/'" ' character ')) )) (compound_statement "{\n    if (iVar2 < 1) goto LAB_0002a370;\n    iVar2 = iVar2 + -1;\n    cVar1 = pcVar8[iVar2];\n  }" { (if_statement "if (iVar2 < 1) goto LAB_0002a370;" if (parenthesized_expression "(iVar2 < 1)" ( (binary_expression "iVar2 < 1" identifier < number_literal) )) (goto_statement "goto LAB_0002a370;" goto statement_identifier ;)) (expression_statement "iVar2 = iVar2 + -1;" (assignment_expression "iVar2 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (expression_statement "cVar1 = pcVar8[iVar2];" (assignment_expression "cVar1 = pcVar8[iVar2]" identifier = (subscript_expression "pcVar8[iVar2]" identifier [ identifier ])) ;) })) (expression_statement "pcVar5 = pcVar8 + iVar2;" (assignment_expression "pcVar5 = pcVar8 + iVar2" identifier = (binary_expression "pcVar8 + iVar2" identifier + identifier)) ;) (labeled_statement "LAB_0002a234:\n  iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46d0);" statement_identifier : (expression_statement "iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46d0);" (assignment_expression "iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46d0)" identifier = (call_expression "(*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46d0)" (parenthesized_expression "(*(code *)PTR_strcmp_000bef68)" ( (pointer_expression "*(code *)PTR_strcmp_000bef68" * (cast_expression "(code *)PTR_strcmp_000bef68" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar5,PTR_s_1_0_000be3a8 + -0x46d0)" ( identifier , (binary_expression "PTR_s_1_0_000be3a8 + -0x46d0" identifier + number_literal) )))) ;)) (if_statement "if (((iVar6 != 0) &&\n      (iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46cc), iVar6 != 0)) &&\n     (iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar8,PTR_s_1_0_000be3a8 + -0x46d4), iVar6 != 0)) {\n    *pcVar5 = '\0';\n    if (iVar2 == 0) {\n      psVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      psVar3 = fxp_realpath_send(pcVar8);\n    }\n    psVar4 = sftp_wait_for_reply(psVar3);\n    s1 = fxp_realpath_recv(psVar4,psVar3);\n    if (s1 == (char *)0x0) {\n      *pcVar5 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(s1);\n      if (s1[iVar6 + -1] == '/') {\n        puVar7 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      pcVar5 = dupcat(s1,puVar7,pcVar8 + iVar2 + 1,0);\n      safefree(pcVar8);\n      safefree(s1);\n      pcVar8 = pcVar5;\n    }\n  }" if (parenthesized_expression "(((iVar6 != 0) &&\n      (iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46cc), iVar6 != 0)) &&\n     (iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar8,PTR_s_1_0_000be3a8 + -0x46d4), iVar6 != 0))" ( (binary_expression "((iVar6 != 0) &&\n      (iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46cc), iVar6 != 0)) &&\n     (iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar8,PTR_s_1_0_000be3a8 + -0x46d4), iVar6 != 0)" (parenthesized_expression "((iVar6 != 0) &&\n      (iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46cc), iVar6 != 0))" ( (binary_expression "(iVar6 != 0) &&\n      (iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46cc), iVar6 != 0)" (parenthesized_expression "(iVar6 != 0)" ( (binary_expression "iVar6 != 0" identifier != number_literal) )) && (parenthesized_expression "(iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46cc), iVar6 != 0)" ( (comma_expression "iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46cc), iVar6 != 0" (assignment_expression "iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46cc)" identifier = (call_expression "(*(code *)PTR_strcmp_000bef68)(pcVar5,PTR_s_1_0_000be3a8 + -0x46cc)" (parenthesized_expression "(*(code *)PTR_strcmp_000bef68)" ( (pointer_expression "*(code *)PTR_strcmp_000bef68" * (cast_expression "(code *)PTR_strcmp_000bef68" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar5,PTR_s_1_0_000be3a8 + -0x46cc)" ( identifier , (binary_expression "PTR_s_1_0_000be3a8 + -0x46cc" identifier + number_literal) )))) , (binary_expression "iVar6 != 0" identifier != number_literal)) ))) )) && (parenthesized_expression "(iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar8,PTR_s_1_0_000be3a8 + -0x46d4), iVar6 != 0)" ( (comma_expression "iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar8,PTR_s_1_0_000be3a8 + -0x46d4), iVar6 != 0" (assignment_expression "iVar6 = (*(code *)PTR_strcmp_000bef68)(pcVar8,PTR_s_1_0_000be3a8 + -0x46d4)" identifier = (call_expression "(*(code *)PTR_strcmp_000bef68)(pcVar8,PTR_s_1_0_000be3a8 + -0x46d4)" (parenthesized_expression "(*(code *)PTR_strcmp_000bef68)" ( (pointer_expression "*(code *)PTR_strcmp_000bef68" * (cast_expression "(code *)PTR_strcmp_000bef68" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar8,PTR_s_1_0_000be3a8 + -0x46d4)" ( identifier , (binary_expression "PTR_s_1_0_000be3a8 + -0x46d4" identifier + number_literal) )))) , (binary_expression "iVar6 != 0" identifier != number_literal)) ))) )) (compound_statement "{\n    *pcVar5 = '\0';\n    if (iVar2 == 0) {\n      psVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      psVar3 = fxp_realpath_send(pcVar8);\n    }\n    psVar4 = sftp_wait_for_reply(psVar3);\n    s1 = fxp_realpath_recv(psVar4,psVar3);\n    if (s1 == (char *)0x0) {\n      *pcVar5 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(s1);\n      if (s1[iVar6 + -1] == '/') {\n        puVar7 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      pcVar5 = dupcat(s1,puVar7,pcVar8 + iVar2 + 1,0);\n      safefree(pcVar8);\n      safefree(s1);\n      pcVar8 = pcVar5;\n    }\n  }" { (expression_statement "*pcVar5 = '\0';" (assignment_expression "*pcVar5 = '\0'" (pointer_expression "*pcVar5" * identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) (if_statement "if (iVar2 == 0) {\n      psVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      psVar3 = fxp_realpath_send(pcVar8);\n    }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n      psVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }" { (expression_statement "psVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);" (assignment_expression "psVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4)" identifier = (call_expression "fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4)" identifier (argument_list "(PTR_s_1_0_000be3a8 + -0x46d4)" ( (binary_expression "PTR_s_1_0_000be3a8 + -0x46d4" identifier + number_literal) )))) ;) }) (else_clause "else {\n      psVar3 = fxp_realpath_send(pcVar8);\n    }" else (compound_statement "{\n      psVar3 = fxp_realpath_send(pcVar8);\n    }" { (expression_statement "psVar3 = fxp_realpath_send(pcVar8);" (assignment_expression "psVar3 = fxp_realpath_send(pcVar8)" identifier = (call_expression "fxp_realpath_send(pcVar8)" identifier (argument_list "(pcVar8)" ( identifier )))) ;) }))) (expression_statement "psVar4 = sftp_wait_for_reply(psVar3);" (assignment_expression "psVar4 = sftp_wait_for_reply(psVar3)" identifier = (call_expression "sftp_wait_for_reply(psVar3)" identifier (argument_list "(psVar3)" ( identifier )))) ;) (expression_statement "s1 = fxp_realpath_recv(psVar4,psVar3);" (assignment_expression "s1 = fxp_realpath_recv(psVar4,psVar3)" identifier = (call_expression "fxp_realpath_recv(psVar4,psVar3)" identifier (argument_list "(psVar4,psVar3)" ( identifier , identifier )))) ;) (if_statement "if (s1 == (char *)0x0) {\n      *pcVar5 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(s1);\n      if (s1[iVar6 + -1] == '/') {\n        puVar7 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      pcVar5 = dupcat(s1,puVar7,pcVar8 + iVar2 + 1,0);\n      safefree(pcVar8);\n      safefree(s1);\n      pcVar8 = pcVar5;\n    }" if (parenthesized_expression "(s1 == (char *)0x0)" ( (binary_expression "s1 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      *pcVar5 = '/';\n    }" { (expression_statement "*pcVar5 = '/';" (assignment_expression "*pcVar5 = '/'" (pointer_expression "*pcVar5" * identifier) = (char_literal "'/'" ' character ')) ;) }) (else_clause "else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(s1);\n      if (s1[iVar6 + -1] == '/') {\n        puVar7 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      pcVar5 = dupcat(s1,puVar7,pcVar8 + iVar2 + 1,0);\n      safefree(pcVar8);\n      safefree(s1);\n      pcVar8 = pcVar5;\n    }" else (compound_statement "{\n      iVar6 = (*(code *)PTR_strlen_000bee74)(s1);\n      if (s1[iVar6 + -1] == '/') {\n        puVar7 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      pcVar5 = dupcat(s1,puVar7,pcVar8 + iVar2 + 1,0);\n      safefree(pcVar8);\n      safefree(s1);\n      pcVar8 = pcVar5;\n    }" { (expression_statement "iVar6 = (*(code *)PTR_strlen_000bee74)(s1);" (assignment_expression "iVar6 = (*(code *)PTR_strlen_000bee74)(s1)" identifier = (call_expression "(*(code *)PTR_strlen_000bee74)(s1)" (parenthesized_expression "(*(code *)PTR_strlen_000bee74)" ( (pointer_expression "*(code *)PTR_strlen_000bee74" * (cast_expression "(code *)PTR_strlen_000bee74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(s1)" ( identifier )))) ;) (if_statement "if (s1[iVar6 + -1] == '/') {\n        puVar7 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }" if (parenthesized_expression "(s1[iVar6 + -1] == '/')" ( (binary_expression "s1[iVar6 + -1] == '/'" (subscript_expression "s1[iVar6 + -1]" identifier [ (binary_expression "iVar6 + -1" identifier + number_literal) ]) == (char_literal "'/'" ' character ')) )) (compound_statement "{\n        puVar7 = PTR_s_1_0_000be3a8 + 0x884;\n      }" { (expression_statement "puVar7 = PTR_s_1_0_000be3a8 + 0x884;" (assignment_expression "puVar7 = PTR_s_1_0_000be3a8 + 0x884" identifier = (binary_expression "PTR_s_1_0_000be3a8 + 0x884" identifier + number_literal)) ;) }) (else_clause "else {\n        puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }" else (compound_statement "{\n        puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }" { (expression_statement "puVar7 = PTR_s_1_0_000be3a8 + -0x46d4;" (assignment_expression "puVar7 = PTR_s_1_0_000be3a8 + -0x46d4" identifier = (binary_expression "PTR_s_1_0_000be3a8 + -0x46d4" identifier + number_literal)) ;) }))) (expression_statement "pcVar5 = dupcat(s1,puVar7,pcVar8 + iVar2 + 1,0);" (assignment_expression "pcVar5 = dupcat(s1,puVar7,pcVar8 + iVar2 + 1,0)" identifier = (call_expression "dupcat(s1,puVar7,pcVar8 + iVar2 + 1,0)" identifier (argument_list "(s1,puVar7,pcVar8 + iVar2 + 1,0)" ( identifier , identifier , (binary_expression "pcVar8 + iVar2 + 1" (binary_expression "pcVar8 + iVar2" identifier + identifier) + number_literal) , number_literal )))) ;) (expression_statement "safefree(pcVar8);" (call_expression "safefree(pcVar8)" identifier (argument_list "(pcVar8)" ( identifier ))) ;) (expression_statement "safefree(s1);" (call_expression "safefree(s1)" identifier (argument_list "(s1)" ( identifier ))) ;) (expression_statement "pcVar8 = pcVar5;" (assignment_expression "pcVar8 = pcVar5" identifier = identifier) ;) }))) })) (return_statement "return pcVar8;" return identifier ;) })))
(translation_unit "int canonify(char *param_1)\n\n{\n  char cVar1;\n  int iVar2;\n  undefined4 uVar3;\n  undefined4 uVar4;\n  int iVar5;\n  int iVar6;\n  char *pcVar7;\n  undefined *puVar8;\n  int iVar9;\n  \n  if (*param_1 == '/') {\n    iVar2 = dupstr();\n  }\n  else {\n    iVar9 = *(int *)PTR_pwd_000be5b4;\n    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);\n    if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }\n    iVar2 = dupcat(iVar9,puVar8,param_1,0);\n  }\n  uVar3 = fxp_realpath_send(iVar2);\n  uVar4 = sftp_wait_for_reply(uVar3);\n  iVar9 = fxp_realpath_recv(uVar4,uVar3);\n  if (iVar9 != 0) {\n    safefree(iVar2);\n    return iVar9;\n  }\n  iVar9 = (*(code *)PTR_strlen_000bee74)(iVar2);\n  if (iVar9 < 3) {\n    if (iVar9 < 1) {\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }\n  }\n  else {\n    pcVar7 = (char *)(iVar2 + iVar9 + -1);\n    if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }\n  }\n  iVar9 = iVar9 + -1;\n  cVar1 = *(char *)(iVar2 + iVar9);\n  while (cVar1 != '/') {\n    if (iVar9 < 1) goto LAB_0002a370;\n    iVar9 = iVar9 + -1;\n    cVar1 = *(char *)(iVar2 + iVar9);\n  }\n  pcVar7 = (char *)(iVar2 + iVar9);\nLAB_0002a234:\n  iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0);\n  if (((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&\n     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)) {\n    *pcVar7 = '\0';\n    if (iVar9 == 0) {\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }\n    uVar4 = sftp_wait_for_reply(uVar3);\n    iVar5 = fxp_realpath_recv(uVar4,uVar3);\n    if (iVar5 == 0) {\n      *pcVar7 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }\n  }\n  return iVar2;\n}\n\n" (function_definition "int canonify(char *param_1)\n\n{\n  char cVar1;\n  int iVar2;\n  undefined4 uVar3;\n  undefined4 uVar4;\n  int iVar5;\n  int iVar6;\n  char *pcVar7;\n  undefined *puVar8;\n  int iVar9;\n  \n  if (*param_1 == '/') {\n    iVar2 = dupstr();\n  }\n  else {\n    iVar9 = *(int *)PTR_pwd_000be5b4;\n    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);\n    if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }\n    iVar2 = dupcat(iVar9,puVar8,param_1,0);\n  }\n  uVar3 = fxp_realpath_send(iVar2);\n  uVar4 = sftp_wait_for_reply(uVar3);\n  iVar9 = fxp_realpath_recv(uVar4,uVar3);\n  if (iVar9 != 0) {\n    safefree(iVar2);\n    return iVar9;\n  }\n  iVar9 = (*(code *)PTR_strlen_000bee74)(iVar2);\n  if (iVar9 < 3) {\n    if (iVar9 < 1) {\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }\n  }\n  else {\n    pcVar7 = (char *)(iVar2 + iVar9 + -1);\n    if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }\n  }\n  iVar9 = iVar9 + -1;\n  cVar1 = *(char *)(iVar2 + iVar9);\n  while (cVar1 != '/') {\n    if (iVar9 < 1) goto LAB_0002a370;\n    iVar9 = iVar9 + -1;\n    cVar1 = *(char *)(iVar2 + iVar9);\n  }\n  pcVar7 = (char *)(iVar2 + iVar9);\nLAB_0002a234:\n  iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0);\n  if (((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&\n     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)) {\n    *pcVar7 = '\0';\n    if (iVar9 == 0) {\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }\n    uVar4 = sftp_wait_for_reply(uVar3);\n    iVar5 = fxp_realpath_recv(uVar4,uVar3);\n    if (iVar5 == 0) {\n      *pcVar7 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }\n  }\n  return iVar2;\n}" primitive_type (function_declarator "canonify(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  undefined4 uVar3;\n  undefined4 uVar4;\n  int iVar5;\n  int iVar6;\n  char *pcVar7;\n  undefined *puVar8;\n  int iVar9;\n  \n  if (*param_1 == '/') {\n    iVar2 = dupstr();\n  }\n  else {\n    iVar9 = *(int *)PTR_pwd_000be5b4;\n    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);\n    if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }\n    iVar2 = dupcat(iVar9,puVar8,param_1,0);\n  }\n  uVar3 = fxp_realpath_send(iVar2);\n  uVar4 = sftp_wait_for_reply(uVar3);\n  iVar9 = fxp_realpath_recv(uVar4,uVar3);\n  if (iVar9 != 0) {\n    safefree(iVar2);\n    return iVar9;\n  }\n  iVar9 = (*(code *)PTR_strlen_000bee74)(iVar2);\n  if (iVar9 < 3) {\n    if (iVar9 < 1) {\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }\n  }\n  else {\n    pcVar7 = (char *)(iVar2 + iVar9 + -1);\n    if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }\n  }\n  iVar9 = iVar9 + -1;\n  cVar1 = *(char *)(iVar2 + iVar9);\n  while (cVar1 != '/') {\n    if (iVar9 < 1) goto LAB_0002a370;\n    iVar9 = iVar9 + -1;\n    cVar1 = *(char *)(iVar2 + iVar9);\n  }\n  pcVar7 = (char *)(iVar2 + iVar9);\nLAB_0002a234:\n  iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0);\n  if (((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&\n     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)) {\n    *pcVar7 = '\0';\n    if (iVar9 == 0) {\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }\n    uVar4 = sftp_wait_for_reply(uVar3);\n    iVar5 = fxp_realpath_recv(uVar4,uVar3);\n    if (iVar5 == 0) {\n      *pcVar7 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }\n  }\n  return iVar2;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "undefined4 uVar4;" type_identifier identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "char *pcVar7;" primitive_type (pointer_declarator "*pcVar7" * identifier) ;) (declaration "undefined *puVar8;" type_identifier (pointer_declarator "*puVar8" * identifier) ;) (declaration "int iVar9;" primitive_type identifier ;) (if_statement "if (*param_1 == '/') {\n    iVar2 = dupstr();\n  }\n  else {\n    iVar9 = *(int *)PTR_pwd_000be5b4;\n    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);\n    if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }\n    iVar2 = dupcat(iVar9,puVar8,param_1,0);\n  }" if (parenthesized_expression "(*param_1 == '/')" ( (binary_expression "*param_1 == '/'" (pointer_expression "*param_1" * identifier) == (char_literal "'/'" ' character ')) )) (compound_statement "{\n    iVar2 = dupstr();\n  }" { (expression_statement "iVar2 = dupstr();" (assignment_expression "iVar2 = dupstr()" identifier = (call_expression "dupstr()" identifier (argument_list "()" ( )))) ;) }) (else_clause "else {\n    iVar9 = *(int *)PTR_pwd_000be5b4;\n    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);\n    if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }\n    iVar2 = dupcat(iVar9,puVar8,param_1,0);\n  }" else (compound_statement "{\n    iVar9 = *(int *)PTR_pwd_000be5b4;\n    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);\n    if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }\n    iVar2 = dupcat(iVar9,puVar8,param_1,0);\n  }" { (expression_statement "iVar9 = *(int *)PTR_pwd_000be5b4;" (assignment_expression "iVar9 = *(int *)PTR_pwd_000be5b4" identifier = (pointer_expression "*(int *)PTR_pwd_000be5b4" * (cast_expression "(int *)PTR_pwd_000be5b4" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);" (assignment_expression "iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9)" identifier = (call_expression "(*(code *)PTR_strlen_000bee74)(iVar9)" (parenthesized_expression "(*(code *)PTR_strlen_000bee74)" ( (pointer_expression "*(code *)PTR_strlen_000bee74" * (cast_expression "(code *)PTR_strlen_000bee74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar9)" ( identifier )))) ;) (if_statement "if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }" if (parenthesized_expression "(*(char *)(iVar9 + iVar2 + -1) == '/')" ( (binary_expression "*(char *)(iVar9 + iVar2 + -1) == '/'" (pointer_expression "*(char *)(iVar9 + iVar2 + -1)" * (cast_expression "(char *)(iVar9 + iVar2 + -1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar9 + iVar2 + -1)" ( (binary_expression "iVar9 + iVar2 + -1" (binary_expression "iVar9 + iVar2" identifier + identifier) + number_literal) )))) == (char_literal "'/'" ' character ')) )) (compound_statement "{\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }" { (expression_statement "puVar8 = PTR_s_1_0_000be3a8 + 0x884;" (assignment_expression "puVar8 = PTR_s_1_0_000be3a8 + 0x884" identifier = (binary_expression "PTR_s_1_0_000be3a8 + 0x884" identifier + number_literal)) ;) }) (else_clause "else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }" else (compound_statement "{\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }" { (expression_statement "puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;" (assignment_expression "puVar8 = PTR_s_1_0_000be3a8 + -0x46d4" identifier = (binary_expression "PTR_s_1_0_000be3a8 + -0x46d4" identifier + number_literal)) ;) }))) (expression_statement "iVar2 = dupcat(iVar9,puVar8,param_1,0);" (assignment_expression "iVar2 = dupcat(iVar9,puVar8,param_1,0)" identifier = (call_expression "dupcat(iVar9,puVar8,param_1,0)" identifier (argument_list "(iVar9,puVar8,param_1,0)" ( identifier , identifier , identifier , number_literal )))) ;) }))) (expression_statement "uVar3 = fxp_realpath_send(iVar2);" (assignment_expression "uVar3 = fxp_realpath_send(iVar2)" identifier = (call_expression "fxp_realpath_send(iVar2)" identifier (argument_list "(iVar2)" ( identifier )))) ;) (expression_statement "uVar4 = sftp_wait_for_reply(uVar3);" (assignment_expression "uVar4 = sftp_wait_for_reply(uVar3)" identifier = (call_expression "sftp_wait_for_reply(uVar3)" identifier (argument_list "(uVar3)" ( identifier )))) ;) (expression_statement "iVar9 = fxp_realpath_recv(uVar4,uVar3);" (assignment_expression "iVar9 = fxp_realpath_recv(uVar4,uVar3)" identifier = (call_expression "fxp_realpath_recv(uVar4,uVar3)" identifier (argument_list "(uVar4,uVar3)" ( identifier , identifier )))) ;) (if_statement "if (iVar9 != 0) {\n    safefree(iVar2);\n    return iVar9;\n  }" if (parenthesized_expression "(iVar9 != 0)" ( (binary_expression "iVar9 != 0" identifier != number_literal) )) (compound_statement "{\n    safefree(iVar2);\n    return iVar9;\n  }" { (expression_statement "safefree(iVar2);" (call_expression "safefree(iVar2)" identifier (argument_list "(iVar2)" ( identifier ))) ;) (return_statement "return iVar9;" return identifier ;) })) (expression_statement "iVar9 = (*(code *)PTR_strlen_000bee74)(iVar2);" (assignment_expression "iVar9 = (*(code *)PTR_strlen_000bee74)(iVar2)" identifier = (call_expression "(*(code *)PTR_strlen_000bee74)(iVar2)" (parenthesized_expression "(*(code *)PTR_strlen_000bee74)" ( (pointer_expression "*(code *)PTR_strlen_000bee74" * (cast_expression "(code *)PTR_strlen_000bee74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2)" ( identifier )))) ;) (if_statement "if (iVar9 < 3) {\n    if (iVar9 < 1) {\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }\n  }\n  else {\n    pcVar7 = (char *)(iVar2 + iVar9 + -1);\n    if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }\n  }" if (parenthesized_expression "(iVar9 < 3)" ( (binary_expression "iVar9 < 3" identifier < number_literal) )) (compound_statement "{\n    if (iVar9 < 1) {\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }\n  }" { (if_statement "if (iVar9 < 1) {\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }" if (parenthesized_expression "(iVar9 < 1)" ( (binary_expression "iVar9 < 1" identifier < number_literal) )) (compound_statement "{\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }" { (labeled_statement "LAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);" statement_identifier : (expression_statement "pcVar7 = (char *)(iVar2 + iVar9);" (assignment_expression "pcVar7 = (char *)(iVar2 + iVar9)" identifier = (cast_expression "(char *)(iVar2 + iVar9)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + iVar9)" ( (binary_expression "iVar2 + iVar9" identifier + identifier) )))) ;)) (if_statement "if (*pcVar7 != '/') {\n        return iVar2;\n      }" if (parenthesized_expression "(*pcVar7 != '/')" ( (binary_expression "*pcVar7 != '/'" (pointer_expression "*pcVar7" * identifier) != (char_literal "'/'" ' character ')) )) (compound_statement "{\n        return iVar2;\n      }" { (return_statement "return iVar2;" return identifier ;) })) (goto_statement "goto LAB_0002a234;" goto statement_identifier ;) })) }) (else_clause "else {\n    pcVar7 = (char *)(iVar2 + iVar9 + -1);\n    if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }\n  }" else (compound_statement "{\n    pcVar7 = (char *)(iVar2 + iVar9 + -1);\n    if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }\n  }" { (expression_statement "pcVar7 = (char *)(iVar2 + iVar9 + -1);" (assignment_expression "pcVar7 = (char *)(iVar2 + iVar9 + -1)" identifier = (cast_expression "(char *)(iVar2 + iVar9 + -1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + iVar9 + -1)" ( (binary_expression "iVar2 + iVar9 + -1" (binary_expression "iVar2 + iVar9" identifier + identifier) + number_literal) )))) ;) (if_statement "if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }" if (parenthesized_expression "(*pcVar7 == '/')" ( (binary_expression "*pcVar7 == '/'" (pointer_expression "*pcVar7" * identifier) == (char_literal "'/'" ' character ')) )) (compound_statement "{\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }" { (expression_statement "iVar9 = iVar9 + -1;" (assignment_expression "iVar9 = iVar9 + -1" identifier = (binary_expression "iVar9 + -1" identifier + number_literal)) ;) (expression_statement "*pcVar7 = '\0';" (assignment_expression "*pcVar7 = '\0'" (pointer_expression "*pcVar7" * identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) })) }))) (expression_statement "iVar9 = iVar9 + -1;" (assignment_expression "iVar9 = iVar9 + -1" identifier = (binary_expression "iVar9 + -1" identifier + number_literal)) ;) (expression_statement "cVar1 = *(char *)(iVar2 + iVar9);" (assignment_expression "cVar1 = *(char *)(iVar2 + iVar9)" identifier = (pointer_expression "*(char *)(iVar2 + iVar9)" * (cast_expression "(char *)(iVar2 + iVar9)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + iVar9)" ( (binary_expression "iVar2 + iVar9" identifier + identifier) ))))) ;) (while_statement "while (cVar1 != '/') {\n    if (iVar9 < 1) goto LAB_0002a370;\n    iVar9 = iVar9 + -1;\n    cVar1 = *(char *)(iVar2 + iVar9);\n  }" while (parenthesized_expression "(cVar1 != '/')" ( (binary_expression "cVar1 != '/'" identifier != (char_literal "'/'" ' character ')) )) (compound_statement "{\n    if (iVar9 < 1) goto LAB_0002a370;\n    iVar9 = iVar9 + -1;\n    cVar1 = *(char *)(iVar2 + iVar9);\n  }" { (if_statement "if (iVar9 < 1) goto LAB_0002a370;" if (parenthesized_expression "(iVar9 < 1)" ( (binary_expression "iVar9 < 1" identifier < number_literal) )) (goto_statement "goto LAB_0002a370;" goto statement_identifier ;)) (expression_statement "iVar9 = iVar9 + -1;" (assignment_expression "iVar9 = iVar9 + -1" identifier = (binary_expression "iVar9 + -1" identifier + number_literal)) ;) (expression_statement "cVar1 = *(char *)(iVar2 + iVar9);" (assignment_expression "cVar1 = *(char *)(iVar2 + iVar9)" identifier = (pointer_expression "*(char *)(iVar2 + iVar9)" * (cast_expression "(char *)(iVar2 + iVar9)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + iVar9)" ( (binary_expression "iVar2 + iVar9" identifier + identifier) ))))) ;) })) (expression_statement "pcVar7 = (char *)(iVar2 + iVar9);" (assignment_expression "pcVar7 = (char *)(iVar2 + iVar9)" identifier = (cast_expression "(char *)(iVar2 + iVar9)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + iVar9)" ( (binary_expression "iVar2 + iVar9" identifier + identifier) )))) ;) (labeled_statement "LAB_0002a234:\n  iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0);" statement_identifier : (expression_statement "iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0);" (assignment_expression "iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0)" identifier = (call_expression "(*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0)" (parenthesized_expression "(*(code *)PTR_strcmp_000bef68)" ( (pointer_expression "*(code *)PTR_strcmp_000bef68" * (cast_expression "(code *)PTR_strcmp_000bef68" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0)" ( identifier , (binary_expression "PTR_s_1_0_000be3a8 + -0x46d0" identifier + number_literal) )))) ;)) (if_statement "if (((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&\n     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)) {\n    *pcVar7 = '\0';\n    if (iVar9 == 0) {\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }\n    uVar4 = sftp_wait_for_reply(uVar3);\n    iVar5 = fxp_realpath_recv(uVar4,uVar3);\n    if (iVar5 == 0) {\n      *pcVar7 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }\n  }" if (parenthesized_expression "(((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&\n     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0))" ( (binary_expression "((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&\n     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)" (parenthesized_expression "((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0))" ( (binary_expression "(iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)" (parenthesized_expression "(iVar5 != 0)" ( (binary_expression "iVar5 != 0" identifier != number_literal) )) && (parenthesized_expression "(iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)" ( (comma_expression "iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0" (assignment_expression "iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc)" identifier = (call_expression "(*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc)" (parenthesized_expression "(*(code *)PTR_strcmp_000bef68)" ( (pointer_expression "*(code *)PTR_strcmp_000bef68" * (cast_expression "(code *)PTR_strcmp_000bef68" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc)" ( identifier , (binary_expression "PTR_s_1_0_000be3a8 + -0x46cc" identifier + number_literal) )))) , (binary_expression "iVar5 != 0" identifier != number_literal)) ))) )) && (parenthesized_expression "(iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)" ( (comma_expression "iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0" (assignment_expression "iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4)" identifier = (call_expression "(*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4)" (parenthesized_expression "(*(code *)PTR_strcmp_000bef68)" ( (pointer_expression "*(code *)PTR_strcmp_000bef68" * (cast_expression "(code *)PTR_strcmp_000bef68" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar2,PTR_s_1_0_000be3a8 + -0x46d4)" ( identifier , (binary_expression "PTR_s_1_0_000be3a8 + -0x46d4" identifier + number_literal) )))) , (binary_expression "iVar5 != 0" identifier != number_literal)) ))) )) (compound_statement "{\n    *pcVar7 = '\0';\n    if (iVar9 == 0) {\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }\n    uVar4 = sftp_wait_for_reply(uVar3);\n    iVar5 = fxp_realpath_recv(uVar4,uVar3);\n    if (iVar5 == 0) {\n      *pcVar7 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }\n  }" { (expression_statement "*pcVar7 = '\0';" (assignment_expression "*pcVar7 = '\0'" (pointer_expression "*pcVar7" * identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) (if_statement "if (iVar9 == 0) {\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }" if (parenthesized_expression "(iVar9 == 0)" ( (binary_expression "iVar9 == 0" identifier == number_literal) )) (compound_statement "{\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }" { (expression_statement "uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);" (assignment_expression "uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4)" identifier = (call_expression "fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4)" identifier (argument_list "(PTR_s_1_0_000be3a8 + -0x46d4)" ( (binary_expression "PTR_s_1_0_000be3a8 + -0x46d4" identifier + number_literal) )))) ;) }) (else_clause "else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }" else (compound_statement "{\n      uVar3 = fxp_realpath_send(iVar2);\n    }" { (expression_statement "uVar3 = fxp_realpath_send(iVar2);" (assignment_expression "uVar3 = fxp_realpath_send(iVar2)" identifier = (call_expression "fxp_realpath_send(iVar2)" identifier (argument_list "(iVar2)" ( identifier )))) ;) }))) (expression_statement "uVar4 = sftp_wait_for_reply(uVar3);" (assignment_expression "uVar4 = sftp_wait_for_reply(uVar3)" identifier = (call_expression "sftp_wait_for_reply(uVar3)" identifier (argument_list "(uVar3)" ( identifier )))) ;) (expression_statement "iVar5 = fxp_realpath_recv(uVar4,uVar3);" (assignment_expression "iVar5 = fxp_realpath_recv(uVar4,uVar3)" identifier = (call_expression "fxp_realpath_recv(uVar4,uVar3)" identifier (argument_list "(uVar4,uVar3)" ( identifier , identifier )))) ;) (if_statement "if (iVar5 == 0) {\n      *pcVar7 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }" if (parenthesized_expression "(iVar5 == 0)" ( (binary_expression "iVar5 == 0" identifier == number_literal) )) (compound_statement "{\n      *pcVar7 = '/';\n    }" { (expression_statement "*pcVar7 = '/';" (assignment_expression "*pcVar7 = '/'" (pointer_expression "*pcVar7" * identifier) = (char_literal "'/'" ' character ')) ;) }) (else_clause "else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }" else (compound_statement "{\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }" { (expression_statement "iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);" (assignment_expression "iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5)" identifier = (call_expression "(*(code *)PTR_strlen_000bee74)(iVar5)" (parenthesized_expression "(*(code *)PTR_strlen_000bee74)" ( (pointer_expression "*(code *)PTR_strlen_000bee74" * (cast_expression "(code *)PTR_strlen_000bee74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar5)" ( identifier )))) ;) (if_statement "if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }" if (parenthesized_expression "(*(char *)(iVar5 + iVar6 + -1) == '/')" ( (binary_expression "*(char *)(iVar5 + iVar6 + -1) == '/'" (pointer_expression "*(char *)(iVar5 + iVar6 + -1)" * (cast_expression "(char *)(iVar5 + iVar6 + -1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + iVar6 + -1)" ( (binary_expression "iVar5 + iVar6 + -1" (binary_expression "iVar5 + iVar6" identifier + identifier) + number_literal) )))) == (char_literal "'/'" ' character ')) )) (compound_statement "{\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }" { (expression_statement "puVar8 = PTR_s_1_0_000be3a8 + 0x884;" (assignment_expression "puVar8 = PTR_s_1_0_000be3a8 + 0x884" identifier = (binary_expression "PTR_s_1_0_000be3a8 + 0x884" identifier + number_literal)) ;) }) (else_clause "else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }" else (compound_statement "{\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }" { (expression_statement "puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;" (assignment_expression "puVar8 = PTR_s_1_0_000be3a8 + -0x46d4" identifier = (binary_expression "PTR_s_1_0_000be3a8 + -0x46d4" identifier + number_literal)) ;) }))) (expression_statement "iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);" (assignment_expression "iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0)" identifier = (call_expression "dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0)" identifier (argument_list "(iVar5,puVar8,iVar2 + iVar9 + 1,0)" ( identifier , identifier , (binary_expression "iVar2 + iVar9 + 1" (binary_expression "iVar2 + iVar9" identifier + identifier) + number_literal) , number_literal )))) ;) (expression_statement "safefree(iVar2);" (call_expression "safefree(iVar2)" identifier (argument_list "(iVar2)" ( identifier ))) ;) (expression_statement "safefree(iVar5);" (call_expression "safefree(iVar5)" identifier (argument_list "(iVar5)" ( identifier ))) ;) (expression_statement "iVar2 = iVar9;" (assignment_expression "iVar2 = iVar9" identifier = identifier) ;) }))) })) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == (char_literal ' character ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT + IDENT) + LIT) )))) == (char_literal ' character ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }))) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , LIT )))) ;) }))) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) ;)) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != (char_literal ' character ')) )) (compound_statement { (return_statement return IDENT ;) })) (goto_statement goto statement_identifier ;) })) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT + IDENT) + LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == (char_literal ' character ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (char_literal ' escape_sequence ')) ;) })) }))) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) ))))) ;) (while_statement while (parenthesized_expression ( (binary_expression IDENT != (char_literal ' character ')) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) ))))) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) ;) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , (binary_expression IDENT + LIT) )))) ;)) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != LIT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , (binary_expression IDENT + LIT) )))) , (binary_expression IDENT != LIT)) ))) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , (binary_expression IDENT + LIT) )))) , (binary_expression IDENT != LIT)) ))) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (char_literal ' escape_sequence ')) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) )))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) }))) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (char_literal ' character ')) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT + IDENT) + LIT) )))) == (char_literal ' character ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }))) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , (binary_expression (binary_expression IDENT + IDENT) + LIT) , LIT )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }))) })) (return_statement return IDENT ;) })))
(function_definition "int canonify(char *param_1)\n\n{\n  char cVar1;\n  int iVar2;\n  undefined4 uVar3;\n  undefined4 uVar4;\n  int iVar5;\n  int iVar6;\n  char *pcVar7;\n  undefined *puVar8;\n  int iVar9;\n  \n  if (*param_1 == '/') {\n    iVar2 = dupstr();\n  }\n  else {\n    iVar9 = *(int *)PTR_pwd_000be5b4;\n    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);\n    if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }\n    iVar2 = dupcat(iVar9,puVar8,param_1,0);\n  }\n  uVar3 = fxp_realpath_send(iVar2);\n  uVar4 = sftp_wait_for_reply(uVar3);\n  iVar9 = fxp_realpath_recv(uVar4,uVar3);\n  if (iVar9 != 0) {\n    safefree(iVar2);\n    return iVar9;\n  }\n  iVar9 = (*(code *)PTR_strlen_000bee74)(iVar2);\n  if (iVar9 < 3) {\n    if (iVar9 < 1) {\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }\n  }\n  else {\n    pcVar7 = (char *)(iVar2 + iVar9 + -1);\n    if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }\n  }\n  iVar9 = iVar9 + -1;\n  cVar1 = *(char *)(iVar2 + iVar9);\n  while (cVar1 != '/') {\n    if (iVar9 < 1) goto LAB_0002a370;\n    iVar9 = iVar9 + -1;\n    cVar1 = *(char *)(iVar2 + iVar9);\n  }\n  pcVar7 = (char *)(iVar2 + iVar9);\nLAB_0002a234:\n  iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0);\n  if (((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&\n     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)) {\n    *pcVar7 = '\0';\n    if (iVar9 == 0) {\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }\n    uVar4 = sftp_wait_for_reply(uVar3);\n    iVar5 = fxp_realpath_recv(uVar4,uVar3);\n    if (iVar5 == 0) {\n      *pcVar7 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }\n  }\n  return iVar2;\n}" (primitive_type "int") (function_declarator "canonify(char *param_1)" (identifier "canonify") (parameter_list "(char *param_1)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  undefined4 uVar3;\n  undefined4 uVar4;\n  int iVar5;\n  int iVar6;\n  char *pcVar7;\n  undefined *puVar8;\n  int iVar9;\n  \n  if (*param_1 == '/') {\n    iVar2 = dupstr();\n  }\n  else {\n    iVar9 = *(int *)PTR_pwd_000be5b4;\n    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);\n    if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }\n    iVar2 = dupcat(iVar9,puVar8,param_1,0);\n  }\n  uVar3 = fxp_realpath_send(iVar2);\n  uVar4 = sftp_wait_for_reply(uVar3);\n  iVar9 = fxp_realpath_recv(uVar4,uVar3);\n  if (iVar9 != 0) {\n    safefree(iVar2);\n    return iVar9;\n  }\n  iVar9 = (*(code *)PTR_strlen_000bee74)(iVar2);\n  if (iVar9 < 3) {\n    if (iVar9 < 1) {\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }\n  }\n  else {\n    pcVar7 = (char *)(iVar2 + iVar9 + -1);\n    if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }\n  }\n  iVar9 = iVar9 + -1;\n  cVar1 = *(char *)(iVar2 + iVar9);\n  while (cVar1 != '/') {\n    if (iVar9 < 1) goto LAB_0002a370;\n    iVar9 = iVar9 + -1;\n    cVar1 = *(char *)(iVar2 + iVar9);\n  }\n  pcVar7 = (char *)(iVar2 + iVar9);\nLAB_0002a234:\n  iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0);\n  if (((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&\n     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)) {\n    *pcVar7 = '\0';\n    if (iVar9 == 0) {\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }\n    uVar4 = sftp_wait_for_reply(uVar3);\n    iVar5 = fxp_realpath_recv(uVar4,uVar3);\n    if (iVar5 == 0) {\n      *pcVar7 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }\n  }\n  return iVar2;\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined4 uVar3;" (type_identifier "undefined4") (identifier "uVar3") (; ";")) (declaration "undefined4 uVar4;" (type_identifier "undefined4") (identifier "uVar4") (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (declaration "int iVar6;" (primitive_type "int") (identifier "iVar6") (; ";")) (declaration "char *pcVar7;" (primitive_type "char") (pointer_declarator "*pcVar7" (* "*") (identifier "pcVar7")) (; ";")) (declaration "undefined *puVar8;" (type_identifier "undefined") (pointer_declarator "*puVar8" (* "*") (identifier "puVar8")) (; ";")) (declaration "int iVar9;" (primitive_type "int") (identifier "iVar9") (; ";")) (if_statement "if (*param_1 == '/') {\n    iVar2 = dupstr();\n  }\n  else {\n    iVar9 = *(int *)PTR_pwd_000be5b4;\n    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);\n    if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }\n    iVar2 = dupcat(iVar9,puVar8,param_1,0);\n  }" (if "if") (parenthesized_expression "(*param_1 == '/')" (( "(") (binary_expression "*param_1 == '/'" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (== "==") (char_literal "'/'" (' "'") (character "/") (' "'"))) () ")")) (compound_statement "{\n    iVar2 = dupstr();\n  }" ({ "{") (expression_statement "iVar2 = dupstr();" (assignment_expression "iVar2 = dupstr()" (identifier "iVar2") (= "=") (call_expression "dupstr()" (identifier "dupstr") (argument_list "()" (( "(") () ")")))) (; ";")) (} "}")) (else_clause "else {\n    iVar9 = *(int *)PTR_pwd_000be5b4;\n    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);\n    if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }\n    iVar2 = dupcat(iVar9,puVar8,param_1,0);\n  }" (else "else") (compound_statement "{\n    iVar9 = *(int *)PTR_pwd_000be5b4;\n    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);\n    if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }\n    iVar2 = dupcat(iVar9,puVar8,param_1,0);\n  }" ({ "{") (expression_statement "iVar9 = *(int *)PTR_pwd_000be5b4;" (assignment_expression "iVar9 = *(int *)PTR_pwd_000be5b4" (identifier "iVar9") (= "=") (pointer_expression "*(int *)PTR_pwd_000be5b4" (* "*") (cast_expression "(int *)PTR_pwd_000be5b4" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_pwd_000be5b4")))) (; ";")) (expression_statement "iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);" (assignment_expression "iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9)" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_strlen_000bee74)(iVar9)" (parenthesized_expression "(*(code *)PTR_strlen_000bee74)" (( "(") (pointer_expression "*(code *)PTR_strlen_000bee74" (* "*") (cast_expression "(code *)PTR_strlen_000bee74" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_strlen_000bee74"))) () ")")) (argument_list "(iVar9)" (( "(") (identifier "iVar9") () ")")))) (; ";")) (if_statement "if (*(char *)(iVar9 + iVar2 + -1) == '/') {\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }\n    else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }" (if "if") (parenthesized_expression "(*(char *)(iVar9 + iVar2 + -1) == '/')" (( "(") (binary_expression "*(char *)(iVar9 + iVar2 + -1) == '/'" (pointer_expression "*(char *)(iVar9 + iVar2 + -1)" (* "*") (cast_expression "(char *)(iVar9 + iVar2 + -1)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar9 + iVar2 + -1)" (( "(") (binary_expression "iVar9 + iVar2 + -1" (binary_expression "iVar9 + iVar2" (identifier "iVar9") (+ "+") (identifier "iVar2")) (+ "+") (number_literal "-1")) () ")")))) (== "==") (char_literal "'/'" (' "'") (character "/") (' "'"))) () ")")) (compound_statement "{\n      puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n    }" ({ "{") (expression_statement "puVar8 = PTR_s_1_0_000be3a8 + 0x884;" (assignment_expression "puVar8 = PTR_s_1_0_000be3a8 + 0x884" (identifier "puVar8") (= "=") (binary_expression "PTR_s_1_0_000be3a8 + 0x884" (identifier "PTR_s_1_0_000be3a8") (+ "+") (number_literal "0x884"))) (; ";")) (} "}")) (else_clause "else {\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }" (else "else") (compound_statement "{\n      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n    }" ({ "{") (expression_statement "puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;" (assignment_expression "puVar8 = PTR_s_1_0_000be3a8 + -0x46d4" (identifier "puVar8") (= "=") (binary_expression "PTR_s_1_0_000be3a8 + -0x46d4" (identifier "PTR_s_1_0_000be3a8") (+ "+") (number_literal "-0x46d4"))) (; ";")) (} "}")))) (expression_statement "iVar2 = dupcat(iVar9,puVar8,param_1,0);" (assignment_expression "iVar2 = dupcat(iVar9,puVar8,param_1,0)" (identifier "iVar2") (= "=") (call_expression "dupcat(iVar9,puVar8,param_1,0)" (identifier "dupcat") (argument_list "(iVar9,puVar8,param_1,0)" (( "(") (identifier "iVar9") (, ",") (identifier "puVar8") (, ",") (identifier "param_1") (, ",") (number_literal "0") () ")")))) (; ";")) (} "}")))) (expression_statement "uVar3 = fxp_realpath_send(iVar2);" (assignment_expression "uVar3 = fxp_realpath_send(iVar2)" (identifier "uVar3") (= "=") (call_expression "fxp_realpath_send(iVar2)" (identifier "fxp_realpath_send") (argument_list "(iVar2)" (( "(") (identifier "iVar2") () ")")))) (; ";")) (expression_statement "uVar4 = sftp_wait_for_reply(uVar3);" (assignment_expression "uVar4 = sftp_wait_for_reply(uVar3)" (identifier "uVar4") (= "=") (call_expression "sftp_wait_for_reply(uVar3)" (identifier "sftp_wait_for_reply") (argument_list "(uVar3)" (( "(") (identifier "uVar3") () ")")))) (; ";")) (expression_statement "iVar9 = fxp_realpath_recv(uVar4,uVar3);" (assignment_expression "iVar9 = fxp_realpath_recv(uVar4,uVar3)" (identifier "iVar9") (= "=") (call_expression "fxp_realpath_recv(uVar4,uVar3)" (identifier "fxp_realpath_recv") (argument_list "(uVar4,uVar3)" (( "(") (identifier "uVar4") (, ",") (identifier "uVar3") () ")")))) (; ";")) (if_statement "if (iVar9 != 0) {\n    safefree(iVar2);\n    return iVar9;\n  }" (if "if") (parenthesized_expression "(iVar9 != 0)" (( "(") (binary_expression "iVar9 != 0" (identifier "iVar9") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    safefree(iVar2);\n    return iVar9;\n  }" ({ "{") (expression_statement "safefree(iVar2);" (call_expression "safefree(iVar2)" (identifier "safefree") (argument_list "(iVar2)" (( "(") (identifier "iVar2") () ")"))) (; ";")) (return_statement "return iVar9;" (return "return") (identifier "iVar9") (; ";")) (} "}"))) (expression_statement "iVar9 = (*(code *)PTR_strlen_000bee74)(iVar2);" (assignment_expression "iVar9 = (*(code *)PTR_strlen_000bee74)(iVar2)" (identifier "iVar9") (= "=") (call_expression "(*(code *)PTR_strlen_000bee74)(iVar2)" (parenthesized_expression "(*(code *)PTR_strlen_000bee74)" (( "(") (pointer_expression "*(code *)PTR_strlen_000bee74" (* "*") (cast_expression "(code *)PTR_strlen_000bee74" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_strlen_000bee74"))) () ")")) (argument_list "(iVar2)" (( "(") (identifier "iVar2") () ")")))) (; ";")) (if_statement "if (iVar9 < 3) {\n    if (iVar9 < 1) {\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }\n  }\n  else {\n    pcVar7 = (char *)(iVar2 + iVar9 + -1);\n    if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }\n  }" (if "if") (parenthesized_expression "(iVar9 < 3)" (( "(") (binary_expression "iVar9 < 3" (identifier "iVar9") (< "<") (number_literal "3")) () ")")) (compound_statement "{\n    if (iVar9 < 1) {\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }\n  }" ({ "{") (if_statement "if (iVar9 < 1) {\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }" (if "if") (parenthesized_expression "(iVar9 < 1)" (( "(") (binary_expression "iVar9 < 1" (identifier "iVar9") (< "<") (number_literal "1")) () ")")) (compound_statement "{\nLAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);\n      if (*pcVar7 != '/') {\n        return iVar2;\n      }\n      goto LAB_0002a234;\n    }" ({ "{") (labeled_statement "LAB_0002a370:\n      pcVar7 = (char *)(iVar2 + iVar9);" (statement_identifier "LAB_0002a370") (: ":") (expression_statement "pcVar7 = (char *)(iVar2 + iVar9);" (assignment_expression "pcVar7 = (char *)(iVar2 + iVar9)" (identifier "pcVar7") (= "=") (cast_expression "(char *)(iVar2 + iVar9)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + iVar9)" (( "(") (binary_expression "iVar2 + iVar9" (identifier "iVar2") (+ "+") (identifier "iVar9")) () ")")))) (; ";"))) (if_statement "if (*pcVar7 != '/') {\n        return iVar2;\n      }" (if "if") (parenthesized_expression "(*pcVar7 != '/')" (( "(") (binary_expression "*pcVar7 != '/'" (pointer_expression "*pcVar7" (* "*") (identifier "pcVar7")) (!= "!=") (char_literal "'/'" (' "'") (character "/") (' "'"))) () ")")) (compound_statement "{\n        return iVar2;\n      }" ({ "{") (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))) (goto_statement "goto LAB_0002a234;" (goto "goto") (statement_identifier "LAB_0002a234") (; ";")) (} "}"))) (} "}")) (else_clause "else {\n    pcVar7 = (char *)(iVar2 + iVar9 + -1);\n    if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }\n  }" (else "else") (compound_statement "{\n    pcVar7 = (char *)(iVar2 + iVar9 + -1);\n    if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }\n  }" ({ "{") (expression_statement "pcVar7 = (char *)(iVar2 + iVar9 + -1);" (assignment_expression "pcVar7 = (char *)(iVar2 + iVar9 + -1)" (identifier "pcVar7") (= "=") (cast_expression "(char *)(iVar2 + iVar9 + -1)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + iVar9 + -1)" (( "(") (binary_expression "iVar2 + iVar9 + -1" (binary_expression "iVar2 + iVar9" (identifier "iVar2") (+ "+") (identifier "iVar9")) (+ "+") (number_literal "-1")) () ")")))) (; ";")) (if_statement "if (*pcVar7 == '/') {\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }" (if "if") (parenthesized_expression "(*pcVar7 == '/')" (( "(") (binary_expression "*pcVar7 == '/'" (pointer_expression "*pcVar7" (* "*") (identifier "pcVar7")) (== "==") (char_literal "'/'" (' "'") (character "/") (' "'"))) () ")")) (compound_statement "{\n      iVar9 = iVar9 + -1;\n      *pcVar7 = '\0';\n    }" ({ "{") (expression_statement "iVar9 = iVar9 + -1;" (assignment_expression "iVar9 = iVar9 + -1" (identifier "iVar9") (= "=") (binary_expression "iVar9 + -1" (identifier "iVar9") (+ "+") (number_literal "-1"))) (; ";")) (expression_statement "*pcVar7 = '\0';" (assignment_expression "*pcVar7 = '\0'" (pointer_expression "*pcVar7" (* "*") (identifier "pcVar7")) (= "=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) (; ";")) (} "}"))) (} "}")))) (expression_statement "iVar9 = iVar9 + -1;" (assignment_expression "iVar9 = iVar9 + -1" (identifier "iVar9") (= "=") (binary_expression "iVar9 + -1" (identifier "iVar9") (+ "+") (number_literal "-1"))) (; ";")) (expression_statement "cVar1 = *(char *)(iVar2 + iVar9);" (assignment_expression "cVar1 = *(char *)(iVar2 + iVar9)" (identifier "cVar1") (= "=") (pointer_expression "*(char *)(iVar2 + iVar9)" (* "*") (cast_expression "(char *)(iVar2 + iVar9)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + iVar9)" (( "(") (binary_expression "iVar2 + iVar9" (identifier "iVar2") (+ "+") (identifier "iVar9")) () ")"))))) (; ";")) (while_statement "while (cVar1 != '/') {\n    if (iVar9 < 1) goto LAB_0002a370;\n    iVar9 = iVar9 + -1;\n    cVar1 = *(char *)(iVar2 + iVar9);\n  }" (while "while") (parenthesized_expression "(cVar1 != '/')" (( "(") (binary_expression "cVar1 != '/'" (identifier "cVar1") (!= "!=") (char_literal "'/'" (' "'") (character "/") (' "'"))) () ")")) (compound_statement "{\n    if (iVar9 < 1) goto LAB_0002a370;\n    iVar9 = iVar9 + -1;\n    cVar1 = *(char *)(iVar2 + iVar9);\n  }" ({ "{") (if_statement "if (iVar9 < 1) goto LAB_0002a370;" (if "if") (parenthesized_expression "(iVar9 < 1)" (( "(") (binary_expression "iVar9 < 1" (identifier "iVar9") (< "<") (number_literal "1")) () ")")) (goto_statement "goto LAB_0002a370;" (goto "goto") (statement_identifier "LAB_0002a370") (; ";"))) (expression_statement "iVar9 = iVar9 + -1;" (assignment_expression "iVar9 = iVar9 + -1" (identifier "iVar9") (= "=") (binary_expression "iVar9 + -1" (identifier "iVar9") (+ "+") (number_literal "-1"))) (; ";")) (expression_statement "cVar1 = *(char *)(iVar2 + iVar9);" (assignment_expression "cVar1 = *(char *)(iVar2 + iVar9)" (identifier "cVar1") (= "=") (pointer_expression "*(char *)(iVar2 + iVar9)" (* "*") (cast_expression "(char *)(iVar2 + iVar9)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + iVar9)" (( "(") (binary_expression "iVar2 + iVar9" (identifier "iVar2") (+ "+") (identifier "iVar9")) () ")"))))) (; ";")) (} "}"))) (expression_statement "pcVar7 = (char *)(iVar2 + iVar9);" (assignment_expression "pcVar7 = (char *)(iVar2 + iVar9)" (identifier "pcVar7") (= "=") (cast_expression "(char *)(iVar2 + iVar9)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + iVar9)" (( "(") (binary_expression "iVar2 + iVar9" (identifier "iVar2") (+ "+") (identifier "iVar9")) () ")")))) (; ";")) (labeled_statement "LAB_0002a234:\n  iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0);" (statement_identifier "LAB_0002a234") (: ":") (expression_statement "iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0);" (assignment_expression "iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0)" (identifier "iVar5") (= "=") (call_expression "(*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0)" (parenthesized_expression "(*(code *)PTR_strcmp_000bef68)" (( "(") (pointer_expression "*(code *)PTR_strcmp_000bef68" (* "*") (cast_expression "(code *)PTR_strcmp_000bef68" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_strcmp_000bef68"))) () ")")) (argument_list "(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0)" (( "(") (identifier "pcVar7") (, ",") (binary_expression "PTR_s_1_0_000be3a8 + -0x46d0" (identifier "PTR_s_1_0_000be3a8") (+ "+") (number_literal "-0x46d0")) () ")")))) (; ";"))) (if_statement "if (((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&\n     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)) {\n    *pcVar7 = '\0';\n    if (iVar9 == 0) {\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }\n    uVar4 = sftp_wait_for_reply(uVar3);\n    iVar5 = fxp_realpath_recv(uVar4,uVar3);\n    if (iVar5 == 0) {\n      *pcVar7 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }\n  }" (if "if") (parenthesized_expression "(((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&\n     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0))" (( "(") (binary_expression "((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&\n     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)" (parenthesized_expression "((iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0))" (( "(") (binary_expression "(iVar5 != 0) &&\n      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)" (parenthesized_expression "(iVar5 != 0)" (( "(") (binary_expression "iVar5 != 0" (identifier "iVar5") (!= "!=") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)" (( "(") (comma_expression "iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0" (assignment_expression "iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc)" (identifier "iVar5") (= "=") (call_expression "(*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc)" (parenthesized_expression "(*(code *)PTR_strcmp_000bef68)" (( "(") (pointer_expression "*(code *)PTR_strcmp_000bef68" (* "*") (cast_expression "(code *)PTR_strcmp_000bef68" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_strcmp_000bef68"))) () ")")) (argument_list "(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc)" (( "(") (identifier "pcVar7") (, ",") (binary_expression "PTR_s_1_0_000be3a8 + -0x46cc" (identifier "PTR_s_1_0_000be3a8") (+ "+") (number_literal "-0x46cc")) () ")")))) (, ",") (binary_expression "iVar5 != 0" (identifier "iVar5") (!= "!=") (number_literal "0"))) () ")"))) () ")")) (&& "&&") (parenthesized_expression "(iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)" (( "(") (comma_expression "iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0" (assignment_expression "iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4)" (identifier "iVar5") (= "=") (call_expression "(*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4)" (parenthesized_expression "(*(code *)PTR_strcmp_000bef68)" (( "(") (pointer_expression "*(code *)PTR_strcmp_000bef68" (* "*") (cast_expression "(code *)PTR_strcmp_000bef68" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_strcmp_000bef68"))) () ")")) (argument_list "(iVar2,PTR_s_1_0_000be3a8 + -0x46d4)" (( "(") (identifier "iVar2") (, ",") (binary_expression "PTR_s_1_0_000be3a8 + -0x46d4" (identifier "PTR_s_1_0_000be3a8") (+ "+") (number_literal "-0x46d4")) () ")")))) (, ",") (binary_expression "iVar5 != 0" (identifier "iVar5") (!= "!=") (number_literal "0"))) () ")"))) () ")")) (compound_statement "{\n    *pcVar7 = '\0';\n    if (iVar9 == 0) {\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }\n    uVar4 = sftp_wait_for_reply(uVar3);\n    iVar5 = fxp_realpath_recv(uVar4,uVar3);\n    if (iVar5 == 0) {\n      *pcVar7 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }\n  }" ({ "{") (expression_statement "*pcVar7 = '\0';" (assignment_expression "*pcVar7 = '\0'" (pointer_expression "*pcVar7" (* "*") (identifier "pcVar7")) (= "=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) (; ";")) (if_statement "if (iVar9 == 0) {\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }\n    else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }" (if "if") (parenthesized_expression "(iVar9 == 0)" (( "(") (binary_expression "iVar9 == 0" (identifier "iVar9") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);\n    }" ({ "{") (expression_statement "uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);" (assignment_expression "uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4)" (identifier "uVar3") (= "=") (call_expression "fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4)" (identifier "fxp_realpath_send") (argument_list "(PTR_s_1_0_000be3a8 + -0x46d4)" (( "(") (binary_expression "PTR_s_1_0_000be3a8 + -0x46d4" (identifier "PTR_s_1_0_000be3a8") (+ "+") (number_literal "-0x46d4")) () ")")))) (; ";")) (} "}")) (else_clause "else {\n      uVar3 = fxp_realpath_send(iVar2);\n    }" (else "else") (compound_statement "{\n      uVar3 = fxp_realpath_send(iVar2);\n    }" ({ "{") (expression_statement "uVar3 = fxp_realpath_send(iVar2);" (assignment_expression "uVar3 = fxp_realpath_send(iVar2)" (identifier "uVar3") (= "=") (call_expression "fxp_realpath_send(iVar2)" (identifier "fxp_realpath_send") (argument_list "(iVar2)" (( "(") (identifier "iVar2") () ")")))) (; ";")) (} "}")))) (expression_statement "uVar4 = sftp_wait_for_reply(uVar3);" (assignment_expression "uVar4 = sftp_wait_for_reply(uVar3)" (identifier "uVar4") (= "=") (call_expression "sftp_wait_for_reply(uVar3)" (identifier "sftp_wait_for_reply") (argument_list "(uVar3)" (( "(") (identifier "uVar3") () ")")))) (; ";")) (expression_statement "iVar5 = fxp_realpath_recv(uVar4,uVar3);" (assignment_expression "iVar5 = fxp_realpath_recv(uVar4,uVar3)" (identifier "iVar5") (= "=") (call_expression "fxp_realpath_recv(uVar4,uVar3)" (identifier "fxp_realpath_recv") (argument_list "(uVar4,uVar3)" (( "(") (identifier "uVar4") (, ",") (identifier "uVar3") () ")")))) (; ";")) (if_statement "if (iVar5 == 0) {\n      *pcVar7 = '/';\n    }\n    else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }" (if "if") (parenthesized_expression "(iVar5 == 0)" (( "(") (binary_expression "iVar5 == 0" (identifier "iVar5") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      *pcVar7 = '/';\n    }" ({ "{") (expression_statement "*pcVar7 = '/';" (assignment_expression "*pcVar7 = '/'" (pointer_expression "*pcVar7" (* "*") (identifier "pcVar7")) (= "=") (char_literal "'/'" (' "'") (character "/") (' "'"))) (; ";")) (} "}")) (else_clause "else {\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }" (else "else") (compound_statement "{\n      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);\n      if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }\n      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);\n      safefree(iVar2);\n      safefree(iVar5);\n      iVar2 = iVar9;\n    }" ({ "{") (expression_statement "iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);" (assignment_expression "iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5)" (identifier "iVar6") (= "=") (call_expression "(*(code *)PTR_strlen_000bee74)(iVar5)" (parenthesized_expression "(*(code *)PTR_strlen_000bee74)" (( "(") (pointer_expression "*(code *)PTR_strlen_000bee74" (* "*") (cast_expression "(code *)PTR_strlen_000bee74" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_strlen_000bee74"))) () ")")) (argument_list "(iVar5)" (( "(") (identifier "iVar5") () ")")))) (; ";")) (if_statement "if (*(char *)(iVar5 + iVar6 + -1) == '/') {\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }\n      else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }" (if "if") (parenthesized_expression "(*(char *)(iVar5 + iVar6 + -1) == '/')" (( "(") (binary_expression "*(char *)(iVar5 + iVar6 + -1) == '/'" (pointer_expression "*(char *)(iVar5 + iVar6 + -1)" (* "*") (cast_expression "(char *)(iVar5 + iVar6 + -1)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar5 + iVar6 + -1)" (( "(") (binary_expression "iVar5 + iVar6 + -1" (binary_expression "iVar5 + iVar6" (identifier "iVar5") (+ "+") (identifier "iVar6")) (+ "+") (number_literal "-1")) () ")")))) (== "==") (char_literal "'/'" (' "'") (character "/") (' "'"))) () ")")) (compound_statement "{\n        puVar8 = PTR_s_1_0_000be3a8 + 0x884;\n      }" ({ "{") (expression_statement "puVar8 = PTR_s_1_0_000be3a8 + 0x884;" (assignment_expression "puVar8 = PTR_s_1_0_000be3a8 + 0x884" (identifier "puVar8") (= "=") (binary_expression "PTR_s_1_0_000be3a8 + 0x884" (identifier "PTR_s_1_0_000be3a8") (+ "+") (number_literal "0x884"))) (; ";")) (} "}")) (else_clause "else {\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }" (else "else") (compound_statement "{\n        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;\n      }" ({ "{") (expression_statement "puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;" (assignment_expression "puVar8 = PTR_s_1_0_000be3a8 + -0x46d4" (identifier "puVar8") (= "=") (binary_expression "PTR_s_1_0_000be3a8 + -0x46d4" (identifier "PTR_s_1_0_000be3a8") (+ "+") (number_literal "-0x46d4"))) (; ";")) (} "}")))) (expression_statement "iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);" (assignment_expression "iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0)" (identifier "iVar9") (= "=") (call_expression "dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0)" (identifier "dupcat") (argument_list "(iVar5,puVar8,iVar2 + iVar9 + 1,0)" (( "(") (identifier "iVar5") (, ",") (identifier "puVar8") (, ",") (binary_expression "iVar2 + iVar9 + 1" (binary_expression "iVar2 + iVar9" (identifier "iVar2") (+ "+") (identifier "iVar9")) (+ "+") (number_literal "1")) (, ",") (number_literal "0") () ")")))) (; ";")) (expression_statement "safefree(iVar2);" (call_expression "safefree(iVar2)" (identifier "safefree") (argument_list "(iVar2)" (( "(") (identifier "iVar2") () ")"))) (; ";")) (expression_statement "safefree(iVar5);" (call_expression "safefree(iVar5)" (identifier "safefree") (argument_list "(iVar5)" (( "(") (identifier "iVar5") () ")"))) (; ";")) (expression_statement "iVar2 = iVar9;" (assignment_expression "iVar2 = iVar9" (identifier "iVar2") (= "=") (identifier "iVar9")) (; ";")) (} "}")))) (} "}"))) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}")))

char * function_1(char *name)

{
  char var_11;
  int var_2;
  type_1 *psVar3;
  type_2 *psVar4;
  char *var_8;
  char *var_13;
  int var_12;
  type_3 *puVar7;
  char *var_10;
  
  if (*name == '/') {
                    /* WARNING: Subroutine does not return */
    var_1(name);
  }
  var_10 = *(char **)PTR_pwd_000be5b4;
  var_2 = (*(type_4 *)PTR_strlen_000bee74)(var_10);
  if (var_10[var_2 + -1] == '/') {
    puVar7 = var_3 + 0x884;
  }
  else {
    puVar7 = var_3 + -0x46d4;
  }
  var_10 = var_4(var_10,puVar7,name,0);
  psVar3 = var_5(var_10);
  psVar4 = var_6(psVar3);
  var_8 = var_7(psVar4,psVar3);
  if (var_8 != (char *)0x0) {
    var_9(var_10);
    return var_8;
  }
  var_2 = (*(type_4 *)PTR_strlen_000bee74)(var_10);
  if (var_2 < 3) {
    if (var_2 < 1) {
LAB_0002a370:
      var_8 = var_10 + var_2;
      if (*var_8 != '/') {
        return var_10;
      }
      goto LAB_0002a234;
    }
  }
  else {
    var_12 = var_2 + -1;
    if (var_10[var_12] == '/') {
      var_2 = var_2 + -1;
      var_10[var_12] = '\0';
    }
  }
  var_2 = var_2 + -1;
  var_11 = var_10[var_2];
  while (var_11 != '/') {
    if (var_2 < 1) goto LAB_0002a370;
    var_2 = var_2 + -1;
    var_11 = var_10[var_2];
  }
  var_8 = var_10 + var_2;
LAB_0002a234:
  var_12 = (*(type_4 *)PTR_strcmp_000bef68)(var_8,var_3 + -0x46d0);
  if (((var_12 != 0) &&
      (var_12 = (*(type_4 *)PTR_strcmp_000bef68)(var_8,var_3 + -0x46cc), var_12 != 0)) &&
     (var_12 = (*(type_4 *)PTR_strcmp_000bef68)(var_10,var_3 + -0x46d4), var_12 != 0)) {
    *var_8 = '\0';
    if (var_2 == 0) {
      psVar3 = var_5(var_3 + -0x46d4);
    }
    else {
      psVar3 = var_5(var_10);
    }
    psVar4 = var_6(psVar3);
    var_13 = var_7(psVar4,psVar3);
    if (var_13 == (char *)0x0) {
      *var_8 = '/';
    }
    else {
      var_12 = (*(type_4 *)PTR_strlen_000bee74)(var_13);
      if (var_13[var_12 + -1] == '/') {
        puVar7 = var_3 + 0x884;
      }
      else {
        puVar7 = var_3 + -0x46d4;
      }
      var_8 = var_4(var_13,puVar7,var_10 + var_2 + 1,0);
      var_9(var_10);
      var_9(var_13);
      var_10 = var_8;
    }
  }
  return var_10;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (char_literal (character)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (number_literal))))) right: (char_literal (character)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (number_literal)))))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (labeled_statement label: (statement_identifier) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (char_literal (character)))) consequence: (compound_statement (return_statement (identifier)))) (goto_statement label: (statement_identifier))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (char_literal (character)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (char_literal (escape_sequence))))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (character)))) body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (goto_statement label: (statement_identifier))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))))) (labeled_statement label: (statement_identifier) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (comma_expression left: (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (number_literal))))) right: (binary_expression left: (identifier) right: (number_literal)))))) right: (parenthesized_expression (comma_expression left: (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (number_literal))))) right: (binary_expression left: (identifier) right: (number_literal)))))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (char_literal (escape_sequence)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal))))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier)))))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (char_literal (character))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (number_literal))))) right: (char_literal (character)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (number_literal)) (number_literal))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (identifier)))))))) (return_statement (identifier)))))

int MASKED(char *param_1)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  int iVar5;
  int iVar6;
  char *pcVar7;
  undefined *puVar8;
  int iVar9;
  
  if (*param_1 == '/') {
    iVar2 = dupstr();
  }
  else {
    iVar9 = *(int *)PTR_pwd_000be5b4;
    iVar2 = (*(code *)PTR_strlen_000bee74)(iVar9);
    if (*(char *)(iVar9 + iVar2 + -1) == '/') {
      puVar8 = PTR_s_1_0_000be3a8 + 0x884;
    }
    else {
      puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;
    }
    iVar2 = dupcat(iVar9,puVar8,param_1,0);
  }
  uVar3 = fxp_realpath_send(iVar2);
  uVar4 = sftp_wait_for_reply(uVar3);
  iVar9 = fxp_realpath_recv(uVar4,uVar3);
  if (iVar9 != 0) {
    safefree(iVar2);
    return iVar9;
  }
  iVar9 = (*(code *)PTR_strlen_000bee74)(iVar2);
  if (iVar9 < 3) {
    if (iVar9 < 1) {
LAB_0002a370:
      pcVar7 = (char *)(iVar2 + iVar9);
      if (*pcVar7 != '/') {
        return iVar2;
      }
      goto LAB_0002a234;
    }
  }
  else {
    pcVar7 = (char *)(iVar2 + iVar9 + -1);
    if (*pcVar7 == '/') {
      iVar9 = iVar9 + -1;
      *pcVar7 = '\0';
    }
  }
  iVar9 = iVar9 + -1;
  cVar1 = *(char *)(iVar2 + iVar9);
  while (cVar1 != '/') {
    if (iVar9 < 1) goto LAB_0002a370;
    iVar9 = iVar9 + -1;
    cVar1 = *(char *)(iVar2 + iVar9);
  }
  pcVar7 = (char *)(iVar2 + iVar9);
LAB_0002a234:
  iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46d0);
  if (((iVar5 != 0) &&
      (iVar5 = (*(code *)PTR_strcmp_000bef68)(pcVar7,PTR_s_1_0_000be3a8 + -0x46cc), iVar5 != 0)) &&
     (iVar5 = (*(code *)PTR_strcmp_000bef68)(iVar2,PTR_s_1_0_000be3a8 + -0x46d4), iVar5 != 0)) {
    *pcVar7 = '\0';
    if (iVar9 == 0) {
      uVar3 = fxp_realpath_send(PTR_s_1_0_000be3a8 + -0x46d4);
    }
    else {
      uVar3 = fxp_realpath_send(iVar2);
    }
    uVar4 = sftp_wait_for_reply(uVar3);
    iVar5 = fxp_realpath_recv(uVar4,uVar3);
    if (iVar5 == 0) {
      *pcVar7 = '/';
    }
    else {
      iVar6 = (*(code *)PTR_strlen_000bee74)(iVar5);
      if (*(char *)(iVar5 + iVar6 + -1) == '/') {
        puVar8 = PTR_s_1_0_000be3a8 + 0x884;
      }
      else {
        puVar8 = PTR_s_1_0_000be3a8 + -0x46d4;
      }
      iVar9 = dupcat(iVar5,puVar8,iVar2 + iVar9 + 1,0);
      safefree(iVar2);
      safefree(iVar5);
      iVar2 = iVar9;
    }
  }
  return iVar2;
}

