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

MagicInfo * GetMagicInfo(uchar *magic,size_t length,ExceptionInfo *exception)

{
  MagickBooleanType MVar1;
  MagicInfo *pMVar2;
  int iVar3;
  
  if (exception == (ExceptionInfo *)0x0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");
  }
  MVar1 = IsMagicListInstantiated(exception);
  if (MVar1 != MagickFalse) {
    if (magic_cache == (LinkedListInfo *)0x0) {
      if (magic_cache_semaphore == (SemaphoreInfo *)0x0) {
        ActivateSemaphoreInfo(&magic_cache_semaphore);
      }
      LockSemaphoreInfo(magic_cache_semaphore);
      if (magic_cache == (LinkedListInfo *)0x0) {
        magic_cache = NewLinkedList(0);
      }
      UnlockSemaphoreInfo(magic_cache_semaphore);
      if (magic_cache == (LinkedListInfo *)0x0) {
        return (MagicInfo *)0x0;
      }
    }
    if (magic == (uchar *)0x0) {
      LockSemaphoreInfo(magic_list_semaphore);
      ResetLinkedListIterator(magic_list);
      pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list);
      UnlockSemaphoreInfo(magic_list_semaphore);
      return pMVar2;
    }
    LockSemaphoreInfo(magic_cache_semaphore);
    ResetLinkedListIterator(magic_cache);
    while (pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_cache), pMVar2 != (MagicInfo *)0x0)
    {
      iVar3 = (int)pMVar2->offset;
      if ((iVar3 + pMVar2->length <= length) &&
         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {
        UnlockSemaphoreInfo(magic_cache_semaphore);
        return pMVar2;
      }
    }
    UnlockSemaphoreInfo(magic_cache_semaphore);
    LockSemaphoreInfo(magic_list_semaphore);
    ResetLinkedListIterator(magic_list);
    while (pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list), pMVar2 != (MagicInfo *)0x0) {
      iVar3 = (int)pMVar2->offset;
      if (*(int *)((int)&pMVar2->offset + 4) < 0) {
                    /* WARNING: Subroutine does not return */
        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");
      }
      if ((iVar3 + pMVar2->length <= length) &&
         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {
        UnlockSemaphoreInfo(magic_list_semaphore);
        LockSemaphoreInfo(magic_cache_semaphore);
        InsertValueInSortedLinkedList(magic_cache,CompareMagickInfoSize,(void **)0x0,pMVar2);
        UnlockSemaphoreInfo(magic_cache_semaphore);
        return pMVar2;
      }
    }
    UnlockSemaphoreInfo(magic_list_semaphore);
  }
  return (MagicInfo *)0x0;
}



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

int GetMagicInfo(int param_1,uint param_2,int param_3)

{
  int iVar1;
  int iVar2;
  
  if (param_3 == 0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");
  }
  iVar1 = FUN_000f54e0();
  if (iVar1 != 0) {
    if (DAT_003dd7d8 == 0) {
      if (DAT_003dd7d0 == 0) {
        ActivateSemaphoreInfo(&DAT_003dd7d0);
      }
      LockSemaphoreInfo(DAT_003dd7d0);
      if (DAT_003dd7d8 == 0) {
        DAT_003dd7d8 = NewLinkedList(0);
      }
      UnlockSemaphoreInfo(DAT_003dd7d0);
      if (DAT_003dd7d8 == 0) {
        return 0;
      }
    }
    if (param_1 == 0) {
      LockSemaphoreInfo(DAT_003dd7cc);
      ResetLinkedListIterator(DAT_003dd7d4);
      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);
      UnlockSemaphoreInfo(DAT_003dd7cc);
      return iVar1;
    }
    LockSemaphoreInfo(DAT_003dd7d0);
    ResetLinkedListIterator(DAT_003dd7d8);
    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {
      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&
         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),
                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {
        UnlockSemaphoreInfo(DAT_003dd7d0);
        return iVar1;
      }
    }
    UnlockSemaphoreInfo(DAT_003dd7d0);
    LockSemaphoreInfo(DAT_003dd7cc);
    ResetLinkedListIterator(DAT_003dd7d4);
    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {
      if (*(int *)(iVar1 + 0x18) < 0) {
                    /* WARNING: Subroutine does not return */
        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");
      }
      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&
         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),
                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {
        UnlockSemaphoreInfo(DAT_003dd7cc);
        LockSemaphoreInfo(DAT_003dd7d0);
        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);
        UnlockSemaphoreInfo(DAT_003dd7d0);
        return iVar1;
      }
    }
    UnlockSemaphoreInfo(DAT_003dd7cc);
  }
  return 0;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00038830
