aboutsummaryrefslogtreecommitdiffstats
path: root/fw/pseudo/auc.auc_cmd02.after.c
blob: 09f1cb13055905747069a7ac66bdd6fa29359995 (plain) (blame)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
int __fastcall auc_cmd02(void *ctx, struct ta_params *params)
{
  int result; // r0
  char *v5; // r11
  unsigned int v6; // r6
  int v7; // r2
  void *v8; // r0
  int v9; // r9
  int v10; // r10
  int v11; // r6
  int v12; // r0
  bool v13; // zf
  unsigned int v14; // r0
  bool v15; // zf
  int v16; // r3
  unsigned int v17; // r2
  unsigned int v18; // r1
  int v19; // r3
  unsigned int v20; // r0
  int *v21; // r1
  struct ta_params *v22; // r3
  int v23; // t1
  unsigned int v24; // r3
  int v25; // [sp+4h] [bp-18h]
  int v26; // [sp+8h] [bp-14h]
  int v27; // [sp+Ch] [bp-10h]
  int v28; // [sp+10h] [bp-Ch] BYREF
  int v29; // [sp+14h] [bp-8h] BYREF
  int v30; // [sp+18h] [bp-4h] BYREF

  result = 2;
  if ( ctx != nullptr && params != nullptr )
  {
    if ( *(_DWORD *)ctx <= 0xFu && *((_DWORD *)(v5 = (char *)nullsub_3 + 28 * *(_DWORD *)ctx) + 2) == 1 )
    {
      result = 11;
      v6 = *((_DWORD *)v5 + 7);
      v7 = *((_DWORD *)ctx + 3);
      if ( v7 - 1 >= v6 && (v6 == -1 || v7 != 0) )
      {
        v8 = *((void **)v5 + 1);
        v9 = 0;
        *((_DWORD *)v5 + 7) = v7;
        v10 = *((_DWORD *)ctx + 5);
        v29 = 0;
        v11 = auc_cmd02__h3(ctx: v8, params: (struct ta_params *)&v30);
        v12 = auc_cmd02__h2(ctx: *((void **)v5 + 1), params: (struct ta_params *)&v29);
        if ( v11 != 0 )
          v11 = 13;
        if ( v12 != 0 )
          v11 = 14;
        if ( auc_cmd02__h4(ctx: *((void **)v5 + 1), params: (struct ta_params *)&v28) != 0 )
          v11 = 15;
        v13 = v27 == 3;
        if ( v27 == 3 )
          v13 = v25 == 1;
        if ( v13 )
        {
          v14 = *((unsigned __int16 *)ctx + 12);
          v9 = 1;
          if ( v14 <= 6 )
            *((_DWORD *)nullsub_3 + v14 + 113) = 1;
        }
        v15 = v9 == 0;
        if ( v9 == 0 )
          v15 = (v30 | 1) == 3;
        v16 = 8;
        if ( v15 )
        {
          v24 = *((unsigned __int16 *)ctx + 12);
          if ( v24 > 6 )
            v16 = 8;
          else
            v16 = 8 * (*((_DWORD *)nullsub_3 + v24 + 113) != 1);
        }
        if ( (v29 & 2) != 0 )
        {
          v18 = 8194;
          if ( v26 == 2 )
            v18 = 139266;
          v17 = v10 & 0x80 | (32 * (v27 != 0)) | (16 * v9) | (v9 << 11) | ((v28 == 2) << 8) | v16 & 0xFFFFFFF8;
        }
        else
        {
          v17 = 16388;
          v18 = v10 & 0x80 | (32 * (v27 != 0)) | (16 * v9) | (v9 << 11) | ((v28 == 2) << 8) | v16 & 0xFFFFFFF8;
          if ( v29 << 31 == 0 )
            v17 = 16396;
        }
        *((_DWORD *)params + 72) = v11;
        v19 = *((_DWORD *)ctx + 3);
        v20 = *((_DWORD *)ctx + 7);
        *((_DWORD *)params + 64) = v20;
        *((_DWORD *)params + 65) = v19;
        *((_DWORD *)params + 67) = v18 | v17;
        *((_DWORD *)params + 66) = *((unsigned __int16 *)ctx + 12);
        if ( v20 <= 0x20 )
        {
          if ( v20 != 0 )
          {
            v21 = (int *)((char *)ctx + 32);
            v22 = params;
            do
            {
              *((_DWORD *)v22 + 1) = 0;
              --v20;
              v23 = *v21++;
              *(_DWORD *)v22 = v23;
              v22 = (struct ta_params *)((char *)v22 + 8);
            }
            while ( v20 != 0 );
          }
          if ( auc_cmd02__h1(ctx: params, params: (struct ta_params *)0x110) != 0 )
            return 12;
          else
            return 16 * (sub_4018B8(a1: (int)nullsub_3, a2: 496) != 0);
        }
        else
        {
          return 17;
        }
      }
    }
    else
    {
      return 1;
    }
  }
  return result;
}