
int set_loop(char **device,char *file,ulonglong offset,uint flags)

{
  long lVar1;
  uint __fd;
  int iVar2;
  int iVar3;
  int iVar4;
  char *pcVar5;
  long lVar6;
  uint minor;
  bb_loop_info *pbVar7;
  long in_FS_OFFSET;
  byte bVar8;
  int local_1f8;
  ulonglong local_1e0;
  stat statbuf;
  bb_loop_info loopinfo;
  char dev [23];
  
  bVar8 = 0;
  lVar1 = *(long *)(in_FS_OFFSET + 0x28);
  local_1f8 = (flags & 1 ^ 1) * 2;
  while (__fd = __open64_2(file,local_1f8), (int)__fd < 0) {
    if (local_1f8 == 0) {
      iVar3 = -*bb_errno;
      goto LAB_001a03dd;
    }
    local_1f8 = 0;
  }
  pcVar5 = *device;
  if (*device == (char *)0x0) {
    pcVar5 = dev;
  }
  iVar3 = -1;
  minor = 0;
  do {
    __sprintf_chk(dev,1,0x17,"/dev/loop%u",minor);
    *bb_errno = 0;
    iVar2 = __xstat64(1,pcVar5,(stat64 *)&statbuf);
    if ((iVar2 != 0) || ((statbuf.st_mode & 0xf000) != 0x6000)) {
      if ((*bb_errno == 2) && (pcVar5 == dev)) {
        local_1e0 = bb_makedev(7,minor);
        iVar2 = __xmknod(0,dev,0x61a4,&local_1e0);
        if (iVar2 == 0) goto LAB_001a04e8;
      }
LAB_001a06b5:
      close(__fd);
      iVar3 = -1;
      goto LAB_001a03dd;
    }
LAB_001a04e8:
    iVar2 = __open64_2(pcVar5,local_1f8);
    if (iVar2 < 0) {
      if (*bb_errno == 0x1e) {
        iVar2 = open64(pcVar5,0);
        if (-1 < iVar2) {
          local_1f8 = 0;
          goto LAB_001a0597;
        }
        local_1f8 = 0;
      }
      if (*bb_errno == 6) goto LAB_001a06b5;
    }
    else {
LAB_001a0597:
      iVar3 = ioctl(iVar2,0x4c05,&loopinfo);
      if (iVar3 == 0) {
        iVar3 = -1;
      }
      else if (*bb_errno == 6) {
        iVar4 = ioctl(iVar2,0x4c00,(ulong)__fd);
        if (iVar4 == 0) {
          pbVar7 = &loopinfo;
          for (lVar6 = 0x1d; lVar6 != 0; lVar6 = lVar6 + -1) {
            pbVar7->lo_device = 0;
            pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);
          }
          safe_strncpy((char *)loopinfo.lo_file_name,file,0x40);
          loopinfo.lo_flags = flags & 0xfffffffe;
          loopinfo.lo_offset = offset;
          iVar4 = ioctl(iVar2,0x4c04,&loopinfo);
          iVar3 = 0;
          if (iVar4 == 0) {
LAB_001a0559:
            close(__fd);
            if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {
              pcVar5 = xstrdup(dev);
              *device = pcVar5;
            }
LAB_001a03dd:
            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {
              return iVar3;
            }
                    /* WARNING: Subroutine does not return */
            __stack_chk_fail();
          }
          if ((loopinfo.lo_flags & 4) != 0) {
            loopinfo.lo_flags = loopinfo.lo_flags - 4;
            iVar4 = ioctl(iVar2,0x4c04,&loopinfo);
            if (iVar4 == 0) goto LAB_001a0559;
          }
          iVar3 = iVar4;
          ioctl(iVar2,0x4c01,0);
        }
      }
      else {
        iVar3 = -1;
      }
      close(iVar2);
    }
    if (((*device != (char *)0x0) || (minor = minor + 1, iVar3 == 0)) || (0xfffff < (int)minor))
    goto LAB_001a0559;
  } while( true );
}



int FUN_001a037d(long *param_1,undefined8 param_2,undefined8 param_3,uint param_4)

{
  uint __fd;
  int iVar1;
  int iVar2;
  int iVar3;
  long lVar4;
  int iVar5;
  undefined8 *puVar6;
  char *__filename;
  long in_FS_OFFSET;
  byte bVar7;
  int local_1f8;
  __dev_t local_1e0;
  stat64 local_1d8;
  undefined8 local_148 [3];
  undefined8 local_130;
  uint local_114;
  undefined1 local_110 [184];
  char local_58 [24];
  long local_40;
  
  bVar7 = 0;
  local_40 = *(long *)(in_FS_OFFSET + 0x28);
  local_1f8 = (param_4 & 1 ^ 1) * 2;
  while (__fd = __open64_2(param_2,local_1f8), (int)__fd < 0) {
    if (local_1f8 == 0) {
      iVar2 = -*DAT_001c65c0;
      goto LAB_001a03dd;
    }
    local_1f8 = 0;
  }
  __filename = (char *)*param_1;
  if ((char *)*param_1 == (char *)0x0) {
    __filename = local_58;
  }
  iVar2 = -1;
  iVar5 = 0;
  do {
    __sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);
    *DAT_001c65c0 = 0;
    iVar1 = __xstat64(1,__filename,&local_1d8);
    if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {
      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {
        local_1e0 = FUN_001a094e(7,iVar5);
        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);
        if (iVar1 == 0) goto LAB_001a04e8;
      }
LAB_001a06b5:
      close(__fd);
      iVar2 = -1;
      goto LAB_001a03dd;
    }
LAB_001a04e8:
    iVar1 = __open64_2(__filename,local_1f8);
    if (iVar1 < 0) {
      if (*DAT_001c65c0 == 0x1e) {
        iVar1 = open64(__filename,0);
        if (-1 < iVar1) {
          local_1f8 = 0;
          goto LAB_001a0597;
        }
        local_1f8 = 0;
      }
      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;
    }
    else {
LAB_001a0597:
      iVar2 = ioctl(iVar1,0x4c05,local_148);
      if (iVar2 == 0) {
        iVar2 = -1;
      }
      else if (*DAT_001c65c0 == 6) {
        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);
        if (iVar3 == 0) {
          puVar6 = local_148;
          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {
            *puVar6 = 0;
            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;
          }
          FUN_001a49d0(local_110,param_2,0x40);
          local_114 = param_4 & 0xfffffffe;
          local_130 = param_3;
          iVar3 = ioctl(iVar1,0x4c04,local_148);
          iVar2 = 0;
          if (iVar3 == 0) {
LAB_001a0559:
            close(__fd);
            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {
              lVar4 = FUN_0010e627(local_58);
              *param_1 = lVar4;
            }
LAB_001a03dd:
            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {
              return iVar2;
            }
                    /* WARNING: Subroutine does not return */
            __stack_chk_fail();
          }
          if ((local_114 & 4) != 0) {
            local_114 = local_114 - 4;
            iVar3 = ioctl(iVar1,0x4c04,local_148);
            if (iVar3 == 0) goto LAB_001a0559;
          }
          iVar2 = iVar3;
          ioctl(iVar1,0x4c01,0);
        }
      }
      else {
        iVar2 = -1;
      }
      close(iVar1);
    }
    if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))
    goto LAB_001a0559;
  } while( true );
}