ADD EBX,0x2e3847
SUB ESP,0xc
MOV EAX,dword ptr [ESP + 0x28]
MOV EBP,dword ptr [ESP + 0x20]
MOV EDI,dword ptr [ESP + 0x24]
TEST EAX,EAX
JZ 0x000f5a5c
CALL 0x000f54e0
TEST EAX,EAX
JZ 0x000f58ea
MOV EAX,dword ptr [EBX + 0x47d8]
TEST EAX,EAX
JZ 0x000f5900
TEST EBP,EBP
JZ 0x000f594b
SUB ESP,0xc
PUSH dword ptr [EBX + 0x47d0]
CALL 0x00031050
POP ECX
PUSH dword ptr [EBX + 0x47d8]
CALL 0x00031700
POP ESI
JMP 0x000f584a
MOV EAX,dword ptr [EAX + 0x14]
MOV EDX,dword ptr [ESI + 0x10]
LEA ECX,[EAX + EDX*0x1]
CMP ECX,EDI
JA 0x000f5847
SUB ESP,0x4
ADD EAX,EBP
PUSH EDX
PUSH dword ptr [ESI + 0xc]
PUSH EAX
CALL 0x000308a0
ADD ESP,0x10
TEST EAX,EAX
JZ 0x000f5990
SUB ESP,0xc
PUSH dword ptr [EBX + 0x47d8]
CALL 0x00031f60
ADD ESP,0x10
MOV ESI,EAX
TEST EAX,EAX
JNZ 0x000f5820
SUB ESP,0xc
PUSH dword ptr [EBX + 0x47d0]
CALL 0x00031da0
POP EAX
PUSH dword ptr [EBX + 0x47cc]
CALL 0x00031050
POP EAX
PUSH dword ptr [EBX + 0x47d4]
CALL 0x00031700
POP EAX
JMP 0x000f58c5
MOV EDX,dword ptr [ESI + 0x18]
MOV EAX,dword ptr [ESI + 0x14]
TEST EDX,EDX
JS 0x000f5a3d
MOV EDX,dword ptr [ESI + 0x10]
LEA ECX,[EAX + EDX*0x1]
CMP ECX,EDI
JA 0x000f58c2
SUB ESP,0x4
ADD EAX,EBP
PUSH EDX
PUSH dword ptr [ESI + 0xc]
PUSH EAX
CALL 0x000308a0
ADD ESP,0x10
TEST EAX,EAX
JZ 0x000f59b0
SUB ESP,0xc
PUSH dword ptr [EBX + 0x47d4]
CALL 0x00031f60
ADD ESP,0x10
MOV ESI,EAX
TEST EAX,EAX
JNZ 0x000f5890
SUB ESP,0xc
PUSH dword ptr [EBX + 0x47cc]
CALL 0x00031da0
ADD ESP,0x10
ADD ESP,0xc
XOR ESI,ESI
POP EBX
MOV EAX,ESI
POP ESI
POP EDI
POP EBP
RET
MOV EAX,dword ptr [EBX + 0x47d0]
TEST EAX,EAX
JZ 0x000f5a20
SUB ESP,0xc
PUSH EAX
CALL 0x00031050
MOV EAX,dword ptr [EBX + 0x47d8]
ADD ESP,0x10
TEST EAX,EAX
JZ 0x000f5a00
SUB ESP,0xc
PUSH dword ptr [EBX + 0x47d0]
CALL 0x00031da0
MOV EAX,dword ptr [EBX + 0x47d8]
ADD ESP,0x10
TEST EAX,EAX
JZ 0x000f58ea
TEST EBP,EBP
JNZ 0x000f57f9
SUB ESP,0xc
PUSH dword ptr [EBX + 0x47cc]
CALL 0x00031050
POP ECX
PUSH dword ptr [EBX + 0x47d4]
CALL 0x00031700
POP ESI
PUSH dword ptr [EBX + 0x47d4]
CALL 0x00031f60
POP EDI
PUSH dword ptr [EBX + 0x47cc]
MOV ESI,EAX
CALL 0x00031da0
ADD ESP,0x10
MOV EAX,ESI
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH dword ptr [EBX + 0x47d0]
CALL 0x00031da0
ADD ESP,0x10
MOV EAX,ESI
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH dword ptr [EBX + 0x47cc]
CALL 0x00031da0
POP EAX
PUSH dword ptr [EBX + 0x47d0]
CALL 0x00031050
LEA EAX,[EBX + 0xffd1c460]
ADD ESP,0x10
PUSH ESI
PUSH 0x0
PUSH EAX
PUSH dword ptr [EBX + 0x47d8]
CALL 0x00032160
POP EDX
PUSH dword ptr [EBX + 0x47d0]
CALL 0x00031da0
ADD ESP,0x10
MOV EAX,ESI
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH 0x0
CALL 0x000333c0
ADD ESP,0x10
MOV dword ptr [EBX + 0x47d8],EAX
JMP 0x000f5928
LEA EAX,[EBX + 0x47d0]
SUB ESP,0xc
PUSH EAX
CALL 0x00031830
MOV EAX,dword ptr [EBX + 0x47d0]
ADD ESP,0x10
JMP 0x000f590e
LEA EAX,[EBX + 0xffee081c]
PUSH EAX
LEA EAX,[EBX + 0xffee04e4]
PUSH 0x143
PUSH EAX
LEA EAX,[EBX + 0xffee04f7]
PUSH EAX
CALL 0x000313d0
LEA EAX,[EBX + 0xffee081c]
PUSH EAX
LEA EAX,[EBX + 0xffee04e4]
PUSH 0x11e
PUSH EAX
LEA EAX,[EBX + 0xffec6a3c]
PUSH EAX
CALL 0x000313d0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint GetMagicInfo(int param_1,uint param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (param_3 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }\n  iVar1 = FUN_000f54e0();\n  if (iVar1 != 0) {\n    if (DAT_003dd7d8 == 0) {\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }\n    if (param_1 == 0) {\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }\n    LockSemaphoreInfo(DAT_003dd7d0);\n    ResetLinkedListIterator(DAT_003dd7d8);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7d0);\n    LockSemaphoreInfo(DAT_003dd7cc);\n    ResetLinkedListIterator(DAT_003dd7d4);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7cc);\n  }\n  return 0;\n}\n\n" comment (function_definition "int GetMagicInfo(int param_1,uint param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (param_3 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }\n  iVar1 = FUN_000f54e0();\n  if (iVar1 != 0) {\n    if (DAT_003dd7d8 == 0) {\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }\n    if (param_1 == 0) {\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }\n    LockSemaphoreInfo(DAT_003dd7d0);\n    ResetLinkedListIterator(DAT_003dd7d8);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7d0);\n    LockSemaphoreInfo(DAT_003dd7cc);\n    ResetLinkedListIterator(DAT_003dd7d4);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7cc);\n  }\n  return 0;\n}" primitive_type (function_declarator "GetMagicInfo(int param_1,uint param_2,int param_3)" identifier (parameter_list "(int param_1,uint param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  if (param_3 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }\n  iVar1 = FUN_000f54e0();\n  if (iVar1 != 0) {\n    if (DAT_003dd7d8 == 0) {\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }\n    if (param_1 == 0) {\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }\n    LockSemaphoreInfo(DAT_003dd7d0);\n    ResetLinkedListIterator(DAT_003dd7d8);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7d0);\n    LockSemaphoreInfo(DAT_003dd7cc);\n    ResetLinkedListIterator(DAT_003dd7d4);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7cc);\n  }\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (if_statement "if (param_3 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }" { comment (expression_statement "__assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");" (call_expression "__assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo")" identifier (argument_list "("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo")" ( (string_literal ""exception != (ExceptionInfo *) NULL"" " string_content ") , (string_literal ""MagickCore/magic.c"" " string_content ") , number_literal , (string_literal ""GetMagicInfo"" " string_content ") ))) ;) })) (expression_statement "iVar1 = FUN_000f54e0();" (assignment_expression "iVar1 = FUN_000f54e0()" identifier = (call_expression "FUN_000f54e0()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar1 != 0) {\n    if (DAT_003dd7d8 == 0) {\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }\n    if (param_1 == 0) {\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }\n    LockSemaphoreInfo(DAT_003dd7d0);\n    ResetLinkedListIterator(DAT_003dd7d8);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7d0);\n    LockSemaphoreInfo(DAT_003dd7cc);\n    ResetLinkedListIterator(DAT_003dd7d4);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7cc);\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    if (DAT_003dd7d8 == 0) {\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }\n    if (param_1 == 0) {\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }\n    LockSemaphoreInfo(DAT_003dd7d0);\n    ResetLinkedListIterator(DAT_003dd7d8);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7d0);\n    LockSemaphoreInfo(DAT_003dd7cc);\n    ResetLinkedListIterator(DAT_003dd7d4);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7cc);\n  }" { (if_statement "if (DAT_003dd7d8 == 0) {\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }" if (parenthesized_expression "(DAT_003dd7d8 == 0)" ( (binary_expression "DAT_003dd7d8 == 0" identifier == number_literal) )) (compound_statement "{\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }" { (if_statement "if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }" if (parenthesized_expression "(DAT_003dd7d0 == 0)" ( (binary_expression "DAT_003dd7d0 == 0" identifier == number_literal) )) (compound_statement "{\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }" { (expression_statement "ActivateSemaphoreInfo(&DAT_003dd7d0);" (call_expression "ActivateSemaphoreInfo(&DAT_003dd7d0)" identifier (argument_list "(&DAT_003dd7d0)" ( (pointer_expression "&DAT_003dd7d0" & identifier) ))) ;) })) (expression_statement "LockSemaphoreInfo(DAT_003dd7d0);" (call_expression "LockSemaphoreInfo(DAT_003dd7d0)" identifier (argument_list "(DAT_003dd7d0)" ( identifier ))) ;) (if_statement "if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }" if (parenthesized_expression "(DAT_003dd7d8 == 0)" ( (binary_expression "DAT_003dd7d8 == 0" identifier == number_literal) )) (compound_statement "{\n        DAT_003dd7d8 = NewLinkedList(0);\n      }" { (expression_statement "DAT_003dd7d8 = NewLinkedList(0);" (assignment_expression "DAT_003dd7d8 = NewLinkedList(0)" identifier = (call_expression "NewLinkedList(0)" identifier (argument_list "(0)" ( number_literal )))) ;) })) (expression_statement "UnlockSemaphoreInfo(DAT_003dd7d0);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7d0)" identifier (argument_list "(DAT_003dd7d0)" ( identifier ))) ;) (if_statement "if (DAT_003dd7d8 == 0) {\n        return 0;\n      }" if (parenthesized_expression "(DAT_003dd7d8 == 0)" ( (binary_expression "DAT_003dd7d8 == 0" identifier == number_literal) )) (compound_statement "{\n        return 0;\n      }" { (return_statement "return 0;" return number_literal ;) })) })) (if_statement "if (param_1 == 0) {\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }" if (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) (compound_statement "{\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }" { (expression_statement "LockSemaphoreInfo(DAT_003dd7cc);" (call_expression "LockSemaphoreInfo(DAT_003dd7cc)" identifier (argument_list "(DAT_003dd7cc)" ( identifier ))) ;) (expression_statement "ResetLinkedListIterator(DAT_003dd7d4);" (call_expression "ResetLinkedListIterator(DAT_003dd7d4)" identifier (argument_list "(DAT_003dd7d4)" ( identifier ))) ;) (expression_statement "iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);" (assignment_expression "iVar1 = GetNextValueInLinkedList(DAT_003dd7d4)" identifier = (call_expression "GetNextValueInLinkedList(DAT_003dd7d4)" identifier (argument_list "(DAT_003dd7d4)" ( identifier )))) ;) (expression_statement "UnlockSemaphoreInfo(DAT_003dd7cc);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7cc)" identifier (argument_list "(DAT_003dd7cc)" ( identifier ))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "LockSemaphoreInfo(DAT_003dd7d0);" (call_expression "LockSemaphoreInfo(DAT_003dd7d0)" identifier (argument_list "(DAT_003dd7d0)" ( identifier ))) ;) (expression_statement "ResetLinkedListIterator(DAT_003dd7d8);" (call_expression "ResetLinkedListIterator(DAT_003dd7d8)" identifier (argument_list "(DAT_003dd7d8)" ( identifier ))) ;) (while_statement "while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }" while (parenthesized_expression "(iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0)" ( (comma_expression "iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0" (assignment_expression "iVar1 = GetNextValueInLinkedList(DAT_003dd7d8)" identifier = (call_expression "GetNextValueInLinkedList(DAT_003dd7d8)" identifier (argument_list "(DAT_003dd7d8)" ( identifier )))) , (binary_expression "iVar1 != 0" identifier != number_literal)) )) (compound_statement "{\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }" { (if_statement "if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }" if (parenthesized_expression "((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0))" ( (binary_expression "(*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)" (parenthesized_expression "(*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2)" ( (binary_expression "*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2" (binary_expression "*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10)" (pointer_expression "*(int *)(iVar1 + 0x14)" * (cast_expression "(int *)(iVar1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x14)" ( (binary_expression "iVar1 + 0x14" identifier + number_literal) )))) + (pointer_expression "*(size_t *)(iVar1 + 0x10)" * (cast_expression "(size_t *)(iVar1 + 0x10)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x10)" ( (binary_expression "iVar1 + 0x10" identifier + number_literal) ))))) <= identifier) )) && (parenthesized_expression "(iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)" ( (comma_expression "iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0" (assignment_expression "iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" identifier = (call_expression "memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" identifier (argument_list "((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" ( (cast_expression "(void *)(*(int *)(iVar1 + 0x14) + param_1)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(iVar1 + 0x14) + param_1)" ( (binary_expression "*(int *)(iVar1 + 0x14) + param_1" (pointer_expression "*(int *)(iVar1 + 0x14)" * (cast_expression "(int *)(iVar1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x14)" ( (binary_expression "iVar1 + 0x14" identifier + number_literal) )))) + identifier) ))) , (pointer_expression "*(void **)(iVar1 + 0xc)" * (cast_expression "(void **)(iVar1 + 0xc)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar1 + 0xc)" ( (binary_expression "iVar1 + 0xc" identifier + number_literal) )))) , (pointer_expression "*(size_t *)(iVar1 + 0x10)" * (cast_expression "(size_t *)(iVar1 + 0x10)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x10)" ( (binary_expression "iVar1 + 0x10" identifier + number_literal) )))) )))) , (binary_expression "iVar2 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }" { (expression_statement "UnlockSemaphoreInfo(DAT_003dd7d0);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7d0)" identifier (argument_list "(DAT_003dd7d0)" ( identifier ))) ;) (return_statement "return iVar1;" return identifier ;) })) })) (expression_statement "UnlockSemaphoreInfo(DAT_003dd7d0);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7d0)" identifier (argument_list "(DAT_003dd7d0)" ( identifier ))) ;) (expression_statement "LockSemaphoreInfo(DAT_003dd7cc);" (call_expression "LockSemaphoreInfo(DAT_003dd7cc)" identifier (argument_list "(DAT_003dd7cc)" ( identifier ))) ;) (expression_statement "ResetLinkedListIterator(DAT_003dd7d4);" (call_expression "ResetLinkedListIterator(DAT_003dd7d4)" identifier (argument_list "(DAT_003dd7d4)" ( identifier ))) ;) (while_statement "while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }" while (parenthesized_expression "(iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0)" ( (comma_expression "iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0" (assignment_expression "iVar1 = GetNextValueInLinkedList(DAT_003dd7d4)" identifier = (call_expression "GetNextValueInLinkedList(DAT_003dd7d4)" identifier (argument_list "(DAT_003dd7d4)" ( identifier )))) , (binary_expression "iVar1 != 0" identifier != number_literal)) )) (compound_statement "{\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }" { (if_statement "if (*(int *)(iVar1 + 0x18) < 0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }" if (parenthesized_expression "(*(int *)(iVar1 + 0x18) < 0)" ( (binary_expression "*(int *)(iVar1 + 0x18) < 0" (pointer_expression "*(int *)(iVar1 + 0x18)" * (cast_expression "(int *)(iVar1 + 0x18)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x18)" ( (binary_expression "iVar1 + 0x18" identifier + number_literal) )))) < number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }" { comment (expression_statement "__assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");" (call_expression "__assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo")" identifier (argument_list "("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo")" ( (string_literal ""p->offset >= 0"" " string_content ") , (string_literal ""MagickCore/magic.c"" " string_content ") , number_literal , (string_literal ""GetMagicInfo"" " string_content ") ))) ;) })) (if_statement "if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }" if (parenthesized_expression "((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0))" ( (binary_expression "(*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)" (parenthesized_expression "(*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2)" ( (binary_expression "*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2" (binary_expression "*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10)" (pointer_expression "*(int *)(iVar1 + 0x14)" * (cast_expression "(int *)(iVar1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x14)" ( (binary_expression "iVar1 + 0x14" identifier + number_literal) )))) + (pointer_expression "*(size_t *)(iVar1 + 0x10)" * (cast_expression "(size_t *)(iVar1 + 0x10)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x10)" ( (binary_expression "iVar1 + 0x10" identifier + number_literal) ))))) <= identifier) )) && (parenthesized_expression "(iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)" ( (comma_expression "iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0" (assignment_expression "iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" identifier = (call_expression "memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" identifier (argument_list "((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" ( (cast_expression "(void *)(*(int *)(iVar1 + 0x14) + param_1)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(iVar1 + 0x14) + param_1)" ( (binary_expression "*(int *)(iVar1 + 0x14) + param_1" (pointer_expression "*(int *)(iVar1 + 0x14)" * (cast_expression "(int *)(iVar1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x14)" ( (binary_expression "iVar1 + 0x14" identifier + number_literal) )))) + identifier) ))) , (pointer_expression "*(void **)(iVar1 + 0xc)" * (cast_expression "(void **)(iVar1 + 0xc)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar1 + 0xc)" ( (binary_expression "iVar1 + 0xc" identifier + number_literal) )))) , (pointer_expression "*(size_t *)(iVar1 + 0x10)" * (cast_expression "(size_t *)(iVar1 + 0x10)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x10)" ( (binary_expression "iVar1 + 0x10" identifier + number_literal) )))) )))) , (binary_expression "iVar2 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }" { (expression_statement "UnlockSemaphoreInfo(DAT_003dd7cc);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7cc)" identifier (argument_list "(DAT_003dd7cc)" ( identifier ))) ;) (expression_statement "LockSemaphoreInfo(DAT_003dd7d0);" (call_expression "LockSemaphoreInfo(DAT_003dd7d0)" identifier (argument_list "(DAT_003dd7d0)" ( identifier ))) ;) (expression_statement "InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);" (call_expression "InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1)" identifier (argument_list "(DAT_003dd7d8,FUN_000f5460,0,iVar1)" ( identifier , identifier , number_literal , identifier ))) ;) (expression_statement "UnlockSemaphoreInfo(DAT_003dd7d0);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7d0)" identifier (argument_list "(DAT_003dd7d0)" ( identifier ))) ;) (return_statement "return iVar1;" return identifier ;) })) })) (expression_statement "UnlockSemaphoreInfo(DAT_003dd7cc);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7cc)" identifier (argument_list "(DAT_003dd7cc)" ( identifier ))) ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n/* WARNING: Enum "ExceptionType": Some values do not have unique names */\n\nMagicInfo * GetMagicInfo(uchar *magic,size_t length,ExceptionInfo *exception)\n\n{\n  MagickBooleanType MVar1;\n  MagicInfo *pMVar2;\n  int iVar3;\n  \n  if (exception == (ExceptionInfo *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }\n  MVar1 = IsMagicListInstantiated(exception);\n  if (MVar1 != MagickFalse) {\n    if (magic_cache == (LinkedListInfo *)0x0) {\n      if (magic_cache_semaphore == (SemaphoreInfo *)0x0) {\n        ActivateSemaphoreInfo(&magic_cache_semaphore);\n      }\n      LockSemaphoreInfo(magic_cache_semaphore);\n      if (magic_cache == (LinkedListInfo *)0x0) {\n        magic_cache = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(magic_cache_semaphore);\n      if (magic_cache == (LinkedListInfo *)0x0) {\n        return (MagicInfo *)0x0;\n      }\n    }\n    if (magic == (uchar *)0x0) {\n      LockSemaphoreInfo(magic_list_semaphore);\n      ResetLinkedListIterator(magic_list);\n      pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list);\n      UnlockSemaphoreInfo(magic_list_semaphore);\n      return pMVar2;\n    }\n    LockSemaphoreInfo(magic_cache_semaphore);\n    ResetLinkedListIterator(magic_cache);\n    while (pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_cache), pMVar2 != (MagicInfo *)0x0)\n    {\n      iVar3 = (int)pMVar2->offset;\n      if ((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }\n    }\n    UnlockSemaphoreInfo(magic_cache_semaphore);\n    LockSemaphoreInfo(magic_list_semaphore);\n    ResetLinkedListIterator(magic_list);\n    while (pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list), pMVar2 != (MagicInfo *)0x0) {\n      iVar3 = (int)pMVar2->offset;\n      if (*(int *)((int)&pMVar2->offset + 4) < 0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {\n        UnlockSemaphoreInfo(magic_list_semaphore);\n        LockSemaphoreInfo(magic_cache_semaphore);\n        InsertValueInSortedLinkedList(magic_cache,CompareMagickInfoSize,(void **)0x0,pMVar2);\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }\n    }\n    UnlockSemaphoreInfo(magic_list_semaphore);\n  }\n  return (MagicInfo *)0x0;\n}\n\n" comment comment comment (function_definition "MagicInfo * GetMagicInfo(uchar *magic,size_t length,ExceptionInfo *exception)\n\n{\n  MagickBooleanType MVar1;\n  MagicInfo *pMVar2;\n  int iVar3;\n  \n  if (exception == (ExceptionInfo *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }\n  MVar1 = IsMagicListInstantiated(exception);\n  if (MVar1 != MagickFalse) {\n    if (magic_cache == (LinkedListInfo *)0x0) {\n      if (magic_cache_semaphore == (SemaphoreInfo *)0x0) {\n        ActivateSemaphoreInfo(&magic_cache_semaphore);\n      }\n      LockSemaphoreInfo(magic_cache_semaphore);\n      if (magic_cache == (LinkedListInfo *)0x0) {\n        magic_cache = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(magic_cache_semaphore);\n      if (magic_cache == (LinkedListInfo *)0x0) {\n        return (MagicInfo *)0x0;\n      }\n    }\n    if (magic == (uchar *)0x0) {\n      LockSemaphoreInfo(magic_list_semaphore);\n      ResetLinkedListIterator(magic_list);\n      pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list);\n      UnlockSemaphoreInfo(magic_list_semaphore);\n      return pMVar2;\n    }\n    LockSemaphoreInfo(magic_cache_semaphore);\n    ResetLinkedListIterator(magic_cache);\n    while (pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_cache), pMVar2 != (MagicInfo *)0x0)\n    {\n      iVar3 = (int)pMVar2->offset;\n      if ((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }\n    }\n    UnlockSemaphoreInfo(magic_cache_semaphore);\n    LockSemaphoreInfo(magic_list_semaphore);\n    ResetLinkedListIterator(magic_list);\n    while (pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list), pMVar2 != (MagicInfo *)0x0) {\n      iVar3 = (int)pMVar2->offset;\n      if (*(int *)((int)&pMVar2->offset + 4) < 0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {\n        UnlockSemaphoreInfo(magic_list_semaphore);\n        LockSemaphoreInfo(magic_cache_semaphore);\n        InsertValueInSortedLinkedList(magic_cache,CompareMagickInfoSize,(void **)0x0,pMVar2);\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }\n    }\n    UnlockSemaphoreInfo(magic_list_semaphore);\n  }\n  return (MagicInfo *)0x0;\n}" type_identifier (pointer_declarator "* GetMagicInfo(uchar *magic,size_t length,ExceptionInfo *exception)" * (function_declarator "GetMagicInfo(uchar *magic,size_t length,ExceptionInfo *exception)" identifier (parameter_list "(uchar *magic,size_t length,ExceptionInfo *exception)" ( (parameter_declaration "uchar *magic" type_identifier (pointer_declarator "*magic" * identifier)) , (parameter_declaration "size_t length" primitive_type identifier) , (parameter_declaration "ExceptionInfo *exception" type_identifier (pointer_declarator "*exception" * identifier)) )))) (compound_statement "{\n  MagickBooleanType MVar1;\n  MagicInfo *pMVar2;\n  int iVar3;\n  \n  if (exception == (ExceptionInfo *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }\n  MVar1 = IsMagicListInstantiated(exception);\n  if (MVar1 != MagickFalse) {\n    if (magic_cache == (LinkedListInfo *)0x0) {\n      if (magic_cache_semaphore == (SemaphoreInfo *)0x0) {\n        ActivateSemaphoreInfo(&magic_cache_semaphore);\n      }\n      LockSemaphoreInfo(magic_cache_semaphore);\n      if (magic_cache == (LinkedListInfo *)0x0) {\n        magic_cache = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(magic_cache_semaphore);\n      if (magic_cache == (LinkedListInfo *)0x0) {\n        return (MagicInfo *)0x0;\n      }\n    }\n    if (magic == (uchar *)0x0) {\n      LockSemaphoreInfo(magic_list_semaphore);\n      ResetLinkedListIterator(magic_list);\n      pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list);\n      UnlockSemaphoreInfo(magic_list_semaphore);\n      return pMVar2;\n    }\n    LockSemaphoreInfo(magic_cache_semaphore);\n    ResetLinkedListIterator(magic_cache);\n    while (pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_cache), pMVar2 != (MagicInfo *)0x0)\n    {\n      iVar3 = (int)pMVar2->offset;\n      if ((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }\n    }\n    UnlockSemaphoreInfo(magic_cache_semaphore);\n    LockSemaphoreInfo(magic_list_semaphore);\n    ResetLinkedListIterator(magic_list);\n    while (pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list), pMVar2 != (MagicInfo *)0x0) {\n      iVar3 = (int)pMVar2->offset;\n      if (*(int *)((int)&pMVar2->offset + 4) < 0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {\n        UnlockSemaphoreInfo(magic_list_semaphore);\n        LockSemaphoreInfo(magic_cache_semaphore);\n        InsertValueInSortedLinkedList(magic_cache,CompareMagickInfoSize,(void **)0x0,pMVar2);\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }\n    }\n    UnlockSemaphoreInfo(magic_list_semaphore);\n  }\n  return (MagicInfo *)0x0;\n}" { (declaration "MagickBooleanType MVar1;" type_identifier identifier ;) (declaration "MagicInfo *pMVar2;" type_identifier (pointer_declarator "*pMVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (if_statement "if (exception == (ExceptionInfo *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }" if (parenthesized_expression "(exception == (ExceptionInfo *)0x0)" ( (binary_expression "exception == (ExceptionInfo *)0x0" identifier == (cast_expression "(ExceptionInfo *)0x0" ( (type_descriptor "ExceptionInfo *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }" { comment (expression_statement "__assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");" (call_expression "__assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo")" identifier (argument_list "("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo")" ( (string_literal ""exception != (ExceptionInfo *) NULL"" " string_content ") , (string_literal ""MagickCore/magic.c"" " string_content ") , number_literal , (string_literal ""GetMagicInfo"" " string_content ") ))) ;) })) (expression_statement "MVar1 = IsMagicListInstantiated(exception);" (assignment_expression "MVar1 = IsMagicListInstantiated(exception)" identifier = (call_expression "IsMagicListInstantiated(exception)" identifier (argument_list "(exception)" ( identifier )))) ;) (if_statement "if (MVar1 != MagickFalse) {\n    if (magic_cache == (LinkedListInfo *)0x0) {\n      if (magic_cache_semaphore == (SemaphoreInfo *)0x0) {\n        ActivateSemaphoreInfo(&magic_cache_semaphore);\n      }\n      LockSemaphoreInfo(magic_cache_semaphore);\n      if (magic_cache == (LinkedListInfo *)0x0) {\n        magic_cache = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(magic_cache_semaphore);\n      if (magic_cache == (LinkedListInfo *)0x0) {\n        return (MagicInfo *)0x0;\n      }\n    }\n    if (magic == (uchar *)0x0) {\n      LockSemaphoreInfo(magic_list_semaphore);\n      ResetLinkedListIterator(magic_list);\n      pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list);\n      UnlockSemaphoreInfo(magic_list_semaphore);\n      return pMVar2;\n    }\n    LockSemaphoreInfo(magic_cache_semaphore);\n    ResetLinkedListIterator(magic_cache);\n    while (pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_cache), pMVar2 != (MagicInfo *)0x0)\n    {\n      iVar3 = (int)pMVar2->offset;\n      if ((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }\n    }\n    UnlockSemaphoreInfo(magic_cache_semaphore);\n    LockSemaphoreInfo(magic_list_semaphore);\n    ResetLinkedListIterator(magic_list);\n    while (pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list), pMVar2 != (MagicInfo *)0x0) {\n      iVar3 = (int)pMVar2->offset;\n      if (*(int *)((int)&pMVar2->offset + 4) < 0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {\n        UnlockSemaphoreInfo(magic_list_semaphore);\n        LockSemaphoreInfo(magic_cache_semaphore);\n        InsertValueInSortedLinkedList(magic_cache,CompareMagickInfoSize,(void **)0x0,pMVar2);\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }\n    }\n    UnlockSemaphoreInfo(magic_list_semaphore);\n  }" if (parenthesized_expression "(MVar1 != MagickFalse)" ( (binary_expression "MVar1 != MagickFalse" identifier != identifier) )) (compound_statement "{\n    if (magic_cache == (LinkedListInfo *)0x0) {\n      if (magic_cache_semaphore == (SemaphoreInfo *)0x0) {\n        ActivateSemaphoreInfo(&magic_cache_semaphore);\n      }\n      LockSemaphoreInfo(magic_cache_semaphore);\n      if (magic_cache == (LinkedListInfo *)0x0) {\n        magic_cache = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(magic_cache_semaphore);\n      if (magic_cache == (LinkedListInfo *)0x0) {\n        return (MagicInfo *)0x0;\n      }\n    }\n    if (magic == (uchar *)0x0) {\n      LockSemaphoreInfo(magic_list_semaphore);\n      ResetLinkedListIterator(magic_list);\n      pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list);\n      UnlockSemaphoreInfo(magic_list_semaphore);\n      return pMVar2;\n    }\n    LockSemaphoreInfo(magic_cache_semaphore);\n    ResetLinkedListIterator(magic_cache);\n    while (pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_cache), pMVar2 != (MagicInfo *)0x0)\n    {\n      iVar3 = (int)pMVar2->offset;\n      if ((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }\n    }\n    UnlockSemaphoreInfo(magic_cache_semaphore);\n    LockSemaphoreInfo(magic_list_semaphore);\n    ResetLinkedListIterator(magic_list);\n    while (pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list), pMVar2 != (MagicInfo *)0x0) {\n      iVar3 = (int)pMVar2->offset;\n      if (*(int *)((int)&pMVar2->offset + 4) < 0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {\n        UnlockSemaphoreInfo(magic_list_semaphore);\n        LockSemaphoreInfo(magic_cache_semaphore);\n        InsertValueInSortedLinkedList(magic_cache,CompareMagickInfoSize,(void **)0x0,pMVar2);\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }\n    }\n    UnlockSemaphoreInfo(magic_list_semaphore);\n  }" { (if_statement "if (magic_cache == (LinkedListInfo *)0x0) {\n      if (magic_cache_semaphore == (SemaphoreInfo *)0x0) {\n        ActivateSemaphoreInfo(&magic_cache_semaphore);\n      }\n      LockSemaphoreInfo(magic_cache_semaphore);\n      if (magic_cache == (LinkedListInfo *)0x0) {\n        magic_cache = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(magic_cache_semaphore);\n      if (magic_cache == (LinkedListInfo *)0x0) {\n        return (MagicInfo *)0x0;\n      }\n    }" if (parenthesized_expression "(magic_cache == (LinkedListInfo *)0x0)" ( (binary_expression "magic_cache == (LinkedListInfo *)0x0" identifier == (cast_expression "(LinkedListInfo *)0x0" ( (type_descriptor "LinkedListInfo *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      if (magic_cache_semaphore == (SemaphoreInfo *)0x0) {\n        ActivateSemaphoreInfo(&magic_cache_semaphore);\n      }\n      LockSemaphoreInfo(magic_cache_semaphore);\n      if (magic_cache == (LinkedListInfo *)0x0) {\n        magic_cache = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(magic_cache_semaphore);\n      if (magic_cache == (LinkedListInfo *)0x0) {\n        return (MagicInfo *)0x0;\n      }\n    }" { (if_statement "if (magic_cache_semaphore == (SemaphoreInfo *)0x0) {\n        ActivateSemaphoreInfo(&magic_cache_semaphore);\n      }" if (parenthesized_expression "(magic_cache_semaphore == (SemaphoreInfo *)0x0)" ( (binary_expression "magic_cache_semaphore == (SemaphoreInfo *)0x0" identifier == (cast_expression "(SemaphoreInfo *)0x0" ( (type_descriptor "SemaphoreInfo *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        ActivateSemaphoreInfo(&magic_cache_semaphore);\n      }" { (expression_statement "ActivateSemaphoreInfo(&magic_cache_semaphore);" (call_expression "ActivateSemaphoreInfo(&magic_cache_semaphore)" identifier (argument_list "(&magic_cache_semaphore)" ( (pointer_expression "&magic_cache_semaphore" & identifier) ))) ;) })) (expression_statement "LockSemaphoreInfo(magic_cache_semaphore);" (call_expression "LockSemaphoreInfo(magic_cache_semaphore)" identifier (argument_list "(magic_cache_semaphore)" ( identifier ))) ;) (if_statement "if (magic_cache == (LinkedListInfo *)0x0) {\n        magic_cache = NewLinkedList(0);\n      }" if (parenthesized_expression "(magic_cache == (LinkedListInfo *)0x0)" ( (binary_expression "magic_cache == (LinkedListInfo *)0x0" identifier == (cast_expression "(LinkedListInfo *)0x0" ( (type_descriptor "LinkedListInfo *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        magic_cache = NewLinkedList(0);\n      }" { (expression_statement "magic_cache = NewLinkedList(0);" (assignment_expression "magic_cache = NewLinkedList(0)" identifier = (call_expression "NewLinkedList(0)" identifier (argument_list "(0)" ( number_literal )))) ;) })) (expression_statement "UnlockSemaphoreInfo(magic_cache_semaphore);" (call_expression "UnlockSemaphoreInfo(magic_cache_semaphore)" identifier (argument_list "(magic_cache_semaphore)" ( identifier ))) ;) (if_statement "if (magic_cache == (LinkedListInfo *)0x0) {\n        return (MagicInfo *)0x0;\n      }" if (parenthesized_expression "(magic_cache == (LinkedListInfo *)0x0)" ( (binary_expression "magic_cache == (LinkedListInfo *)0x0" identifier == (cast_expression "(LinkedListInfo *)0x0" ( (type_descriptor "LinkedListInfo *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        return (MagicInfo *)0x0;\n      }" { (return_statement "return (MagicInfo *)0x0;" return (cast_expression "(MagicInfo *)0x0" ( (type_descriptor "MagicInfo *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) })) (if_statement "if (magic == (uchar *)0x0) {\n      LockSemaphoreInfo(magic_list_semaphore);\n      ResetLinkedListIterator(magic_list);\n      pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list);\n      UnlockSemaphoreInfo(magic_list_semaphore);\n      return pMVar2;\n    }" if (parenthesized_expression "(magic == (uchar *)0x0)" ( (binary_expression "magic == (uchar *)0x0" identifier == (cast_expression "(uchar *)0x0" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      LockSemaphoreInfo(magic_list_semaphore);\n      ResetLinkedListIterator(magic_list);\n      pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list);\n      UnlockSemaphoreInfo(magic_list_semaphore);\n      return pMVar2;\n    }" { (expression_statement "LockSemaphoreInfo(magic_list_semaphore);" (call_expression "LockSemaphoreInfo(magic_list_semaphore)" identifier (argument_list "(magic_list_semaphore)" ( identifier ))) ;) (expression_statement "ResetLinkedListIterator(magic_list);" (call_expression "ResetLinkedListIterator(magic_list)" identifier (argument_list "(magic_list)" ( identifier ))) ;) (expression_statement "pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list);" (assignment_expression "pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list)" identifier = (cast_expression "(MagicInfo *)GetNextValueInLinkedList(magic_list)" ( (type_descriptor "MagicInfo *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "GetNextValueInLinkedList(magic_list)" identifier (argument_list "(magic_list)" ( identifier ))))) ;) (expression_statement "UnlockSemaphoreInfo(magic_list_semaphore);" (call_expression "UnlockSemaphoreInfo(magic_list_semaphore)" identifier (argument_list "(magic_list_semaphore)" ( identifier ))) ;) (return_statement "return pMVar2;" return identifier ;) })) (expression_statement "LockSemaphoreInfo(magic_cache_semaphore);" (call_expression "LockSemaphoreInfo(magic_cache_semaphore)" identifier (argument_list "(magic_cache_semaphore)" ( identifier ))) ;) (expression_statement "ResetLinkedListIterator(magic_cache);" (call_expression "ResetLinkedListIterator(magic_cache)" identifier (argument_list "(magic_cache)" ( identifier ))) ;) (while_statement "while (pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_cache), pMVar2 != (MagicInfo *)0x0)\n    {\n      iVar3 = (int)pMVar2->offset;\n      if ((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }\n    }" while (parenthesized_expression "(pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_cache), pMVar2 != (MagicInfo *)0x0)" ( (comma_expression "pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_cache), pMVar2 != (MagicInfo *)0x0" (assignment_expression "pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_cache)" identifier = (cast_expression "(MagicInfo *)GetNextValueInLinkedList(magic_cache)" ( (type_descriptor "MagicInfo *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "GetNextValueInLinkedList(magic_cache)" identifier (argument_list "(magic_cache)" ( identifier ))))) , (binary_expression "pMVar2 != (MagicInfo *)0x0" identifier != (cast_expression "(MagicInfo *)0x0" ( (type_descriptor "MagicInfo *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))) )) (compound_statement "{\n      iVar3 = (int)pMVar2->offset;\n      if ((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }\n    }" { (expression_statement "iVar3 = (int)pMVar2->offset;" (assignment_expression "iVar3 = (int)pMVar2->offset" identifier = (cast_expression "(int)pMVar2->offset" ( (type_descriptor "int" primitive_type) ) (field_expression "pMVar2->offset" identifier -> field_identifier))) ;) (if_statement "if ((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }" if (parenthesized_expression "((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0))" ( (binary_expression "(iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)" (parenthesized_expression "(iVar3 + pMVar2->length <= length)" ( (binary_expression "iVar3 + pMVar2->length <= length" (binary_expression "iVar3 + pMVar2->length" identifier + (field_expression "pMVar2->length" identifier -> field_identifier)) <= identifier) )) && (parenthesized_expression "(iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)" ( (comma_expression "iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0" (assignment_expression "iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length)" identifier = (call_expression "memcmp(magic + iVar3,pMVar2->magic,pMVar2->length)" identifier (argument_list "(magic + iVar3,pMVar2->magic,pMVar2->length)" ( (binary_expression "magic + iVar3" identifier + identifier) , (field_expression "pMVar2->magic" identifier -> field_identifier) , (field_expression "pMVar2->length" identifier -> field_identifier) )))) , (binary_expression "iVar3 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }" { (expression_statement "UnlockSemaphoreInfo(magic_cache_semaphore);" (call_expression "UnlockSemaphoreInfo(magic_cache_semaphore)" identifier (argument_list "(magic_cache_semaphore)" ( identifier ))) ;) (return_statement "return pMVar2;" return identifier ;) })) })) (expression_statement "UnlockSemaphoreInfo(magic_cache_semaphore);" (call_expression "UnlockSemaphoreInfo(magic_cache_semaphore)" identifier (argument_list "(magic_cache_semaphore)" ( identifier ))) ;) (expression_statement "LockSemaphoreInfo(magic_list_semaphore);" (call_expression "LockSemaphoreInfo(magic_list_semaphore)" identifier (argument_list "(magic_list_semaphore)" ( identifier ))) ;) (expression_statement "ResetLinkedListIterator(magic_list);" (call_expression "ResetLinkedListIterator(magic_list)" identifier (argument_list "(magic_list)" ( identifier ))) ;) (while_statement "while (pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list), pMVar2 != (MagicInfo *)0x0) {\n      iVar3 = (int)pMVar2->offset;\n      if (*(int *)((int)&pMVar2->offset + 4) < 0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {\n        UnlockSemaphoreInfo(magic_list_semaphore);\n        LockSemaphoreInfo(magic_cache_semaphore);\n        InsertValueInSortedLinkedList(magic_cache,CompareMagickInfoSize,(void **)0x0,pMVar2);\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }\n    }" while (parenthesized_expression "(pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list), pMVar2 != (MagicInfo *)0x0)" ( (comma_expression "pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list), pMVar2 != (MagicInfo *)0x0" (assignment_expression "pMVar2 = (MagicInfo *)GetNextValueInLinkedList(magic_list)" identifier = (cast_expression "(MagicInfo *)GetNextValueInLinkedList(magic_list)" ( (type_descriptor "MagicInfo *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "GetNextValueInLinkedList(magic_list)" identifier (argument_list "(magic_list)" ( identifier ))))) , (binary_expression "pMVar2 != (MagicInfo *)0x0" identifier != (cast_expression "(MagicInfo *)0x0" ( (type_descriptor "MagicInfo *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal))) )) (compound_statement "{\n      iVar3 = (int)pMVar2->offset;\n      if (*(int *)((int)&pMVar2->offset + 4) < 0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {\n        UnlockSemaphoreInfo(magic_list_semaphore);\n        LockSemaphoreInfo(magic_cache_semaphore);\n        InsertValueInSortedLinkedList(magic_cache,CompareMagickInfoSize,(void **)0x0,pMVar2);\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }\n    }" { (expression_statement "iVar3 = (int)pMVar2->offset;" (assignment_expression "iVar3 = (int)pMVar2->offset" identifier = (cast_expression "(int)pMVar2->offset" ( (type_descriptor "int" primitive_type) ) (field_expression "pMVar2->offset" identifier -> field_identifier))) ;) (if_statement "if (*(int *)((int)&pMVar2->offset + 4) < 0) {\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }" if (parenthesized_expression "(*(int *)((int)&pMVar2->offset + 4) < 0)" ( (binary_expression "*(int *)((int)&pMVar2->offset + 4) < 0" (pointer_expression "*(int *)((int)&pMVar2->offset + 4)" * (cast_expression "(int *)((int)&pMVar2->offset + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)&pMVar2->offset + 4)" ( (binary_expression "(int)&pMVar2->offset + 4" (cast_expression "(int)&pMVar2->offset" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&pMVar2->offset" & (field_expression "pMVar2->offset" identifier -> field_identifier))) + number_literal) )))) < number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }" { comment (expression_statement "__assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");" (call_expression "__assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo")" identifier (argument_list "("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo")" ( (string_literal ""p->offset >= 0"" " string_content ") , (string_literal ""MagickCore/magic.c"" " string_content ") , number_literal , (string_literal ""GetMagicInfo"" " string_content ") ))) ;) })) (if_statement "if ((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)) {\n        UnlockSemaphoreInfo(magic_list_semaphore);\n        LockSemaphoreInfo(magic_cache_semaphore);\n        InsertValueInSortedLinkedList(magic_cache,CompareMagickInfoSize,(void **)0x0,pMVar2);\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }" if (parenthesized_expression "((iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0))" ( (binary_expression "(iVar3 + pMVar2->length <= length) &&\n         (iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)" (parenthesized_expression "(iVar3 + pMVar2->length <= length)" ( (binary_expression "iVar3 + pMVar2->length <= length" (binary_expression "iVar3 + pMVar2->length" identifier + (field_expression "pMVar2->length" identifier -> field_identifier)) <= identifier) )) && (parenthesized_expression "(iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0)" ( (comma_expression "iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length), iVar3 == 0" (assignment_expression "iVar3 = memcmp(magic + iVar3,pMVar2->magic,pMVar2->length)" identifier = (call_expression "memcmp(magic + iVar3,pMVar2->magic,pMVar2->length)" identifier (argument_list "(magic + iVar3,pMVar2->magic,pMVar2->length)" ( (binary_expression "magic + iVar3" identifier + identifier) , (field_expression "pMVar2->magic" identifier -> field_identifier) , (field_expression "pMVar2->length" identifier -> field_identifier) )))) , (binary_expression "iVar3 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n        UnlockSemaphoreInfo(magic_list_semaphore);\n        LockSemaphoreInfo(magic_cache_semaphore);\n        InsertValueInSortedLinkedList(magic_cache,CompareMagickInfoSize,(void **)0x0,pMVar2);\n        UnlockSemaphoreInfo(magic_cache_semaphore);\n        return pMVar2;\n      }" { (expression_statement "UnlockSemaphoreInfo(magic_list_semaphore);" (call_expression "UnlockSemaphoreInfo(magic_list_semaphore)" identifier (argument_list "(magic_list_semaphore)" ( identifier ))) ;) (expression_statement "LockSemaphoreInfo(magic_cache_semaphore);" (call_expression "LockSemaphoreInfo(magic_cache_semaphore)" identifier (argument_list "(magic_cache_semaphore)" ( identifier ))) ;) (expression_statement "InsertValueInSortedLinkedList(magic_cache,CompareMagickInfoSize,(void **)0x0,pMVar2);" (call_expression "InsertValueInSortedLinkedList(magic_cache,CompareMagickInfoSize,(void **)0x0,pMVar2)" identifier (argument_list "(magic_cache,CompareMagickInfoSize,(void **)0x0,pMVar2)" ( identifier , identifier , (cast_expression "(void **)0x0" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) number_literal) , identifier ))) ;) (expression_statement "UnlockSemaphoreInfo(magic_cache_semaphore);" (call_expression "UnlockSemaphoreInfo(magic_cache_semaphore)" identifier (argument_list "(magic_cache_semaphore)" ( identifier ))) ;) (return_statement "return pMVar2;" return identifier ;) })) })) (expression_statement "UnlockSemaphoreInfo(magic_list_semaphore);" (call_expression "UnlockSemaphoreInfo(magic_list_semaphore)" identifier (argument_list "(magic_list_semaphore)" ( identifier ))) ;) })) (return_statement "return (MagicInfo *)0x0;" return (cast_expression "(MagicInfo *)0x0" ( (type_descriptor "MagicInfo *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "int GetMagicInfo(int param_1,uint param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (param_3 == 0) {\n                    \n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }\n  iVar1 = FUN_000f54e0();\n  if (iVar1 != 0) {\n    if (DAT_003dd7d8 == 0) {\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }\n    if (param_1 == 0) {\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }\n    LockSemaphoreInfo(DAT_003dd7d0);\n    ResetLinkedListIterator(DAT_003dd7d8);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7d0);\n    LockSemaphoreInfo(DAT_003dd7cc);\n    ResetLinkedListIterator(DAT_003dd7d4);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    \n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7cc);\n  }\n  return 0;\n}\n\n" (function_definition "int GetMagicInfo(int param_1,uint param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (param_3 == 0) {\n                    \n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }\n  iVar1 = FUN_000f54e0();\n  if (iVar1 != 0) {\n    if (DAT_003dd7d8 == 0) {\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }\n    if (param_1 == 0) {\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }\n    LockSemaphoreInfo(DAT_003dd7d0);\n    ResetLinkedListIterator(DAT_003dd7d8);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7d0);\n    LockSemaphoreInfo(DAT_003dd7cc);\n    ResetLinkedListIterator(DAT_003dd7d4);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    \n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7cc);\n  }\n  return 0;\n}" primitive_type (function_declarator "GetMagicInfo(int param_1,uint param_2,int param_3)" identifier (parameter_list "(int param_1,uint param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  if (param_3 == 0) {\n                    \n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }\n  iVar1 = FUN_000f54e0();\n  if (iVar1 != 0) {\n    if (DAT_003dd7d8 == 0) {\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }\n    if (param_1 == 0) {\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }\n    LockSemaphoreInfo(DAT_003dd7d0);\n    ResetLinkedListIterator(DAT_003dd7d8);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7d0);\n    LockSemaphoreInfo(DAT_003dd7cc);\n    ResetLinkedListIterator(DAT_003dd7d4);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    \n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7cc);\n  }\n  return 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (if_statement "if (param_3 == 0) {\n                    \n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n                    \n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }" { (expression_statement "__assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");" (call_expression "__assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo")" identifier (argument_list "("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo")" ( (string_literal ""exception != (ExceptionInfo *) NULL"" " string_content ") , (string_literal ""MagickCore/magic.c"" " string_content ") , number_literal , (string_literal ""GetMagicInfo"" " string_content ") ))) ;) })) (expression_statement "iVar1 = FUN_000f54e0();" (assignment_expression "iVar1 = FUN_000f54e0()" identifier = (call_expression "FUN_000f54e0()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar1 != 0) {\n    if (DAT_003dd7d8 == 0) {\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }\n    if (param_1 == 0) {\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }\n    LockSemaphoreInfo(DAT_003dd7d0);\n    ResetLinkedListIterator(DAT_003dd7d8);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7d0);\n    LockSemaphoreInfo(DAT_003dd7cc);\n    ResetLinkedListIterator(DAT_003dd7d4);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    \n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7cc);\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    if (DAT_003dd7d8 == 0) {\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }\n    if (param_1 == 0) {\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }\n    LockSemaphoreInfo(DAT_003dd7d0);\n    ResetLinkedListIterator(DAT_003dd7d8);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7d0);\n    LockSemaphoreInfo(DAT_003dd7cc);\n    ResetLinkedListIterator(DAT_003dd7d4);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    \n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7cc);\n  }" { (if_statement "if (DAT_003dd7d8 == 0) {\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }" if (parenthesized_expression "(DAT_003dd7d8 == 0)" ( (binary_expression "DAT_003dd7d8 == 0" identifier == number_literal) )) (compound_statement "{\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }" { (if_statement "if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }" if (parenthesized_expression "(DAT_003dd7d0 == 0)" ( (binary_expression "DAT_003dd7d0 == 0" identifier == number_literal) )) (compound_statement "{\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }" { (expression_statement "ActivateSemaphoreInfo(&DAT_003dd7d0);" (call_expression "ActivateSemaphoreInfo(&DAT_003dd7d0)" identifier (argument_list "(&DAT_003dd7d0)" ( (pointer_expression "&DAT_003dd7d0" & identifier) ))) ;) })) (expression_statement "LockSemaphoreInfo(DAT_003dd7d0);" (call_expression "LockSemaphoreInfo(DAT_003dd7d0)" identifier (argument_list "(DAT_003dd7d0)" ( identifier ))) ;) (if_statement "if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }" if (parenthesized_expression "(DAT_003dd7d8 == 0)" ( (binary_expression "DAT_003dd7d8 == 0" identifier == number_literal) )) (compound_statement "{\n        DAT_003dd7d8 = NewLinkedList(0);\n      }" { (expression_statement "DAT_003dd7d8 = NewLinkedList(0);" (assignment_expression "DAT_003dd7d8 = NewLinkedList(0)" identifier = (call_expression "NewLinkedList(0)" identifier (argument_list "(0)" ( number_literal )))) ;) })) (expression_statement "UnlockSemaphoreInfo(DAT_003dd7d0);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7d0)" identifier (argument_list "(DAT_003dd7d0)" ( identifier ))) ;) (if_statement "if (DAT_003dd7d8 == 0) {\n        return 0;\n      }" if (parenthesized_expression "(DAT_003dd7d8 == 0)" ( (binary_expression "DAT_003dd7d8 == 0" identifier == number_literal) )) (compound_statement "{\n        return 0;\n      }" { (return_statement "return 0;" return number_literal ;) })) })) (if_statement "if (param_1 == 0) {\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }" if (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) (compound_statement "{\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }" { (expression_statement "LockSemaphoreInfo(DAT_003dd7cc);" (call_expression "LockSemaphoreInfo(DAT_003dd7cc)" identifier (argument_list "(DAT_003dd7cc)" ( identifier ))) ;) (expression_statement "ResetLinkedListIterator(DAT_003dd7d4);" (call_expression "ResetLinkedListIterator(DAT_003dd7d4)" identifier (argument_list "(DAT_003dd7d4)" ( identifier ))) ;) (expression_statement "iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);" (assignment_expression "iVar1 = GetNextValueInLinkedList(DAT_003dd7d4)" identifier = (call_expression "GetNextValueInLinkedList(DAT_003dd7d4)" identifier (argument_list "(DAT_003dd7d4)" ( identifier )))) ;) (expression_statement "UnlockSemaphoreInfo(DAT_003dd7cc);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7cc)" identifier (argument_list "(DAT_003dd7cc)" ( identifier ))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "LockSemaphoreInfo(DAT_003dd7d0);" (call_expression "LockSemaphoreInfo(DAT_003dd7d0)" identifier (argument_list "(DAT_003dd7d0)" ( identifier ))) ;) (expression_statement "ResetLinkedListIterator(DAT_003dd7d8);" (call_expression "ResetLinkedListIterator(DAT_003dd7d8)" identifier (argument_list "(DAT_003dd7d8)" ( identifier ))) ;) (while_statement "while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }" while (parenthesized_expression "(iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0)" ( (comma_expression "iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0" (assignment_expression "iVar1 = GetNextValueInLinkedList(DAT_003dd7d8)" identifier = (call_expression "GetNextValueInLinkedList(DAT_003dd7d8)" identifier (argument_list "(DAT_003dd7d8)" ( identifier )))) , (binary_expression "iVar1 != 0" identifier != number_literal)) )) (compound_statement "{\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }" { (if_statement "if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }" if (parenthesized_expression "((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0))" ( (binary_expression "(*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)" (parenthesized_expression "(*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2)" ( (binary_expression "*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2" (binary_expression "*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10)" (pointer_expression "*(int *)(iVar1 + 0x14)" * (cast_expression "(int *)(iVar1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x14)" ( (binary_expression "iVar1 + 0x14" identifier + number_literal) )))) + (pointer_expression "*(size_t *)(iVar1 + 0x10)" * (cast_expression "(size_t *)(iVar1 + 0x10)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x10)" ( (binary_expression "iVar1 + 0x10" identifier + number_literal) ))))) <= identifier) )) && (parenthesized_expression "(iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)" ( (comma_expression "iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0" (assignment_expression "iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" identifier = (call_expression "memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" identifier (argument_list "((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" ( (cast_expression "(void *)(*(int *)(iVar1 + 0x14) + param_1)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(iVar1 + 0x14) + param_1)" ( (binary_expression "*(int *)(iVar1 + 0x14) + param_1" (pointer_expression "*(int *)(iVar1 + 0x14)" * (cast_expression "(int *)(iVar1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x14)" ( (binary_expression "iVar1 + 0x14" identifier + number_literal) )))) + identifier) ))) , (pointer_expression "*(void **)(iVar1 + 0xc)" * (cast_expression "(void **)(iVar1 + 0xc)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar1 + 0xc)" ( (binary_expression "iVar1 + 0xc" identifier + number_literal) )))) , (pointer_expression "*(size_t *)(iVar1 + 0x10)" * (cast_expression "(size_t *)(iVar1 + 0x10)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x10)" ( (binary_expression "iVar1 + 0x10" identifier + number_literal) )))) )))) , (binary_expression "iVar2 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }" { (expression_statement "UnlockSemaphoreInfo(DAT_003dd7d0);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7d0)" identifier (argument_list "(DAT_003dd7d0)" ( identifier ))) ;) (return_statement "return iVar1;" return identifier ;) })) })) (expression_statement "UnlockSemaphoreInfo(DAT_003dd7d0);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7d0)" identifier (argument_list "(DAT_003dd7d0)" ( identifier ))) ;) (expression_statement "LockSemaphoreInfo(DAT_003dd7cc);" (call_expression "LockSemaphoreInfo(DAT_003dd7cc)" identifier (argument_list "(DAT_003dd7cc)" ( identifier ))) ;) (expression_statement "ResetLinkedListIterator(DAT_003dd7d4);" (call_expression "ResetLinkedListIterator(DAT_003dd7d4)" identifier (argument_list "(DAT_003dd7d4)" ( identifier ))) ;) (while_statement "while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    \n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }" while (parenthesized_expression "(iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0)" ( (comma_expression "iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0" (assignment_expression "iVar1 = GetNextValueInLinkedList(DAT_003dd7d4)" identifier = (call_expression "GetNextValueInLinkedList(DAT_003dd7d4)" identifier (argument_list "(DAT_003dd7d4)" ( identifier )))) , (binary_expression "iVar1 != 0" identifier != number_literal)) )) (compound_statement "{\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    \n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }" { (if_statement "if (*(int *)(iVar1 + 0x18) < 0) {\n                    \n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }" if (parenthesized_expression "(*(int *)(iVar1 + 0x18) < 0)" ( (binary_expression "*(int *)(iVar1 + 0x18) < 0" (pointer_expression "*(int *)(iVar1 + 0x18)" * (cast_expression "(int *)(iVar1 + 0x18)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x18)" ( (binary_expression "iVar1 + 0x18" identifier + number_literal) )))) < number_literal) )) (compound_statement "{\n                    \n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }" { (expression_statement "__assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");" (call_expression "__assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo")" identifier (argument_list "("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo")" ( (string_literal ""p->offset >= 0"" " string_content ") , (string_literal ""MagickCore/magic.c"" " string_content ") , number_literal , (string_literal ""GetMagicInfo"" " string_content ") ))) ;) })) (if_statement "if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }" if (parenthesized_expression "((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0))" ( (binary_expression "(*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)" (parenthesized_expression "(*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2)" ( (binary_expression "*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2" (binary_expression "*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10)" (pointer_expression "*(int *)(iVar1 + 0x14)" * (cast_expression "(int *)(iVar1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x14)" ( (binary_expression "iVar1 + 0x14" identifier + number_literal) )))) + (pointer_expression "*(size_t *)(iVar1 + 0x10)" * (cast_expression "(size_t *)(iVar1 + 0x10)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x10)" ( (binary_expression "iVar1 + 0x10" identifier + number_literal) ))))) <= identifier) )) && (parenthesized_expression "(iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)" ( (comma_expression "iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0" (assignment_expression "iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" identifier = (call_expression "memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" identifier (argument_list "((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" ( (cast_expression "(void *)(*(int *)(iVar1 + 0x14) + param_1)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(iVar1 + 0x14) + param_1)" ( (binary_expression "*(int *)(iVar1 + 0x14) + param_1" (pointer_expression "*(int *)(iVar1 + 0x14)" * (cast_expression "(int *)(iVar1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x14)" ( (binary_expression "iVar1 + 0x14" identifier + number_literal) )))) + identifier) ))) , (pointer_expression "*(void **)(iVar1 + 0xc)" * (cast_expression "(void **)(iVar1 + 0xc)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(iVar1 + 0xc)" ( (binary_expression "iVar1 + 0xc" identifier + number_literal) )))) , (pointer_expression "*(size_t *)(iVar1 + 0x10)" * (cast_expression "(size_t *)(iVar1 + 0x10)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + 0x10)" ( (binary_expression "iVar1 + 0x10" identifier + number_literal) )))) )))) , (binary_expression "iVar2 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }" { (expression_statement "UnlockSemaphoreInfo(DAT_003dd7cc);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7cc)" identifier (argument_list "(DAT_003dd7cc)" ( identifier ))) ;) (expression_statement "LockSemaphoreInfo(DAT_003dd7d0);" (call_expression "LockSemaphoreInfo(DAT_003dd7d0)" identifier (argument_list "(DAT_003dd7d0)" ( identifier ))) ;) (expression_statement "InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);" (call_expression "InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1)" identifier (argument_list "(DAT_003dd7d8,FUN_000f5460,0,iVar1)" ( identifier , identifier , number_literal , identifier ))) ;) (expression_statement "UnlockSemaphoreInfo(DAT_003dd7d0);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7d0)" identifier (argument_list "(DAT_003dd7d0)" ( identifier ))) ;) (return_statement "return iVar1;" return identifier ;) })) })) (expression_statement "UnlockSemaphoreInfo(DAT_003dd7cc);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7cc)" identifier (argument_list "(DAT_003dd7cc)" ( identifier ))) ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (pointer_expression & IDENT) ))) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT )))) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (while_statement while (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) , (binary_expression IDENT != LIT)) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) <= IDENT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + IDENT) ))) , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) , (binary_expression IDENT == LIT)) ))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return IDENT ;) })) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (while_statement while (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) , (binary_expression IDENT != LIT)) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) < LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) <= IDENT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + IDENT) ))) , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) , (binary_expression IDENT == LIT)) ))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , LIT , IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return IDENT ;) })) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) (return_statement return LIT ;) })))
(function_definition "int GetMagicInfo(int param_1,uint param_2,int param_3)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (param_3 == 0) {\n                    \n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }\n  iVar1 = FUN_000f54e0();\n  if (iVar1 != 0) {\n    if (DAT_003dd7d8 == 0) {\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }\n    if (param_1 == 0) {\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }\n    LockSemaphoreInfo(DAT_003dd7d0);\n    ResetLinkedListIterator(DAT_003dd7d8);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7d0);\n    LockSemaphoreInfo(DAT_003dd7cc);\n    ResetLinkedListIterator(DAT_003dd7d4);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    \n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7cc);\n  }\n  return 0;\n}" (primitive_type "int") (function_declarator "GetMagicInfo(int param_1,uint param_2,int param_3)" (identifier "GetMagicInfo") (parameter_list "(int param_1,uint param_2,int param_3)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  if (param_3 == 0) {\n                    \n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }\n  iVar1 = FUN_000f54e0();\n  if (iVar1 != 0) {\n    if (DAT_003dd7d8 == 0) {\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }\n    if (param_1 == 0) {\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }\n    LockSemaphoreInfo(DAT_003dd7d0);\n    ResetLinkedListIterator(DAT_003dd7d8);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7d0);\n    LockSemaphoreInfo(DAT_003dd7cc);\n    ResetLinkedListIterator(DAT_003dd7d4);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    \n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7cc);\n  }\n  return 0;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (if_statement "if (param_3 == 0) {\n                    \n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }" (if "if") (parenthesized_expression "(param_3 == 0)" (( "(") (binary_expression "param_3 == 0" (identifier "param_3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n                    \n    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");\n  }" ({ "{") (expression_statement "__assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");" (call_expression "__assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo")" (identifier "__assert_fail") (argument_list "("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo")" (( "(") (string_literal ""exception != (ExceptionInfo *) NULL"" (" """) (string_content "exception != (ExceptionInfo *) NULL") (" """)) (, ",") (string_literal ""MagickCore/magic.c"" (" """) (string_content "MagickCore/magic.c") (" """)) (, ",") (number_literal "0x11e") (, ",") (string_literal ""GetMagicInfo"" (" """) (string_content "GetMagicInfo") (" """)) () ")"))) (; ";")) (} "}"))) (expression_statement "iVar1 = FUN_000f54e0();" (assignment_expression "iVar1 = FUN_000f54e0()" (identifier "iVar1") (= "=") (call_expression "FUN_000f54e0()" (identifier "FUN_000f54e0") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n    if (DAT_003dd7d8 == 0) {\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }\n    if (param_1 == 0) {\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }\n    LockSemaphoreInfo(DAT_003dd7d0);\n    ResetLinkedListIterator(DAT_003dd7d8);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7d0);\n    LockSemaphoreInfo(DAT_003dd7cc);\n    ResetLinkedListIterator(DAT_003dd7d4);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    \n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7cc);\n  }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    if (DAT_003dd7d8 == 0) {\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }\n    if (param_1 == 0) {\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }\n    LockSemaphoreInfo(DAT_003dd7d0);\n    ResetLinkedListIterator(DAT_003dd7d8);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7d0);\n    LockSemaphoreInfo(DAT_003dd7cc);\n    ResetLinkedListIterator(DAT_003dd7d4);\n    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    \n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }\n    UnlockSemaphoreInfo(DAT_003dd7cc);\n  }" ({ "{") (if_statement "if (DAT_003dd7d8 == 0) {\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }" (if "if") (parenthesized_expression "(DAT_003dd7d8 == 0)" (( "(") (binary_expression "DAT_003dd7d8 == 0" (identifier "DAT_003dd7d8") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }\n      LockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }\n      UnlockSemaphoreInfo(DAT_003dd7d0);\n      if (DAT_003dd7d8 == 0) {\n        return 0;\n      }\n    }" ({ "{") (if_statement "if (DAT_003dd7d0 == 0) {\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }" (if "if") (parenthesized_expression "(DAT_003dd7d0 == 0)" (( "(") (binary_expression "DAT_003dd7d0 == 0" (identifier "DAT_003dd7d0") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        ActivateSemaphoreInfo(&DAT_003dd7d0);\n      }" ({ "{") (expression_statement "ActivateSemaphoreInfo(&DAT_003dd7d0);" (call_expression "ActivateSemaphoreInfo(&DAT_003dd7d0)" (identifier "ActivateSemaphoreInfo") (argument_list "(&DAT_003dd7d0)" (( "(") (pointer_expression "&DAT_003dd7d0" (& "&") (identifier "DAT_003dd7d0")) () ")"))) (; ";")) (} "}"))) (expression_statement "LockSemaphoreInfo(DAT_003dd7d0);" (call_expression "LockSemaphoreInfo(DAT_003dd7d0)" (identifier "LockSemaphoreInfo") (argument_list "(DAT_003dd7d0)" (( "(") (identifier "DAT_003dd7d0") () ")"))) (; ";")) (if_statement "if (DAT_003dd7d8 == 0) {\n        DAT_003dd7d8 = NewLinkedList(0);\n      }" (if "if") (parenthesized_expression "(DAT_003dd7d8 == 0)" (( "(") (binary_expression "DAT_003dd7d8 == 0" (identifier "DAT_003dd7d8") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        DAT_003dd7d8 = NewLinkedList(0);\n      }" ({ "{") (expression_statement "DAT_003dd7d8 = NewLinkedList(0);" (assignment_expression "DAT_003dd7d8 = NewLinkedList(0)" (identifier "DAT_003dd7d8") (= "=") (call_expression "NewLinkedList(0)" (identifier "NewLinkedList") (argument_list "(0)" (( "(") (number_literal "0") () ")")))) (; ";")) (} "}"))) (expression_statement "UnlockSemaphoreInfo(DAT_003dd7d0);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7d0)" (identifier "UnlockSemaphoreInfo") (argument_list "(DAT_003dd7d0)" (( "(") (identifier "DAT_003dd7d0") () ")"))) (; ";")) (if_statement "if (DAT_003dd7d8 == 0) {\n        return 0;\n      }" (if "if") (parenthesized_expression "(DAT_003dd7d8 == 0)" (( "(") (binary_expression "DAT_003dd7d8 == 0" (identifier "DAT_003dd7d8") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        return 0;\n      }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (} "}"))) (if_statement "if (param_1 == 0) {\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }" (if "if") (parenthesized_expression "(param_1 == 0)" (( "(") (binary_expression "param_1 == 0" (identifier "param_1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      LockSemaphoreInfo(DAT_003dd7cc);\n      ResetLinkedListIterator(DAT_003dd7d4);\n      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);\n      UnlockSemaphoreInfo(DAT_003dd7cc);\n      return iVar1;\n    }" ({ "{") (expression_statement "LockSemaphoreInfo(DAT_003dd7cc);" (call_expression "LockSemaphoreInfo(DAT_003dd7cc)" (identifier "LockSemaphoreInfo") (argument_list "(DAT_003dd7cc)" (( "(") (identifier "DAT_003dd7cc") () ")"))) (; ";")) (expression_statement "ResetLinkedListIterator(DAT_003dd7d4);" (call_expression "ResetLinkedListIterator(DAT_003dd7d4)" (identifier "ResetLinkedListIterator") (argument_list "(DAT_003dd7d4)" (( "(") (identifier "DAT_003dd7d4") () ")"))) (; ";")) (expression_statement "iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);" (assignment_expression "iVar1 = GetNextValueInLinkedList(DAT_003dd7d4)" (identifier "iVar1") (= "=") (call_expression "GetNextValueInLinkedList(DAT_003dd7d4)" (identifier "GetNextValueInLinkedList") (argument_list "(DAT_003dd7d4)" (( "(") (identifier "DAT_003dd7d4") () ")")))) (; ";")) (expression_statement "UnlockSemaphoreInfo(DAT_003dd7cc);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7cc)" (identifier "UnlockSemaphoreInfo") (argument_list "(DAT_003dd7cc)" (( "(") (identifier "DAT_003dd7cc") () ")"))) (; ";")) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (expression_statement "LockSemaphoreInfo(DAT_003dd7d0);" (call_expression "LockSemaphoreInfo(DAT_003dd7d0)" (identifier "LockSemaphoreInfo") (argument_list "(DAT_003dd7d0)" (( "(") (identifier "DAT_003dd7d0") () ")"))) (; ";")) (expression_statement "ResetLinkedListIterator(DAT_003dd7d8);" (call_expression "ResetLinkedListIterator(DAT_003dd7d8)" (identifier "ResetLinkedListIterator") (argument_list "(DAT_003dd7d8)" (( "(") (identifier "DAT_003dd7d8") () ")"))) (; ";")) (while_statement "while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }" (while "while") (parenthesized_expression "(iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0)" (( "(") (comma_expression "iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0" (assignment_expression "iVar1 = GetNextValueInLinkedList(DAT_003dd7d8)" (identifier "iVar1") (= "=") (call_expression "GetNextValueInLinkedList(DAT_003dd7d8)" (identifier "GetNextValueInLinkedList") (argument_list "(DAT_003dd7d8)" (( "(") (identifier "DAT_003dd7d8") () ")")))) (, ",") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0"))) () ")")) (compound_statement "{\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }" ({ "{") (if_statement "if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }" (if "if") (parenthesized_expression "((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0))" (( "(") (binary_expression "(*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)" (parenthesized_expression "(*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2)" (( "(") (binary_expression "*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2" (binary_expression "*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10)" (pointer_expression "*(int *)(iVar1 + 0x14)" (* "*") (cast_expression "(int *)(iVar1 + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 0x14)" (( "(") (binary_expression "iVar1 + 0x14" (identifier "iVar1") (+ "+") (number_literal "0x14")) () ")")))) (+ "+") (pointer_expression "*(size_t *)(iVar1 + 0x10)" (* "*") (cast_expression "(size_t *)(iVar1 + 0x10)" (( "(") (type_descriptor "size_t *" (primitive_type "size_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 0x10)" (( "(") (binary_expression "iVar1 + 0x10" (identifier "iVar1") (+ "+") (number_literal "0x10")) () ")"))))) (<= "<=") (identifier "param_2")) () ")")) (&& "&&") (parenthesized_expression "(iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)" (( "(") (comma_expression "iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0" (assignment_expression "iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" (identifier "iVar2") (= "=") (call_expression "memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" (identifier "memcmp") (argument_list "((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" (( "(") (cast_expression "(void *)(*(int *)(iVar1 + 0x14) + param_1)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*(int *)(iVar1 + 0x14) + param_1)" (( "(") (binary_expression "*(int *)(iVar1 + 0x14) + param_1" (pointer_expression "*(int *)(iVar1 + 0x14)" (* "*") (cast_expression "(int *)(iVar1 + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 0x14)" (( "(") (binary_expression "iVar1 + 0x14" (identifier "iVar1") (+ "+") (number_literal "0x14")) () ")")))) (+ "+") (identifier "param_1")) () ")"))) (, ",") (pointer_expression "*(void **)(iVar1 + 0xc)" (* "*") (cast_expression "(void **)(iVar1 + 0xc)" (( "(") (type_descriptor "void **" (primitive_type "void") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(iVar1 + 0xc)" (( "(") (binary_expression "iVar1 + 0xc" (identifier "iVar1") (+ "+") (number_literal "0xc")) () ")")))) (, ",") (pointer_expression "*(size_t *)(iVar1 + 0x10)" (* "*") (cast_expression "(size_t *)(iVar1 + 0x10)" (( "(") (type_descriptor "size_t *" (primitive_type "size_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 0x10)" (( "(") (binary_expression "iVar1 + 0x10" (identifier "iVar1") (+ "+") (number_literal "0x10")) () ")")))) () ")")))) (, ",") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0"))) () ")"))) () ")")) (compound_statement "{\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }" ({ "{") (expression_statement "UnlockSemaphoreInfo(DAT_003dd7d0);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7d0)" (identifier "UnlockSemaphoreInfo") (argument_list "(DAT_003dd7d0)" (( "(") (identifier "DAT_003dd7d0") () ")"))) (; ";")) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (} "}"))) (expression_statement "UnlockSemaphoreInfo(DAT_003dd7d0);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7d0)" (identifier "UnlockSemaphoreInfo") (argument_list "(DAT_003dd7d0)" (( "(") (identifier "DAT_003dd7d0") () ")"))) (; ";")) (expression_statement "LockSemaphoreInfo(DAT_003dd7cc);" (call_expression "LockSemaphoreInfo(DAT_003dd7cc)" (identifier "LockSemaphoreInfo") (argument_list "(DAT_003dd7cc)" (( "(") (identifier "DAT_003dd7cc") () ")"))) (; ";")) (expression_statement "ResetLinkedListIterator(DAT_003dd7d4);" (call_expression "ResetLinkedListIterator(DAT_003dd7d4)" (identifier "ResetLinkedListIterator") (argument_list "(DAT_003dd7d4)" (( "(") (identifier "DAT_003dd7d4") () ")"))) (; ";")) (while_statement "while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    \n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }" (while "while") (parenthesized_expression "(iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0)" (( "(") (comma_expression "iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0" (assignment_expression "iVar1 = GetNextValueInLinkedList(DAT_003dd7d4)" (identifier "iVar1") (= "=") (call_expression "GetNextValueInLinkedList(DAT_003dd7d4)" (identifier "GetNextValueInLinkedList") (argument_list "(DAT_003dd7d4)" (( "(") (identifier "DAT_003dd7d4") () ")")))) (, ",") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0"))) () ")")) (compound_statement "{\n      if (*(int *)(iVar1 + 0x18) < 0) {\n                    \n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }\n      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }\n    }" ({ "{") (if_statement "if (*(int *)(iVar1 + 0x18) < 0) {\n                    \n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }" (if "if") (parenthesized_expression "(*(int *)(iVar1 + 0x18) < 0)" (( "(") (binary_expression "*(int *)(iVar1 + 0x18) < 0" (pointer_expression "*(int *)(iVar1 + 0x18)" (* "*") (cast_expression "(int *)(iVar1 + 0x18)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 0x18)" (( "(") (binary_expression "iVar1 + 0x18" (identifier "iVar1") (+ "+") (number_literal "0x18")) () ")")))) (< "<") (number_literal "0")) () ")")) (compound_statement "{\n                    \n        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");\n      }" ({ "{") (expression_statement "__assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");" (call_expression "__assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo")" (identifier "__assert_fail") (argument_list "("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo")" (( "(") (string_literal ""p->offset >= 0"" (" """) (string_content "p->offset >= 0") (" """)) (, ",") (string_literal ""MagickCore/magic.c"" (" """) (string_content "MagickCore/magic.c") (" """)) (, ",") (number_literal "0x143") (, ",") (string_literal ""GetMagicInfo"" (" """) (string_content "GetMagicInfo") (" """)) () ")"))) (; ";")) (} "}"))) (if_statement "if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }" (if "if") (parenthesized_expression "((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0))" (( "(") (binary_expression "(*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&\n         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)" (parenthesized_expression "(*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2)" (( "(") (binary_expression "*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2" (binary_expression "*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10)" (pointer_expression "*(int *)(iVar1 + 0x14)" (* "*") (cast_expression "(int *)(iVar1 + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 0x14)" (( "(") (binary_expression "iVar1 + 0x14" (identifier "iVar1") (+ "+") (number_literal "0x14")) () ")")))) (+ "+") (pointer_expression "*(size_t *)(iVar1 + 0x10)" (* "*") (cast_expression "(size_t *)(iVar1 + 0x10)" (( "(") (type_descriptor "size_t *" (primitive_type "size_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 0x10)" (( "(") (binary_expression "iVar1 + 0x10" (identifier "iVar1") (+ "+") (number_literal "0x10")) () ")"))))) (<= "<=") (identifier "param_2")) () ")")) (&& "&&") (parenthesized_expression "(iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)" (( "(") (comma_expression "iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0" (assignment_expression "iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" (identifier "iVar2") (= "=") (call_expression "memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" (identifier "memcmp") (argument_list "((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),\n                         *(size_t *)(iVar1 + 0x10))" (( "(") (cast_expression "(void *)(*(int *)(iVar1 + 0x14) + param_1)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*(int *)(iVar1 + 0x14) + param_1)" (( "(") (binary_expression "*(int *)(iVar1 + 0x14) + param_1" (pointer_expression "*(int *)(iVar1 + 0x14)" (* "*") (cast_expression "(int *)(iVar1 + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 0x14)" (( "(") (binary_expression "iVar1 + 0x14" (identifier "iVar1") (+ "+") (number_literal "0x14")) () ")")))) (+ "+") (identifier "param_1")) () ")"))) (, ",") (pointer_expression "*(void **)(iVar1 + 0xc)" (* "*") (cast_expression "(void **)(iVar1 + 0xc)" (( "(") (type_descriptor "void **" (primitive_type "void") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(iVar1 + 0xc)" (( "(") (binary_expression "iVar1 + 0xc" (identifier "iVar1") (+ "+") (number_literal "0xc")) () ")")))) (, ",") (pointer_expression "*(size_t *)(iVar1 + 0x10)" (* "*") (cast_expression "(size_t *)(iVar1 + 0x10)" (( "(") (type_descriptor "size_t *" (primitive_type "size_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + 0x10)" (( "(") (binary_expression "iVar1 + 0x10" (identifier "iVar1") (+ "+") (number_literal "0x10")) () ")")))) () ")")))) (, ",") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0"))) () ")"))) () ")")) (compound_statement "{\n        UnlockSemaphoreInfo(DAT_003dd7cc);\n        LockSemaphoreInfo(DAT_003dd7d0);\n        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);\n        UnlockSemaphoreInfo(DAT_003dd7d0);\n        return iVar1;\n      }" ({ "{") (expression_statement "UnlockSemaphoreInfo(DAT_003dd7cc);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7cc)" (identifier "UnlockSemaphoreInfo") (argument_list "(DAT_003dd7cc)" (( "(") (identifier "DAT_003dd7cc") () ")"))) (; ";")) (expression_statement "LockSemaphoreInfo(DAT_003dd7d0);" (call_expression "LockSemaphoreInfo(DAT_003dd7d0)" (identifier "LockSemaphoreInfo") (argument_list "(DAT_003dd7d0)" (( "(") (identifier "DAT_003dd7d0") () ")"))) (; ";")) (expression_statement "InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);" (call_expression "InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1)" (identifier "InsertValueInSortedLinkedList") (argument_list "(DAT_003dd7d8,FUN_000f5460,0,iVar1)" (( "(") (identifier "DAT_003dd7d8") (, ",") (identifier "FUN_000f5460") (, ",") (number_literal "0") (, ",") (identifier "iVar1") () ")"))) (; ";")) (expression_statement "UnlockSemaphoreInfo(DAT_003dd7d0);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7d0)" (identifier "UnlockSemaphoreInfo") (argument_list "(DAT_003dd7d0)" (( "(") (identifier "DAT_003dd7d0") () ")"))) (; ";")) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (} "}"))) (expression_statement "UnlockSemaphoreInfo(DAT_003dd7cc);" (call_expression "UnlockSemaphoreInfo(DAT_003dd7cc)" (identifier "UnlockSemaphoreInfo") (argument_list "(DAT_003dd7cc)" (( "(") (identifier "DAT_003dd7cc") () ")"))) (; ";")) (} "}"))) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

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

