#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef unsigned char mpz_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char *GetHash(unsigned char *, char **);
unsigned char *GetHexHash(unsigned char *, char **);
int /*<<< orphan*/ GetJnHash(unsigned char, unsigned char);
int ceil(int /*<<< orphan*/);
int /*<<< orphan*/ f(unsigned char, unsigned char, unsigned char,
                     unsigned char);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
scalar_t__ fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char);
int /*<<< orphan*/ free(unsigned char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ mpz_add(unsigned char, unsigned char, unsigned char);
int /*<<< orphan*/ mpz_add_ui(unsigned char, unsigned char, int);
int /*<<< orphan*/ mpz_clear(unsigned char);
scalar_t__ mpz_cmp(unsigned char, unsigned char);
int /*<<< orphan*/ mpz_init(unsigned char);
int /*<<< orphan*/ mpz_inp_str(unsigned char, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ mpz_invert(unsigned char, unsigned char, unsigned char);
int mpz_jacobi(unsigned char, unsigned char);
int /*<<< orphan*/ mpz_mod(unsigned char, unsigned char, unsigned char);
int /*<<< orphan*/ mpz_mul(unsigned char, unsigned char, unsigned char);
int /*<<< orphan*/ mpz_powm_ui(unsigned char, unsigned char, int,
                               unsigned char);
int /*<<< orphan*/ mpz_set(unsigned char, unsigned char);
int /*<<< orphan*/ mpz_set_str(unsigned char, unsigned char *, int);
int /*<<< orphan*/ sqrt(int);
scalar_t__ strcmp(char *, char *);
void Decrypt(char *filename, unsigned char *identity, int l, mpz_t p, mpz_t q,
             mpz_t n, mpz_t u, mpz_t r, char **error) {
  int k, i, alpha, beta, read_length, bit, m, mrev, bytes_no, choice;
  mpz_t rp, S, R, uR, cR, x, s, tmp, *xs;
  FILE *fd, *fd_write;
  unsigned char *hash, *hex_hash, *cs, c, decrypted_character;
  mpz_init(R);
  mpz_init(uR);
  mpz_init(rp);
  mpz_init(S);
  mpz_init(cR);
  mpz_init(x);
  mpz_init(s);
  mpz_init(tmp);
  fd = fopen(filename, "r");
  if (fd == NULL) {
    *error = "file open failed";
    return;
  }
  fd_write = fopen("decrypted_text", "w");
  if (fd_write == NULL) {
    *error = "file open failed";
    return;
  }
  bytes_no = l / 8;
  k = ceil(sqrt(l));
  xs = (mpz_t *)malloc(k * sizeof(mpz_t));
  if (xs == NULL) {
    *error = "malloc";
    return;
  }
  cs = (char *)malloc(bytes_no * sizeof(char));
  if (cs == NULL) {
    *error = "malloc";
    return;
  }
  hash = GetHash(identity, error);
  if (strcmp(*error, "success") != 0)
    return;
  hex_hash = GetHexHash(hash, error);
  if (strcmp(*error, "success") != 0)
    return;
  mpz_set_str(R, hex_hash, 16);
  mpz_mod(R, R, n);
  GetJnHash(n, R);
  mpz_mul(uR, R, u);
  mpz_mod(uR, uR, n);
  mpz_powm_ui(rp, r, 2, n);
  choice = 2;
  mpz_set(cR, uR);
  if (mpz_cmp(rp, R) == 0) {
    choice = 1;
    mpz_set(cR, R);
  }
  while (!feof(fd)) {
    for (i = 0; i < bytes_no; i++) {
      fgetc(fd);
      cs[i] = (unsigned char)fgetc(fd);
      if (choice == 2)
        cs[i] = (unsigned char)fgetc(fd);
      else
        fgetc(fd);
      fgetc(fd);
    }
    for (i = 0; i < k; i++) {
      mpz_init(xs[i]);
      mpz_inp_str(xs[i], fd, 10);
      if (choice == 2)
        mpz_inp_str(xs[i], fd, 10);
      else
        mpz_inp_str(tmp, fd, 10);
    }
    i = 0;
    alpha = 1;
    beta = 0;
    while (i < l) {
      if (i % 8 == 0) {
        decrypted_character ^= decrypted_character;
        c = cs[i / 8];
      }
      bit = ((1 << 7) & c) == 0 ? 1 : -1;
      c <<= 1;
      if (i < k) {
        f(tmp, r, xs[i], n);
        m = bit * mpz_jacobi(tmp, n);
        mrev = (m == -1) ? 1 : 0;
        decrypted_character |= mrev;
      } else {
        mpz_mul(tmp, cR, xs[alpha]);
        mpz_mod(tmp, tmp, n);
        mpz_mul(tmp, tmp, xs[beta]);
        mpz_mod(tmp, tmp, n);
        mpz_add_ui(tmp, tmp, 1);
        mpz_mod(tmp, tmp, n);
        mpz_invert(tmp, tmp, n);
        mpz_add(x, xs[alpha], xs[beta]);
        mpz_mod(x, x, n);
        mpz_mul(x, x, tmp);
        mpz_mod(x, x, n);
        f(tmp, r, x, n);
        m = bit * mpz_jacobi(tmp, n);
        mrev = (m == -1) ? 1 : 0;
        decrypted_character |= mrev;
        beta++;
        if (beta == k) {
          alpha++;
          beta = 0;
        }
      }
      i++;
      if (i % 8 == 0)
        fprintf(fd_write, "%c", decrypted_character);
      else
        decrypted_character <<= 1;
    }
  }
  for (i = 0; i < k; i++)
    mpz_clear(xs[i]);
  free(xs);
  free(cs);
  mpz_clear(R);
  mpz_clear(uR);
  mpz_clear(tmp);
  mpz_clear(s);
  mpz_clear(x);
  mpz_clear(cR);
  mpz_clear(S);
  mpz_clear(rp);
  fclose(fd);
  fclose(fd_write);
}


x86 assembly (clang, -O0):
<Decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %r8d,-0x94(%rbp)
mov    %ecx,%eax
mov    -0x94(%rbp),%ecx
mov    %eax,-0x90(%rbp)
mov    %edx,%eax
mov    -0x90(%rbp),%edx
mov    %eax,-0x8c(%rbp)
mov    %rsi,%rax
mov    -0x8c(%rbp),%esi
mov    %rax,-0x88(%rbp)
mov    %rdi,%r8
mov    -0x88(%rbp),%rdi
mov    %r9b,%al
mov    0x20(%rbp),%r9
mov    0x18(%rbp),%r9b
mov    0x10(%rbp),%r9b
mov    %r8,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %dl,-0x15(%rbp)
mov    %cl,-0x16(%rbp)
mov    %al,-0x17(%rbp)
movzbl -0x43(%rbp),%edi
call   10c0 <mpz_init@plt>
movzbl -0x44(%rbp),%edi
call   10c0 <mpz_init@plt>
movzbl -0x41(%rbp),%edi
call   10c0 <mpz_init@plt>
movzbl -0x42(%rbp),%edi
call   10c0 <mpz_init@plt>
movzbl -0x45(%rbp),%edi
call   10c0 <mpz_init@plt>
movzbl -0x46(%rbp),%edi
call   10c0 <mpz_init@plt>
movzbl -0x47(%rbp),%edi
call   10c0 <mpz_init@plt>
movzbl -0x48(%rbp),%edi
call   10c0 <mpz_init@plt>
mov    -0x8(%rbp),%rdi
lea    0xc92(%rip),%rsi
call   1190 <fopen@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    1395 <Decrypt+0xe5>
mov    0x20(%rbp),%rax
lea    0xc75(%rip),%rcx
mov    %rcx,(%rax)
jmp    1a27 <Decrypt+0x777>
lea    0xc77(%rip),%rdi
lea    0xc7f(%rip),%rsi
call   1190 <fopen@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
jne    13ca <Decrypt+0x11a>
mov    0x20(%rbp),%rax
lea    0xc40(%rip),%rcx
mov    %rcx,(%rax)
jmp    1a27 <Decrypt+0x777>
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x3c(%rbp)
mov    -0x14(%rbp),%edi
call   11c0 <sqrt@plt>
mov    %eax,%edi
call   1040 <ceil@plt>
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1120 <malloc@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    141b <Decrypt+0x16b>
mov    0x20(%rbp),%rax
lea    0xc11(%rip),%rcx
mov    %rcx,(%rax)
jmp    1a27 <Decrypt+0x777>
movslq -0x3c(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1120 <malloc@plt>
mov    %rax,-0x78(%rbp)
cmpq   $0x0,-0x78(%rbp)
jne    144c <Decrypt+0x19c>
mov    0x20(%rbp),%rax
lea    0xbe0(%rip),%rcx
mov    %rcx,(%rax)
jmp    1a27 <Decrypt+0x777>
mov    -0x10(%rbp),%rdi
mov    0x20(%rbp),%rsi
call   11d0 <GetHash@plt>
mov    %rax,-0x68(%rbp)
mov    0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xbc0(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
je     147f <Decrypt+0x1cf>
jmp    1a27 <Decrypt+0x777>
mov    -0x68(%rbp),%rdi
mov    0x20(%rbp),%rsi
call   10a0 <GetHexHash@plt>
mov    %rax,-0x70(%rbp)
mov    0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xb8d(%rip),%rsi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
je     14b2 <Decrypt+0x202>
jmp    1a27 <Decrypt+0x777>
mov    -0x43(%rbp),%al
mov    -0x70(%rbp),%rsi
mov    $0x10,%edx
movzbl %al,%edi
call   1130 <mpz_set_str@plt>
mov    -0x43(%rbp),%cl
mov    -0x43(%rbp),%al
movzbl %cl,%edi
movzbl %al,%esi
movzbl -0x17(%rbp),%edx
call   1170 <mpz_mod@plt>
mov    -0x17(%rbp),%al
movzbl %al,%edi
movzbl -0x43(%rbp),%esi
call   11a0 <GetJnHash@plt>
mov    -0x44(%rbp),%cl
mov    -0x43(%rbp),%al
movzbl %cl,%edi
movzbl %al,%esi
movzbl 0x10(%rbp),%edx
call   1110 <mpz_mul@plt>
mov    -0x44(%rbp),%cl
mov    -0x44(%rbp),%al
movzbl %cl,%edi
movzbl %al,%esi
movzbl -0x17(%rbp),%edx
call   1170 <mpz_mod@plt>
mov    -0x41(%rbp),%cl
mov    0x18(%rbp),%al
mov    $0x2,%edx
movzbl %cl,%edi
movzbl %al,%esi
movzbl -0x17(%rbp),%ecx
call   1150 <mpz_powm_ui@plt>
movl   $0x2,-0x40(%rbp)
mov    -0x45(%rbp),%al
movzbl %al,%edi
movzbl -0x44(%rbp),%esi
call   1050 <mpz_set@plt>
mov    -0x41(%rbp),%al
movzbl %al,%edi
movzbl -0x43(%rbp),%esi
call   1160 <mpz_cmp@plt>
cmp    $0x0,%rax
jne    1573 <Decrypt+0x2c3>
movl   $0x1,-0x40(%rbp)
mov    -0x45(%rbp),%al
movzbl %al,%edi
movzbl -0x43(%rbp),%esi
call   1050 <mpz_set@plt>
jmp    1578 <Decrypt+0x2c8>
mov    -0x58(%rbp),%rdi
call   10f0 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1596 <Decrypt+0x2e6>
jmp    1989 <Decrypt+0x6d9>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    160d <Decrypt+0x35d>
mov    -0x58(%rbp),%rdi
call   1090 <fgetc@plt>
mov    -0x58(%rbp),%rdi
call   1090 <fgetc@plt>
mov    %al,%dl
mov    -0x78(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
cmpl   $0x2,-0x40(%rbp)
jne    15ed <Decrypt+0x33d>
mov    -0x58(%rbp),%rdi
call   1090 <fgetc@plt>
mov    %al,%dl
mov    -0x78(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    15f6 <Decrypt+0x346>
mov    -0x58(%rbp),%rdi
call   1090 <fgetc@plt>
mov    -0x58(%rbp),%rdi
call   1090 <fgetc@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    159d <Decrypt+0x2ed>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    169f <Decrypt+0x3ef>
mov    -0x50(%rbp),%rax
movslq -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   10c0 <mpz_init@plt>
mov    -0x50(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x58(%rbp),%rsi
mov    $0xa,%edx
movzbl %al,%edi
call   1140 <mpz_inp_str@plt>
cmpl   $0x2,-0x40(%rbp)
jne    1678 <Decrypt+0x3c8>
mov    -0x50(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x58(%rbp),%rsi
mov    $0xa,%edx
movzbl %al,%edi
call   1140 <mpz_inp_str@plt>
jmp    168c <Decrypt+0x3dc>
mov    -0x48(%rbp),%al
mov    -0x58(%rbp),%rsi
mov    $0xa,%edx
movzbl %al,%edi
call   1140 <mpz_inp_str@plt>
jmp    1691 <Decrypt+0x3e1>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1614 <Decrypt+0x364>
movl   $0x0,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1984 <Decrypt+0x6d4>
mov    -0x20(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1709 <Decrypt+0x459>
movzbl -0x7a(%rbp),%ecx
movzbl -0x7a(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x7a(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xa0(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x79(%rbp)
movzbl -0x79(%rbp),%edx
and    $0x80,%edx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
mov    %eax,-0x30(%rbp)
movzbl -0x79(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x79(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    17a9 <Decrypt+0x4f9>
mov    -0x48(%rbp),%dl
mov    0x18(%rbp),%cl
mov    -0x50(%rbp),%rax
movslq -0x20(%rbp),%rsi
mov    (%rax,%rsi,1),%al
movzbl %dl,%edi
movzbl %cl,%esi
movzbl %al,%edx
movzbl -0x17(%rbp),%ecx
call   1080 <f@plt>
mov    -0x30(%rbp),%eax
mov    %eax,-0xa4(%rbp)
mov    -0x48(%rbp),%al
movzbl %al,%edi
movzbl -0x17(%rbp),%esi
call   11b0 <mpz_jacobi@plt>
mov    %eax,%ecx
mov    -0xa4(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0xffffffff,%edx
cmove  %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%ecx
movzbl -0x7a(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x7a(%rbp)
jmp    193f <Decrypt+0x68f>
mov    -0x48(%rbp),%sil
mov    -0x45(%rbp),%dl
mov    -0x50(%rbp),%rax
movslq -0x24(%rbp),%rcx
movzbl %sil,%edi
movzbl %dl,%esi
movzbl (%rax,%rcx,1),%edx
call   1110 <mpz_mul@plt>
mov    -0x48(%rbp),%cl
mov    -0x48(%rbp),%al
movzbl %cl,%edi
movzbl %al,%esi
movzbl -0x17(%rbp),%edx
call   1170 <mpz_mod@plt>
mov    -0x48(%rbp),%sil
mov    -0x48(%rbp),%dl
mov    -0x50(%rbp),%rax
movslq -0x28(%rbp),%rcx
movzbl %sil,%edi
movzbl %dl,%esi
movzbl (%rax,%rcx,1),%edx
call   1110 <mpz_mul@plt>
mov    -0x48(%rbp),%cl
mov    -0x48(%rbp),%al
movzbl %cl,%edi
movzbl %al,%esi
movzbl -0x17(%rbp),%edx
call   1170 <mpz_mod@plt>
mov    -0x48(%rbp),%al
mov    $0x1,%edx
movzbl %al,%edi
movzbl -0x48(%rbp),%esi
call   1070 <mpz_add_ui@plt>
mov    -0x48(%rbp),%cl
mov    -0x48(%rbp),%al
movzbl %cl,%edi
movzbl %al,%esi
movzbl -0x17(%rbp),%edx
call   1170 <mpz_mod@plt>
mov    -0x48(%rbp),%cl
mov    -0x48(%rbp),%al
movzbl %cl,%edi
movzbl %al,%esi
movzbl -0x17(%rbp),%edx
call   10b0 <mpz_invert@plt>
mov    -0x46(%rbp),%sil
mov    -0x50(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x50(%rbp),%rax
movslq -0x28(%rbp),%rcx
movzbl %sil,%edi
movzbl %dl,%esi
movzbl (%rax,%rcx,1),%edx
call   1100 <mpz_add@plt>
mov    -0x46(%rbp),%cl
mov    -0x46(%rbp),%al
movzbl %cl,%edi
movzbl %al,%esi
movzbl -0x17(%rbp),%edx
call   1170 <mpz_mod@plt>
mov    -0x46(%rbp),%cl
mov    -0x46(%rbp),%al
movzbl %cl,%edi
movzbl %al,%esi
movzbl -0x48(%rbp),%edx
call   1110 <mpz_mul@plt>
mov    -0x46(%rbp),%cl
mov    -0x46(%rbp),%al
movzbl %cl,%edi
movzbl %al,%esi
movzbl -0x17(%rbp),%edx
call   1170 <mpz_mod@plt>
mov    -0x48(%rbp),%dl
mov    0x18(%rbp),%cl
mov    -0x46(%rbp),%al
movzbl %dl,%edi
movzbl %cl,%esi
movzbl %al,%edx
movzbl -0x17(%rbp),%ecx
call   1080 <f@plt>
mov    -0x30(%rbp),%eax
mov    %eax,-0xa8(%rbp)
mov    -0x48(%rbp),%al
movzbl %al,%edi
movzbl -0x17(%rbp),%esi
call   11b0 <mpz_jacobi@plt>
mov    %eax,%ecx
mov    -0xa8(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0xffffffff,%edx
cmove  %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%ecx
movzbl -0x7a(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x7a(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    193a <Decrypt+0x68a>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
jmp    193f <Decrypt+0x68f>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1975 <Decrypt+0x6c5>
mov    -0x60(%rbp),%rdi
lea    0x6cc(%rip),%rsi
movzbl -0x7a(%rbp),%edx
call   10e0 <fprintf@plt>
jmp    197f <Decrypt+0x6cf>
movzbl -0x7a(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x7a(%rbp)
jmp    16b4 <Decrypt+0x404>
jmp    1578 <Decrypt+0x2c8>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    19bb <Decrypt+0x70b>
mov    -0x50(%rbp),%rax
movslq -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1180 <mpz_clear@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1990 <Decrypt+0x6e0>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
movzbl -0x43(%rbp),%edi
call   1180 <mpz_clear@plt>
movzbl -0x44(%rbp),%edi
call   1180 <mpz_clear@plt>
movzbl -0x48(%rbp),%edi
call   1180 <mpz_clear@plt>
movzbl -0x47(%rbp),%edi
call   1180 <mpz_clear@plt>
movzbl -0x46(%rbp),%edi
call   1180 <mpz_clear@plt>
movzbl -0x45(%rbp),%edi
call   1180 <mpz_clear@plt>
movzbl -0x42(%rbp),%edi
call   1180 <mpz_clear@plt>
movzbl -0x41(%rbp),%edi
call   1180 <mpz_clear@plt>
mov    -0x58(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x60(%rbp),%rdi
call   1060 <fclose@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Decrypt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9d,%r14d
mov    %rdx,0x18(%rsp)
mov    %rsi,%r15
mov    %rdi,%rbx
mov    0xb0(%rsp),%rbp
mov    0xa8(%rsp),%r12b
mov    0xa0(%rsp),%r13b
xor    %edi,%edi
call   10d0 <mpz_init@plt>
xor    %edi,%edi
call   10d0 <mpz_init@plt>
xor    %edi,%edi
call   10d0 <mpz_init@plt>
xor    %edi,%edi
call   10d0 <mpz_init@plt>
xor    %edi,%edi
call   10d0 <mpz_init@plt>
xor    %edi,%edi
call   10d0 <mpz_init@plt>
xor    %edi,%edi
call   10d0 <mpz_init@plt>
xor    %edi,%edi
call   10d0 <mpz_init@plt>
lea    0xcdd(%rip),%rsi
mov    %rbx,%rdi
call   1190 <fopen@plt>
mov    %rax,0x38(%rsp)
test   %rax,%rax
je     152b <Decrypt+0x27b>
lea    0xcd3(%rip),%rdi
lea    0xcdb(%rip),%rsi
call   1190 <fopen@plt>
mov    %rax,0x40(%rsp)
test   %rax,%rax
je     152b <Decrypt+0x27b>
mov    0x18(%rsp),%rdi
lea    0x7(%rdi),%ebx
test   %edi,%edi
cmovns %edi,%ebx
call   11c0 <sqrt@plt>
mov    %eax,%edi
call   1040 <ceil@plt>
mov    %eax,0xc(%rsp)
mov    %eax,%edi
call   1120 <malloc@plt>
mov    %rax,0x20(%rsp)
test   %rax,%rax
je     1534 <Decrypt+0x284>
sar    $0x3,%ebx
mov    %ebx,%edi
call   1120 <malloc@plt>
mov    %rax,0x28(%rsp)
test   %rax,%rax
je     1534 <Decrypt+0x284>
mov    %r15,%rdi
mov    %rbp,%rsi
call   11d0 <GetHash@plt>
mov    %rax,%r15
mov    0x0(%rbp),%rdi
lea    0xc6e(%rip),%rsi
call   10e0 <strcmp@plt>
test   %rax,%rax
jne    153f <Decrypt+0x28f>
mov    %r15,%rdi
mov    %rbp,%rsi
call   10a0 <GetHexHash@plt>
mov    %rax,%r15
mov    0x0(%rbp),%rdi
lea    0xc47(%rip),%rsi
call   10e0 <strcmp@plt>
test   %rax,%rax
jne    153f <Decrypt+0x28f>
mov    %ebx,0x8(%rsp)
xor    %edi,%edi
mov    %r15,%rsi
mov    $0x10,%edx
call   1130 <mpz_set_str@plt>
movzbl %r14b,%ebx
xor    %edi,%edi
xor    %esi,%esi
mov    %ebx,%edx
call   1170 <mpz_mod@plt>
mov    %ebx,%edi
xor    %esi,%esi
call   11a0 <GetJnHash@plt>
movzbl %r13b,%edx
xor    %edi,%edi
xor    %esi,%esi
call   1110 <mpz_mul@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %ebx,%edx
call   1170 <mpz_mod@plt>
movzbl %r12b,%esi
xor    %edi,%edi
mov    %esi,0x14(%rsp)
mov    $0x2,%edx
mov    %ebx,0x10(%rsp)
mov    %ebx,%ecx
call   1150 <mpz_powm_ui@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <mpz_set@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1160 <mpz_cmp@plt>
mov    %rax,0x50(%rsp)
test   %rax,%rax
jne    1474 <Decrypt+0x1c4>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <mpz_set@plt>
mov    0x38(%rsp),%rbp
mov    %rbp,%rdi
call   10f0 <feof@plt>
mov    0xc(%rsp),%ecx
mov    %rcx,0x30(%rsp)
test   %eax,%eax
mov    0x20(%rsp),%r12
mov    0x28(%rsp),%r13
mov    0x8(%rsp),%ecx
je     154e <Decrypt+0x29e>
cmpl   $0x0,0xc(%rsp)
mov    0x30(%rsp),%r14
jle    14c3 <Decrypt+0x213>
xor    %ebx,%ebx
xchg   %ax,%ax
movzbl (%r12,%rbx,1),%edi
call   1180 <mpz_clear@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    14b0 <Decrypt+0x200>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1180 <mpz_clear@plt>
xor    %edi,%edi
call   1180 <mpz_clear@plt>
xor    %edi,%edi
call   1180 <mpz_clear@plt>
xor    %edi,%edi
call   1180 <mpz_clear@plt>
xor    %edi,%edi
call   1180 <mpz_clear@plt>
xor    %edi,%edi
call   1180 <mpz_clear@plt>
xor    %edi,%edi
call   1180 <mpz_clear@plt>
xor    %edi,%edi
call   1180 <mpz_clear@plt>
mov    %rbp,%rdi
call   1060 <fclose@plt>
mov    0x40(%rsp),%rdi
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <fclose@plt>
lea    0xad0(%rip),%rax
jmp    153b <Decrypt+0x28b>
lea    0xae9(%rip),%rax
mov    %rax,0x0(%rbp)
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movslq 0xc(%rsp),%rax
mov    %rax,0x60(%rsp)
mov    %ecx,%eax
mov    %rax,0x48(%rsp)
mov    0x18(%rsp),%eax
mov    %rax,0x58(%rsp)
mov    %eax,0x8(%rsp)
jmp    1595 <Decrypt+0x2e5>
mov    0x8(%rsp),%ebp
mov    %ebp,0x8(%rsp)
mov    0x38(%rsp),%rbp
mov    %rbp,%rdi
call   10f0 <feof@plt>
test   %eax,%eax
mov    0x20(%rsp),%r12
mov    0x28(%rsp),%r13
jne    14a0 <Decrypt+0x1f0>
cmpl   $0x8,0x18(%rsp)
jl     15e0 <Decrypt+0x330>
xor    %ebx,%ebx
jmp    15b3 <Decrypt+0x303>
mov    %rbp,%rdi
call   1090 <fgetc@plt>
add    $0x1,%rbx
cmp    %rbx,0x48(%rsp)
je     15e0 <Decrypt+0x330>
mov    %rbp,%rdi
call   1090 <fgetc@plt>
mov    %rbp,%rdi
call   1090 <fgetc@plt>
mov    %al,0x0(%r13,%rbx,1)
mov    %rbp,%rdi
call   1090 <fgetc@plt>
cmpq   $0x0,0x50(%rsp)
je     15a0 <Decrypt+0x2f0>
mov    %al,0x0(%r13,%rbx,1)
jmp    15a0 <Decrypt+0x2f0>
nop
cmpl   $0x0,0xc(%rsp)
mov    0x30(%rsp),%r13
jle    1627 <Decrypt+0x377>
xor    %ebx,%ebx
xchg   %ax,%ax
movzbl (%r12,%rbx,1),%edi
call   10d0 <mpz_init@plt>
movzbl (%r12,%rbx,1),%edi
mov    %rbp,%rsi
mov    $0xa,%edx
call   1140 <mpz_inp_str@plt>
movzbl (%r12,%rbx,1),%edi
mov    %rbp,%rsi
mov    $0xa,%edx
call   1140 <mpz_inp_str@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    15f0 <Decrypt+0x340>
cmpl   $0x0,0x18(%rsp)
jle    156e <Decrypt+0x2be>
xor    %r13d,%r13d
mov    $0x1,%r12d
xor    %r15d,%r15d
mov    0x8(%rsp),%ebp
jmp    1661 <Decrypt+0x3b1>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    %bpl,%bpl
add    %r14b,%r14b
cmp    %r13,0x58(%rsp)
je     1572 <Decrypt+0x2c2>
test   $0x7,%r13b
je     16a0 <Decrypt+0x3f0>
cmp    0x60(%rsp),%r13
jge    16b9 <Decrypt+0x409>
mov    0x20(%rsp),%rax
movzbl (%rax,%r13,1),%edx
xor    %edi,%edi
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%ebx
mov    %ebx,%ecx
call   1080 <f@plt>
xor    %edi,%edi
mov    %ebx,%esi
call   11b0 <mpz_jacobi@plt>
jmp    179c <Decrypt+0x4ec>
nopw   0x0(%rax,%rax,1)
mov    %r13d,%eax
shr    $0x3,%eax
mov    0x28(%rsp),%rcx
movzbl (%rcx,%rax,1),%r14d
xor    %ebp,%ebp
cmp    0x60(%rsp),%r13
jl     166e <Decrypt+0x3be>
movslq %r12d,%r12
mov    %ebp,0x8(%rsp)
mov    0x20(%rsp),%rbp
movzbl 0x0(%rbp,%r12,1),%edx
xor    %edi,%edi
xor    %esi,%esi
call   1110 <mpz_mul@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r12,%rbx
mov    0x10(%rsp),%r12d
mov    %r12d,%edx
call   1170 <mpz_mod@plt>
movslq %r15d,%r15
movzbl 0x0(%rbp,%r15,1),%edx
xor    %edi,%edi
xor    %esi,%esi
call   1110 <mpz_mul@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r12d,%edx
call   1170 <mpz_mod@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1070 <mpz_add_ui@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r12d,%edx
call   1170 <mpz_mod@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r12d,%edx
call   10c0 <mpz_invert@plt>
movzbl 0x0(%rbp,%rbx,1),%esi
movzbl 0x0(%rbp,%r15,1),%edx
mov    0x8(%rsp),%ebp
xor    %edi,%edi
call   1100 <mpz_add@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r12d,%edx
call   1170 <mpz_mod@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1110 <mpz_mul@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r12d,%edx
call   1170 <mpz_mod@plt>
xor    %edi,%edi
mov    0x14(%rsp),%esi
xor    %edx,%edx
mov    %r12d,%ecx
call   1080 <f@plt>
xor    %edi,%edi
mov    %r12d,%esi
mov    %rbx,%r12
call   11b0 <mpz_jacobi@plt>
add    $0x1,%r15d
xor    %ecx,%ecx
cmp    0xc(%rsp),%r15d
sete   %cl
mov    $0x0,%edx
cmove  %edx,%r15d
add    %ecx,%r12d
mov    %eax,%ecx
neg    %ecx
test   %r14b,%r14b
cmovns %eax,%ecx
cmp    $0xffffffff,%ecx
sete   %al
or     %al,%bpl
add    $0x1,%r13
test   $0x7,%r13b
jne    1650 <Decrypt+0x3a0>
movsbl %bpl,%edi
mov    0x40(%rsp),%rsi
call   10b0 <fputc@plt>
jmp    1653 <Decrypt+0x3a3>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [17 x i8] c"file open failed\00"
@.str.2 = [15 x i8] c"decrypted_text\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [7 x i8] c"malloc\00"
@.str.5 = [8 x i8] c"success\00"
@.str.6 = [3 x i8] c"%c\00"
define void @Decrypt(i8* %0, i8* %1, i32 %2, i8 zeroext %3, i8 zeroext %4, i8 zeroext %5, i8 zeroext %6, i8 zeroext %7, i8** %8) {
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8
%14 = alloca i8
%15 = alloca i8
%16 = alloca i8
%17 = alloca i8
%18 = alloca i8**
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i8
%30 = alloca i8
%31 = alloca i8
%32 = alloca i8
%33 = alloca i8
%34 = alloca i8
%35 = alloca i8
%36 = alloca i8
%37 = alloca i8*
%38 = alloca i32*
%39 = alloca i32*
%40 = alloca i8*
%41 = alloca i8*
%42 = alloca i8*
%43 = alloca i8
%44 = alloca i8
store i8* %0, i8** %10
store i8* %1, i8** %11
store i32 %2, i32* %12
store i8 %3, i8* %13
store i8 %4, i8* %14
store i8 %5, i8* %15
store i8 %6, i8* %16
store i8 %7, i8* %17
store i8** %8, i8*** %18
%45 = load i8, i8* %31
%46 = call i32 @mpz_init(i8 zeroext %45)
%47 = load i8, i8* %32
%48 = call i32 @mpz_init(i8 zeroext %47)
%49 = load i8, i8* %29
%50 = call i32 @mpz_init(i8 zeroext %49)
%51 = load i8, i8* %30
%52 = call i32 @mpz_init(i8 zeroext %51)
%53 = load i8, i8* %33
%54 = call i32 @mpz_init(i8 zeroext %53)
%55 = load i8, i8* %34
%56 = call i32 @mpz_init(i8 zeroext %55)
%57 = load i8, i8* %35
%58 = call i32 @mpz_init(i8 zeroext %57)
%59 = load i8, i8* %36
%60 = call i32 @mpz_init(i8 zeroext %59)
%61 = load i8*, i8** %10
%62 = call i32* @fopen(i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %62, i32** %38
%63 = load i32*, i32** %38
%64 = icmp eq i32* %63, null
br i1 %64, label %65, label %67
65: ; preds = %9
%66 = load i8**, i8*** %18
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %66
br label %434
67: ; preds = %9
%68 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %68, i32** %39
%69 = load i32*, i32** %39
%70 = icmp eq i32* %69, null
br i1 %70, label %71, label %73
71: ; preds = %67
%72 = load i8**, i8*** %18
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %72
br label %434
73: ; preds = %67
%74 = load i32, i32* %12
%75 = sdiv i32 %74, 8
store i32 %75, i32* %27
%76 = load i32, i32* %12
%77 = call i32 @sqrt(i32 %76)
%78 = call i32 @ceil(i32 %77)
store i32 %78, i32* %19
%79 = load i32, i32* %19
%80 = sext i32 %79 to i64
%81 = mul i64 %80, 1
%82 = trunc i64 %81 to i32
%83 = call i64 @malloc(i32 %82)
%84 = inttoptr i64 %83 to i8*
store i8* %84, i8** %37
%85 = load i8*, i8** %37
%86 = icmp eq i8* %85, null
br i1 %86, label %87, label %89
87: ; preds = %73
%88 = load i8**, i8*** %18
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %88
br label %434
89: ; preds = %73
%90 = load i32, i32* %27
%91 = sext i32 %90 to i64
%92 = mul i64 %91, 1
%93 = trunc i64 %92 to i32
%94 = call i64 @malloc(i32 %93)
%95 = inttoptr i64 %94 to i8*
store i8* %95, i8** %42
%96 = load i8*, i8** %42
%97 = icmp eq i8* %96, null
br i1 %97, label %98, label %100
98: ; preds = %89
%99 = load i8**, i8*** %18
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %99
br label %434
100: ; preds = %89
%101 = load i8*, i8** %11
%102 = load i8**, i8*** %18
%103 = call i8* @GetHash(i8* %101, i8** %102)
store i8* %103, i8** %40
%104 = load i8**, i8*** %18
%105 = load i8*, i8** %104
%106 = call i64 @strcmp(i8* %105, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%107 = icmp ne i64 %106, 0
br i1 %107, label %108, label %109
108: ; preds = %100
br label %434
109: ; preds = %100
%110 = load i8*, i8** %40
%111 = load i8**, i8*** %18
%112 = call i8* @GetHexHash(i8* %110, i8** %111)
store i8* %112, i8** %41
%113 = load i8**, i8*** %18
%114 = load i8*, i8** %113
%115 = call i64 @strcmp(i8* %114, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%116 = icmp ne i64 %115, 0
br i1 %116, label %117, label %118
117: ; preds = %109
br label %434
118: ; preds = %109
%119 = load i8, i8* %31
%120 = load i8*, i8** %41
%121 = call i32 @mpz_set_str(i8 zeroext %119, i8* %120, i32 16)
%122 = load i8, i8* %31
%123 = load i8, i8* %31
%124 = load i8, i8* %15
%125 = call i32 @mpz_mod(i8 zeroext %122, i8 zeroext %123, i8 zeroext %124)
%126 = load i8, i8* %15
%127 = load i8, i8* %31
%128 = call i32 @GetJnHash(i8 zeroext %126, i8 zeroext %127)
%129 = load i8, i8* %32
%130 = load i8, i8* %31
%131 = load i8, i8* %16
%132 = call i32 @mpz_mul(i8 zeroext %129, i8 zeroext %130, i8 zeroext %131)
%133 = load i8, i8* %32
%134 = load i8, i8* %32
%135 = load i8, i8* %15
%136 = call i32 @mpz_mod(i8 zeroext %133, i8 zeroext %134, i8 zeroext %135)
%137 = load i8, i8* %29
%138 = load i8, i8* %17
%139 = load i8, i8* %15
%140 = call i32 @mpz_powm_ui(i8 zeroext %137, i8 zeroext %138, i32 2, i8 zeroext %139)
store i32 2, i32* %28
%141 = load i8, i8* %33
%142 = load i8, i8* %32
%143 = call i32 @mpz_set(i8 zeroext %141, i8 zeroext %142)
%144 = load i8, i8* %29
%145 = load i8, i8* %31
%146 = call i64 @mpz_cmp(i8 zeroext %144, i8 zeroext %145)
%147 = icmp eq i64 %146, 0
br i1 %147, label %148, label %152
148: ; preds = %118
store i32 1, i32* %28
%149 = load i8, i8* %33
%150 = load i8, i8* %31
%151 = call i32 @mpz_set(i8 zeroext %149, i8 zeroext %150)
br label %152
152: ; preds = %148, %118
br label %153
153: ; preds = %393, %152
%154 = load i32*, i32** %38
%155 = call i32 @feof(i32* %154)
%156 = icmp ne i32 %155, 0
%157 = xor i1 %156, true
br i1 %157, label %158, label %394
158: ; preds = %153
store i32 0, i32* %20
br label %159
159: ; preds = %189, %158
%160 = load i32, i32* %20
%161 = load i32, i32* %27
%162 = icmp slt i32 %160, %161
br i1 %162, label %163, label %192
163: ; preds = %159
%164 = load i32*, i32** %38
%165 = call i64 @fgetc(i32* %164)
%166 = load i32*, i32** %38
%167 = call i64 @fgetc(i32* %166)
%168 = trunc i64 %167 to i8
%169 = load i8*, i8** %42
%170 = load i32, i32* %20
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds i8, i8* %169, i64 %171
store i8 %168, i8* %172
%173 = load i32, i32* %28
%174 = icmp eq i32 %173, 2
br i1 %174, label %175, label %183
175: ; preds = %163
%176 = load i32*, i32** %38
%177 = call i64 @fgetc(i32* %176)
%178 = trunc i64 %177 to i8
%179 = load i8*, i8** %42
%180 = load i32, i32* %20
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds i8, i8* %179, i64 %181
store i8 %178, i8* %182
br label %186
183: ; preds = %163
%184 = load i32*, i32** %38
%185 = call i64 @fgetc(i32* %184)
br label %186
186: ; preds = %183, %175
%187 = load i32*, i32** %38
%188 = call i64 @fgetc(i32* %187)
br label %189
189: ; preds = %186
%190 = load i32, i32* %20
%191 = add nsw i32 %190, 1
store i32 %191, i32* %20
br label %159
192: ; preds = %159
store i32 0, i32* %20
br label %193
193: ; preds = %226, %192
%194 = load i32, i32* %20
%195 = load i32, i32* %19
%196 = icmp slt i32 %194, %195
br i1 %196, label %197, label %229
197: ; preds = %193
%198 = load i8*, i8** %37
%199 = load i32, i32* %20
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds i8, i8* %198, i64 %200
%202 = load i8, i8* %201
%203 = call i32 @mpz_init(i8 zeroext %202)
%204 = load i8*, i8** %37
%205 = load i32, i32* %20
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds i8, i8* %204, i64 %206
%208 = load i8, i8* %207
%209 = load i32*, i32** %38
%210 = call i32 @mpz_inp_str(i8 zeroext %208, i32* %209, i32 10)
%211 = load i32, i32* %28
%212 = icmp eq i32 %211, 2
br i1 %212, label %213, label %221
213: ; preds = %197
%214 = load i8*, i8** %37
%215 = load i32, i32* %20
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds i8, i8* %214, i64 %216
%218 = load i8, i8* %217
%219 = load i32*, i32** %38
%220 = call i32 @mpz_inp_str(i8 zeroext %218, i32* %219, i32 10)
br label %225
221: ; preds = %197
%222 = load i8, i8* %36
%223 = load i32*, i32** %38
%224 = call i32 @mpz_inp_str(i8 zeroext %222, i32* %223, i32 10)
br label %225
225: ; preds = %221, %213
br label %226
226: ; preds = %225
%227 = load i32, i32* %20
%228 = add nsw i32 %227, 1
store i32 %228, i32* %20
br label %193
229: ; preds = %193
store i32 0, i32* %20
store i32 1, i32* %21
store i32 0, i32* %22
br label %230
230: ; preds = %392, %229
%231 = load i32, i32* %20
%232 = load i32, i32* %12
%233 = icmp slt i32 %231, %232
br i1 %233, label %234, label %393
234: ; preds = %230
%235 = load i32, i32* %20
%236 = srem i32 %235, 8
%237 = icmp eq i32 %236, 0
br i1 %237, label %238, label %251
238: ; preds = %234
%239 = load i8, i8* %44
%240 = zext i8 %239 to i32
%241 = load i8, i8* %44
%242 = zext i8 %241 to i32
%243 = xor i32 %242, %240
%244 = trunc i32 %243 to i8
store i8 %244, i8* %44
%245 = load i8*, i8** %42
%246 = load i32, i32* %20
%247 = sdiv i32 %246, 8
%248 = sext i32 %247 to i64
%249 = getelementptr inbounds i8, i8* %245, i64 %248
%250 = load i8, i8* %249
store i8 %250, i8* %43
br label %251
251: ; preds = %238, %234
%252 = load i8, i8* %43
%253 = zext i8 %252 to i32
%254 = and i32 128, %253
%255 = icmp eq i32 %254, 0
%256 = zext i1 %255 to i64
%257 = select i1 %255, i32 1, i32 -1
store i32 %257, i32* %24
%258 = load i8, i8* %43
%259 = zext i8 %258 to i32
%260 = shl i32 %259, 1
%261 = trunc i32 %260 to i8
store i8 %261, i8* %43
%262 = load i32, i32* %20
%263 = load i32, i32* %19
%264 = icmp slt i32 %262, %263
br i1 %264, label %265, label %289
265: ; preds = %251
%266 = load i8, i8* %36
%267 = load i8, i8* %17
%268 = load i8*, i8** %37
%269 = load i32, i32* %20
%270 = sext i32 %269 to i64
%271 = getelementptr inbounds i8, i8* %268, i64 %270
%272 = load i8, i8* %271
%273 = load i8, i8* %15
%274 = call i32 @f(i8 zeroext %266, i8 zeroext %267, i8 zeroext %272, i8 zeroext %273)
%275 = load i32, i32* %24
%276 = load i8, i8* %36
%277 = load i8, i8* %15
%278 = call i32 @mpz_jacobi(i8 zeroext %276, i8 zeroext %277)
%279 = mul nsw i32 %275, %278
store i32 %279, i32* %25
%280 = load i32, i32* %25
%281 = icmp eq i32 %280, -1
%282 = zext i1 %281 to i64
%283 = select i1 %281, i32 1, i32 0
store i32 %283, i32* %26
%284 = load i32, i32* %26
%285 = load i8, i8* %44
%286 = zext i8 %285 to i32
%287 = or i32 %286, %284
%288 = trunc i32 %287 to i8
store i8 %288, i8* %44
br label %377
289: ; preds = %251
%290 = load i8, i8* %36
%291 = load i8, i8* %33
%292 = load i8*, i8** %37
%293 = load i32, i32* %21
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds i8, i8* %292, i64 %294
%296 = load i8, i8* %295
%297 = call i32 @mpz_mul(i8 zeroext %290, i8 zeroext %291, i8 zeroext %296)
%298 = load i8, i8* %36
%299 = load i8, i8* %36
%300 = load i8, i8* %15
%301 = call i32 @mpz_mod(i8 zeroext %298, i8 zeroext %299, i8 zeroext %300)
%302 = load i8, i8* %36
%303 = load i8, i8* %36
%304 = load i8*, i8** %37
%305 = load i32, i32* %22
%306 = sext i32 %305 to i64
%307 = getelementptr inbounds i8, i8* %304, i64 %306
%308 = load i8, i8* %307
%309 = call i32 @mpz_mul(i8 zeroext %302, i8 zeroext %303, i8 zeroext %308)
%310 = load i8, i8* %36
%311 = load i8, i8* %36
%312 = load i8, i8* %15
%313 = call i32 @mpz_mod(i8 zeroext %310, i8 zeroext %311, i8 zeroext %312)
%314 = load i8, i8* %36
%315 = load i8, i8* %36
%316 = call i32 @mpz_add_ui(i8 zeroext %314, i8 zeroext %315, i32 1)
%317 = load i8, i8* %36
%318 = load i8, i8* %36
%319 = load i8, i8* %15
%320 = call i32 @mpz_mod(i8 zeroext %317, i8 zeroext %318, i8 zeroext %319)
%321 = load i8, i8* %36
%322 = load i8, i8* %36
%323 = load i8, i8* %15
%324 = call i32 @mpz_invert(i8 zeroext %321, i8 zeroext %322, i8 zeroext %323)
%325 = load i8, i8* %34
%326 = load i8*, i8** %37
%327 = load i32, i32* %21
%328 = sext i32 %327 to i64
%329 = getelementptr inbounds i8, i8* %326, i64 %328
%330 = load i8, i8* %329
%331 = load i8*, i8** %37
%332 = load i32, i32* %22
%333 = sext i32 %332 to i64
%334 = getelementptr inbounds i8, i8* %331, i64 %333
%335 = load i8, i8* %334
%336 = call i32 @mpz_add(i8 zeroext %325, i8 zeroext %330, i8 zeroext %335)
%337 = load i8, i8* %34
%338 = load i8, i8* %34
%339 = load i8, i8* %15
%340 = call i32 @mpz_mod(i8 zeroext %337, i8 zeroext %338, i8 zeroext %339)
%341 = load i8, i8* %34
%342 = load i8, i8* %34
%343 = load i8, i8* %36
%344 = call i32 @mpz_mul(i8 zeroext %341, i8 zeroext %342, i8 zeroext %343)
%345 = load i8, i8* %34
%346 = load i8, i8* %34
%347 = load i8, i8* %15
%348 = call i32 @mpz_mod(i8 zeroext %345, i8 zeroext %346, i8 zeroext %347)
%349 = load i8, i8* %36
%350 = load i8, i8* %17
%351 = load i8, i8* %34
%352 = load i8, i8* %15
%353 = call i32 @f(i8 zeroext %349, i8 zeroext %350, i8 zeroext %351, i8 zeroext %352)
%354 = load i32, i32* %24
%355 = load i8, i8* %36
%356 = load i8, i8* %15
%357 = call i32 @mpz_jacobi(i8 zeroext %355, i8 zeroext %356)
%358 = mul nsw i32 %354, %357
store i32 %358, i32* %25
%359 = load i32, i32* %25
%360 = icmp eq i32 %359, -1
%361 = zext i1 %360 to i64
%362 = select i1 %360, i32 1, i32 0
store i32 %362, i32* %26
%363 = load i32, i32* %26
%364 = load i8, i8* %44
%365 = zext i8 %364 to i32
%366 = or i32 %365, %363
%367 = trunc i32 %366 to i8
store i8 %367, i8* %44
%368 = load i32, i32* %22
%369 = add nsw i32 %368, 1
store i32 %369, i32* %22
%370 = load i32, i32* %22
%371 = load i32, i32* %19
%372 = icmp eq i32 %370, %371
br i1 %372, label %373, label %376
373: ; preds = %289
%374 = load i32, i32* %21
%375 = add nsw i32 %374, 1
store i32 %375, i32* %21
store i32 0, i32* %22
br label %376
376: ; preds = %373, %289
br label %377
377: ; preds = %376, %265
%378 = load i32, i32* %20
%379 = add nsw i32 %378, 1
store i32 %379, i32* %20
%380 = load i32, i32* %20
%381 = srem i32 %380, 8
%382 = icmp eq i32 %381, 0
br i1 %382, label %383, label %387
383: ; preds = %377
%384 = load i32*, i32** %39
%385 = load i8, i8* %44
%386 = call i32 @fprintf(i32* %384, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8 zeroext %385)
br label %392
387: ; preds = %377
%388 = load i8, i8* %44
%389 = zext i8 %388 to i32
%390 = shl i32 %389, 1
%391 = trunc i32 %390 to i8
store i8 %391, i8* %44
br label %392
392: ; preds = %387, %383
br label %230
393: ; preds = %230
br label %153
394: ; preds = %153
store i32 0, i32* %20
br label %395
395: ; preds = %406, %394
%396 = load i32, i32* %20
%397 = load i32, i32* %19
%398 = icmp slt i32 %396, %397
br i1 %398, label %399, label %409
399: ; preds = %395
%400 = load i8*, i8** %37
%401 = load i32, i32* %20
%402 = sext i32 %401 to i64
%403 = getelementptr inbounds i8, i8* %400, i64 %402
%404 = load i8, i8* %403
%405 = call i32 @mpz_clear(i8 zeroext %404)
br label %406
406: ; preds = %399
%407 = load i32, i32* %20
%408 = add nsw i32 %407, 1
store i32 %408, i32* %20
br label %395
409: ; preds = %395
%410 = load i8*, i8** %37
%411 = call i32 @free(i8* %410)
%412 = load i8*, i8** %42
%413 = call i32 @free(i8* %412)
%414 = load i8, i8* %31
%415 = call i32 @mpz_clear(i8 zeroext %414)
%416 = load i8, i8* %32
%417 = call i32 @mpz_clear(i8 zeroext %416)
%418 = load i8, i8* %36
%419 = call i32 @mpz_clear(i8 zeroext %418)
%420 = load i8, i8* %35
%421 = call i32 @mpz_clear(i8 zeroext %420)
%422 = load i8, i8* %34
%423 = call i32 @mpz_clear(i8 zeroext %422)
%424 = load i8, i8* %33
%425 = call i32 @mpz_clear(i8 zeroext %424)
%426 = load i8, i8* %30
%427 = call i32 @mpz_clear(i8 zeroext %426)
%428 = load i8, i8* %29
%429 = call i32 @mpz_clear(i8 zeroext %428)
%430 = load i32*, i32** %38
%431 = call i32 @fclose(i32* %430)
%432 = load i32*, i32** %39
%433 = call i32 @fclose(i32* %432)
br label %434
434: ; preds = %409, %117, %108, %98, %87, %71, %65
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [17 x i8] c"file open failed\00"
@.str.2 = [15 x i8] c"decrypted_text\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [7 x i8] c"malloc\00"
@.str.5 = [8 x i8] c"success\00"
define void @Decrypt(i8* nocapture %0, i8* %1, i32 %2, i8 zeroext %3, i8 zeroext %4, i8 zeroext %5, i8 zeroext %6, i8 zeroext %7, i8** %8) {
%10 = tail call i32 @mpz_init(i8 zeroext undef)
%11 = tail call i32 @mpz_init(i8 zeroext undef)
%12 = tail call i32 @mpz_init(i8 zeroext undef)
%13 = tail call i32 @mpz_init(i8 zeroext undef)
%14 = tail call i32 @mpz_init(i8 zeroext undef)
%15 = tail call i32 @mpz_init(i8 zeroext undef)
%16 = tail call i32 @mpz_init(i8 zeroext undef)
%17 = tail call i32 @mpz_init(i8 zeroext undef)
%18 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %21
20: ; preds = %9
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %8
br label %201
21: ; preds = %9
%22 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %25
24: ; preds = %21
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %8
br label %201
25: ; preds = %21
%26 = sdiv i32 %2, 8
%27 = tail call i32 @sqrt(i32 %2)
%28 = tail call i32 @ceil(i32 %27)
%29 = tail call i64 @malloc(i32 %28)
%30 = inttoptr i64 %29 to i8*
%31 = icmp eq i64 %29, 0
br i1 %31, label %32, label %33
32: ; preds = %25
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %8
br label %201
33: ; preds = %25
%34 = tail call i64 @malloc(i32 %26)
%35 = inttoptr i64 %34 to i8*
%36 = icmp eq i64 %34, 0
br i1 %36, label %37, label %38
37: ; preds = %33
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %8
br label %201
38: ; preds = %33
%39 = tail call i8* @GetHash(i8* %1, i8** %8)
%40 = load i8*, i8** %8
%41 = tail call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %201
43: ; preds = %38
%44 = tail call i8* @GetHexHash(i8* %39, i8** %8)
%45 = load i8*, i8** %8
%46 = tail call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %201
48: ; preds = %43
%49 = tail call i32 @mpz_set_str(i8 zeroext undef, i8* %44, i32 16)
%50 = tail call i32 @mpz_mod(i8 zeroext undef, i8 zeroext undef, i8 zeroext %5)
%51 = tail call i32 @GetJnHash(i8 zeroext %5, i8 zeroext undef)
%52 = tail call i32 @mpz_mul(i8 zeroext undef, i8 zeroext undef, i8 zeroext %6)
%53 = tail call i32 @mpz_mod(i8 zeroext undef, i8 zeroext undef, i8 zeroext %5)
%54 = tail call i32 @mpz_powm_ui(i8 zeroext undef, i8 zeroext %7, i32 2, i8 zeroext %5)
%55 = tail call i32 @mpz_set(i8 zeroext undef, i8 zeroext undef)
%56 = tail call i64 @mpz_cmp(i8 zeroext undef, i8 zeroext undef)
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %60
58: ; preds = %48
%59 = tail call i32 @mpz_set(i8 zeroext undef, i8 zeroext undef)
br label %60
60: ; preds = %58, %48
%61 = tail call i32 @feof(i32* %18)
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %80
63: ; preds = %60
%64 = icmp sgt i32 %2, 7
%65 = icmp sgt i32 %28, 0
%66 = icmp sgt i32 %2, 0
%67 = sext i32 %28 to i64
%68 = zext i32 %26 to i64
%69 = zext i32 %28 to i64
%70 = zext i32 %2 to i64
%71 = xor i1 %57, true
br label %77
72: ; preds = %178, %98
%73 = phi i8 [ %79, %98 ], [ %127, %178 ]
%74 = phi i8 [ %78, %98 ], [ %179, %178 ]
%75 = tail call i32 @feof(i32* %18)
%76 = icmp eq i32 %75, 0
br i1 %76, label %77, label %80
77: ; preds = %63, %72
%78 = phi i8 [ undef, %63 ], [ %74, %72 ]
%79 = phi i8 [ undef, %63 ], [ %73, %72 ]
br i1 %64, label %85, label %84
80: ; preds = %72, %60
%81 = icmp sgt i32 %28, 0
br i1 %81, label %82, label %188
82: ; preds = %80
%83 = zext i32 %28 to i64
br label %181
84: ; preds = %94, %77
br i1 %65, label %99, label %98
85: ; preds = %77, %94
%86 = phi i64 [ %96, %94 ], [ 0, %77 ]
%87 = tail call i64 @fgetc(i32* %18)
%88 = tail call i64 @fgetc(i32* %18)
%89 = trunc i64 %88 to i8
%90 = getelementptr inbounds i8, i8* %35, i64 %86
store i8 %89, i8* %90
%91 = tail call i64 @fgetc(i32* %18)
br i1 %57, label %94, label %92
92: ; preds = %85
%93 = trunc i64 %91 to i8
store i8 %93, i8* %90
br label %94
94: ; preds = %85, %92
%95 = tail call i64 @fgetc(i32* %18)
%96 = add nuw nsw i64 %86, 1
%97 = icmp eq i64 %96, %68
br i1 %97, label %84, label %85
98: ; preds = %99, %84
br i1 %66, label %110, label %72
99: ; preds = %84, %99
%100 = phi i64 [ %108, %99 ], [ 0, %84 ]
%101 = getelementptr inbounds i8, i8* %30, i64 %100
%102 = load i8, i8* %101
%103 = tail call i32 @mpz_init(i8 zeroext %102)
%104 = load i8, i8* %101
%105 = tail call i32 @mpz_inp_str(i8 zeroext %104, i32* %18, i32 10)
%106 = load i8, i8* %101
%107 = tail call i32 @mpz_inp_str(i8 zeroext %106, i32* %18, i32 10)
%108 = add nuw nsw i64 %100, 1
%109 = icmp eq i64 %108, %69
br i1 %109, label %98, label %99
110: ; preds = %98, %178
%111 = phi i64 [ %170, %178 ], [ 0, %98 ]
%112 = phi i8 [ %179, %178 ], [ %78, %98 ]
%113 = phi i8 [ %127, %178 ], [ %79, %98 ]
%114 = phi i32 [ %163, %178 ], [ 1, %98 ]
%115 = phi i32 [ %162, %178 ], [ 0, %98 ]
%116 = and i64 %111, 7
%117 = icmp eq i64 %116, 0
br i1 %117, label %118, label %123
118: ; preds = %110
%119 = lshr i64 %111, 3
%120 = and i64 %119, 536870911
%121 = getelementptr inbounds i8, i8* %35, i64 %120
%122 = load i8, i8* %121
br label %123
123: ; preds = %118, %110
%124 = phi i8 [ %122, %118 ], [ %113, %110 ]
%125 = phi i8 [ 0, %118 ], [ %112, %110 ]
%126 = icmp sgt i8 %124, -1
%127 = shl i8 %124, 1
%128 = icmp slt i64 %111, %67
br i1 %128, label %129, label %134
129: ; preds = %123
%130 = getelementptr inbounds i8, i8* %30, i64 %111
%131 = load i8, i8* %130
%132 = tail call i32 @f(i8 zeroext undef, i8 zeroext %7, i8 zeroext %131, i8 zeroext %5)
%133 = tail call i32 @mpz_jacobi(i8 zeroext undef, i8 zeroext %5)
br label %161
134: ; preds = %123
%135 = sext i32 %114 to i64
%136 = getelementptr inbounds i8, i8* %30, i64 %135
%137 = load i8, i8* %136
%138 = tail call i32 @mpz_mul(i8 zeroext undef, i8 zeroext undef, i8 zeroext %137)
%139 = tail call i32 @mpz_mod(i8 zeroext undef, i8 zeroext undef, i8 zeroext %5)
%140 = sext i32 %115 to i64
%141 = getelementptr inbounds i8, i8* %30, i64 %140
%142 = load i8, i8* %141
%143 = tail call i32 @mpz_mul(i8 zeroext undef, i8 zeroext undef, i8 zeroext %142)
%144 = tail call i32 @mpz_mod(i8 zeroext undef, i8 zeroext undef, i8 zeroext %5)
%145 = tail call i32 @mpz_add_ui(i8 zeroext undef, i8 zeroext undef, i32 1)
%146 = tail call i32 @mpz_mod(i8 zeroext undef, i8 zeroext undef, i8 zeroext %5)
%147 = tail call i32 @mpz_invert(i8 zeroext undef, i8 zeroext undef, i8 zeroext %5)
%148 = load i8, i8* %136
%149 = load i8, i8* %141
%150 = tail call i32 @mpz_add(i8 zeroext undef, i8 zeroext %148, i8 zeroext %149)
%151 = tail call i32 @mpz_mod(i8 zeroext undef, i8 zeroext undef, i8 zeroext %5)
%152 = tail call i32 @mpz_mul(i8 zeroext undef, i8 zeroext undef, i8 zeroext undef)
%153 = tail call i32 @mpz_mod(i8 zeroext undef, i8 zeroext undef, i8 zeroext %5)
%154 = tail call i32 @f(i8 zeroext undef, i8 zeroext %7, i8 zeroext undef, i8 zeroext %5)
%155 = tail call i32 @mpz_jacobi(i8 zeroext undef, i8 zeroext %5)
%156 = add nsw i32 %115, 1
%157 = icmp eq i32 %156, %28
%158 = select i1 %157, i32 0, i32 %156
%159 = zext i1 %157 to i32
%160 = add nsw i32 %114, %159
br label %161
161: ; preds = %134, %129
%162 = phi i32 [ %115, %129 ], [ %158, %134 ]
%163 = phi i32 [ %114, %129 ], [ %160, %134 ]
%164 = phi i32 [ %133, %129 ], [ %155, %134 ]
%165 = sub nsw i32 0, %164
%166 = select i1 %126, i32 %164, i32 %165
%167 = icmp eq i32 %166, -1
%168 = zext i1 %167 to i8
%169 = or i8 %125, %168
%170 = add nuw nsw i64 %111, 1
%171 = and i64 %170, 7
%172 = icmp eq i64 %171, 0
br i1 %172, label %173, label %176
173: ; preds = %161
%174 = sext i8 %169 to i32
%175 = tail call i32 @fputc(i32 %174, i32* %22)
br label %178
176: ; preds = %161
%177 = shl i8 %169, 1
br label %178
178: ; preds = %176, %173
%179 = phi i8 [ %169, %173 ], [ %177, %176 ]
%180 = icmp eq i64 %170, %70
br i1 %180, label %72, label %110
181: ; preds = %82, %181
%182 = phi i64 [ 0, %82 ], [ %186, %181 ]
%183 = getelementptr inbounds i8, i8* %30, i64 %182
%184 = load i8, i8* %183
%185 = tail call i32 @mpz_clear(i8 zeroext %184)
%186 = add nuw nsw i64 %182, 1
%187 = icmp eq i64 %186, %83
br i1 %187, label %188, label %181
188: ; preds = %181, %80
%189 = tail call i32 @free(i8* %30)
%190 = tail call i32 @free(i8* %35)
%191 = tail call i32 @mpz_clear(i8 zeroext undef)
%192 = tail call i32 @mpz_clear(i8 zeroext undef)
%193 = tail call i32 @mpz_clear(i8 zeroext undef)
%194 = tail call i32 @mpz_clear(i8 zeroext undef)
%195 = tail call i32 @mpz_clear(i8 zeroext undef)
%196 = tail call i32 @mpz_clear(i8 zeroext undef)
%197 = tail call i32 @mpz_clear(i8 zeroext undef)
%198 = tail call i32 @mpz_clear(i8 zeroext undef)
%199 = tail call i32 @fclose(i32* %18)
%200 = tail call i32 @fclose(i32* %22)
br label %201
201: ; preds = %43, %38, %188, %37, %32, %24, %20
ret void
}