PUSH R15
PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x1f8
MOV qword ptr [RSP + 0x10],RDI
MOV qword ptr [RSP + 0x18],RSI
MOV qword ptr [RSP + 0x28],RDX
MOV dword ptr [RSP + 0x34],ECX
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RSP + 0x1e8],RAX
XOR EAX,EAX
MOV EBP,ECX
AND EBP,0x1
XOR EBP,0x1
ADD EBP,EBP
MOV ESI,EBP
MOV RDI,qword ptr [RSP + 0x18]
CALL 0x0010bcc0
TEST EAX,EAX
JNS 0x001a0402
TEST EBP,EBP
JNZ 0x001a03fb
MOV RAX,qword ptr [0x001c65c0]
MOV EBX,dword ptr [RAX]
NEG EBX
MOV EAX,EBX
MOV RDX,qword ptr [RSP + 0x1e8]
XOR RDX,qword ptr FS:[0x28]
JZ 0x001a06c8
CALL 0x0010b500
MOV EBP,0x0
JMP 0x001a03be
MOV dword ptr [RSP + 0xc],EAX
MOV RAX,qword ptr [RSP + 0x10]
MOV R13,qword ptr [RAX]
LEA RAX,[RSP + 0x1d0]
TEST R13,R13
CMOVZ R13,RAX
MOV R14D,0xffffffff
MOV ECX,0x0
MOV qword ptr [RSP + 0x20],RAX
LEA R15,[RSP + 0xe0]
LEA RAX,[R15 + 0x38]
MOV qword ptr [RSP + 0x38],RAX
MOV dword ptr [RSP + 0x30],EBP
MOV EBP,ECX
MOV R8D,EBP
LEA RCX,[0x1bd073]
MOV EDX,0x17
MOV ESI,0x1
MOV RDI,qword ptr [RSP + 0x20]
MOV EAX,0x0
CALL 0x0010c570
MOV RAX,qword ptr [0x001c65c0]
MOV dword ptr [RAX],0x0
LEA RDX,[RSP + 0x50]
MOV RSI,R13
MOV EDI,0x1
CALL 0x0010b410
TEST EAX,EAX
JNZ 0x001a049a
MOV EAX,dword ptr [RSP + 0x68]
AND EAX,0xf000
CMP EAX,0x6000
JZ 0x001a04e8
MOV RAX,qword ptr [0x001c65c0]
CMP dword ptr [RAX],0x2
JNZ 0x001a06b5
MOV RBX,qword ptr [RSP + 0x20]
CMP R13,RBX
JNZ 0x001a06b5
MOV ESI,EBP
MOV EDI,0x7
CALL 0x001a094e
MOV qword ptr [RSP + 0x48],RAX
LEA RCX,[RSP + 0x48]
MOV EDX,0x61a4
MOV RSI,RBX
MOV EDI,0x0
CALL 0x0010bbb0
TEST EAX,EAX
JNZ 0x001a06b5
MOV ESI,dword ptr [RSP + 0x30]
MOV RDI,R13
CALL 0x0010bcc0
MOV EBX,EAX
TEST EAX,EAX
JNS 0x001a0597
MOV RAX,qword ptr [0x001c65c0]
CMP dword ptr [RAX],0x1e
JNZ 0x001a052a
MOV ESI,0x0
MOV RDI,R13
MOV EAX,0x0
CALL 0x0010bff0
MOV EBX,EAX
TEST EAX,EAX
JNS 0x001a058f
MOV dword ptr [RSP + 0x30],0x0
MOV RAX,qword ptr [0x001c65c0]
CMP dword ptr [RAX],0x6
JZ 0x001a06b5
MOV RAX,qword ptr [RSP + 0x10]
CMP qword ptr [RAX],0x0
JNZ 0x001a0559
ADD EBP,0x1
TEST R14D,R14D
JZ 0x001a0559
CMP EBP,0xfffff
JLE 0x001a0444
MOV EDI,dword ptr [RSP + 0xc]
CALL 0x0010b7d0
TEST R14D,R14D
JNZ 0x001a06ad
MOV R15,qword ptr [RSP + 0x10]
CMP qword ptr [R15],0x0
JNZ 0x001a03dd
LEA RDI,[RSP + 0x1d0]
CALL 0x0010e627
MOV qword ptr [R15],RAX
JMP 0x001a03dd
MOV dword ptr [RSP + 0x30],0x0
MOV RDX,R15
MOV ESI,0x4c05
MOV EDI,EBX
MOV EAX,0x0
CALL 0x0010b760
MOV R12D,EAX
TEST EAX,EAX
JZ 0x001a069d
MOV RAX,qword ptr [0x001c65c0]
CMP dword ptr [RAX],0x6
JNZ 0x001a06a5
MOV EDX,dword ptr [RSP + 0xc]
MOV ESI,0x4c00
MOV EDI,EBX
MOV EAX,0x0
CALL 0x0010b760
MOV R14D,EAX
TEST EAX,EAX
JNZ 0x001a068e
MOV ECX,0x1d
MOV EAX,0x0
MOV RDI,R15
STOSQ.REP RDI
MOV EDX,0x40
MOV RSI,qword ptr [RSP + 0x18]
MOV RDI,qword ptr [RSP + 0x38]
CALL 0x001a49d0
MOV RAX,qword ptr [RSP + 0x28]
MOV qword ptr [RSP + 0xf8],RAX
MOV EAX,dword ptr [RSP + 0x34]
AND EAX,0xfffffffe
MOV dword ptr [RSP + 0x114],EAX
MOV RDX,R15
MOV ESI,0x4c04
MOV EDI,EBX
MOV EAX,0x0
CALL 0x0010b760
MOV R12D,EAX
TEST EAX,EAX
JZ 0x001a0559
MOV EAX,dword ptr [RSP + 0x114]
TEST AL,0x4
JZ 0x001a0678
SUB EAX,0x4
MOV dword ptr [RSP + 0x114],EAX
MOV RDX,R15
MOV ESI,0x4c04
MOV EDI,EBX
MOV EAX,0x0
CALL 0x0010b760
MOV R12D,EAX
TEST EAX,EAX
JZ 0x001a0559
MOV EDX,0x0
MOV ESI,0x4c01
MOV EDI,EBX
MOV EAX,0x0
CALL 0x0010b760
MOV EDI,EBX
CALL 0x0010b7d0
MOV R14D,R12D
JMP 0x001a053a
MOV R12D,0xffffffff
JMP 0x001a068e
MOV R12D,0xffffffff
JMP 0x001a068e
MOV EBX,R14D
JMP 0x001a03dd
MOV EDI,dword ptr [RSP + 0xc]
CALL 0x0010b7d0
MOV EBX,0xffffffff
JMP 0x001a03dd
ADD RSP,0x1f8
POP RBX
POP RBP
POP R12
POP R13
POP R14
POP R15
RET
(translation_unit "int FUN_001a037d(long *param_1,undefined8 param_2,undefined8 param_3,uint param_4)\n\n{\n  uint __fd;\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  int iVar5;\n  undefined8 *puVar6;\n  char *__filename;\n  long in_FS_OFFSET;\n  byte bVar7;\n  int local_1f8;\n  __dev_t local_1e0;\n  stat64 local_1d8;\n  undefined8 local_148 [3];\n  undefined8 local_130;\n  uint local_114;\n  undefined1 local_110 [184];\n  char local_58 [24];\n  long local_40;\n  \n  bVar7 = 0;\n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  local_1f8 = (param_4 & 1 ^ 1) * 2;\n  while (__fd = __open64_2(param_2,local_1f8), (int)__fd < 0) {\n    if (local_1f8 == 0) {\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }\n  __filename = (char *)*param_1;\n  if ((char *)*param_1 == (char *)0x0) {\n    __filename = local_58;\n  }\n  iVar2 = -1;\n  iVar5 = 0;\n  do {\n    __sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);\n    *DAT_001c65c0 = 0;\n    iVar1 = __xstat64(1,__filename,&local_1d8);\n    if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar1 = __open64_2(__filename,local_1f8);\n    if (iVar1 < 0) {\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }\n    if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))\n    goto LAB_001a0559;\n  } while( true );\n}\n\n" (function_definition "int FUN_001a037d(long *param_1,undefined8 param_2,undefined8 param_3,uint param_4)\n\n{\n  uint __fd;\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  int iVar5;\n  undefined8 *puVar6;\n  char *__filename;\n  long in_FS_OFFSET;\n  byte bVar7;\n  int local_1f8;\n  __dev_t local_1e0;\n  stat64 local_1d8;\n  undefined8 local_148 [3];\n  undefined8 local_130;\n  uint local_114;\n  undefined1 local_110 [184];\n  char local_58 [24];\n  long local_40;\n  \n  bVar7 = 0;\n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  local_1f8 = (param_4 & 1 ^ 1) * 2;\n  while (__fd = __open64_2(param_2,local_1f8), (int)__fd < 0) {\n    if (local_1f8 == 0) {\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }\n  __filename = (char *)*param_1;\n  if ((char *)*param_1 == (char *)0x0) {\n    __filename = local_58;\n  }\n  iVar2 = -1;\n  iVar5 = 0;\n  do {\n    __sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);\n    *DAT_001c65c0 = 0;\n    iVar1 = __xstat64(1,__filename,&local_1d8);\n    if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar1 = __open64_2(__filename,local_1f8);\n    if (iVar1 < 0) {\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }\n    if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))\n    goto LAB_001a0559;\n  } while( true );\n}" primitive_type (function_declarator "FUN_001a037d(long *param_1,undefined8 param_2,undefined8 param_3,uint param_4)" identifier (parameter_list "(long *param_1,undefined8 param_2,undefined8 param_3,uint param_4)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined8 param_2" type_identifier identifier) , (parameter_declaration "undefined8 param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) ))) (compound_statement "{\n  uint __fd;\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  int iVar5;\n  undefined8 *puVar6;\n  char *__filename;\n  long in_FS_OFFSET;\n  byte bVar7;\n  int local_1f8;\n  __dev_t local_1e0;\n  stat64 local_1d8;\n  undefined8 local_148 [3];\n  undefined8 local_130;\n  uint local_114;\n  undefined1 local_110 [184];\n  char local_58 [24];\n  long local_40;\n  \n  bVar7 = 0;\n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  local_1f8 = (param_4 & 1 ^ 1) * 2;\n  while (__fd = __open64_2(param_2,local_1f8), (int)__fd < 0) {\n    if (local_1f8 == 0) {\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }\n  __filename = (char *)*param_1;\n  if ((char *)*param_1 == (char *)0x0) {\n    __filename = local_58;\n  }\n  iVar2 = -1;\n  iVar5 = 0;\n  do {\n    __sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);\n    *DAT_001c65c0 = 0;\n    iVar1 = __xstat64(1,__filename,&local_1d8);\n    if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar1 = __open64_2(__filename,local_1f8);\n    if (iVar1 < 0) {\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }\n    if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))\n    goto LAB_001a0559;\n  } while( true );\n}" { (declaration "uint __fd;" type_identifier identifier ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "undefined8 *puVar6;" type_identifier (pointer_declarator "*puVar6" * identifier) ;) (declaration "char *__filename;" primitive_type (pointer_declarator "*__filename" * identifier) ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "byte bVar7;" type_identifier identifier ;) (declaration "int local_1f8;" primitive_type identifier ;) (declaration "__dev_t local_1e0;" type_identifier identifier ;) (declaration "stat64 local_1d8;" type_identifier identifier ;) (declaration "undefined8 local_148 [3];" type_identifier (array_declarator "local_148 [3]" identifier [ number_literal ]) ;) (declaration "undefined8 local_130;" type_identifier identifier ;) (declaration "uint local_114;" type_identifier identifier ;) (declaration "undefined1 local_110 [184];" type_identifier (array_declarator "local_110 [184]" identifier [ number_literal ]) ;) (declaration "char local_58 [24];" primitive_type (array_declarator "local_58 [24]" identifier [ number_literal ]) ;) (declaration "long local_40;" (sized_type_specifier "long" long) identifier ;) (expression_statement "bVar7 = 0;" (assignment_expression "bVar7 = 0" identifier = number_literal) ;) (expression_statement "local_40 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_40 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (expression_statement "local_1f8 = (param_4 & 1 ^ 1) * 2;" (assignment_expression "local_1f8 = (param_4 & 1 ^ 1) * 2" identifier = (binary_expression "(param_4 & 1 ^ 1) * 2" (parenthesized_expression "(param_4 & 1 ^ 1)" ( (binary_expression "param_4 & 1 ^ 1" (binary_expression "param_4 & 1" identifier & number_literal) ^ number_literal) )) * number_literal)) ;) (while_statement "while (__fd = __open64_2(param_2,local_1f8), (int)__fd < 0) {\n    if (local_1f8 == 0) {\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }" while (parenthesized_expression "(__fd = __open64_2(param_2,local_1f8), (int)__fd < 0)" ( (comma_expression "__fd = __open64_2(param_2,local_1f8), (int)__fd < 0" (assignment_expression "__fd = __open64_2(param_2,local_1f8)" identifier = (call_expression "__open64_2(param_2,local_1f8)" identifier (argument_list "(param_2,local_1f8)" ( identifier , identifier )))) , (binary_expression "(int)__fd < 0" (cast_expression "(int)__fd" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal)) )) (compound_statement "{\n    if (local_1f8 == 0) {\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }" { (if_statement "if (local_1f8 == 0) {\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }" if (parenthesized_expression "(local_1f8 == 0)" ( (binary_expression "local_1f8 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }" { (expression_statement "iVar2 = -*DAT_001c65c0;" (assignment_expression "iVar2 = -*DAT_001c65c0" identifier = (unary_expression "-*DAT_001c65c0" - (pointer_expression "*DAT_001c65c0" * identifier))) ;) (goto_statement "goto LAB_001a03dd;" goto statement_identifier ;) })) (expression_statement "local_1f8 = 0;" (assignment_expression "local_1f8 = 0" identifier = number_literal) ;) })) (expression_statement "__filename = (char *)*param_1;" (assignment_expression "__filename = (char *)*param_1" identifier = (cast_expression "(char *)*param_1" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (if_statement "if ((char *)*param_1 == (char *)0x0) {\n    __filename = local_58;\n  }" if (parenthesized_expression "((char *)*param_1 == (char *)0x0)" ( (binary_expression "(char *)*param_1 == (char *)0x0" (cast_expression "(char *)*param_1" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)) == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    __filename = local_58;\n  }" { (expression_statement "__filename = local_58;" (assignment_expression "__filename = local_58" identifier = identifier) ;) })) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" identifier = number_literal) ;) (do_statement "do {\n    __sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);\n    *DAT_001c65c0 = 0;\n    iVar1 = __xstat64(1,__filename,&local_1d8);\n    if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar1 = __open64_2(__filename,local_1f8);\n    if (iVar1 < 0) {\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }\n    if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))\n    goto LAB_001a0559;\n  } while( true );" do (compound_statement "{\n    __sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);\n    *DAT_001c65c0 = 0;\n    iVar1 = __xstat64(1,__filename,&local_1d8);\n    if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar1 = __open64_2(__filename,local_1f8);\n    if (iVar1 < 0) {\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }\n    if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))\n    goto LAB_001a0559;\n  }" { (expression_statement "__sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);" (call_expression "__sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5)" identifier (argument_list "(local_58,1,0x17,"/dev/loop%u",iVar5)" ( identifier , number_literal , number_literal , (string_literal ""/dev/loop%u"" " string_content ") , identifier ))) ;) (expression_statement "*DAT_001c65c0 = 0;" (assignment_expression "*DAT_001c65c0 = 0" (pointer_expression "*DAT_001c65c0" * identifier) = number_literal) ;) (expression_statement "iVar1 = __xstat64(1,__filename,&local_1d8);" (assignment_expression "iVar1 = __xstat64(1,__filename,&local_1d8)" identifier = (call_expression "__xstat64(1,__filename,&local_1d8)" identifier (argument_list "(1,__filename,&local_1d8)" ( number_literal , identifier , (pointer_expression "&local_1d8" & identifier) )))) ;) (if_statement "if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }" if (parenthesized_expression "((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000))" ( (binary_expression "(iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)" (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) || (parenthesized_expression "((local_1d8.st_mode & 0xf000) != 0x6000)" ( (binary_expression "(local_1d8.st_mode & 0xf000) != 0x6000" (parenthesized_expression "(local_1d8.st_mode & 0xf000)" ( (binary_expression "local_1d8.st_mode & 0xf000" (field_expression "local_1d8.st_mode" identifier . field_identifier) & number_literal) )) != number_literal) ))) )) (compound_statement "{\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }" { (if_statement "if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }" if (parenthesized_expression "((*DAT_001c65c0 == 2) && (__filename == local_58))" ( (binary_expression "(*DAT_001c65c0 == 2) && (__filename == local_58)" (parenthesized_expression "(*DAT_001c65c0 == 2)" ( (binary_expression "*DAT_001c65c0 == 2" (pointer_expression "*DAT_001c65c0" * identifier) == number_literal) )) && (parenthesized_expression "(__filename == local_58)" ( (binary_expression "__filename == local_58" identifier == identifier) ))) )) (compound_statement "{\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }" { (expression_statement "local_1e0 = FUN_001a094e(7,iVar5);" (assignment_expression "local_1e0 = FUN_001a094e(7,iVar5)" identifier = (call_expression "FUN_001a094e(7,iVar5)" identifier (argument_list "(7,iVar5)" ( number_literal , identifier )))) ;) (expression_statement "iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);" (assignment_expression "iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0)" identifier = (call_expression "__xmknod(0,local_58,0x61a4,&local_1e0)" identifier (argument_list "(0,local_58,0x61a4,&local_1e0)" ( number_literal , identifier , number_literal , (pointer_expression "&local_1e0" & identifier) )))) ;) (if_statement "if (iVar1 == 0) goto LAB_001a04e8;" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (goto_statement "goto LAB_001a04e8;" goto statement_identifier ;)) })) (labeled_statement "LAB_001a06b5:\n      close(__fd);" statement_identifier : (expression_statement "close(__fd);" (call_expression "close(__fd)" identifier (argument_list "(__fd)" ( identifier ))) ;)) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (goto_statement "goto LAB_001a03dd;" goto statement_identifier ;) })) (labeled_statement "LAB_001a04e8:\n    iVar1 = __open64_2(__filename,local_1f8);" statement_identifier : (expression_statement "iVar1 = __open64_2(__filename,local_1f8);" (assignment_expression "iVar1 = __open64_2(__filename,local_1f8)" identifier = (call_expression "__open64_2(__filename,local_1f8)" identifier (argument_list "(__filename,local_1f8)" ( identifier , identifier )))) ;)) (if_statement "if (iVar1 < 0) {\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }" { (if_statement "if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }" if (parenthesized_expression "(*DAT_001c65c0 == 0x1e)" ( (binary_expression "*DAT_001c65c0 == 0x1e" (pointer_expression "*DAT_001c65c0" * identifier) == number_literal) )) (compound_statement "{\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }" { (expression_statement "iVar1 = open64(__filename,0);" (assignment_expression "iVar1 = open64(__filename,0)" identifier = (call_expression "open64(__filename,0)" identifier (argument_list "(__filename,0)" ( identifier , number_literal )))) ;) (if_statement "if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }" { (expression_statement "local_1f8 = 0;" (assignment_expression "local_1f8 = 0" identifier = number_literal) ;) (goto_statement "goto LAB_001a0597;" goto statement_identifier ;) })) (expression_statement "local_1f8 = 0;" (assignment_expression "local_1f8 = 0" identifier = number_literal) ;) })) (if_statement "if (*DAT_001c65c0 == 6) goto LAB_001a06b5;" if (parenthesized_expression "(*DAT_001c65c0 == 6)" ( (binary_expression "*DAT_001c65c0 == 6" (pointer_expression "*DAT_001c65c0" * identifier) == number_literal) )) (goto_statement "goto LAB_001a06b5;" goto statement_identifier ;)) }) (else_clause "else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }" else (compound_statement "{\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }" { (labeled_statement "LAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);" statement_identifier : (expression_statement "iVar2 = ioctl(iVar1,0x4c05,local_148);" (assignment_expression "iVar2 = ioctl(iVar1,0x4c05,local_148)" identifier = (call_expression "ioctl(iVar1,0x4c05,local_148)" identifier (argument_list "(iVar1,0x4c05,local_148)" ( identifier , number_literal , identifier )))) ;)) (if_statement "if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        iVar2 = -1;\n      }" { (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) }) (else_clause "else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }" else (if_statement "if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }" if (parenthesized_expression "(*DAT_001c65c0 == 6)" ( (binary_expression "*DAT_001c65c0 == 6" (pointer_expression "*DAT_001c65c0" * identifier) == number_literal) )) (compound_statement "{\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }" { (expression_statement "iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);" (assignment_expression "iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd)" identifier = (call_expression "ioctl(iVar1,0x4c00,(ulong)__fd)" identifier (argument_list "(iVar1,0x4c00,(ulong)__fd)" ( identifier , number_literal , (cast_expression "(ulong)__fd" ( (type_descriptor "ulong" type_identifier) ) identifier) )))) ;) (if_statement "if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }" { (expression_statement "puVar6 = local_148;" (assignment_expression "puVar6 = local_148" identifier = identifier) ;) (for_statement "for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }" for ( (assignment_expression "lVar4 = 0x1d" identifier = number_literal) ; (binary_expression "lVar4 != 0" identifier != number_literal) ; (assignment_expression "lVar4 = lVar4 + -1" identifier = (binary_expression "lVar4 + -1" identifier + number_literal)) ) (compound_statement "{\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }" { (expression_statement "*puVar6 = 0;" (assignment_expression "*puVar6 = 0" (pointer_expression "*puVar6" * identifier) = number_literal) ;) (expression_statement "puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;" (assignment_expression "puVar6 = puVar6 + (ulong)bVar7 * -2 + 1" identifier = (binary_expression "puVar6 + (ulong)bVar7 * -2 + 1" (binary_expression "puVar6 + (ulong)bVar7 * -2" identifier + (binary_expression "(ulong)bVar7 * -2" (cast_expression "(ulong)bVar7" ( (type_descriptor "ulong" type_identifier) ) identifier) * number_literal)) + number_literal)) ;) })) (expression_statement "FUN_001a49d0(local_110,param_2,0x40);" (call_expression "FUN_001a49d0(local_110,param_2,0x40)" identifier (argument_list "(local_110,param_2,0x40)" ( identifier , identifier , number_literal ))) ;) (expression_statement "local_114 = param_4 & 0xfffffffe;" (assignment_expression "local_114 = param_4 & 0xfffffffe" identifier = (binary_expression "param_4 & 0xfffffffe" identifier & number_literal)) ;) (expression_statement "local_130 = param_3;" (assignment_expression "local_130 = param_3" identifier = identifier) ;) (expression_statement "iVar3 = ioctl(iVar1,0x4c04,local_148);" (assignment_expression "iVar3 = ioctl(iVar1,0x4c04,local_148)" identifier = (call_expression "ioctl(iVar1,0x4c04,local_148)" identifier (argument_list "(iVar1,0x4c04,local_148)" ( identifier , number_literal , identifier )))) ;) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (if_statement "if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }" { (labeled_statement "LAB_001a0559:\n            close(__fd);" statement_identifier : (expression_statement "close(__fd);" (call_expression "close(__fd)" identifier (argument_list "(__fd)" ( identifier ))) ;)) (if_statement "if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }" if (parenthesized_expression "((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0))" ( (binary_expression "(iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)" (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) && (parenthesized_expression "(iVar2 = iVar1, *param_1 == 0)" ( (comma_expression "iVar2 = iVar1, *param_1 == 0" (assignment_expression "iVar2 = iVar1" identifier = identifier) , (binary_expression "*param_1 == 0" (pointer_expression "*param_1" * identifier) == number_literal)) ))) )) (compound_statement "{\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }" { (expression_statement "lVar4 = FUN_0010e627(local_58);" (assignment_expression "lVar4 = FUN_0010e627(local_58)" identifier = (call_expression "FUN_0010e627(local_58)" identifier (argument_list "(local_58)" ( identifier )))) ;) (expression_statement "*param_1 = lVar4;" (assignment_expression "*param_1 = lVar4" (pointer_expression "*param_1" * identifier) = identifier) ;) })) (labeled_statement "LAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }" statement_identifier : (if_statement "if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }" if (parenthesized_expression "(local_40 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_40 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n              return iVar2;\n            }" { (return_statement "return iVar2;" return identifier ;) }))) comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })) (if_statement "if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }" if (parenthesized_expression "((local_114 & 4) != 0)" ( (binary_expression "(local_114 & 4) != 0" (parenthesized_expression "(local_114 & 4)" ( (binary_expression "local_114 & 4" identifier & number_literal) )) != number_literal) )) (compound_statement "{\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }" { (expression_statement "local_114 = local_114 - 4;" (assignment_expression "local_114 = local_114 - 4" identifier = (binary_expression "local_114 - 4" identifier - number_literal)) ;) (expression_statement "iVar3 = ioctl(iVar1,0x4c04,local_148);" (assignment_expression "iVar3 = ioctl(iVar1,0x4c04,local_148)" identifier = (call_expression "ioctl(iVar1,0x4c04,local_148)" identifier (argument_list "(iVar1,0x4c04,local_148)" ( identifier , number_literal , identifier )))) ;) (if_statement "if (iVar3 == 0) goto LAB_001a0559;" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (goto_statement "goto LAB_001a0559;" goto statement_identifier ;)) })) (expression_statement "iVar2 = iVar3;" (assignment_expression "iVar2 = iVar3" identifier = identifier) ;) (expression_statement "ioctl(iVar1,0x4c01,0);" (call_expression "ioctl(iVar1,0x4c01,0)" identifier (argument_list "(iVar1,0x4c01,0)" ( identifier , number_literal , number_literal ))) ;) })) }) (else_clause "else {\n        iVar2 = -1;\n      }" else (compound_statement "{\n        iVar2 = -1;\n      }" { (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) }))))) (expression_statement "close(iVar1);" (call_expression "close(iVar1)" identifier (argument_list "(iVar1)" ( identifier ))) ;) }))) (if_statement "if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))\n    goto LAB_001a0559;" if (parenthesized_expression "(((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))" ( (binary_expression "((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5)" (parenthesized_expression "((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0))" ( (binary_expression "(*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)" (parenthesized_expression "(*param_1 != 0)" ( (binary_expression "*param_1 != 0" (pointer_expression "*param_1" * identifier) != number_literal) )) || (parenthesized_expression "(iVar5 = iVar5 + 1, iVar2 == 0)" ( (comma_expression "iVar5 = iVar5 + 1, iVar2 == 0" (assignment_expression "iVar5 = iVar5 + 1" identifier = (binary_expression "iVar5 + 1" identifier + number_literal)) , (binary_expression "iVar2 == 0" identifier == number_literal)) ))) )) || (parenthesized_expression "(0xfffff < iVar5)" ( (binary_expression "0xfffff < iVar5" number_literal < identifier) ))) )) (goto_statement "goto LAB_001a0559;" goto statement_identifier ;)) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "int set_loop(char **device,char *file,ulonglong offset,uint flags)\n\n{\n  long lVar1;\n  uint __fd;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  char *pcVar5;\n  long lVar6;\n  uint minor;\n  bb_loop_info *pbVar7;\n  long in_FS_OFFSET;\n  byte bVar8;\n  int local_1f8;\n  ulonglong local_1e0;\n  stat statbuf;\n  bb_loop_info loopinfo;\n  char dev [23];\n  \n  bVar8 = 0;\n  lVar1 = *(long *)(in_FS_OFFSET + 0x28);\n  local_1f8 = (flags & 1 ^ 1) * 2;\n  while (__fd = __open64_2(file,local_1f8), (int)__fd < 0) {\n    if (local_1f8 == 0) {\n      iVar3 = -*bb_errno;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }\n  pcVar5 = *device;\n  if (*device == (char *)0x0) {\n    pcVar5 = dev;\n  }\n  iVar3 = -1;\n  minor = 0;\n  do {\n    __sprintf_chk(dev,1,0x17,"/dev/loop%u",minor);\n    *bb_errno = 0;\n    iVar2 = __xstat64(1,pcVar5,(stat64 *)&statbuf);\n    if ((iVar2 != 0) || ((statbuf.st_mode & 0xf000) != 0x6000)) {\n      if ((*bb_errno == 2) && (pcVar5 == dev)) {\n        local_1e0 = bb_makedev(7,minor);\n        iVar2 = __xmknod(0,dev,0x61a4,&local_1e0);\n        if (iVar2 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar3 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar2 = __open64_2(pcVar5,local_1f8);\n    if (iVar2 < 0) {\n      if (*bb_errno == 0x1e) {\n        iVar2 = open64(pcVar5,0);\n        if (-1 < iVar2) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*bb_errno == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar3 = ioctl(iVar2,0x4c05,&loopinfo);\n      if (iVar3 == 0) {\n        iVar3 = -1;\n      }\n      else if (*bb_errno == 6) {\n        iVar4 = ioctl(iVar2,0x4c00,(ulong)__fd);\n        if (iVar4 == 0) {\n          pbVar7 = &loopinfo;\n          for (lVar6 = 0x1d; lVar6 != 0; lVar6 = lVar6 + -1) {\n            pbVar7->lo_device = 0;\n            pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);\n          }\n          safe_strncpy((char *)loopinfo.lo_file_name,file,0x40);\n          loopinfo.lo_flags = flags & 0xfffffffe;\n          loopinfo.lo_offset = offset;\n          iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n          iVar3 = 0;\n          if (iVar4 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }\nLAB_001a03dd:\n            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((loopinfo.lo_flags & 4) != 0) {\n            loopinfo.lo_flags = loopinfo.lo_flags - 4;\n            iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n            if (iVar4 == 0) goto LAB_001a0559;\n          }\n          iVar3 = iVar4;\n          ioctl(iVar2,0x4c01,0);\n        }\n      }\n      else {\n        iVar3 = -1;\n      }\n      close(iVar2);\n    }\n    if (((*device != (char *)0x0) || (minor = minor + 1, iVar3 == 0)) || (0xfffff < (int)minor))\n    goto LAB_001a0559;\n  } while( true );\n}\n\n" (function_definition "int set_loop(char **device,char *file,ulonglong offset,uint flags)\n\n{\n  long lVar1;\n  uint __fd;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  char *pcVar5;\n  long lVar6;\n  uint minor;\n  bb_loop_info *pbVar7;\n  long in_FS_OFFSET;\n  byte bVar8;\n  int local_1f8;\n  ulonglong local_1e0;\n  stat statbuf;\n  bb_loop_info loopinfo;\n  char dev [23];\n  \n  bVar8 = 0;\n  lVar1 = *(long *)(in_FS_OFFSET + 0x28);\n  local_1f8 = (flags & 1 ^ 1) * 2;\n  while (__fd = __open64_2(file,local_1f8), (int)__fd < 0) {\n    if (local_1f8 == 0) {\n      iVar3 = -*bb_errno;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }\n  pcVar5 = *device;\n  if (*device == (char *)0x0) {\n    pcVar5 = dev;\n  }\n  iVar3 = -1;\n  minor = 0;\n  do {\n    __sprintf_chk(dev,1,0x17,"/dev/loop%u",minor);\n    *bb_errno = 0;\n    iVar2 = __xstat64(1,pcVar5,(stat64 *)&statbuf);\n    if ((iVar2 != 0) || ((statbuf.st_mode & 0xf000) != 0x6000)) {\n      if ((*bb_errno == 2) && (pcVar5 == dev)) {\n        local_1e0 = bb_makedev(7,minor);\n        iVar2 = __xmknod(0,dev,0x61a4,&local_1e0);\n        if (iVar2 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar3 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar2 = __open64_2(pcVar5,local_1f8);\n    if (iVar2 < 0) {\n      if (*bb_errno == 0x1e) {\n        iVar2 = open64(pcVar5,0);\n        if (-1 < iVar2) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*bb_errno == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar3 = ioctl(iVar2,0x4c05,&loopinfo);\n      if (iVar3 == 0) {\n        iVar3 = -1;\n      }\n      else if (*bb_errno == 6) {\n        iVar4 = ioctl(iVar2,0x4c00,(ulong)__fd);\n        if (iVar4 == 0) {\n          pbVar7 = &loopinfo;\n          for (lVar6 = 0x1d; lVar6 != 0; lVar6 = lVar6 + -1) {\n            pbVar7->lo_device = 0;\n            pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);\n          }\n          safe_strncpy((char *)loopinfo.lo_file_name,file,0x40);\n          loopinfo.lo_flags = flags & 0xfffffffe;\n          loopinfo.lo_offset = offset;\n          iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n          iVar3 = 0;\n          if (iVar4 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }\nLAB_001a03dd:\n            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((loopinfo.lo_flags & 4) != 0) {\n            loopinfo.lo_flags = loopinfo.lo_flags - 4;\n            iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n            if (iVar4 == 0) goto LAB_001a0559;\n          }\n          iVar3 = iVar4;\n          ioctl(iVar2,0x4c01,0);\n        }\n      }\n      else {\n        iVar3 = -1;\n      }\n      close(iVar2);\n    }\n    if (((*device != (char *)0x0) || (minor = minor + 1, iVar3 == 0)) || (0xfffff < (int)minor))\n    goto LAB_001a0559;\n  } while( true );\n}" primitive_type (function_declarator "set_loop(char **device,char *file,ulonglong offset,uint flags)" identifier (parameter_list "(char **device,char *file,ulonglong offset,uint flags)" ( (parameter_declaration "char **device" primitive_type (pointer_declarator "**device" * (pointer_declarator "*device" * identifier))) , (parameter_declaration "char *file" primitive_type (pointer_declarator "*file" * identifier)) , (parameter_declaration "ulonglong offset" type_identifier identifier) , (parameter_declaration "uint flags" type_identifier identifier) ))) (compound_statement "{\n  long lVar1;\n  uint __fd;\n  int iVar2;\n  int iVar3;\n  int iVar4;\n  char *pcVar5;\n  long lVar6;\n  uint minor;\n  bb_loop_info *pbVar7;\n  long in_FS_OFFSET;\n  byte bVar8;\n  int local_1f8;\n  ulonglong local_1e0;\n  stat statbuf;\n  bb_loop_info loopinfo;\n  char dev [23];\n  \n  bVar8 = 0;\n  lVar1 = *(long *)(in_FS_OFFSET + 0x28);\n  local_1f8 = (flags & 1 ^ 1) * 2;\n  while (__fd = __open64_2(file,local_1f8), (int)__fd < 0) {\n    if (local_1f8 == 0) {\n      iVar3 = -*bb_errno;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }\n  pcVar5 = *device;\n  if (*device == (char *)0x0) {\n    pcVar5 = dev;\n  }\n  iVar3 = -1;\n  minor = 0;\n  do {\n    __sprintf_chk(dev,1,0x17,"/dev/loop%u",minor);\n    *bb_errno = 0;\n    iVar2 = __xstat64(1,pcVar5,(stat64 *)&statbuf);\n    if ((iVar2 != 0) || ((statbuf.st_mode & 0xf000) != 0x6000)) {\n      if ((*bb_errno == 2) && (pcVar5 == dev)) {\n        local_1e0 = bb_makedev(7,minor);\n        iVar2 = __xmknod(0,dev,0x61a4,&local_1e0);\n        if (iVar2 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar3 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar2 = __open64_2(pcVar5,local_1f8);\n    if (iVar2 < 0) {\n      if (*bb_errno == 0x1e) {\n        iVar2 = open64(pcVar5,0);\n        if (-1 < iVar2) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*bb_errno == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar3 = ioctl(iVar2,0x4c05,&loopinfo);\n      if (iVar3 == 0) {\n        iVar3 = -1;\n      }\n      else if (*bb_errno == 6) {\n        iVar4 = ioctl(iVar2,0x4c00,(ulong)__fd);\n        if (iVar4 == 0) {\n          pbVar7 = &loopinfo;\n          for (lVar6 = 0x1d; lVar6 != 0; lVar6 = lVar6 + -1) {\n            pbVar7->lo_device = 0;\n            pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);\n          }\n          safe_strncpy((char *)loopinfo.lo_file_name,file,0x40);\n          loopinfo.lo_flags = flags & 0xfffffffe;\n          loopinfo.lo_offset = offset;\n          iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n          iVar3 = 0;\n          if (iVar4 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }\nLAB_001a03dd:\n            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((loopinfo.lo_flags & 4) != 0) {\n            loopinfo.lo_flags = loopinfo.lo_flags - 4;\n            iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n            if (iVar4 == 0) goto LAB_001a0559;\n          }\n          iVar3 = iVar4;\n          ioctl(iVar2,0x4c01,0);\n        }\n      }\n      else {\n        iVar3 = -1;\n      }\n      close(iVar2);\n    }\n    if (((*device != (char *)0x0) || (minor = minor + 1, iVar3 == 0)) || (0xfffff < (int)minor))\n    goto LAB_001a0559;\n  } while( true );\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "uint __fd;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "char *pcVar5;" primitive_type (pointer_declarator "*pcVar5" * identifier) ;) (declaration "long lVar6;" (sized_type_specifier "long" long) identifier ;) (declaration "uint minor;" type_identifier identifier ;) (declaration "bb_loop_info *pbVar7;" type_identifier (pointer_declarator "*pbVar7" * identifier) ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "byte bVar8;" type_identifier identifier ;) (declaration "int local_1f8;" primitive_type identifier ;) (declaration "ulonglong local_1e0;" type_identifier identifier ;) (declaration "stat statbuf;" type_identifier identifier ;) (declaration "bb_loop_info loopinfo;" type_identifier identifier ;) (declaration "char dev [23];" primitive_type (array_declarator "dev [23]" identifier [ number_literal ]) ;) (expression_statement "bVar8 = 0;" (assignment_expression "bVar8 = 0" identifier = number_literal) ;) (expression_statement "lVar1 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "lVar1 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (expression_statement "local_1f8 = (flags & 1 ^ 1) * 2;" (assignment_expression "local_1f8 = (flags & 1 ^ 1) * 2" identifier = (binary_expression "(flags & 1 ^ 1) * 2" (parenthesized_expression "(flags & 1 ^ 1)" ( (binary_expression "flags & 1 ^ 1" (binary_expression "flags & 1" identifier & number_literal) ^ number_literal) )) * number_literal)) ;) (while_statement "while (__fd = __open64_2(file,local_1f8), (int)__fd < 0) {\n    if (local_1f8 == 0) {\n      iVar3 = -*bb_errno;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }" while (parenthesized_expression "(__fd = __open64_2(file,local_1f8), (int)__fd < 0)" ( (comma_expression "__fd = __open64_2(file,local_1f8), (int)__fd < 0" (assignment_expression "__fd = __open64_2(file,local_1f8)" identifier = (call_expression "__open64_2(file,local_1f8)" identifier (argument_list "(file,local_1f8)" ( identifier , identifier )))) , (binary_expression "(int)__fd < 0" (cast_expression "(int)__fd" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal)) )) (compound_statement "{\n    if (local_1f8 == 0) {\n      iVar3 = -*bb_errno;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }" { (if_statement "if (local_1f8 == 0) {\n      iVar3 = -*bb_errno;\n      goto LAB_001a03dd;\n    }" if (parenthesized_expression "(local_1f8 == 0)" ( (binary_expression "local_1f8 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar3 = -*bb_errno;\n      goto LAB_001a03dd;\n    }" { (expression_statement "iVar3 = -*bb_errno;" (assignment_expression "iVar3 = -*bb_errno" identifier = (unary_expression "-*bb_errno" - (pointer_expression "*bb_errno" * identifier))) ;) (goto_statement "goto LAB_001a03dd;" goto statement_identifier ;) })) (expression_statement "local_1f8 = 0;" (assignment_expression "local_1f8 = 0" identifier = number_literal) ;) })) (expression_statement "pcVar5 = *device;" (assignment_expression "pcVar5 = *device" identifier = (pointer_expression "*device" * identifier)) ;) (if_statement "if (*device == (char *)0x0) {\n    pcVar5 = dev;\n  }" if (parenthesized_expression "(*device == (char *)0x0)" ( (binary_expression "*device == (char *)0x0" (pointer_expression "*device" * identifier) == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    pcVar5 = dev;\n  }" { (expression_statement "pcVar5 = dev;" (assignment_expression "pcVar5 = dev" identifier = identifier) ;) })) (expression_statement "iVar3 = -1;" (assignment_expression "iVar3 = -1" identifier = number_literal) ;) (expression_statement "minor = 0;" (assignment_expression "minor = 0" identifier = number_literal) ;) (do_statement "do {\n    __sprintf_chk(dev,1,0x17,"/dev/loop%u",minor);\n    *bb_errno = 0;\n    iVar2 = __xstat64(1,pcVar5,(stat64 *)&statbuf);\n    if ((iVar2 != 0) || ((statbuf.st_mode & 0xf000) != 0x6000)) {\n      if ((*bb_errno == 2) && (pcVar5 == dev)) {\n        local_1e0 = bb_makedev(7,minor);\n        iVar2 = __xmknod(0,dev,0x61a4,&local_1e0);\n        if (iVar2 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar3 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar2 = __open64_2(pcVar5,local_1f8);\n    if (iVar2 < 0) {\n      if (*bb_errno == 0x1e) {\n        iVar2 = open64(pcVar5,0);\n        if (-1 < iVar2) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*bb_errno == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar3 = ioctl(iVar2,0x4c05,&loopinfo);\n      if (iVar3 == 0) {\n        iVar3 = -1;\n      }\n      else if (*bb_errno == 6) {\n        iVar4 = ioctl(iVar2,0x4c00,(ulong)__fd);\n        if (iVar4 == 0) {\n          pbVar7 = &loopinfo;\n          for (lVar6 = 0x1d; lVar6 != 0; lVar6 = lVar6 + -1) {\n            pbVar7->lo_device = 0;\n            pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);\n          }\n          safe_strncpy((char *)loopinfo.lo_file_name,file,0x40);\n          loopinfo.lo_flags = flags & 0xfffffffe;\n          loopinfo.lo_offset = offset;\n          iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n          iVar3 = 0;\n          if (iVar4 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }\nLAB_001a03dd:\n            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((loopinfo.lo_flags & 4) != 0) {\n            loopinfo.lo_flags = loopinfo.lo_flags - 4;\n            iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n            if (iVar4 == 0) goto LAB_001a0559;\n          }\n          iVar3 = iVar4;\n          ioctl(iVar2,0x4c01,0);\n        }\n      }\n      else {\n        iVar3 = -1;\n      }\n      close(iVar2);\n    }\n    if (((*device != (char *)0x0) || (minor = minor + 1, iVar3 == 0)) || (0xfffff < (int)minor))\n    goto LAB_001a0559;\n  } while( true );" do (compound_statement "{\n    __sprintf_chk(dev,1,0x17,"/dev/loop%u",minor);\n    *bb_errno = 0;\n    iVar2 = __xstat64(1,pcVar5,(stat64 *)&statbuf);\n    if ((iVar2 != 0) || ((statbuf.st_mode & 0xf000) != 0x6000)) {\n      if ((*bb_errno == 2) && (pcVar5 == dev)) {\n        local_1e0 = bb_makedev(7,minor);\n        iVar2 = __xmknod(0,dev,0x61a4,&local_1e0);\n        if (iVar2 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar3 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar2 = __open64_2(pcVar5,local_1f8);\n    if (iVar2 < 0) {\n      if (*bb_errno == 0x1e) {\n        iVar2 = open64(pcVar5,0);\n        if (-1 < iVar2) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*bb_errno == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar3 = ioctl(iVar2,0x4c05,&loopinfo);\n      if (iVar3 == 0) {\n        iVar3 = -1;\n      }\n      else if (*bb_errno == 6) {\n        iVar4 = ioctl(iVar2,0x4c00,(ulong)__fd);\n        if (iVar4 == 0) {\n          pbVar7 = &loopinfo;\n          for (lVar6 = 0x1d; lVar6 != 0; lVar6 = lVar6 + -1) {\n            pbVar7->lo_device = 0;\n            pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);\n          }\n          safe_strncpy((char *)loopinfo.lo_file_name,file,0x40);\n          loopinfo.lo_flags = flags & 0xfffffffe;\n          loopinfo.lo_offset = offset;\n          iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n          iVar3 = 0;\n          if (iVar4 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }\nLAB_001a03dd:\n            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((loopinfo.lo_flags & 4) != 0) {\n            loopinfo.lo_flags = loopinfo.lo_flags - 4;\n            iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n            if (iVar4 == 0) goto LAB_001a0559;\n          }\n          iVar3 = iVar4;\n          ioctl(iVar2,0x4c01,0);\n        }\n      }\n      else {\n        iVar3 = -1;\n      }\n      close(iVar2);\n    }\n    if (((*device != (char *)0x0) || (minor = minor + 1, iVar3 == 0)) || (0xfffff < (int)minor))\n    goto LAB_001a0559;\n  }" { (expression_statement "__sprintf_chk(dev,1,0x17,"/dev/loop%u",minor);" (call_expression "__sprintf_chk(dev,1,0x17,"/dev/loop%u",minor)" identifier (argument_list "(dev,1,0x17,"/dev/loop%u",minor)" ( identifier , number_literal , number_literal , (string_literal ""/dev/loop%u"" " string_content ") , identifier ))) ;) (expression_statement "*bb_errno = 0;" (assignment_expression "*bb_errno = 0" (pointer_expression "*bb_errno" * identifier) = number_literal) ;) (expression_statement "iVar2 = __xstat64(1,pcVar5,(stat64 *)&statbuf);" (assignment_expression "iVar2 = __xstat64(1,pcVar5,(stat64 *)&statbuf)" identifier = (call_expression "__xstat64(1,pcVar5,(stat64 *)&statbuf)" identifier (argument_list "(1,pcVar5,(stat64 *)&statbuf)" ( number_literal , identifier , (cast_expression "(stat64 *)&statbuf" ( (type_descriptor "stat64 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&statbuf" & identifier)) )))) ;) (if_statement "if ((iVar2 != 0) || ((statbuf.st_mode & 0xf000) != 0x6000)) {\n      if ((*bb_errno == 2) && (pcVar5 == dev)) {\n        local_1e0 = bb_makedev(7,minor);\n        iVar2 = __xmknod(0,dev,0x61a4,&local_1e0);\n        if (iVar2 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar3 = -1;\n      goto LAB_001a03dd;\n    }" if (parenthesized_expression "((iVar2 != 0) || ((statbuf.st_mode & 0xf000) != 0x6000))" ( (binary_expression "(iVar2 != 0) || ((statbuf.st_mode & 0xf000) != 0x6000)" (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) || (parenthesized_expression "((statbuf.st_mode & 0xf000) != 0x6000)" ( (binary_expression "(statbuf.st_mode & 0xf000) != 0x6000" (parenthesized_expression "(statbuf.st_mode & 0xf000)" ( (binary_expression "statbuf.st_mode & 0xf000" (field_expression "statbuf.st_mode" identifier . field_identifier) & number_literal) )) != number_literal) ))) )) (compound_statement "{\n      if ((*bb_errno == 2) && (pcVar5 == dev)) {\n        local_1e0 = bb_makedev(7,minor);\n        iVar2 = __xmknod(0,dev,0x61a4,&local_1e0);\n        if (iVar2 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar3 = -1;\n      goto LAB_001a03dd;\n    }" { (if_statement "if ((*bb_errno == 2) && (pcVar5 == dev)) {\n        local_1e0 = bb_makedev(7,minor);\n        iVar2 = __xmknod(0,dev,0x61a4,&local_1e0);\n        if (iVar2 == 0) goto LAB_001a04e8;\n      }" if (parenthesized_expression "((*bb_errno == 2) && (pcVar5 == dev))" ( (binary_expression "(*bb_errno == 2) && (pcVar5 == dev)" (parenthesized_expression "(*bb_errno == 2)" ( (binary_expression "*bb_errno == 2" (pointer_expression "*bb_errno" * identifier) == number_literal) )) && (parenthesized_expression "(pcVar5 == dev)" ( (binary_expression "pcVar5 == dev" identifier == identifier) ))) )) (compound_statement "{\n        local_1e0 = bb_makedev(7,minor);\n        iVar2 = __xmknod(0,dev,0x61a4,&local_1e0);\n        if (iVar2 == 0) goto LAB_001a04e8;\n      }" { (expression_statement "local_1e0 = bb_makedev(7,minor);" (assignment_expression "local_1e0 = bb_makedev(7,minor)" identifier = (call_expression "bb_makedev(7,minor)" identifier (argument_list "(7,minor)" ( number_literal , identifier )))) ;) (expression_statement "iVar2 = __xmknod(0,dev,0x61a4,&local_1e0);" (assignment_expression "iVar2 = __xmknod(0,dev,0x61a4,&local_1e0)" identifier = (call_expression "__xmknod(0,dev,0x61a4,&local_1e0)" identifier (argument_list "(0,dev,0x61a4,&local_1e0)" ( number_literal , identifier , number_literal , (pointer_expression "&local_1e0" & identifier) )))) ;) (if_statement "if (iVar2 == 0) goto LAB_001a04e8;" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (goto_statement "goto LAB_001a04e8;" goto statement_identifier ;)) })) (labeled_statement "LAB_001a06b5:\n      close(__fd);" statement_identifier : (expression_statement "close(__fd);" (call_expression "close(__fd)" identifier (argument_list "(__fd)" ( identifier ))) ;)) (expression_statement "iVar3 = -1;" (assignment_expression "iVar3 = -1" identifier = number_literal) ;) (goto_statement "goto LAB_001a03dd;" goto statement_identifier ;) })) (labeled_statement "LAB_001a04e8:\n    iVar2 = __open64_2(pcVar5,local_1f8);" statement_identifier : (expression_statement "iVar2 = __open64_2(pcVar5,local_1f8);" (assignment_expression "iVar2 = __open64_2(pcVar5,local_1f8)" identifier = (call_expression "__open64_2(pcVar5,local_1f8)" identifier (argument_list "(pcVar5,local_1f8)" ( identifier , identifier )))) ;)) (if_statement "if (iVar2 < 0) {\n      if (*bb_errno == 0x1e) {\n        iVar2 = open64(pcVar5,0);\n        if (-1 < iVar2) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*bb_errno == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar3 = ioctl(iVar2,0x4c05,&loopinfo);\n      if (iVar3 == 0) {\n        iVar3 = -1;\n      }\n      else if (*bb_errno == 6) {\n        iVar4 = ioctl(iVar2,0x4c00,(ulong)__fd);\n        if (iVar4 == 0) {\n          pbVar7 = &loopinfo;\n          for (lVar6 = 0x1d; lVar6 != 0; lVar6 = lVar6 + -1) {\n            pbVar7->lo_device = 0;\n            pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);\n          }\n          safe_strncpy((char *)loopinfo.lo_file_name,file,0x40);\n          loopinfo.lo_flags = flags & 0xfffffffe;\n          loopinfo.lo_offset = offset;\n          iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n          iVar3 = 0;\n          if (iVar4 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }\nLAB_001a03dd:\n            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((loopinfo.lo_flags & 4) != 0) {\n            loopinfo.lo_flags = loopinfo.lo_flags - 4;\n            iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n            if (iVar4 == 0) goto LAB_001a0559;\n          }\n          iVar3 = iVar4;\n          ioctl(iVar2,0x4c01,0);\n        }\n      }\n      else {\n        iVar3 = -1;\n      }\n      close(iVar2);\n    }" if (parenthesized_expression "(iVar2 < 0)" ( (binary_expression "iVar2 < 0" identifier < number_literal) )) (compound_statement "{\n      if (*bb_errno == 0x1e) {\n        iVar2 = open64(pcVar5,0);\n        if (-1 < iVar2) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*bb_errno == 6) goto LAB_001a06b5;\n    }" { (if_statement "if (*bb_errno == 0x1e) {\n        iVar2 = open64(pcVar5,0);\n        if (-1 < iVar2) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }" if (parenthesized_expression "(*bb_errno == 0x1e)" ( (binary_expression "*bb_errno == 0x1e" (pointer_expression "*bb_errno" * identifier) == number_literal) )) (compound_statement "{\n        iVar2 = open64(pcVar5,0);\n        if (-1 < iVar2) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }" { (expression_statement "iVar2 = open64(pcVar5,0);" (assignment_expression "iVar2 = open64(pcVar5,0)" identifier = (call_expression "open64(pcVar5,0)" identifier (argument_list "(pcVar5,0)" ( identifier , number_literal )))) ;) (if_statement "if (-1 < iVar2) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }" { (expression_statement "local_1f8 = 0;" (assignment_expression "local_1f8 = 0" identifier = number_literal) ;) (goto_statement "goto LAB_001a0597;" goto statement_identifier ;) })) (expression_statement "local_1f8 = 0;" (assignment_expression "local_1f8 = 0" identifier = number_literal) ;) })) (if_statement "if (*bb_errno == 6) goto LAB_001a06b5;" if (parenthesized_expression "(*bb_errno == 6)" ( (binary_expression "*bb_errno == 6" (pointer_expression "*bb_errno" * identifier) == number_literal) )) (goto_statement "goto LAB_001a06b5;" goto statement_identifier ;)) }) (else_clause "else {\nLAB_001a0597:\n      iVar3 = ioctl(iVar2,0x4c05,&loopinfo);\n      if (iVar3 == 0) {\n        iVar3 = -1;\n      }\n      else if (*bb_errno == 6) {\n        iVar4 = ioctl(iVar2,0x4c00,(ulong)__fd);\n        if (iVar4 == 0) {\n          pbVar7 = &loopinfo;\n          for (lVar6 = 0x1d; lVar6 != 0; lVar6 = lVar6 + -1) {\n            pbVar7->lo_device = 0;\n            pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);\n          }\n          safe_strncpy((char *)loopinfo.lo_file_name,file,0x40);\n          loopinfo.lo_flags = flags & 0xfffffffe;\n          loopinfo.lo_offset = offset;\n          iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n          iVar3 = 0;\n          if (iVar4 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }\nLAB_001a03dd:\n            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((loopinfo.lo_flags & 4) != 0) {\n            loopinfo.lo_flags = loopinfo.lo_flags - 4;\n            iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n            if (iVar4 == 0) goto LAB_001a0559;\n          }\n          iVar3 = iVar4;\n          ioctl(iVar2,0x4c01,0);\n        }\n      }\n      else {\n        iVar3 = -1;\n      }\n      close(iVar2);\n    }" else (compound_statement "{\nLAB_001a0597:\n      iVar3 = ioctl(iVar2,0x4c05,&loopinfo);\n      if (iVar3 == 0) {\n        iVar3 = -1;\n      }\n      else if (*bb_errno == 6) {\n        iVar4 = ioctl(iVar2,0x4c00,(ulong)__fd);\n        if (iVar4 == 0) {\n          pbVar7 = &loopinfo;\n          for (lVar6 = 0x1d; lVar6 != 0; lVar6 = lVar6 + -1) {\n            pbVar7->lo_device = 0;\n            pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);\n          }\n          safe_strncpy((char *)loopinfo.lo_file_name,file,0x40);\n          loopinfo.lo_flags = flags & 0xfffffffe;\n          loopinfo.lo_offset = offset;\n          iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n          iVar3 = 0;\n          if (iVar4 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }\nLAB_001a03dd:\n            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((loopinfo.lo_flags & 4) != 0) {\n            loopinfo.lo_flags = loopinfo.lo_flags - 4;\n            iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n            if (iVar4 == 0) goto LAB_001a0559;\n          }\n          iVar3 = iVar4;\n          ioctl(iVar2,0x4c01,0);\n        }\n      }\n      else {\n        iVar3 = -1;\n      }\n      close(iVar2);\n    }" { (labeled_statement "LAB_001a0597:\n      iVar3 = ioctl(iVar2,0x4c05,&loopinfo);" statement_identifier : (expression_statement "iVar3 = ioctl(iVar2,0x4c05,&loopinfo);" (assignment_expression "iVar3 = ioctl(iVar2,0x4c05,&loopinfo)" identifier = (call_expression "ioctl(iVar2,0x4c05,&loopinfo)" identifier (argument_list "(iVar2,0x4c05,&loopinfo)" ( identifier , number_literal , (pointer_expression "&loopinfo" & identifier) )))) ;)) (if_statement "if (iVar3 == 0) {\n        iVar3 = -1;\n      }\n      else if (*bb_errno == 6) {\n        iVar4 = ioctl(iVar2,0x4c00,(ulong)__fd);\n        if (iVar4 == 0) {\n          pbVar7 = &loopinfo;\n          for (lVar6 = 0x1d; lVar6 != 0; lVar6 = lVar6 + -1) {\n            pbVar7->lo_device = 0;\n            pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);\n          }\n          safe_strncpy((char *)loopinfo.lo_file_name,file,0x40);\n          loopinfo.lo_flags = flags & 0xfffffffe;\n          loopinfo.lo_offset = offset;\n          iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n          iVar3 = 0;\n          if (iVar4 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }\nLAB_001a03dd:\n            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((loopinfo.lo_flags & 4) != 0) {\n            loopinfo.lo_flags = loopinfo.lo_flags - 4;\n            iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n            if (iVar4 == 0) goto LAB_001a0559;\n          }\n          iVar3 = iVar4;\n          ioctl(iVar2,0x4c01,0);\n        }\n      }\n      else {\n        iVar3 = -1;\n      }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n        iVar3 = -1;\n      }" { (expression_statement "iVar3 = -1;" (assignment_expression "iVar3 = -1" identifier = number_literal) ;) }) (else_clause "else if (*bb_errno == 6) {\n        iVar4 = ioctl(iVar2,0x4c00,(ulong)__fd);\n        if (iVar4 == 0) {\n          pbVar7 = &loopinfo;\n          for (lVar6 = 0x1d; lVar6 != 0; lVar6 = lVar6 + -1) {\n            pbVar7->lo_device = 0;\n            pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);\n          }\n          safe_strncpy((char *)loopinfo.lo_file_name,file,0x40);\n          loopinfo.lo_flags = flags & 0xfffffffe;\n          loopinfo.lo_offset = offset;\n          iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n          iVar3 = 0;\n          if (iVar4 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }\nLAB_001a03dd:\n            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((loopinfo.lo_flags & 4) != 0) {\n            loopinfo.lo_flags = loopinfo.lo_flags - 4;\n            iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n            if (iVar4 == 0) goto LAB_001a0559;\n          }\n          iVar3 = iVar4;\n          ioctl(iVar2,0x4c01,0);\n        }\n      }\n      else {\n        iVar3 = -1;\n      }" else (if_statement "if (*bb_errno == 6) {\n        iVar4 = ioctl(iVar2,0x4c00,(ulong)__fd);\n        if (iVar4 == 0) {\n          pbVar7 = &loopinfo;\n          for (lVar6 = 0x1d; lVar6 != 0; lVar6 = lVar6 + -1) {\n            pbVar7->lo_device = 0;\n            pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);\n          }\n          safe_strncpy((char *)loopinfo.lo_file_name,file,0x40);\n          loopinfo.lo_flags = flags & 0xfffffffe;\n          loopinfo.lo_offset = offset;\n          iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n          iVar3 = 0;\n          if (iVar4 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }\nLAB_001a03dd:\n            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((loopinfo.lo_flags & 4) != 0) {\n            loopinfo.lo_flags = loopinfo.lo_flags - 4;\n            iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n            if (iVar4 == 0) goto LAB_001a0559;\n          }\n          iVar3 = iVar4;\n          ioctl(iVar2,0x4c01,0);\n        }\n      }\n      else {\n        iVar3 = -1;\n      }" if (parenthesized_expression "(*bb_errno == 6)" ( (binary_expression "*bb_errno == 6" (pointer_expression "*bb_errno" * identifier) == number_literal) )) (compound_statement "{\n        iVar4 = ioctl(iVar2,0x4c00,(ulong)__fd);\n        if (iVar4 == 0) {\n          pbVar7 = &loopinfo;\n          for (lVar6 = 0x1d; lVar6 != 0; lVar6 = lVar6 + -1) {\n            pbVar7->lo_device = 0;\n            pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);\n          }\n          safe_strncpy((char *)loopinfo.lo_file_name,file,0x40);\n          loopinfo.lo_flags = flags & 0xfffffffe;\n          loopinfo.lo_offset = offset;\n          iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n          iVar3 = 0;\n          if (iVar4 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }\nLAB_001a03dd:\n            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((loopinfo.lo_flags & 4) != 0) {\n            loopinfo.lo_flags = loopinfo.lo_flags - 4;\n            iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n            if (iVar4 == 0) goto LAB_001a0559;\n          }\n          iVar3 = iVar4;\n          ioctl(iVar2,0x4c01,0);\n        }\n      }" { (expression_statement "iVar4 = ioctl(iVar2,0x4c00,(ulong)__fd);" (assignment_expression "iVar4 = ioctl(iVar2,0x4c00,(ulong)__fd)" identifier = (call_expression "ioctl(iVar2,0x4c00,(ulong)__fd)" identifier (argument_list "(iVar2,0x4c00,(ulong)__fd)" ( identifier , number_literal , (cast_expression "(ulong)__fd" ( (type_descriptor "ulong" type_identifier) ) identifier) )))) ;) (if_statement "if (iVar4 == 0) {\n          pbVar7 = &loopinfo;\n          for (lVar6 = 0x1d; lVar6 != 0; lVar6 = lVar6 + -1) {\n            pbVar7->lo_device = 0;\n            pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);\n          }\n          safe_strncpy((char *)loopinfo.lo_file_name,file,0x40);\n          loopinfo.lo_flags = flags & 0xfffffffe;\n          loopinfo.lo_offset = offset;\n          iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n          iVar3 = 0;\n          if (iVar4 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }\nLAB_001a03dd:\n            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((loopinfo.lo_flags & 4) != 0) {\n            loopinfo.lo_flags = loopinfo.lo_flags - 4;\n            iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n            if (iVar4 == 0) goto LAB_001a0559;\n          }\n          iVar3 = iVar4;\n          ioctl(iVar2,0x4c01,0);\n        }" if (parenthesized_expression "(iVar4 == 0)" ( (binary_expression "iVar4 == 0" identifier == number_literal) )) (compound_statement "{\n          pbVar7 = &loopinfo;\n          for (lVar6 = 0x1d; lVar6 != 0; lVar6 = lVar6 + -1) {\n            pbVar7->lo_device = 0;\n            pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);\n          }\n          safe_strncpy((char *)loopinfo.lo_file_name,file,0x40);\n          loopinfo.lo_flags = flags & 0xfffffffe;\n          loopinfo.lo_offset = offset;\n          iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n          iVar3 = 0;\n          if (iVar4 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }\nLAB_001a03dd:\n            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }\n          if ((loopinfo.lo_flags & 4) != 0) {\n            loopinfo.lo_flags = loopinfo.lo_flags - 4;\n            iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n            if (iVar4 == 0) goto LAB_001a0559;\n          }\n          iVar3 = iVar4;\n          ioctl(iVar2,0x4c01,0);\n        }" { (expression_statement "pbVar7 = &loopinfo;" (assignment_expression "pbVar7 = &loopinfo" identifier = (pointer_expression "&loopinfo" & identifier)) ;) (for_statement "for (lVar6 = 0x1d; lVar6 != 0; lVar6 = lVar6 + -1) {\n            pbVar7->lo_device = 0;\n            pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);\n          }" for ( (assignment_expression "lVar6 = 0x1d" identifier = number_literal) ; (binary_expression "lVar6 != 0" identifier != number_literal) ; (assignment_expression "lVar6 = lVar6 + -1" identifier = (binary_expression "lVar6 + -1" identifier + number_literal)) ) (compound_statement "{\n            pbVar7->lo_device = 0;\n            pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);\n          }" { (expression_statement "pbVar7->lo_device = 0;" (assignment_expression "pbVar7->lo_device = 0" (field_expression "pbVar7->lo_device" identifier -> field_identifier) = number_literal) ;) (expression_statement "pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8);" (assignment_expression "pbVar7 = (bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8)" identifier = (cast_expression "(bb_loop_info *)((long)pbVar7 + (ulong)bVar8 * -0x10 + 8)" ( (type_descriptor "bb_loop_info *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)pbVar7 + (ulong)bVar8 * -0x10 + 8)" ( (binary_expression "(long)pbVar7 + (ulong)bVar8 * -0x10 + 8" (binary_expression "(long)pbVar7 + (ulong)bVar8 * -0x10" (cast_expression "(long)pbVar7" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "(ulong)bVar8 * -0x10" (cast_expression "(ulong)bVar8" ( (type_descriptor "ulong" type_identifier) ) identifier) * number_literal)) + number_literal) )))) ;) })) (expression_statement "safe_strncpy((char *)loopinfo.lo_file_name,file,0x40);" (call_expression "safe_strncpy((char *)loopinfo.lo_file_name,file,0x40)" identifier (argument_list "((char *)loopinfo.lo_file_name,file,0x40)" ( (cast_expression "(char *)loopinfo.lo_file_name" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (field_expression "loopinfo.lo_file_name" identifier . field_identifier)) , identifier , number_literal ))) ;) (expression_statement "loopinfo.lo_flags = flags & 0xfffffffe;" (assignment_expression "loopinfo.lo_flags = flags & 0xfffffffe" (field_expression "loopinfo.lo_flags" identifier . field_identifier) = (binary_expression "flags & 0xfffffffe" identifier & number_literal)) ;) (expression_statement "loopinfo.lo_offset = offset;" (assignment_expression "loopinfo.lo_offset = offset" (field_expression "loopinfo.lo_offset" identifier . field_identifier) = identifier) ;) (expression_statement "iVar4 = ioctl(iVar2,0x4c04,&loopinfo);" (assignment_expression "iVar4 = ioctl(iVar2,0x4c04,&loopinfo)" identifier = (call_expression "ioctl(iVar2,0x4c04,&loopinfo)" identifier (argument_list "(iVar2,0x4c04,&loopinfo)" ( identifier , number_literal , (pointer_expression "&loopinfo" & identifier) )))) ;) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (if_statement "if (iVar4 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }\nLAB_001a03dd:\n            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }" if (parenthesized_expression "(iVar4 == 0)" ( (binary_expression "iVar4 == 0" identifier == number_literal) )) (compound_statement "{\nLAB_001a0559:\n            close(__fd);\n            if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }\nLAB_001a03dd:\n            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }\n                    /* WARNING: Subroutine does not return */\n            __stack_chk_fail();\n          }" { (labeled_statement "LAB_001a0559:\n            close(__fd);" statement_identifier : (expression_statement "close(__fd);" (call_expression "close(__fd)" identifier (argument_list "(__fd)" ( identifier ))) ;)) (if_statement "if ((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)) {\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }" if (parenthesized_expression "((iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0))" ( (binary_expression "(iVar3 == 0) && (iVar3 = iVar2, *device == (char *)0x0)" (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) && (parenthesized_expression "(iVar3 = iVar2, *device == (char *)0x0)" ( (comma_expression "iVar3 = iVar2, *device == (char *)0x0" (assignment_expression "iVar3 = iVar2" identifier = identifier) , (binary_expression "*device == (char *)0x0" (pointer_expression "*device" * identifier) == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) (compound_statement "{\n              pcVar5 = xstrdup(dev);\n              *device = pcVar5;\n            }" { (expression_statement "pcVar5 = xstrdup(dev);" (assignment_expression "pcVar5 = xstrdup(dev)" identifier = (call_expression "xstrdup(dev)" identifier (argument_list "(dev)" ( identifier )))) ;) (expression_statement "*device = pcVar5;" (assignment_expression "*device = pcVar5" (pointer_expression "*device" * identifier) = identifier) ;) })) (labeled_statement "LAB_001a03dd:\n            if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }" statement_identifier : (if_statement "if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar3;\n            }" if (parenthesized_expression "(lVar1 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "lVar1 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n              return iVar3;\n            }" { (return_statement "return iVar3;" return identifier ;) }))) comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })) (if_statement "if ((loopinfo.lo_flags & 4) != 0) {\n            loopinfo.lo_flags = loopinfo.lo_flags - 4;\n            iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n            if (iVar4 == 0) goto LAB_001a0559;\n          }" if (parenthesized_expression "((loopinfo.lo_flags & 4) != 0)" ( (binary_expression "(loopinfo.lo_flags & 4) != 0" (parenthesized_expression "(loopinfo.lo_flags & 4)" ( (binary_expression "loopinfo.lo_flags & 4" (field_expression "loopinfo.lo_flags" identifier . field_identifier) & number_literal) )) != number_literal) )) (compound_statement "{\n            loopinfo.lo_flags = loopinfo.lo_flags - 4;\n            iVar4 = ioctl(iVar2,0x4c04,&loopinfo);\n            if (iVar4 == 0) goto LAB_001a0559;\n          }" { (expression_statement "loopinfo.lo_flags = loopinfo.lo_flags - 4;" (assignment_expression "loopinfo.lo_flags = loopinfo.lo_flags - 4" (field_expression "loopinfo.lo_flags" identifier . field_identifier) = (binary_expression "loopinfo.lo_flags - 4" (field_expression "loopinfo.lo_flags" identifier . field_identifier) - number_literal)) ;) (expression_statement "iVar4 = ioctl(iVar2,0x4c04,&loopinfo);" (assignment_expression "iVar4 = ioctl(iVar2,0x4c04,&loopinfo)" identifier = (call_expression "ioctl(iVar2,0x4c04,&loopinfo)" identifier (argument_list "(iVar2,0x4c04,&loopinfo)" ( identifier , number_literal , (pointer_expression "&loopinfo" & identifier) )))) ;) (if_statement "if (iVar4 == 0) goto LAB_001a0559;" if (parenthesized_expression "(iVar4 == 0)" ( (binary_expression "iVar4 == 0" identifier == number_literal) )) (goto_statement "goto LAB_001a0559;" goto statement_identifier ;)) })) (expression_statement "iVar3 = iVar4;" (assignment_expression "iVar3 = iVar4" identifier = identifier) ;) (expression_statement "ioctl(iVar2,0x4c01,0);" (call_expression "ioctl(iVar2,0x4c01,0)" identifier (argument_list "(iVar2,0x4c01,0)" ( identifier , number_literal , number_literal ))) ;) })) }) (else_clause "else {\n        iVar3 = -1;\n      }" else (compound_statement "{\n        iVar3 = -1;\n      }" { (expression_statement "iVar3 = -1;" (assignment_expression "iVar3 = -1" identifier = number_literal) ;) }))))) (expression_statement "close(iVar2);" (call_expression "close(iVar2)" identifier (argument_list "(iVar2)" ( identifier ))) ;) }))) (if_statement "if (((*device != (char *)0x0) || (minor = minor + 1, iVar3 == 0)) || (0xfffff < (int)minor))\n    goto LAB_001a0559;" if (parenthesized_expression "(((*device != (char *)0x0) || (minor = minor + 1, iVar3 == 0)) || (0xfffff < (int)minor))" ( (binary_expression "((*device != (char *)0x0) || (minor = minor + 1, iVar3 == 0)) || (0xfffff < (int)minor)" (parenthesized_expression "((*device != (char *)0x0) || (minor = minor + 1, iVar3 == 0))" ( (binary_expression "(*device != (char *)0x0) || (minor = minor + 1, iVar3 == 0)" (parenthesized_expression "(*device != (char *)0x0)" ( (binary_expression "*device != (char *)0x0" (pointer_expression "*device" * identifier) != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) || (parenthesized_expression "(minor = minor + 1, iVar3 == 0)" ( (comma_expression "minor = minor + 1, iVar3 == 0" (assignment_expression "minor = minor + 1" identifier = (binary_expression "minor + 1" identifier + number_literal)) , (binary_expression "iVar3 == 0" identifier == number_literal)) ))) )) || (parenthesized_expression "(0xfffff < (int)minor)" ( (binary_expression "0xfffff < (int)minor" number_literal < (cast_expression "(int)minor" ( (type_descriptor "int" primitive_type) ) identifier)) ))) )) (goto_statement "goto LAB_001a0559;" goto statement_identifier ;)) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "int FUN_001a037d(long *param_1,undefined8 param_2,undefined8 param_3,uint param_4)\n\n{\n  uint __fd;\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  int iVar5;\n  undefined8 *puVar6;\n  char *__filename;\n  long in_FS_OFFSET;\n  byte bVar7;\n  int local_1f8;\n  __dev_t local_1e0;\n  stat64 local_1d8;\n  undefined8 local_148 [3];\n  undefined8 local_130;\n  uint local_114;\n  undefined1 local_110 [184];\n  char local_58 [24];\n  long local_40;\n  \n  bVar7 = 0;\n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  local_1f8 = (param_4 & 1 ^ 1) * 2;\n  while (__fd = __open64_2(param_2,local_1f8), (int)__fd < 0) {\n    if (local_1f8 == 0) {\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }\n  __filename = (char *)*param_1;\n  if ((char *)*param_1 == (char *)0x0) {\n    __filename = local_58;\n  }\n  iVar2 = -1;\n  iVar5 = 0;\n  do {\n    __sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);\n    *DAT_001c65c0 = 0;\n    iVar1 = __xstat64(1,__filename,&local_1d8);\n    if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar1 = __open64_2(__filename,local_1f8);\n    if (iVar1 < 0) {\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }\n    if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))\n    goto LAB_001a0559;\n  } while( true );\n}\n\n" (function_definition "int FUN_001a037d(long *param_1,undefined8 param_2,undefined8 param_3,uint param_4)\n\n{\n  uint __fd;\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  int iVar5;\n  undefined8 *puVar6;\n  char *__filename;\n  long in_FS_OFFSET;\n  byte bVar7;\n  int local_1f8;\n  __dev_t local_1e0;\n  stat64 local_1d8;\n  undefined8 local_148 [3];\n  undefined8 local_130;\n  uint local_114;\n  undefined1 local_110 [184];\n  char local_58 [24];\n  long local_40;\n  \n  bVar7 = 0;\n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  local_1f8 = (param_4 & 1 ^ 1) * 2;\n  while (__fd = __open64_2(param_2,local_1f8), (int)__fd < 0) {\n    if (local_1f8 == 0) {\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }\n  __filename = (char *)*param_1;\n  if ((char *)*param_1 == (char *)0x0) {\n    __filename = local_58;\n  }\n  iVar2 = -1;\n  iVar5 = 0;\n  do {\n    __sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);\n    *DAT_001c65c0 = 0;\n    iVar1 = __xstat64(1,__filename,&local_1d8);\n    if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar1 = __open64_2(__filename,local_1f8);\n    if (iVar1 < 0) {\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }\n    if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))\n    goto LAB_001a0559;\n  } while( true );\n}" primitive_type (function_declarator "FUN_001a037d(long *param_1,undefined8 param_2,undefined8 param_3,uint param_4)" identifier (parameter_list "(long *param_1,undefined8 param_2,undefined8 param_3,uint param_4)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined8 param_2" type_identifier identifier) , (parameter_declaration "undefined8 param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) ))) (compound_statement "{\n  uint __fd;\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  int iVar5;\n  undefined8 *puVar6;\n  char *__filename;\n  long in_FS_OFFSET;\n  byte bVar7;\n  int local_1f8;\n  __dev_t local_1e0;\n  stat64 local_1d8;\n  undefined8 local_148 [3];\n  undefined8 local_130;\n  uint local_114;\n  undefined1 local_110 [184];\n  char local_58 [24];\n  long local_40;\n  \n  bVar7 = 0;\n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  local_1f8 = (param_4 & 1 ^ 1) * 2;\n  while (__fd = __open64_2(param_2,local_1f8), (int)__fd < 0) {\n    if (local_1f8 == 0) {\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }\n  __filename = (char *)*param_1;\n  if ((char *)*param_1 == (char *)0x0) {\n    __filename = local_58;\n  }\n  iVar2 = -1;\n  iVar5 = 0;\n  do {\n    __sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);\n    *DAT_001c65c0 = 0;\n    iVar1 = __xstat64(1,__filename,&local_1d8);\n    if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar1 = __open64_2(__filename,local_1f8);\n    if (iVar1 < 0) {\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }\n    if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))\n    goto LAB_001a0559;\n  } while( true );\n}" { (declaration "uint __fd;" type_identifier identifier ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "undefined8 *puVar6;" type_identifier (pointer_declarator "*puVar6" * identifier) ;) (declaration "char *__filename;" primitive_type (pointer_declarator "*__filename" * identifier) ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "byte bVar7;" type_identifier identifier ;) (declaration "int local_1f8;" primitive_type identifier ;) (declaration "__dev_t local_1e0;" type_identifier identifier ;) (declaration "stat64 local_1d8;" type_identifier identifier ;) (declaration "undefined8 local_148 [3];" type_identifier (array_declarator "local_148 [3]" identifier [ number_literal ]) ;) (declaration "undefined8 local_130;" type_identifier identifier ;) (declaration "uint local_114;" type_identifier identifier ;) (declaration "undefined1 local_110 [184];" type_identifier (array_declarator "local_110 [184]" identifier [ number_literal ]) ;) (declaration "char local_58 [24];" primitive_type (array_declarator "local_58 [24]" identifier [ number_literal ]) ;) (declaration "long local_40;" (sized_type_specifier "long" long) identifier ;) (expression_statement "bVar7 = 0;" (assignment_expression "bVar7 = 0" identifier = number_literal) ;) (expression_statement "local_40 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_40 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (expression_statement "local_1f8 = (param_4 & 1 ^ 1) * 2;" (assignment_expression "local_1f8 = (param_4 & 1 ^ 1) * 2" identifier = (binary_expression "(param_4 & 1 ^ 1) * 2" (parenthesized_expression "(param_4 & 1 ^ 1)" ( (binary_expression "param_4 & 1 ^ 1" (binary_expression "param_4 & 1" identifier & number_literal) ^ number_literal) )) * number_literal)) ;) (while_statement "while (__fd = __open64_2(param_2,local_1f8), (int)__fd < 0) {\n    if (local_1f8 == 0) {\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }" while (parenthesized_expression "(__fd = __open64_2(param_2,local_1f8), (int)__fd < 0)" ( (comma_expression "__fd = __open64_2(param_2,local_1f8), (int)__fd < 0" (assignment_expression "__fd = __open64_2(param_2,local_1f8)" identifier = (call_expression "__open64_2(param_2,local_1f8)" identifier (argument_list "(param_2,local_1f8)" ( identifier , identifier )))) , (binary_expression "(int)__fd < 0" (cast_expression "(int)__fd" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal)) )) (compound_statement "{\n    if (local_1f8 == 0) {\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }" { (if_statement "if (local_1f8 == 0) {\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }" if (parenthesized_expression "(local_1f8 == 0)" ( (binary_expression "local_1f8 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }" { (expression_statement "iVar2 = -*DAT_001c65c0;" (assignment_expression "iVar2 = -*DAT_001c65c0" identifier = (unary_expression "-*DAT_001c65c0" - (pointer_expression "*DAT_001c65c0" * identifier))) ;) (goto_statement "goto LAB_001a03dd;" goto statement_identifier ;) })) (expression_statement "local_1f8 = 0;" (assignment_expression "local_1f8 = 0" identifier = number_literal) ;) })) (expression_statement "__filename = (char *)*param_1;" (assignment_expression "__filename = (char *)*param_1" identifier = (cast_expression "(char *)*param_1" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (if_statement "if ((char *)*param_1 == (char *)0x0) {\n    __filename = local_58;\n  }" if (parenthesized_expression "((char *)*param_1 == (char *)0x0)" ( (binary_expression "(char *)*param_1 == (char *)0x0" (cast_expression "(char *)*param_1" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)) == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    __filename = local_58;\n  }" { (expression_statement "__filename = local_58;" (assignment_expression "__filename = local_58" identifier = identifier) ;) })) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" identifier = number_literal) ;) (do_statement "do {\n    __sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);\n    *DAT_001c65c0 = 0;\n    iVar1 = __xstat64(1,__filename,&local_1d8);\n    if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar1 = __open64_2(__filename,local_1f8);\n    if (iVar1 < 0) {\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }\n    if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))\n    goto LAB_001a0559;\n  } while( true );" do (compound_statement "{\n    __sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);\n    *DAT_001c65c0 = 0;\n    iVar1 = __xstat64(1,__filename,&local_1d8);\n    if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar1 = __open64_2(__filename,local_1f8);\n    if (iVar1 < 0) {\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }\n    if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))\n    goto LAB_001a0559;\n  }" { (expression_statement "__sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);" (call_expression "__sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5)" identifier (argument_list "(local_58,1,0x17,"/dev/loop%u",iVar5)" ( identifier , number_literal , number_literal , (string_literal ""/dev/loop%u"" " string_content ") , identifier ))) ;) (expression_statement "*DAT_001c65c0 = 0;" (assignment_expression "*DAT_001c65c0 = 0" (pointer_expression "*DAT_001c65c0" * identifier) = number_literal) ;) (expression_statement "iVar1 = __xstat64(1,__filename,&local_1d8);" (assignment_expression "iVar1 = __xstat64(1,__filename,&local_1d8)" identifier = (call_expression "__xstat64(1,__filename,&local_1d8)" identifier (argument_list "(1,__filename,&local_1d8)" ( number_literal , identifier , (pointer_expression "&local_1d8" & identifier) )))) ;) (if_statement "if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }" if (parenthesized_expression "((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000))" ( (binary_expression "(iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)" (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) || (parenthesized_expression "((local_1d8.st_mode & 0xf000) != 0x6000)" ( (binary_expression "(local_1d8.st_mode & 0xf000) != 0x6000" (parenthesized_expression "(local_1d8.st_mode & 0xf000)" ( (binary_expression "local_1d8.st_mode & 0xf000" (field_expression "local_1d8.st_mode" identifier . field_identifier) & number_literal) )) != number_literal) ))) )) (compound_statement "{\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }" { (if_statement "if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }" if (parenthesized_expression "((*DAT_001c65c0 == 2) && (__filename == local_58))" ( (binary_expression "(*DAT_001c65c0 == 2) && (__filename == local_58)" (parenthesized_expression "(*DAT_001c65c0 == 2)" ( (binary_expression "*DAT_001c65c0 == 2" (pointer_expression "*DAT_001c65c0" * identifier) == number_literal) )) && (parenthesized_expression "(__filename == local_58)" ( (binary_expression "__filename == local_58" identifier == identifier) ))) )) (compound_statement "{\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }" { (expression_statement "local_1e0 = FUN_001a094e(7,iVar5);" (assignment_expression "local_1e0 = FUN_001a094e(7,iVar5)" identifier = (call_expression "FUN_001a094e(7,iVar5)" identifier (argument_list "(7,iVar5)" ( number_literal , identifier )))) ;) (expression_statement "iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);" (assignment_expression "iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0)" identifier = (call_expression "__xmknod(0,local_58,0x61a4,&local_1e0)" identifier (argument_list "(0,local_58,0x61a4,&local_1e0)" ( number_literal , identifier , number_literal , (pointer_expression "&local_1e0" & identifier) )))) ;) (if_statement "if (iVar1 == 0) goto LAB_001a04e8;" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (goto_statement "goto LAB_001a04e8;" goto statement_identifier ;)) })) (labeled_statement "LAB_001a06b5:\n      close(__fd);" statement_identifier : (expression_statement "close(__fd);" (call_expression "close(__fd)" identifier (argument_list "(__fd)" ( identifier ))) ;)) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (goto_statement "goto LAB_001a03dd;" goto statement_identifier ;) })) (labeled_statement "LAB_001a04e8:\n    iVar1 = __open64_2(__filename,local_1f8);" statement_identifier : (expression_statement "iVar1 = __open64_2(__filename,local_1f8);" (assignment_expression "iVar1 = __open64_2(__filename,local_1f8)" identifier = (call_expression "__open64_2(__filename,local_1f8)" identifier (argument_list "(__filename,local_1f8)" ( identifier , identifier )))) ;)) (if_statement "if (iVar1 < 0) {\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }" { (if_statement "if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }" if (parenthesized_expression "(*DAT_001c65c0 == 0x1e)" ( (binary_expression "*DAT_001c65c0 == 0x1e" (pointer_expression "*DAT_001c65c0" * identifier) == number_literal) )) (compound_statement "{\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }" { (expression_statement "iVar1 = open64(__filename,0);" (assignment_expression "iVar1 = open64(__filename,0)" identifier = (call_expression "open64(__filename,0)" identifier (argument_list "(__filename,0)" ( identifier , number_literal )))) ;) (if_statement "if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }" { (expression_statement "local_1f8 = 0;" (assignment_expression "local_1f8 = 0" identifier = number_literal) ;) (goto_statement "goto LAB_001a0597;" goto statement_identifier ;) })) (expression_statement "local_1f8 = 0;" (assignment_expression "local_1f8 = 0" identifier = number_literal) ;) })) (if_statement "if (*DAT_001c65c0 == 6) goto LAB_001a06b5;" if (parenthesized_expression "(*DAT_001c65c0 == 6)" ( (binary_expression "*DAT_001c65c0 == 6" (pointer_expression "*DAT_001c65c0" * identifier) == number_literal) )) (goto_statement "goto LAB_001a06b5;" goto statement_identifier ;)) }) (else_clause "else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }" else (compound_statement "{\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }" { (labeled_statement "LAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);" statement_identifier : (expression_statement "iVar2 = ioctl(iVar1,0x4c05,local_148);" (assignment_expression "iVar2 = ioctl(iVar1,0x4c05,local_148)" identifier = (call_expression "ioctl(iVar1,0x4c05,local_148)" identifier (argument_list "(iVar1,0x4c05,local_148)" ( identifier , number_literal , identifier )))) ;)) (if_statement "if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        iVar2 = -1;\n      }" { (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) }) (else_clause "else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }" else (if_statement "if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }" if (parenthesized_expression "(*DAT_001c65c0 == 6)" ( (binary_expression "*DAT_001c65c0 == 6" (pointer_expression "*DAT_001c65c0" * identifier) == number_literal) )) (compound_statement "{\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }" { (expression_statement "iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);" (assignment_expression "iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd)" identifier = (call_expression "ioctl(iVar1,0x4c00,(ulong)__fd)" identifier (argument_list "(iVar1,0x4c00,(ulong)__fd)" ( identifier , number_literal , (cast_expression "(ulong)__fd" ( (type_descriptor "ulong" type_identifier) ) identifier) )))) ;) (if_statement "if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }" { (expression_statement "puVar6 = local_148;" (assignment_expression "puVar6 = local_148" identifier = identifier) ;) (for_statement "for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }" for ( (assignment_expression "lVar4 = 0x1d" identifier = number_literal) ; (binary_expression "lVar4 != 0" identifier != number_literal) ; (assignment_expression "lVar4 = lVar4 + -1" identifier = (binary_expression "lVar4 + -1" identifier + number_literal)) ) (compound_statement "{\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }" { (expression_statement "*puVar6 = 0;" (assignment_expression "*puVar6 = 0" (pointer_expression "*puVar6" * identifier) = number_literal) ;) (expression_statement "puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;" (assignment_expression "puVar6 = puVar6 + (ulong)bVar7 * -2 + 1" identifier = (binary_expression "puVar6 + (ulong)bVar7 * -2 + 1" (binary_expression "puVar6 + (ulong)bVar7 * -2" identifier + (binary_expression "(ulong)bVar7 * -2" (cast_expression "(ulong)bVar7" ( (type_descriptor "ulong" type_identifier) ) identifier) * number_literal)) + number_literal)) ;) })) (expression_statement "FUN_001a49d0(local_110,param_2,0x40);" (call_expression "FUN_001a49d0(local_110,param_2,0x40)" identifier (argument_list "(local_110,param_2,0x40)" ( identifier , identifier , number_literal ))) ;) (expression_statement "local_114 = param_4 & 0xfffffffe;" (assignment_expression "local_114 = param_4 & 0xfffffffe" identifier = (binary_expression "param_4 & 0xfffffffe" identifier & number_literal)) ;) (expression_statement "local_130 = param_3;" (assignment_expression "local_130 = param_3" identifier = identifier) ;) (expression_statement "iVar3 = ioctl(iVar1,0x4c04,local_148);" (assignment_expression "iVar3 = ioctl(iVar1,0x4c04,local_148)" identifier = (call_expression "ioctl(iVar1,0x4c04,local_148)" identifier (argument_list "(iVar1,0x4c04,local_148)" ( identifier , number_literal , identifier )))) ;) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (if_statement "if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }" { (labeled_statement "LAB_001a0559:\n            close(__fd);" statement_identifier : (expression_statement "close(__fd);" (call_expression "close(__fd)" identifier (argument_list "(__fd)" ( identifier ))) ;)) (if_statement "if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }" if (parenthesized_expression "((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0))" ( (binary_expression "(iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)" (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) && (parenthesized_expression "(iVar2 = iVar1, *param_1 == 0)" ( (comma_expression "iVar2 = iVar1, *param_1 == 0" (assignment_expression "iVar2 = iVar1" identifier = identifier) , (binary_expression "*param_1 == 0" (pointer_expression "*param_1" * identifier) == number_literal)) ))) )) (compound_statement "{\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }" { (expression_statement "lVar4 = FUN_0010e627(local_58);" (assignment_expression "lVar4 = FUN_0010e627(local_58)" identifier = (call_expression "FUN_0010e627(local_58)" identifier (argument_list "(local_58)" ( identifier )))) ;) (expression_statement "*param_1 = lVar4;" (assignment_expression "*param_1 = lVar4" (pointer_expression "*param_1" * identifier) = identifier) ;) })) (labeled_statement "LAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }" statement_identifier : (if_statement "if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }" if (parenthesized_expression "(local_40 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_40 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n              return iVar2;\n            }" { (return_statement "return iVar2;" return identifier ;) }))) (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })) (if_statement "if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }" if (parenthesized_expression "((local_114 & 4) != 0)" ( (binary_expression "(local_114 & 4) != 0" (parenthesized_expression "(local_114 & 4)" ( (binary_expression "local_114 & 4" identifier & number_literal) )) != number_literal) )) (compound_statement "{\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }" { (expression_statement "local_114 = local_114 - 4;" (assignment_expression "local_114 = local_114 - 4" identifier = (binary_expression "local_114 - 4" identifier - number_literal)) ;) (expression_statement "iVar3 = ioctl(iVar1,0x4c04,local_148);" (assignment_expression "iVar3 = ioctl(iVar1,0x4c04,local_148)" identifier = (call_expression "ioctl(iVar1,0x4c04,local_148)" identifier (argument_list "(iVar1,0x4c04,local_148)" ( identifier , number_literal , identifier )))) ;) (if_statement "if (iVar3 == 0) goto LAB_001a0559;" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (goto_statement "goto LAB_001a0559;" goto statement_identifier ;)) })) (expression_statement "iVar2 = iVar3;" (assignment_expression "iVar2 = iVar3" identifier = identifier) ;) (expression_statement "ioctl(iVar1,0x4c01,0);" (call_expression "ioctl(iVar1,0x4c01,0)" identifier (argument_list "(iVar1,0x4c01,0)" ( identifier , number_literal , number_literal ))) ;) })) }) (else_clause "else {\n        iVar2 = -1;\n      }" else (compound_statement "{\n        iVar2 = -1;\n      }" { (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) }))))) (expression_statement "close(iVar1);" (call_expression "close(iVar1)" identifier (argument_list "(iVar1)" ( identifier ))) ;) }))) (if_statement "if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))\n    goto LAB_001a0559;" if (parenthesized_expression "(((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))" ( (binary_expression "((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5)" (parenthesized_expression "((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0))" ( (binary_expression "(*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)" (parenthesized_expression "(*param_1 != 0)" ( (binary_expression "*param_1 != 0" (pointer_expression "*param_1" * identifier) != number_literal) )) || (parenthesized_expression "(iVar5 = iVar5 + 1, iVar2 == 0)" ( (comma_expression "iVar5 = iVar5 + 1, iVar2 == 0" (assignment_expression "iVar5 = iVar5 + 1" identifier = (binary_expression "iVar5 + 1" identifier + number_literal)) , (binary_expression "iVar2 == 0" identifier == number_literal)) ))) )) || (parenthesized_expression "(0xfffff < iVar5)" ( (binary_expression "0xfffff < iVar5" number_literal < identifier) ))) )) (goto_statement "goto LAB_001a0559;" goto statement_identifier ;)) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration (sized_type_specifier long) IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression (binary_expression IDENT & LIT) ^ LIT) )) * LIT)) ;) (while_statement while (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) , (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) < LIT)) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (unary_expression - (pointer_expression * IDENT))) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT)) == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT , LIT , (string_literal " string_content ") , IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , IDENT , (pointer_expression & IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != LIT) )) || (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (field_expression IDENT . field_identifier) & LIT) )) != LIT) ))) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) && (parenthesized_expression ( (binary_expression IDENT == IDENT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , IDENT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , IDENT , LIT , (pointer_expression & IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) })) (labeled_statement statement_identifier : (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;)) (expression_statement (assignment_expression IDENT = LIT) ;) (goto_statement goto statement_identifier ;) })) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;)) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) (goto_statement goto statement_identifier ;)) }) (else_clause else (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , IDENT )))) ;)) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , (cast_expression ( (type_descriptor TYPE) ) IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (for_statement for ( (assignment_expression IDENT = LIT) ; (binary_expression IDENT != LIT) ; (assignment_expression IDENT = (binary_expression IDENT + LIT)) ) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT + (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) * LIT)) + LIT)) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , LIT ))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT & LIT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , IDENT )))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;)) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == LIT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = IDENT) , (binary_expression (pointer_expression * IDENT) == LIT)) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) })) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return IDENT ;) }))) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) })) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT , LIT ))) ;) })) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }))))) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) || (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (binary_expression IDENT + LIT)) , (binary_expression IDENT == LIT)) ))) )) || (parenthesized_expression ( (binary_expression LIT < IDENT) ))) )) (goto_statement goto statement_identifier ;)) }) while (parenthesized_expression ( BOOL )) ;) })))
(function_definition "int FUN_001a037d(long *param_1,undefined8 param_2,undefined8 param_3,uint param_4)\n\n{\n  uint __fd;\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  int iVar5;\n  undefined8 *puVar6;\n  char *__filename;\n  long in_FS_OFFSET;\n  byte bVar7;\n  int local_1f8;\n  __dev_t local_1e0;\n  stat64 local_1d8;\n  undefined8 local_148 [3];\n  undefined8 local_130;\n  uint local_114;\n  undefined1 local_110 [184];\n  char local_58 [24];\n  long local_40;\n  \n  bVar7 = 0;\n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  local_1f8 = (param_4 & 1 ^ 1) * 2;\n  while (__fd = __open64_2(param_2,local_1f8), (int)__fd < 0) {\n    if (local_1f8 == 0) {\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }\n  __filename = (char *)*param_1;\n  if ((char *)*param_1 == (char *)0x0) {\n    __filename = local_58;\n  }\n  iVar2 = -1;\n  iVar5 = 0;\n  do {\n    __sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);\n    *DAT_001c65c0 = 0;\n    iVar1 = __xstat64(1,__filename,&local_1d8);\n    if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar1 = __open64_2(__filename,local_1f8);\n    if (iVar1 < 0) {\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }\n    if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))\n    goto LAB_001a0559;\n  } while( true );\n}" (primitive_type "int") (function_declarator "FUN_001a037d(long *param_1,undefined8 param_2,undefined8 param_3,uint param_4)" (identifier "FUN_001a037d") (parameter_list "(long *param_1,undefined8 param_2,undefined8 param_3,uint param_4)" (( "(") (parameter_declaration "long *param_1" (sized_type_specifier "long" (long "long")) (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined8 param_2" (type_identifier "undefined8") (identifier "param_2")) (, ",") (parameter_declaration "undefined8 param_3" (type_identifier "undefined8") (identifier "param_3")) (, ",") (parameter_declaration "uint param_4" (type_identifier "uint") (identifier "param_4")) () ")"))) (compound_statement "{\n  uint __fd;\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  int iVar5;\n  undefined8 *puVar6;\n  char *__filename;\n  long in_FS_OFFSET;\n  byte bVar7;\n  int local_1f8;\n  __dev_t local_1e0;\n  stat64 local_1d8;\n  undefined8 local_148 [3];\n  undefined8 local_130;\n  uint local_114;\n  undefined1 local_110 [184];\n  char local_58 [24];\n  long local_40;\n  \n  bVar7 = 0;\n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  local_1f8 = (param_4 & 1 ^ 1) * 2;\n  while (__fd = __open64_2(param_2,local_1f8), (int)__fd < 0) {\n    if (local_1f8 == 0) {\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }\n  __filename = (char *)*param_1;\n  if ((char *)*param_1 == (char *)0x0) {\n    __filename = local_58;\n  }\n  iVar2 = -1;\n  iVar5 = 0;\n  do {\n    __sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);\n    *DAT_001c65c0 = 0;\n    iVar1 = __xstat64(1,__filename,&local_1d8);\n    if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar1 = __open64_2(__filename,local_1f8);\n    if (iVar1 < 0) {\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }\n    if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))\n    goto LAB_001a0559;\n  } while( true );\n}" ({ "{") (declaration "uint __fd;" (type_identifier "uint") (identifier "__fd") (; ";")) (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "long lVar4;" (sized_type_specifier "long" (long "long")) (identifier "lVar4") (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (declaration "undefined8 *puVar6;" (type_identifier "undefined8") (pointer_declarator "*puVar6" (* "*") (identifier "puVar6")) (; ";")) (declaration "char *__filename;" (primitive_type "char") (pointer_declarator "*__filename" (* "*") (identifier "__filename")) (; ";")) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" (long "long")) (identifier "in_FS_OFFSET") (; ";")) (declaration "byte bVar7;" (type_identifier "byte") (identifier "bVar7") (; ";")) (declaration "int local_1f8;" (primitive_type "int") (identifier "local_1f8") (; ";")) (declaration "__dev_t local_1e0;" (type_identifier "__dev_t") (identifier "local_1e0") (; ";")) (declaration "stat64 local_1d8;" (type_identifier "stat64") (identifier "local_1d8") (; ";")) (declaration "undefined8 local_148 [3];" (type_identifier "undefined8") (array_declarator "local_148 [3]" (identifier "local_148") ([ "[") (number_literal "3") (] "]")) (; ";")) (declaration "undefined8 local_130;" (type_identifier "undefined8") (identifier "local_130") (; ";")) (declaration "uint local_114;" (type_identifier "uint") (identifier "local_114") (; ";")) (declaration "undefined1 local_110 [184];" (type_identifier "undefined1") (array_declarator "local_110 [184]" (identifier "local_110") ([ "[") (number_literal "184") (] "]")) (; ";")) (declaration "char local_58 [24];" (primitive_type "char") (array_declarator "local_58 [24]" (identifier "local_58") ([ "[") (number_literal "24") (] "]")) (; ";")) (declaration "long local_40;" (sized_type_specifier "long" (long "long")) (identifier "local_40") (; ";")) (expression_statement "bVar7 = 0;" (assignment_expression "bVar7 = 0" (identifier "bVar7") (= "=") (number_literal "0")) (; ";")) (expression_statement "local_40 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_40 = *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_40") (= "=") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) (; ";")) (expression_statement "local_1f8 = (param_4 & 1 ^ 1) * 2;" (assignment_expression "local_1f8 = (param_4 & 1 ^ 1) * 2" (identifier "local_1f8") (= "=") (binary_expression "(param_4 & 1 ^ 1) * 2" (parenthesized_expression "(param_4 & 1 ^ 1)" (( "(") (binary_expression "param_4 & 1 ^ 1" (binary_expression "param_4 & 1" (identifier "param_4") (& "&") (number_literal "1")) (^ "^") (number_literal "1")) () ")")) (* "*") (number_literal "2"))) (; ";")) (while_statement "while (__fd = __open64_2(param_2,local_1f8), (int)__fd < 0) {\n    if (local_1f8 == 0) {\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }" (while "while") (parenthesized_expression "(__fd = __open64_2(param_2,local_1f8), (int)__fd < 0)" (( "(") (comma_expression "__fd = __open64_2(param_2,local_1f8), (int)__fd < 0" (assignment_expression "__fd = __open64_2(param_2,local_1f8)" (identifier "__fd") (= "=") (call_expression "__open64_2(param_2,local_1f8)" (identifier "__open64_2") (argument_list "(param_2,local_1f8)" (( "(") (identifier "param_2") (, ",") (identifier "local_1f8") () ")")))) (, ",") (binary_expression "(int)__fd < 0" (cast_expression "(int)__fd" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "__fd")) (< "<") (number_literal "0"))) () ")")) (compound_statement "{\n    if (local_1f8 == 0) {\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }\n    local_1f8 = 0;\n  }" ({ "{") (if_statement "if (local_1f8 == 0) {\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }" (if "if") (parenthesized_expression "(local_1f8 == 0)" (( "(") (binary_expression "local_1f8 == 0" (identifier "local_1f8") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      iVar2 = -*DAT_001c65c0;\n      goto LAB_001a03dd;\n    }" ({ "{") (expression_statement "iVar2 = -*DAT_001c65c0;" (assignment_expression "iVar2 = -*DAT_001c65c0" (identifier "iVar2") (= "=") (unary_expression "-*DAT_001c65c0" (- "-") (pointer_expression "*DAT_001c65c0" (* "*") (identifier "DAT_001c65c0")))) (; ";")) (goto_statement "goto LAB_001a03dd;" (goto "goto") (statement_identifier "LAB_001a03dd") (; ";")) (} "}"))) (expression_statement "local_1f8 = 0;" (assignment_expression "local_1f8 = 0" (identifier "local_1f8") (= "=") (number_literal "0")) (; ";")) (} "}"))) (expression_statement "__filename = (char *)*param_1;" (assignment_expression "__filename = (char *)*param_1" (identifier "__filename") (= "=") (cast_expression "(char *)*param_1" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (if_statement "if ((char *)*param_1 == (char *)0x0) {\n    __filename = local_58;\n  }" (if "if") (parenthesized_expression "((char *)*param_1 == (char *)0x0)" (( "(") (binary_expression "(char *)*param_1 == (char *)0x0" (cast_expression "(char *)*param_1" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (== "==") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    __filename = local_58;\n  }" ({ "{") (expression_statement "__filename = local_58;" (assignment_expression "__filename = local_58" (identifier "__filename") (= "=") (identifier "local_58")) (; ";")) (} "}"))) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" (identifier "iVar2") (= "=") (number_literal "-1")) (; ";")) (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" (identifier "iVar5") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n    __sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);\n    *DAT_001c65c0 = 0;\n    iVar1 = __xstat64(1,__filename,&local_1d8);\n    if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar1 = __open64_2(__filename,local_1f8);\n    if (iVar1 < 0) {\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }\n    if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))\n    goto LAB_001a0559;\n  } while( true );" (do "do") (compound_statement "{\n    __sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);\n    *DAT_001c65c0 = 0;\n    iVar1 = __xstat64(1,__filename,&local_1d8);\n    if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }\nLAB_001a04e8:\n    iVar1 = __open64_2(__filename,local_1f8);\n    if (iVar1 < 0) {\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }\n    if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))\n    goto LAB_001a0559;\n  }" ({ "{") (expression_statement "__sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);" (call_expression "__sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5)" (identifier "__sprintf_chk") (argument_list "(local_58,1,0x17,"/dev/loop%u",iVar5)" (( "(") (identifier "local_58") (, ",") (number_literal "1") (, ",") (number_literal "0x17") (, ",") (string_literal ""/dev/loop%u"" (" """) (string_content "/dev/loop%u") (" """)) (, ",") (identifier "iVar5") () ")"))) (; ";")) (expression_statement "*DAT_001c65c0 = 0;" (assignment_expression "*DAT_001c65c0 = 0" (pointer_expression "*DAT_001c65c0" (* "*") (identifier "DAT_001c65c0")) (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar1 = __xstat64(1,__filename,&local_1d8);" (assignment_expression "iVar1 = __xstat64(1,__filename,&local_1d8)" (identifier "iVar1") (= "=") (call_expression "__xstat64(1,__filename,&local_1d8)" (identifier "__xstat64") (argument_list "(1,__filename,&local_1d8)" (( "(") (number_literal "1") (, ",") (identifier "__filename") (, ",") (pointer_expression "&local_1d8" (& "&") (identifier "local_1d8")) () ")")))) (; ";")) (if_statement "if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }" (if "if") (parenthesized_expression "((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000))" (( "(") (binary_expression "(iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)" (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "((local_1d8.st_mode & 0xf000) != 0x6000)" (( "(") (binary_expression "(local_1d8.st_mode & 0xf000) != 0x6000" (parenthesized_expression "(local_1d8.st_mode & 0xf000)" (( "(") (binary_expression "local_1d8.st_mode & 0xf000" (field_expression "local_1d8.st_mode" (identifier "local_1d8") (. ".") (field_identifier "st_mode")) (& "&") (number_literal "0xf000")) () ")")) (!= "!=") (number_literal "0x6000")) () ")"))) () ")")) (compound_statement "{\n      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }\nLAB_001a06b5:\n      close(__fd);\n      iVar2 = -1;\n      goto LAB_001a03dd;\n    }" ({ "{") (if_statement "if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }" (if "if") (parenthesized_expression "((*DAT_001c65c0 == 2) && (__filename == local_58))" (( "(") (binary_expression "(*DAT_001c65c0 == 2) && (__filename == local_58)" (parenthesized_expression "(*DAT_001c65c0 == 2)" (( "(") (binary_expression "*DAT_001c65c0 == 2" (pointer_expression "*DAT_001c65c0" (* "*") (identifier "DAT_001c65c0")) (== "==") (number_literal "2")) () ")")) (&& "&&") (parenthesized_expression "(__filename == local_58)" (( "(") (binary_expression "__filename == local_58" (identifier "__filename") (== "==") (identifier "local_58")) () ")"))) () ")")) (compound_statement "{\n        local_1e0 = FUN_001a094e(7,iVar5);\n        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);\n        if (iVar1 == 0) goto LAB_001a04e8;\n      }" ({ "{") (expression_statement "local_1e0 = FUN_001a094e(7,iVar5);" (assignment_expression "local_1e0 = FUN_001a094e(7,iVar5)" (identifier "local_1e0") (= "=") (call_expression "FUN_001a094e(7,iVar5)" (identifier "FUN_001a094e") (argument_list "(7,iVar5)" (( "(") (number_literal "7") (, ",") (identifier "iVar5") () ")")))) (; ";")) (expression_statement "iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);" (assignment_expression "iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0)" (identifier "iVar1") (= "=") (call_expression "__xmknod(0,local_58,0x61a4,&local_1e0)" (identifier "__xmknod") (argument_list "(0,local_58,0x61a4,&local_1e0)" (( "(") (number_literal "0") (, ",") (identifier "local_58") (, ",") (number_literal "0x61a4") (, ",") (pointer_expression "&local_1e0" (& "&") (identifier "local_1e0")) () ")")))) (; ";")) (if_statement "if (iVar1 == 0) goto LAB_001a04e8;" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_001a04e8;" (goto "goto") (statement_identifier "LAB_001a04e8") (; ";"))) (} "}"))) (labeled_statement "LAB_001a06b5:\n      close(__fd);" (statement_identifier "LAB_001a06b5") (: ":") (expression_statement "close(__fd);" (call_expression "close(__fd)" (identifier "close") (argument_list "(__fd)" (( "(") (identifier "__fd") () ")"))) (; ";"))) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" (identifier "iVar2") (= "=") (number_literal "-1")) (; ";")) (goto_statement "goto LAB_001a03dd;" (goto "goto") (statement_identifier "LAB_001a03dd") (; ";")) (} "}"))) (labeled_statement "LAB_001a04e8:\n    iVar1 = __open64_2(__filename,local_1f8);" (statement_identifier "LAB_001a04e8") (: ":") (expression_statement "iVar1 = __open64_2(__filename,local_1f8);" (assignment_expression "iVar1 = __open64_2(__filename,local_1f8)" (identifier "iVar1") (= "=") (call_expression "__open64_2(__filename,local_1f8)" (identifier "__open64_2") (argument_list "(__filename,local_1f8)" (( "(") (identifier "__filename") (, ",") (identifier "local_1f8") () ")")))) (; ";"))) (if_statement "if (iVar1 < 0) {\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }\n    else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n      if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }\n      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;\n    }" ({ "{") (if_statement "if (*DAT_001c65c0 == 0x1e) {\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }" (if "if") (parenthesized_expression "(*DAT_001c65c0 == 0x1e)" (( "(") (binary_expression "*DAT_001c65c0 == 0x1e" (pointer_expression "*DAT_001c65c0" (* "*") (identifier "DAT_001c65c0")) (== "==") (number_literal "0x1e")) () ")")) (compound_statement "{\n        iVar1 = open64(__filename,0);\n        if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }\n        local_1f8 = 0;\n      }" ({ "{") (expression_statement "iVar1 = open64(__filename,0);" (assignment_expression "iVar1 = open64(__filename,0)" (identifier "iVar1") (= "=") (call_expression "open64(__filename,0)" (identifier "open64") (argument_list "(__filename,0)" (( "(") (identifier "__filename") (, ",") (number_literal "0") () ")")))) (; ";")) (if_statement "if (-1 < iVar1) {\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }" (if "if") (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")")) (compound_statement "{\n          local_1f8 = 0;\n          goto LAB_001a0597;\n        }" ({ "{") (expression_statement "local_1f8 = 0;" (assignment_expression "local_1f8 = 0" (identifier "local_1f8") (= "=") (number_literal "0")) (; ";")) (goto_statement "goto LAB_001a0597;" (goto "goto") (statement_identifier "LAB_001a0597") (; ";")) (} "}"))) (expression_statement "local_1f8 = 0;" (assignment_expression "local_1f8 = 0" (identifier "local_1f8") (= "=") (number_literal "0")) (; ";")) (} "}"))) (if_statement "if (*DAT_001c65c0 == 6) goto LAB_001a06b5;" (if "if") (parenthesized_expression "(*DAT_001c65c0 == 6)" (( "(") (binary_expression "*DAT_001c65c0 == 6" (pointer_expression "*DAT_001c65c0" (* "*") (identifier "DAT_001c65c0")) (== "==") (number_literal "6")) () ")")) (goto_statement "goto LAB_001a06b5;" (goto "goto") (statement_identifier "LAB_001a06b5") (; ";"))) (} "}")) (else_clause "else {\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }" (else "else") (compound_statement "{\nLAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);\n      if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }\n      close(iVar1);\n    }" ({ "{") (labeled_statement "LAB_001a0597:\n      iVar2 = ioctl(iVar1,0x4c05,local_148);" (statement_identifier "LAB_001a0597") (: ":") (expression_statement "iVar2 = ioctl(iVar1,0x4c05,local_148);" (assignment_expression "iVar2 = ioctl(iVar1,0x4c05,local_148)" (identifier "iVar2") (= "=") (call_expression "ioctl(iVar1,0x4c05,local_148)" (identifier "ioctl") (argument_list "(iVar1,0x4c05,local_148)" (( "(") (identifier "iVar1") (, ",") (number_literal "0x4c05") (, ",") (identifier "local_148") () ")")))) (; ";"))) (if_statement "if (iVar2 == 0) {\n        iVar2 = -1;\n      }\n      else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        iVar2 = -1;\n      }" ({ "{") (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" (identifier "iVar2") (= "=") (number_literal "-1")) (; ";")) (} "}")) (else_clause "else if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }" (else "else") (if_statement "if (*DAT_001c65c0 == 6) {\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }\n      else {\n        iVar2 = -1;\n      }" (if "if") (parenthesized_expression "(*DAT_001c65c0 == 6)" (( "(") (binary_expression "*DAT_001c65c0 == 6" (pointer_expression "*DAT_001c65c0" (* "*") (identifier "DAT_001c65c0")) (== "==") (number_literal "6")) () ")")) (compound_statement "{\n        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);\n        if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }\n      }" ({ "{") (expression_statement "iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);" (assignment_expression "iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd)" (identifier "iVar3") (= "=") (call_expression "ioctl(iVar1,0x4c00,(ulong)__fd)" (identifier "ioctl") (argument_list "(iVar1,0x4c00,(ulong)__fd)" (( "(") (identifier "iVar1") (, ",") (number_literal "0x4c00") (, ",") (cast_expression "(ulong)__fd" (( "(") (type_descriptor "ulong" (type_identifier "ulong")) () ")") (identifier "__fd")) () ")")))) (; ";")) (if_statement "if (iVar3 == 0) {\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }" (if "if") (parenthesized_expression "(iVar3 == 0)" (( "(") (binary_expression "iVar3 == 0" (identifier "iVar3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n          puVar6 = local_148;\n          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }\n          FUN_001a49d0(local_110,param_2,0x40);\n          local_114 = param_4 & 0xfffffffe;\n          local_130 = param_3;\n          iVar3 = ioctl(iVar1,0x4c04,local_148);\n          iVar2 = 0;\n          if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }\n          if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }\n          iVar2 = iVar3;\n          ioctl(iVar1,0x4c01,0);\n        }" ({ "{") (expression_statement "puVar6 = local_148;" (assignment_expression "puVar6 = local_148" (identifier "puVar6") (= "=") (identifier "local_148")) (; ";")) (for_statement "for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }" (for "for") (( "(") (assignment_expression "lVar4 = 0x1d" (identifier "lVar4") (= "=") (number_literal "0x1d")) (; ";") (binary_expression "lVar4 != 0" (identifier "lVar4") (!= "!=") (number_literal "0")) (; ";") (assignment_expression "lVar4 = lVar4 + -1" (identifier "lVar4") (= "=") (binary_expression "lVar4 + -1" (identifier "lVar4") (+ "+") (number_literal "-1"))) () ")") (compound_statement "{\n            *puVar6 = 0;\n            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;\n          }" ({ "{") (expression_statement "*puVar6 = 0;" (assignment_expression "*puVar6 = 0" (pointer_expression "*puVar6" (* "*") (identifier "puVar6")) (= "=") (number_literal "0")) (; ";")) (expression_statement "puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;" (assignment_expression "puVar6 = puVar6 + (ulong)bVar7 * -2 + 1" (identifier "puVar6") (= "=") (binary_expression "puVar6 + (ulong)bVar7 * -2 + 1" (binary_expression "puVar6 + (ulong)bVar7 * -2" (identifier "puVar6") (+ "+") (binary_expression "(ulong)bVar7 * -2" (cast_expression "(ulong)bVar7" (( "(") (type_descriptor "ulong" (type_identifier "ulong")) () ")") (identifier "bVar7")) (* "*") (number_literal "-2"))) (+ "+") (number_literal "1"))) (; ";")) (} "}"))) (expression_statement "FUN_001a49d0(local_110,param_2,0x40);" (call_expression "FUN_001a49d0(local_110,param_2,0x40)" (identifier "FUN_001a49d0") (argument_list "(local_110,param_2,0x40)" (( "(") (identifier "local_110") (, ",") (identifier "param_2") (, ",") (number_literal "0x40") () ")"))) (; ";")) (expression_statement "local_114 = param_4 & 0xfffffffe;" (assignment_expression "local_114 = param_4 & 0xfffffffe" (identifier "local_114") (= "=") (binary_expression "param_4 & 0xfffffffe" (identifier "param_4") (& "&") (number_literal "0xfffffffe"))) (; ";")) (expression_statement "local_130 = param_3;" (assignment_expression "local_130 = param_3" (identifier "local_130") (= "=") (identifier "param_3")) (; ";")) (expression_statement "iVar3 = ioctl(iVar1,0x4c04,local_148);" (assignment_expression "iVar3 = ioctl(iVar1,0x4c04,local_148)" (identifier "iVar3") (= "=") (call_expression "ioctl(iVar1,0x4c04,local_148)" (identifier "ioctl") (argument_list "(iVar1,0x4c04,local_148)" (( "(") (identifier "iVar1") (, ",") (number_literal "0x4c04") (, ",") (identifier "local_148") () ")")))) (; ";")) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" (identifier "iVar2") (= "=") (number_literal "0")) (; ";")) (if_statement "if (iVar3 == 0) {\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }" (if "if") (parenthesized_expression "(iVar3 == 0)" (( "(") (binary_expression "iVar3 == 0" (identifier "iVar3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\nLAB_001a0559:\n            close(__fd);\n            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }\nLAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }\n                    \n            __stack_chk_fail();\n          }" ({ "{") (labeled_statement "LAB_001a0559:\n            close(__fd);" (statement_identifier "LAB_001a0559") (: ":") (expression_statement "close(__fd);" (call_expression "close(__fd)" (identifier "close") (argument_list "(__fd)" (( "(") (identifier "__fd") () ")"))) (; ";"))) (if_statement "if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }" (if "if") (parenthesized_expression "((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0))" (( "(") (binary_expression "(iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)" (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(iVar2 = iVar1, *param_1 == 0)" (( "(") (comma_expression "iVar2 = iVar1, *param_1 == 0" (assignment_expression "iVar2 = iVar1" (identifier "iVar2") (= "=") (identifier "iVar1")) (, ",") (binary_expression "*param_1 == 0" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (== "==") (number_literal "0"))) () ")"))) () ")")) (compound_statement "{\n              lVar4 = FUN_0010e627(local_58);\n              *param_1 = lVar4;\n            }" ({ "{") (expression_statement "lVar4 = FUN_0010e627(local_58);" (assignment_expression "lVar4 = FUN_0010e627(local_58)" (identifier "lVar4") (= "=") (call_expression "FUN_0010e627(local_58)" (identifier "FUN_0010e627") (argument_list "(local_58)" (( "(") (identifier "local_58") () ")")))) (; ";")) (expression_statement "*param_1 = lVar4;" (assignment_expression "*param_1 = lVar4" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "lVar4")) (; ";")) (} "}"))) (labeled_statement "LAB_001a03dd:\n            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }" (statement_identifier "LAB_001a03dd") (: ":") (if_statement "if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n              return iVar2;\n            }" (if "if") (parenthesized_expression "(local_40 == *(long *)(in_FS_OFFSET + 0x28))" (( "(") (binary_expression "local_40 == *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_40") (== "==") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) () ")")) (compound_statement "{\n              return iVar2;\n            }" ({ "{") (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}")))) (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" (identifier "__stack_chk_fail") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (if_statement "if ((local_114 & 4) != 0) {\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }" (if "if") (parenthesized_expression "((local_114 & 4) != 0)" (( "(") (binary_expression "(local_114 & 4) != 0" (parenthesized_expression "(local_114 & 4)" (( "(") (binary_expression "local_114 & 4" (identifier "local_114") (& "&") (number_literal "4")) () ")")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n            local_114 = local_114 - 4;\n            iVar3 = ioctl(iVar1,0x4c04,local_148);\n            if (iVar3 == 0) goto LAB_001a0559;\n          }" ({ "{") (expression_statement "local_114 = local_114 - 4;" (assignment_expression "local_114 = local_114 - 4" (identifier "local_114") (= "=") (binary_expression "local_114 - 4" (identifier "local_114") (- "-") (number_literal "4"))) (; ";")) (expression_statement "iVar3 = ioctl(iVar1,0x4c04,local_148);" (assignment_expression "iVar3 = ioctl(iVar1,0x4c04,local_148)" (identifier "iVar3") (= "=") (call_expression "ioctl(iVar1,0x4c04,local_148)" (identifier "ioctl") (argument_list "(iVar1,0x4c04,local_148)" (( "(") (identifier "iVar1") (, ",") (number_literal "0x4c04") (, ",") (identifier "local_148") () ")")))) (; ";")) (if_statement "if (iVar3 == 0) goto LAB_001a0559;" (if "if") (parenthesized_expression "(iVar3 == 0)" (( "(") (binary_expression "iVar3 == 0" (identifier "iVar3") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_001a0559;" (goto "goto") (statement_identifier "LAB_001a0559") (; ";"))) (} "}"))) (expression_statement "iVar2 = iVar3;" (assignment_expression "iVar2 = iVar3" (identifier "iVar2") (= "=") (identifier "iVar3")) (; ";")) (expression_statement "ioctl(iVar1,0x4c01,0);" (call_expression "ioctl(iVar1,0x4c01,0)" (identifier "ioctl") (argument_list "(iVar1,0x4c01,0)" (( "(") (identifier "iVar1") (, ",") (number_literal "0x4c01") (, ",") (number_literal "0") () ")"))) (; ";")) (} "}"))) (} "}")) (else_clause "else {\n        iVar2 = -1;\n      }" (else "else") (compound_statement "{\n        iVar2 = -1;\n      }" ({ "{") (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" (identifier "iVar2") (= "=") (number_literal "-1")) (; ";")) (} "}")))))) (expression_statement "close(iVar1);" (call_expression "close(iVar1)" (identifier "close") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")"))) (; ";")) (} "}")))) (if_statement "if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))\n    goto LAB_001a0559;" (if "if") (parenthesized_expression "(((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))" (( "(") (binary_expression "((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5)" (parenthesized_expression "((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0))" (( "(") (binary_expression "(*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)" (parenthesized_expression "(*param_1 != 0)" (( "(") (binary_expression "*param_1 != 0" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (!= "!=") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(iVar5 = iVar5 + 1, iVar2 == 0)" (( "(") (comma_expression "iVar5 = iVar5 + 1, iVar2 == 0" (assignment_expression "iVar5 = iVar5 + 1" (identifier "iVar5") (= "=") (binary_expression "iVar5 + 1" (identifier "iVar5") (+ "+") (number_literal "1"))) (, ",") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0"))) () ")"))) () ")")) (|| "||") (parenthesized_expression "(0xfffff < iVar5)" (( "(") (binary_expression "0xfffff < iVar5" (number_literal "0xfffff") (< "<") (identifier "iVar5")) () ")"))) () ")")) (goto_statement "goto LAB_001a0559;" (goto "goto") (statement_identifier "LAB_001a0559") (; ";"))) (} "}")) (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (; ";")) (} "}")))

int function_1(char **device,char *file,type_1 offset,type_2 var_2)

{
  long var_20;
  type_2 __fd;
  int var_7;
  int var_15;
  int var_16;
  char *var_8;
  long var_17;
  type_2 var_22;
  type_3 *pbVar7;
  long var_1;
  type_4 bVar8;
  int var_4;
  type_1 local_1e0;
  type_5 statbuf;
  type_3 loopinfo;
  char var_9 [23];
  
  bVar8 = 0;
  var_20 = *(long *)(var_1 + 0x28);
  var_4 = (var_2 & 1 ^ 1) * 2;
  while (__fd = var_3(file,var_4), (int)__fd < 0) {
    if (var_4 == 0) {
      var_15 = -*bb_errno;
      goto LAB_001a03dd;
    }
    var_4 = 0;
  }
  var_8 = *device;
  if (*device == (char *)0x0) {
    var_8 = var_9;
  }
  var_15 = -1;
  var_22 = 0;
  do {
    var_5(var_9,1,0x17,"/dev/loop%u",var_22);
    *bb_errno = 0;
    var_7 = var_6(1,var_8,(type_6 *)&statbuf);
    if ((var_7 != 0) || ((statbuf.st_mode & 0xf000) != 0x6000)) {
      if ((*bb_errno == 2) && (var_8 == var_9)) {
        local_1e0 = var_10(7,var_22);
        var_7 = var_11(0,var_9,0x61a4,&local_1e0);
        if (var_7 == 0) goto LAB_001a04e8;
      }
LAB_001a06b5:
      var_12(__fd);
      var_15 = -1;
      goto LAB_001a03dd;
    }
LAB_001a04e8:
    var_7 = var_3(var_8,var_4);
    if (var_7 < 0) {
      if (*bb_errno == 0x1e) {
        var_7 = var_13(var_8,0);
        if (-1 < var_7) {
          var_4 = 0;
          goto LAB_001a0597;
        }
        var_4 = 0;
      }
      if (*bb_errno == 6) goto LAB_001a06b5;
    }
    else {
LAB_001a0597:
      var_15 = var_14(var_7,0x4c05,&loopinfo);
      if (var_15 == 0) {
        var_15 = -1;
      }
      else if (*bb_errno == 6) {
        var_16 = var_14(var_7,0x4c00,(type_7)__fd);
        if (var_16 == 0) {
          pbVar7 = &loopinfo;
          for (var_17 = 0x1d; var_17 != 0; var_17 = var_17 + -1) {
            pbVar7->lo_device = 0;
            pbVar7 = (type_3 *)((long)pbVar7 + (type_7)bVar8 * -0x10 + 8);
          }
          var_18((char *)loopinfo.lo_file_name,file,0x40);
          loopinfo.lo_flags = var_2 & 0xfffffffe;
          loopinfo.lo_offset = offset;
          var_16 = var_14(var_7,0x4c04,&loopinfo);
          var_15 = 0;
          if (var_16 == 0) {
LAB_001a0559:
            var_12(__fd);
            if ((var_15 == 0) && (var_15 = var_7, *device == (char *)0x0)) {
              var_8 = var_19(var_9);
              *device = var_8;
            }
LAB_001a03dd:
            if (var_20 == *(long *)(var_1 + 0x28)) {
              return var_15;
            }
                    /* WARNING: Subroutine does not return */
            var_21();
          }
          if ((loopinfo.lo_flags & 4) != 0) {
            loopinfo.lo_flags = loopinfo.lo_flags - 4;
            var_16 = var_14(var_7,0x4c04,&loopinfo);
            if (var_16 == 0) goto LAB_001a0559;
          }
          var_15 = var_16;
          var_14(var_7,0x4c01,0);
        }
      }
      else {
        var_15 = -1;
      }
      var_12(var_7);
    }
    if (((*device != (char *)0x0) || (var_22 = var_22 + 1, var_15 == 0)) || (0xfffff < (int)var_22))
    goto LAB_001a0559;
  } while( true );
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (sized_type_specifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (declaration type: (primitive_type) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (declaration type: (sized_type_specifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (number_literal))) right: (number_literal)))) (while_statement condition: (parenthesized_expression (comma_expression left: (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier)))) right: (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (number_literal)))) body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (unary_expression argument: (pointer_expression argument: (identifier))))) (goto_statement label: (statement_identifier)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (do_statement body: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (number_literal) (string_literal (string_content)) (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (number_literal) (identifier) (pointer_expression argument: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (number_literal))) right: (number_literal))))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (number_literal) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (number_literal) (identifier) (number_literal) (pointer_expression argument: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (goto_statement label: (statement_identifier))))) (labeled_statement label: (statement_identifier) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (goto_statement label: (statement_identifier)))) (labeled_statement label: (statement_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 (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (goto_statement label: (statement_identifier)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) consequence: (goto_statement label: (statement_identifier)))) alternative: (else_clause (compound_statement (labeled_statement label: (statement_identifier) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))) (for_statement initializer: (assignment_expression left: (identifier) right: (number_literal)) condition: (binary_expression left: (identifier) right: (number_literal)) update: (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))) body: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)) right: (number_literal))) right: (number_literal)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (labeled_statement label: (statement_identifier) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (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: (identifier)) right: (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal)))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))))) (labeled_statement label: (statement_identifier) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) consequence: (compound_statement (return_statement (identifier))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (identifier))))) (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: (identifier))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (number_literal))))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) right: (parenthesized_expression (comma_expression left: (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))) right: (binary_expression left: (identifier) right: (number_literal)))))) right: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))))) consequence: (goto_statement label: (statement_identifier)))) condition: (parenthesized_expression (true))))))

