#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <sys/types.h>


char sum_pw(char *param_1) {
  return param_1[11] +
         param_1[10] +
         param_1[9] +
         param_1[8] +
         param_1[7] +
         param_1[6] +
         param_1[5] +
         param_1[4] +
         param_1[3] +
         param_1[2] +
         param_1[1] +
         param_1[0];
}



uint64_t main(int param_1,char* *param_2) {
  char cVar1;
  uint64_t ret;
  size_t pw_length;

  if (param_1 == 2) {
    pw_length = strlen((char *)param_2[1]);
    if (pw_length == 12) {
      cVar1 = sum_pw(param_2[1]);
      if (cVar1 == 'j') {
        fprintf(stderr,"\nCongratulations ! A right password is indeed %s :-)\n\n",param_2[1]);
        ret = 0;
      }
      else {
        fwrite("\nWrong password ! Try again...\n\n",1,0x20,stderr);
        ret = 1;
      }
    }
    else {
      fwrite("\nWrong password ! Try again...\n\n",1,0x20,stderr);
      ret = 1;
    }
  }
  else {
    fwrite("\nMSE-SRE Challenge E3 --- Enjoy !\n",1,0x22,stderr);
    fwrite("\nWhat I need is 1024 passwords passing the check!\n",1,0x32,stderr);
    fprintf(stderr,"\nUsage: %s <password>\n\n",*param_2);
    ret = 1;
  }
  return ret;
}
