VC++ 6.0 cycles.

So here is what I want to know - How to represent decompiled cycle like this in normal form:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
SYS_DI_ADAPTER_OBJECT *__cdecl sysDXListReverse(SYS_DI_ADAPTER_OBJECT **a1)
{
  SYS_DI_ADAPTER_OBJECT *result; // eax@1
  SYS_DI_ADAPTER_OBJECT *v2; // edi@1
  SYS_DI_ADAPTER_OBJECT **v3; // edx@2
  SYS_DI_ADAPTER_OBJECT *v4; // ecx@2

  v2 = 0;
  for ( result = *a1; *a1; result = *a1 )
  {
//Here it starts
    v4 = *a1;
    v3 = a1;
    if ( *a1 )
    {
      while ( v4 != result )
      {
        v3 = &v4->m_316;
        v4 = v4->m_316;
        if ( !v4 )
          goto LABEL_7;
      }
      *v3 = result->m_316;
      result->m_316 = 0;
    }
LABEL_7: //Here ends
    result->m_316 = v2;
    v2 = result;
  }
  *a1 = v2;
  return result;
}


I think this can be represented in some kind of for - loop. This was compiled with VC++ 6.0 with Speed Optimization. Please Help!
Topic archived. No new replies allowed.