int MASKED(long *param_1,undefined8 param_2,undefined8 param_3,uint param_4)

{
  uint __fd;
  int iVar1;
  int iVar2;
  int iVar3;
  long lVar4;
  int iVar5;
  undefined8 *puVar6;
  char *__filename;
  long in_FS_OFFSET;
  byte bVar7;
  int local_1f8;
  __dev_t local_1e0;
  stat64 local_1d8;
  undefined8 local_148 [3];
  undefined8 local_130;
  uint local_114;
  undefined1 local_110 [184];
  char local_58 [24];
  long local_40;
  
  bVar7 = 0;
  local_40 = *(long *)(in_FS_OFFSET + 0x28);
  local_1f8 = (param_4 & 1 ^ 1) * 2;
  while (__fd = __open64_2(param_2,local_1f8), (int)__fd < 0) {
    if (local_1f8 == 0) {
      iVar2 = -*DAT_001c65c0;
      goto LAB_001a03dd;
    }
    local_1f8 = 0;
  }
  __filename = (char *)*param_1;
  if ((char *)*param_1 == (char *)0x0) {
    __filename = local_58;
  }
  iVar2 = -1;
  iVar5 = 0;
  do {
    __sprintf_chk(local_58,1,0x17,"/dev/loop%u",iVar5);
    *DAT_001c65c0 = 0;
    iVar1 = __xstat64(1,__filename,&local_1d8);
    if ((iVar1 != 0) || ((local_1d8.st_mode & 0xf000) != 0x6000)) {
      if ((*DAT_001c65c0 == 2) && (__filename == local_58)) {
        local_1e0 = FUN_001a094e(7,iVar5);
        iVar1 = __xmknod(0,local_58,0x61a4,&local_1e0);
        if (iVar1 == 0) goto LAB_001a04e8;
      }
LAB_001a06b5:
      close(__fd);
      iVar2 = -1;
      goto LAB_001a03dd;
    }
LAB_001a04e8:
    iVar1 = __open64_2(__filename,local_1f8);
    if (iVar1 < 0) {
      if (*DAT_001c65c0 == 0x1e) {
        iVar1 = open64(__filename,0);
        if (-1 < iVar1) {
          local_1f8 = 0;
          goto LAB_001a0597;
        }
        local_1f8 = 0;
      }
      if (*DAT_001c65c0 == 6) goto LAB_001a06b5;
    }
    else {
LAB_001a0597:
      iVar2 = ioctl(iVar1,0x4c05,local_148);
      if (iVar2 == 0) {
        iVar2 = -1;
      }
      else if (*DAT_001c65c0 == 6) {
        iVar3 = ioctl(iVar1,0x4c00,(ulong)__fd);
        if (iVar3 == 0) {
          puVar6 = local_148;
          for (lVar4 = 0x1d; lVar4 != 0; lVar4 = lVar4 + -1) {
            *puVar6 = 0;
            puVar6 = puVar6 + (ulong)bVar7 * -2 + 1;
          }
          FUN_001a49d0(local_110,param_2,0x40);
          local_114 = param_4 & 0xfffffffe;
          local_130 = param_3;
          iVar3 = ioctl(iVar1,0x4c04,local_148);
          iVar2 = 0;
          if (iVar3 == 0) {
LAB_001a0559:
            close(__fd);
            if ((iVar2 == 0) && (iVar2 = iVar1, *param_1 == 0)) {
              lVar4 = FUN_0010e627(local_58);
              *param_1 = lVar4;
            }
LAB_001a03dd:
            if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {
              return iVar2;
            }
                    /* WARNING: Subroutine does not return */
            __stack_chk_fail();
          }
          if ((local_114 & 4) != 0) {
            local_114 = local_114 - 4;
            iVar3 = ioctl(iVar1,0x4c04,local_148);
            if (iVar3 == 0) goto LAB_001a0559;
          }
          iVar2 = iVar3;
          ioctl(iVar1,0x4c01,0);
        }
      }
      else {
        iVar2 = -1;
      }
      close(iVar1);
    }
    if (((*param_1 != 0) || (iVar5 = iVar5 + 1, iVar2 == 0)) || (0xfffff < iVar5))
    goto LAB_001a0559;
  } while( true );
}