type_1 * function_1(type_2 *var_12,size_t var_17,type_3 *var_1)

{
  type_4 var_4;
  type_1 *var_15;
  int var_16;
  
  if (var_1 == (type_3 *)0x0) {
                    /* WARNING: Subroutine does not return */
    var_2("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"GetMagicInfo");
  }
  var_4 = var_3(var_1);
  if (var_4 != var_5) {
    if (var_6 == (type_5 *)0x0) {
      if (var_7 == (type_6 *)0x0) {
        var_8(&var_7);
      }
      var_9(var_7);
      if (var_6 == (type_5 *)0x0) {
        var_6 = var_10(0);
      }
      var_11(var_7);
      if (var_6 == (type_5 *)0x0) {
        return (type_1 *)0x0;
      }
    }
    if (var_12 == (type_2 *)0x0) {
      var_9(magic_list_semaphore);
      var_13(magic_list);
      var_15 = (type_1 *)var_14(magic_list);
      var_11(magic_list_semaphore);
      return var_15;
    }
    var_9(var_7);
    var_13(var_6);
    while (var_15 = (type_1 *)var_14(var_6), var_15 != (type_1 *)0x0)
    {
      var_16 = (int)var_15->offset;
      if ((var_16 + var_15->var_17 <= var_17) &&
         (var_16 = var_18(var_12 + var_16,var_15->var_12,var_15->var_17), var_16 == 0)) {
        var_11(var_7);
        return var_15;
      }
    }
    var_11(var_7);
    var_9(magic_list_semaphore);
    var_13(magic_list);
    while (var_15 = (type_1 *)var_14(magic_list), var_15 != (type_1 *)0x0) {
      var_16 = (int)var_15->offset;
      if (*(int *)((int)&var_15->offset + 4) < 0) {
                    /* WARNING: Subroutine does not return */
        var_2("p->offset >= 0","MagickCore/magic.c",0x143,"GetMagicInfo");
      }
      if ((var_16 + var_15->var_17 <= var_17) &&
         (var_16 = var_18(var_12 + var_16,var_15->var_12,var_15->var_17), var_16 == 0)) {
        var_11(magic_list_semaphore);
        var_9(var_7);
        var_19(var_6,CompareMagickInfoSize,(void **)0x0,var_15);
        var_11(var_7);
        return var_15;
      }
    }
    var_11(magic_list_semaphore);
  }
  return (type_1 *)0x0;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content)) (string_literal (string_content)) (number_literal) (string_literal (string_content))))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (number_literal))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (return_statement (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (while_statement condition: (parenthesized_expression (comma_expression left: (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier)))) right: (binary_expression left: (identifier) right: (number_literal)))) body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) right: (identifier))) right: (parenthesized_expression (comma_expression left: (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier)))) (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))))) right: (binary_expression left: (identifier) right: (number_literal)))))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (return_statement (identifier)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (while_statement condition: (parenthesized_expression (comma_expression left: (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier)))) right: (binary_expression left: (identifier) right: (number_literal)))) body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content)) (string_literal (string_content)) (number_literal) (string_literal (string_content))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) right: (identifier))) right: (parenthesized_expression (comma_expression left: (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier)))) (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))))) right: (binary_expression left: (identifier) right: (number_literal)))))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (number_literal) (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (return_statement (identifier)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (return_statement (number_literal)))))

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

