rendered paste bodyint __cdecl AMRestorePerformRestoreModeRestore(AMRestoreModeDevice *hAMR,void *theDict,int (__cdecl *progFunc)(_DWORD progFuncData,_DWORD,_DWORD,_DWORD),int){ int (__cdecl *v4)(_DWORD,_DWORD,_DWORD,_DWORD); // eax@1 AMRestoreModeDevice *_hAMR; // esi@1 int result; // eax@4 int (__cdecl *v7)(_DWORD,_DWORD,_DWORD,_DWORD); // eax@5 int v8; // eax@7 int v9; // edi@7 void *dictRestore; // eax@10 void *_dictRestore; // ebx@10 int v12; // edi@12 int v13; // ecx@1 AMRestoreModeDevice *__hAMR; // ST08_4@1 void *v15; // eax@1 int v16; // eax@3 void *v17; // eax@5 void *v18; // eax@11 int v19; // eax@12 int v20; // eax@13 int v21; // eax@14 int v22; // eax@16 int v23; // eax@17 int v24; // eax@18 int v25; // eax@19 int v26; // eax@20 signed int v27; // eax@21 void *v28; // eax@22 int v29; // eax@23 char a3; // [sp+1h] [bp-1h]@1 v13 = progFuncData; _hAMR = hAMR; __hAMR = hAMR; a3 = 0; hAMR->pProgressFunc = progFunc; hAMR->pProgressFuncData = v13; v15 = _CFStringMakeConstantString("%@: operation %d progress %d"); AMRLog(7, v15, __hAMR, 3, -1); v4 = _hAMR->pProgressFunc; if ( v4 ) v4(_hAMR, 3, -1, _hAMR->pProgressFuncData); _hAMR->nOperation = 3; _hAMR->nProgress = -1; v16 = _socketForPort(_hAMR, 0xF27Eu); _hAMR->m_socket = v16; if ( v16 >= 0 ) { v17 = _CFStringMakeConstantString("%@: operation %d progress %d"); AMRLog(7, v17, _hAMR, 4, -1); v7 = _hAMR->pProgressFunc; if ( v7 ) v7(_hAMR, 4, -1, _hAMR->pProgressFuncData); _hAMR->nOperation = 4; _hAMR->nProgress = -1; v8 = queryRestoredInfo(_hAMR); v9 = v8; if ( v8 == 5 ) { result = 5; } else { if ( v8 ) { closesocket(_hAMR->m_socket); result = v9; _hAMR->m_socket = -1; } else { dictRestore = resolveBundlePathOptions_restoreMode(theDict); _dictRestore = dictRestore; if ( dictRestore ) { v19 = DoWaitForStorageDevice(dictRestore); v12 = v19; if ( v19 || (v20 = createFsPartitions(_dictRestore), v12 = v20, v20) || (v21 = restoreImages(_dictRestore, _hAMR, &a3), v12 = v21, v21) || a3 == 1 && ((v22 = fsck(_hAMR), v12 = v22, v22) || (v23 = doDittoAndRemoveActivation(_dictRestore), v12 = v23, v23) || (v24 = doMount(_hAMR), v12 = v24, v24)) || (v25 = doFlashNOR(_hAMR), v12 = v25, v25) || (v26 = doUpdateBaseband(_dictRestore), v12 = v26, v26) || (v27 = setBootStage(_hAMR), v12 = v27, v27) || (v28 = setAutoBootDelay(_hAMR, _dictRestore), v12 = (int)v28, v28) || (v29 = performPostRestoreAction(_dictRestore), v12 = v29, v29) ) logDeviceOutput(_hAMR, _dictRestore); CFRelease(_dictRestore); result = v12; } else { v18 = _CFStringMakeConstantString("_resolveBundlePathOptions for restore mode failed"); AMRLog(3, v18); result = (int)((char *)_dictRestore + 1); } } } } else { result = 2; } return result;}