int __cdecl main(int argc, const char **argv, const char **envp)
{
  char *v3; // edx
  int v4; // eax
  unsigned int v5; // edx
  void **v6; // ecx
  int v7; // esi
  unsigned int v8; // edi
  int v9; // edx
  char v10; // cl
  char v11; // al
  bool v12; // zf
  _BYTE *v13; // esi
  unsigned int v14; // ecx
  size_t v15; // edx
  unsigned int i; // edi
  int j; // eax
  char *v18; // ecx
  char v19; // cl
  size_t v20; // ecx
  size_t v21; // edx
  int v22; // eax
  void **v23; // esi
  _BYTE *v24; // esi
  int v25; // ecx
  void **v26; // eax
  int v27; // eax
  char *v28; // ecx
  int v29; // eax
  int v30; // ecx
  void **v31; // eax
  int v32; // eax
  char *v33; // ecx
  int v34; // eax
  unsigned int v35; // edi
  unsigned int v36; // esi
  char *v37; // edx
  int v38; // ecx
  void *v39; // ecx
  void *v40; // ecx
  int v42; // [esp-8h] [ebp-1308h]
  int v43; // [esp-4h] [ebp-1304h]
  void *Block; // [esp+10h] [ebp-12F0h]
  char v45; // [esp+14h] [ebp-12ECh]
  char v46; // [esp+15h] [ebp-12EBh]
  char v47; // [esp+16h] [ebp-12EAh]
  unsigned int v48; // [esp+18h] [ebp-12E8h]
  int v49; // [esp+1Ch] [ebp-12E4h]
  size_t Size; // [esp+20h] [ebp-12E0h]
  unsigned int v51; // [esp+24h] [ebp-12DCh]
  __int64 v52[23]; // [esp+28h] [ebp-12D8h] BYREF
  char Destination[68]; // [esp+E0h] [ebp-1220h] BYREF
  int v54; // [esp+124h] [ebp-11DCh] BYREF
  __int128 v55; // [esp+128h] [ebp-11D8h]
  __int128 v56; // [esp+138h] [ebp-11C8h]
  __int128 v57; // [esp+148h] [ebp-11B8h]
  __int128 v58; // [esp+158h] [ebp-11A8h]
  char v59[64]; // [esp+168h] [ebp-1198h] BYREF
  int v60; // [esp+1A8h] [ebp-1158h]
  char *v61; // [esp+1ACh] [ebp-1154h]
  int v62[44]; // [esp+1B0h] [ebp-1150h] BYREF
  void *v63[4]; // [esp+260h] [ebp-10A0h] BYREF
  unsigned int v64; // [esp+270h] [ebp-1090h]
  unsigned int v65; // [esp+274h] [ebp-108Ch]
  void *Src[4]; // [esp+278h] [ebp-1088h] BYREF
  int v67; // [esp+288h] [ebp-1078h]
  unsigned int v68; // [esp+28Ch] [ebp-1074h]
  char v69[3840]; // [esp+290h] [ebp-1070h] BYREF
  char v70[256]; // [esp+1190h] [ebp-170h] BYREF
  char v71[32]; // [esp+1290h] [ebp-70h] BYREF
  int v72[4]; // [esp+12B0h] [ebp-50h] BYREF
  __int128 v73; // [esp+12C0h] [ebp-40h]
  __int128 v74; // [esp+12D0h] [ebp-30h]
  __int128 v75; // [esp+12E0h] [ebp-20h]
  int v76; // [esp+12FCh] [ebp-4h]

  v49 = 0;
  if ( argc >= 2 )
  {
    v3 = (char *)argv[1];
    v63[0] = 0;
    v64 = 0;
    v65 = 15;
    v76 = -1;
    sub_407C80(v63, v3, strlen(v3));
    v76 = 1;
    v48 = v64;
    v4 = unknown_libname_5(v64);
    v5 = v48;
    v6 = v63;
    v49 = v4;
    Size = 0;
    if ( v65 >= 0x10 )
      v6 = (void **)v63[0];
    v51 = (unsigned int)v6;
    qmemcpy(v70, &unk_431950, sizeof(v70));
    if ( v48 )
    {
      v7 = v4;
      v8 = v51 - v4;
      v51 = v48;
      LOBYTE(v9) = 0;
      do
      {
        v9 = (unsigned __int8)(v9 + 1);
        ++v7;
        v10 = v70[v9];
        Size = (unsigned __int8)(Size + v10);
        v70[v9] = v70[Size];
        v70[Size] = v10;
        v11 = *(_BYTE *)(v8 + v7 - 1) ^ v70[(unsigned __int8)(v70[v9] + v10)];
        v12 = v51-- == 1;
        *(_BYTE *)(v7 - 1) = v11;
      }
      while ( !v12 );
      v5 = v48;
    }
    v13 = (_BYTE *)unknown_libname_5(4 * ((v5 + 2) / 3) + 1);
    Block = v13;
    memset(Destination, 0, 0x41u);
    strcpy_s(Destination, 0x41u, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-");
    v14 = v48;
    v15 = 0;
    Size = 0;
    for ( i = 0; i < v48; v14 = v48 )
    {
      for ( j = 0; j < 3; ++j )
      {
        if ( i >= v14 )
        {
          if ( (unsigned int)j >= 3 )
          {
            __report_rangecheckfailure();
            goto LABEL_62;
          }
          ++v15;
          v19 = 0;
          Size = v15;
        }
        else
        {
          v18 = (char *)v49++;
          ++i;
          v19 = *v18;
        }
        *(&v45 + j) = v19;
        v14 = v48;
      }
      LOBYTE(v51) = (v45 >> 2) & 0x3F;
      BYTE1(v51) = (16 * (v45 & 3)) | (v46 >> 4) & 0xF;
      HIBYTE(v51) = v47 & 0x3F;
      v20 = 0;
      v15 = Size;
      BYTE2(v51) = (4 * (v46 & 0xF)) | (v47 >> 6) & 3;
      if ( Size != 4 )
      {
        v21 = 4 - Size;
        do
        {
          v22 = *((char *)&v51 + v20++);
          *v13++ = Destination[v22];
        }
        while ( v20 < v21 );
        v15 = Size;
      }
      if ( v15 )
      {
        memset(v13, 61, v15);
        v15 = Size;
        v13 += Size;
      }
    }
    *v13 = 0;
    Src[0] = 0;
    v67 = 0;
    v68 = 15;
    LOBYTE(v76) = 1;
    sub_407C80(Src, Block, strlen((const char *)Block));
    LOBYTE(v76) = 3;
    j_j__free(Block);
    if ( v68 - v67 < 0xA )
    {
      sub_408B40(Src, 10, (int)Block, (int)".encrypted", 0xAu);
    }
    else
    {
      v23 = Src;
      if ( v68 >= 0x10 )
        v23 = (void **)Src[0];
      v24 = (char *)v23 + v67;
      v67 += 10;
      memmove(v24, ".encrypted", 0xAu);
      v24[10] = 0;
    }
    sub_4053E0(v63, (int)v72);
    memset(v59, 0, sizeof(v59));
    v54 = 8;
    v55 = *(_OWORD *)v72;
    v61 = v59;
    v56 = v73;
    v60 = 0;
    v57 = v74;
    v58 = v75;
    memset(v52, 0, sizeof(v52));
    LODWORD(v52[0]) = &unk_431A60;
    LODWORD(v52[15]) = 0;
    memset(&v52[19], 0, 12);
    LOBYTE(v76) = 4;
    v49 = 1;
    LODWORD(v52[14]) = &std::istream::`vftable';
    HIDWORD(v52[13]) = 88;
    v52[1] = 0i64;
    sub_408120((struct std::ios_base *)&v52[14], (int)&v52[2], 0);
    v76 = 6;
    *(_DWORD *)((char *)v52 + *(_DWORD *)(LODWORD(v52[0]) + 4)) = &std::ifstream::`vftable';
    *(unsigned int *)((char *)&v51 + *(_DWORD *)(LODWORD(v52[0]) + 4)) = *(_DWORD *)(LODWORD(v52[0]) + 4) - 112;
    sub_407A80();
    LOBYTE(v76) = 7;
    v26 = v63;
    if ( v65 >= 0x10 )
      v26 = (void **)v63[0];
    v12 = sub_407DF0(v26, 33, v25) == 0;
    v27 = *(_DWORD *)(LODWORD(v52[0]) + 4);
    if ( v12 )
    {
      v29 = *(_DWORD *)((char *)&v52[1] + v27 + 4) | (4 * (*(_DWORD *)((char *)&v52[7] + v27) == 0) + 2);
    }
    else
    {
      v28 = (char *)v52 + v27;
      v29 = 4;
      if ( *((_DWORD *)v28 + 14) )
        v29 = 0;
    }
    sub_4052A0(v29, 0);
    memset(v62, 0, sizeof(v62));
    v62[0] = (int)&unk_431A58;
    v62[28] = 0;
    memset(&v62[36], 0, 12);
    LOBYTE(v76) = 8;
    v49 = 5;
    v62[26] = (int)&std::ostream::`vftable';
    v62[25] = 96;
    sub_408120((struct std::ios_base *)&v62[26], (int)&v62[1], 0);
    v76 = 10;
    *(int *)((char *)v62 + *(_DWORD *)(v62[0] + 4)) = (int)&std::ofstream::`vftable';
    *(int *)((char *)&v62[-1] + *(_DWORD *)(v62[0] + 4)) = *(_DWORD *)(v62[0] + 4) - 104;
    sub_407A80();
    LOBYTE(v76) = 11;
    v31 = Src;
    if ( v68 >= 0x10 )
      v31 = (void **)Src[0];
    v12 = sub_407DF0(v31, 34, v30) == 0;
    v32 = *(_DWORD *)(v62[0] + 4);
    if ( v12 )
    {
      v34 = *(int *)((char *)&v62[3] + v32) | (4 * (*(int *)((char *)&v62[14] + v32) == 0) + 2);
    }
    else
    {
      v33 = (char *)v62 + v32;
      v34 = 4;
      if ( *((_DWORD *)v33 + 14) )
        v34 = 0;
    }
    sub_4052A0(v34, 0);
    if ( HIDWORD(v52[11]) && v62[20] )
    {
      while ( (*((_BYTE *)&v52[1] + *(_DWORD *)(LODWORD(v52[0]) + 4) + 4) & 1) == 0 )
      {
        sub_406E30(v69, v42, v43);
        v35 = v52[1];
        v36 = 0;
        if ( LODWORD(v52[1]) )
        {
          v37 = v61;
          v38 = v60;
          do
          {
            if ( !v38 )
            {
              sub_40C250(&v54, v37);
              v37 = v61;
              v38 = v60;
            }
            --v38;
            v69[v36++] ^= *v37++;
            v61 = v37;
            v60 = v38;
          }
          while ( v36 < v35 );
        }
        sub_406F90(v69, v35, 0);
      }
      sub_406F90(v71, 32, 0);
    }
    *(int *)((char *)v62 + *(_DWORD *)(v62[0] + 4)) = (int)&std::ofstream::`vftable';
    *(int *)((char *)&v62[-1] + *(_DWORD *)(v62[0] + 4)) = *(_DWORD *)(v62[0] + 4) - 104;
    sub_406A30();
    *(int *)((char *)v62 + *(_DWORD *)(v62[0] + 4)) = (int)&std::ostream::`vftable';
    *(int *)((char *)&v62[-1] + *(_DWORD *)(v62[0] + 4)) = *(_DWORD *)(v62[0] + 4) - 8;
    LOBYTE(v76) = 12;
    v62[26] = (int)&std::ios_base::`vftable';
    std::ios_base::_Ios_base_dtor((struct std::ios_base *)&v62[26]);
    *(_DWORD *)((char *)v52 + *(_DWORD *)(LODWORD(v52[0]) + 4)) = &std::ifstream::`vftable';
    *(unsigned int *)((char *)&v51 + *(_DWORD *)(LODWORD(v52[0]) + 4)) = *(_DWORD *)(LODWORD(v52[0]) + 4) - 112;
    sub_406A30();
    *(_DWORD *)((char *)v52 + *(_DWORD *)(LODWORD(v52[0]) + 4)) = &std::istream::`vftable';
    *(unsigned int *)((char *)&v51 + *(_DWORD *)(LODWORD(v52[0]) + 4)) = *(_DWORD *)(LODWORD(v52[0]) + 4) - 24;
    LOBYTE(v76) = 13;
    LODWORD(v52[14]) = &std::ios_base::`vftable';
    std::ios_base::_Ios_base_dtor((struct std::ios_base *)&v52[14]);
    if ( v68 >= 0x10 )
    {
      v39 = Src[0];
      if ( v68 + 1 >= 0x1000 )
      {
        v39 = (void *)*((_DWORD *)Src[0] - 1);
        if ( (unsigned int)(Src[0] - v39 - 4) > 0x1F )
          goto LABEL_62;
      }
      sub_40E0C5(v39);
    }
    v67 = 0;
    v68 = 15;
    LOBYTE(Src[0]) = 0;
    if ( v65 < 0x10 )
      return 0;
    v40 = v63[0];
    if ( v65 + 1 < 0x1000 || (v40 = (void *)*((_DWORD *)v63[0] - 1), (unsigned int)(v63[0] - v40 - 4) <= 0x1F) )
    {
      sub_40E0C5(v40);
      return 0;
    }
LABEL_62:
    _invalid_parameter_noinfo_noreturn();
  }
  sub_4083D0();
  sub_4083D0();
  sub_408640();
  sub_4083D0();
  return 0;
}

This is CTF Reverse task:

 We found this file on our desktop. Strangely we can't open our docs now on...

ALL OF YOUR FILES WERE ENCRYPTED!!!!

P.S. Including the flag, bye!

File name 

pQo1eyYCrZfv0ndQhPPDSBqLStF39GKaO2RzHPVa-QWkW0==.encrypted

so need to decrypt please solve it