int MASKED(int param_1,uint param_2,int param_3)

{
  int iVar1;
  int iVar2;
  
  if (param_3 == 0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("exception != (ExceptionInfo *) NULL","MagickCore/magic.c",0x11e,"MASKED");
  }
  iVar1 = FUN_000f54e0();
  if (iVar1 != 0) {
    if (DAT_003dd7d8 == 0) {
      if (DAT_003dd7d0 == 0) {
        ActivateSemaphoreInfo(&DAT_003dd7d0);
      }
      LockSemaphoreInfo(DAT_003dd7d0);
      if (DAT_003dd7d8 == 0) {
        DAT_003dd7d8 = NewLinkedList(0);
      }
      UnlockSemaphoreInfo(DAT_003dd7d0);
      if (DAT_003dd7d8 == 0) {
        return 0;
      }
    }
    if (param_1 == 0) {
      LockSemaphoreInfo(DAT_003dd7cc);
      ResetLinkedListIterator(DAT_003dd7d4);
      iVar1 = GetNextValueInLinkedList(DAT_003dd7d4);
      UnlockSemaphoreInfo(DAT_003dd7cc);
      return iVar1;
    }
    LockSemaphoreInfo(DAT_003dd7d0);
    ResetLinkedListIterator(DAT_003dd7d8);
    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d8), iVar1 != 0) {
      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&
         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),
                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {
        UnlockSemaphoreInfo(DAT_003dd7d0);
        return iVar1;
      }
    }
    UnlockSemaphoreInfo(DAT_003dd7d0);
    LockSemaphoreInfo(DAT_003dd7cc);
    ResetLinkedListIterator(DAT_003dd7d4);
    while (iVar1 = GetNextValueInLinkedList(DAT_003dd7d4), iVar1 != 0) {
      if (*(int *)(iVar1 + 0x18) < 0) {
                    /* WARNING: Subroutine does not return */
        __assert_fail("p->offset >= 0","MagickCore/magic.c",0x143,"MASKED");
      }
      if ((*(int *)(iVar1 + 0x14) + *(size_t *)(iVar1 + 0x10) <= param_2) &&
         (iVar2 = memcmp((void *)(*(int *)(iVar1 + 0x14) + param_1),*(void **)(iVar1 + 0xc),
                         *(size_t *)(iVar1 + 0x10)), iVar2 == 0)) {
        UnlockSemaphoreInfo(DAT_003dd7cc);
        LockSemaphoreInfo(DAT_003dd7d0);
        InsertValueInSortedLinkedList(DAT_003dd7d8,FUN_000f5460,0,iVar1);
        UnlockSemaphoreInfo(DAT_003dd7d0);
        return iVar1;
      }
    }
    UnlockSemaphoreInfo(DAT_003dd7cc);
  }
  return 0;
}

