#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 int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ gmp_printf(char *, int /*<<< orphan*/, ...);
int /*<<< orphan*/ mpz_gcd(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_gcdext(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_powm(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_powm_ui(int /*<<< orphan*/, int /*<<< orphan*/, int,
                               int /*<<< orphan*/);
int /*<<< orphan*/ mpz_set_str(int /*<<< orphan*/, char *, int);
int main(int argc, char **argv) {
  mpz_t n, e_a, e_b, r, s, mcd, c_a, c_b, m, ca_powr, cb_pows;
  mpz_init(n);
  mpz_init(e_a);
  mpz_init(e_b);
  mpz_init(r);
  mpz_init(s);
  mpz_init(mcd);
  mpz_init(c_a);
  mpz_init(c_b);
  mpz_init(m);
  mpz_init(ca_powr);
  mpz_init(cb_pows);
  mpz_set_str(n,
              "7348323281164651966928382835644791453393993160707443504812498553"
              "42603693301556011015131519",
              10);
  mpz_set_str(c_a,
              "9373470940586005931521789398874924310543516909306974019281593975"
              "0720282941641642747093171",
              10);
  mpz_set_str(c_b,
              "2691254999276767664181707619353697559350256543578907746911676686"
              "82175704132138220498309902",
              10);
  mpz_set_str(e_a, "17", 10);
  mpz_set_str(e_b, "65537", 10);
  mpz_gcdext(mcd, r, s, e_a, e_b);
  gmp_printf("mcd(e_a,e_b): %Zd | r: %Zd | s: %Zd\n", mcd, r, s);
  mpz_gcd(mcd, c_b, n);
  gmp_printf("mcd(c_b,n): %Zd \n\n", mcd);
  mpz_powm(ca_powr, c_a, r, n);
  mpz_powm(cb_pows, c_b, s, n);
  mpz_mul(m, ca_powr, cb_pows);
  mpz_powm_ui(m, m, 1, n);
  gmp_printf("c_a: %Zd\n\nc_b: %Zd\n\n", c_a, c_b);
  gmp_printf("ca_powr: %Zd\n\ncb_pows: %Zd\n\n", ca_powr, cb_pows);
  gmp_printf("m: %Zd\n\n", m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <mpz_init@plt>
mov    -0x18(%rbp),%edi
call   1050 <mpz_init@plt>
mov    -0x1c(%rbp),%edi
call   1050 <mpz_init@plt>
mov    -0x20(%rbp),%edi
call   1050 <mpz_init@plt>
mov    -0x24(%rbp),%edi
call   1050 <mpz_init@plt>
mov    -0x28(%rbp),%edi
call   1050 <mpz_init@plt>
mov    -0x2c(%rbp),%edi
call   1050 <mpz_init@plt>
mov    -0x30(%rbp),%edi
call   1050 <mpz_init@plt>
mov    -0x34(%rbp),%edi
call   1050 <mpz_init@plt>
mov    -0x38(%rbp),%edi
call   1050 <mpz_init@plt>
mov    -0x3c(%rbp),%edi
call   1050 <mpz_init@plt>
mov    -0x14(%rbp),%edi
lea    0xe08(%rip),%rsi
mov    $0xa,%edx
call   1070 <mpz_set_str@plt>
mov    -0x2c(%rbp),%edi
lea    0xe4f(%rip),%rsi
mov    $0xa,%edx
call   1070 <mpz_set_str@plt>
mov    -0x30(%rbp),%edi
lea    0xe95(%rip),%rsi
mov    $0xa,%edx
call   1070 <mpz_set_str@plt>
mov    -0x18(%rbp),%edi
lea    0xedc(%rip),%rsi
mov    $0xa,%edx
call   1070 <mpz_set_str@plt>
mov    -0x1c(%rbp),%edi
lea    0xecb(%rip),%rsi
mov    $0xa,%edx
call   1070 <mpz_set_str@plt>
mov    -0x28(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
call   1040 <mpz_gcdext@plt>
mov    -0x28(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   10a0 <gmp_printf@plt>
mov    -0x28(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1090 <mpz_gcd@plt>
mov    -0x28(%rbp),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   10a0 <gmp_printf@plt>
mov    -0x38(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <mpz_powm@plt>
mov    -0x3c(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <mpz_powm@plt>
mov    -0x34(%rbp),%edi
mov    -0x38(%rbp),%esi
mov    -0x3c(%rbp),%edx
call   1060 <mpz_mul@plt>
mov    -0x34(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
call   1080 <mpz_powm_ui@plt>
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   10a0 <gmp_printf@plt>
mov    -0x38(%rbp),%esi
mov    -0x3c(%rbp),%edx
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   10a0 <gmp_printf@plt>
mov    -0x34(%rbp),%esi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   10a0 <gmp_printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1050 <mpz_init@plt>
call   1050 <mpz_init@plt>
call   1050 <mpz_init@plt>
call   1050 <mpz_init@plt>
call   1050 <mpz_init@plt>
call   1050 <mpz_init@plt>
call   1050 <mpz_init@plt>
call   1050 <mpz_init@plt>
call   1050 <mpz_init@plt>
call   1050 <mpz_init@plt>
call   1050 <mpz_init@plt>
lea    0xe41(%rip),%rsi
mov    $0xa,%edx
call   1070 <mpz_set_str@plt>
lea    0xe8b(%rip),%rsi
mov    $0xa,%edx
call   1070 <mpz_set_str@plt>
lea    0xed4(%rip),%rsi
mov    $0xa,%edx
call   1070 <mpz_set_str@plt>
lea    0xf1e(%rip),%rsi
mov    $0xa,%edx
call   1070 <mpz_set_str@plt>
lea    0xf10(%rip),%rsi
mov    $0xa,%edx
call   1070 <mpz_set_str@plt>
call   1040 <mpz_gcdext@plt>
lea    0xf00(%rip),%rdi
xor    %eax,%eax
call   10a0 <gmp_printf@plt>
call   1090 <mpz_gcd@plt>
lea    0xf12(%rip),%rdi
xor    %eax,%eax
call   10a0 <gmp_printf@plt>
call   1030 <mpz_powm@plt>
call   1030 <mpz_powm@plt>
call   1060 <mpz_mul@plt>
mov    $0x1,%edx
call   1080 <mpz_powm_ui@plt>
lea    0xefe(%rip),%rdi
xor    %eax,%eax
call   10a0 <gmp_printf@plt>
lea    0xf05(%rip),%rdi
xor    %eax,%eax
call   10a0 <gmp_printf@plt>
lea    0xf14(%rip),%rdi
xor    %eax,%eax
call   10a0 <gmp_printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [91 x i8] c"734832328116465196692838283564479145339399316070744350481249855342603693301556011015131519\00"
@.str.1 = [90 x i8] c"93734709405860059315217893988749243105435169093069740192815939750720282941641642747093171\00"
@.str.2 = [91 x i8] c"269125499927676766418170761935369755935025654357890774691167668682175704132138220498309902\00"
@.str.3 = [3 x i8] c"17\00"
@.str.4 = [6 x i8] c"65537\00"
@.str.5 = [37 x i8] c"mcd(e_a,e_b): %Zd | r: %Zd | s: %Zd\0A\00"
@.str.6 = [19 x i8] c"mcd(c_b,n): %Zd \0A\0A\00"
@.str.7 = [21 x i8] c"c_a: %Zd\0A\0Ac_b: %Zd\0A\0A\00"
@.str.8 = [29 x i8] c"ca_powr: %Zd\0A\0Acb_pows: %Zd\0A\0A\00"
@.str.9 = [9 x i8] c"m: %Zd\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = load i32, i32* %6
%18 = call i32 @mpz_init(i32 %17)
%19 = load i32, i32* %7
%20 = call i32 @mpz_init(i32 %19)
%21 = load i32, i32* %8
%22 = call i32 @mpz_init(i32 %21)
%23 = load i32, i32* %9
%24 = call i32 @mpz_init(i32 %23)
%25 = load i32, i32* %10
%26 = call i32 @mpz_init(i32 %25)
%27 = load i32, i32* %11
%28 = call i32 @mpz_init(i32 %27)
%29 = load i32, i32* %12
%30 = call i32 @mpz_init(i32 %29)
%31 = load i32, i32* %13
%32 = call i32 @mpz_init(i32 %31)
%33 = load i32, i32* %14
%34 = call i32 @mpz_init(i32 %33)
%35 = load i32, i32* %15
%36 = call i32 @mpz_init(i32 %35)
%37 = load i32, i32* %16
%38 = call i32 @mpz_init(i32 %37)
%39 = load i32, i32* %6
%40 = call i32 @mpz_set_str(i32 %39, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i32 10)
%41 = load i32, i32* %12
%42 = call i32 @mpz_set_str(i32 %41, i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.1, i64 0, i64 0), i32 10)
%43 = load i32, i32* %13
%44 = call i32 @mpz_set_str(i32 %43, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.2, i64 0, i64 0), i32 10)
%45 = load i32, i32* %7
%46 = call i32 @mpz_set_str(i32 %45, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 10)
%47 = load i32, i32* %8
%48 = call i32 @mpz_set_str(i32 %47, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 10)
%49 = load i32, i32* %11
%50 = load i32, i32* %9
%51 = load i32, i32* %10
%52 = load i32, i32* %7
%53 = load i32, i32* %8
%54 = call i32 @mpz_gcdext(i32 %49, i32 %50, i32 %51, i32 %52, i32 %53)
%55 = load i32, i32* %11
%56 = load i32, i32* %9
%57 = load i32, i32* %10
%58 = call i32 (i8*, i32, ...) @gmp_printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 %55, i32 %56, i32 %57)
%59 = load i32, i32* %11
%60 = load i32, i32* %13
%61 = load i32, i32* %6
%62 = call i32 @mpz_gcd(i32 %59, i32 %60, i32 %61)
%63 = load i32, i32* %11
%64 = call i32 (i8*, i32, ...) @gmp_printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %63)
%65 = load i32, i32* %15
%66 = load i32, i32* %12
%67 = load i32, i32* %9
%68 = load i32, i32* %6
%69 = call i32 @mpz_powm(i32 %65, i32 %66, i32 %67, i32 %68)
%70 = load i32, i32* %16
%71 = load i32, i32* %13
%72 = load i32, i32* %10
%73 = load i32, i32* %6
%74 = call i32 @mpz_powm(i32 %70, i32 %71, i32 %72, i32 %73)
%75 = load i32, i32* %14
%76 = load i32, i32* %15
%77 = load i32, i32* %16
%78 = call i32 @mpz_mul(i32 %75, i32 %76, i32 %77)
%79 = load i32, i32* %14
%80 = load i32, i32* %14
%81 = load i32, i32* %6
%82 = call i32 @mpz_powm_ui(i32 %79, i32 %80, i32 1, i32 %81)
%83 = load i32, i32* %12
%84 = load i32, i32* %13
%85 = call i32 (i8*, i32, ...) @gmp_printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i32 %83, i32 %84)
%86 = load i32, i32* %15
%87 = load i32, i32* %16
%88 = call i32 (i8*, i32, ...) @gmp_printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %86, i32 %87)
%89 = load i32, i32* %14
%90 = call i32 (i8*, i32, ...) @gmp_printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 %89)
ret i32 0
}

LLVM IR (-O2):
@.str = [91 x i8] c"734832328116465196692838283564479145339399316070744350481249855342603693301556011015131519\00"
@.str.1 = [90 x i8] c"93734709405860059315217893988749243105435169093069740192815939750720282941641642747093171\00"
@.str.2 = [91 x i8] c"269125499927676766418170761935369755935025654357890774691167668682175704132138220498309902\00"
@.str.3 = [3 x i8] c"17\00"
@.str.4 = [6 x i8] c"65537\00"
@.str.5 = [37 x i8] c"mcd(e_a,e_b): %Zd | r: %Zd | s: %Zd\0A\00"
@.str.6 = [19 x i8] c"mcd(c_b,n): %Zd \0A\0A\00"
@.str.7 = [21 x i8] c"c_a: %Zd\0A\0Ac_b: %Zd\0A\0A\00"
@.str.8 = [29 x i8] c"ca_powr: %Zd\0A\0Acb_pows: %Zd\0A\0A\00"
@.str.9 = [9 x i8] c"m: %Zd\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @mpz_init(i32 undef)
%4 = tail call i32 @mpz_init(i32 undef)
%5 = tail call i32 @mpz_init(i32 undef)
%6 = tail call i32 @mpz_init(i32 undef)
%7 = tail call i32 @mpz_init(i32 undef)
%8 = tail call i32 @mpz_init(i32 undef)
%9 = tail call i32 @mpz_init(i32 undef)
%10 = tail call i32 @mpz_init(i32 undef)
%11 = tail call i32 @mpz_init(i32 undef)
%12 = tail call i32 @mpz_init(i32 undef)
%13 = tail call i32 @mpz_init(i32 undef)
%14 = tail call i32 @mpz_set_str(i32 undef, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i32 10)
%15 = tail call i32 @mpz_set_str(i32 undef, i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.1, i64 0, i64 0), i32 10)
%16 = tail call i32 @mpz_set_str(i32 undef, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.2, i64 0, i64 0), i32 10)
%17 = tail call i32 @mpz_set_str(i32 undef, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 10)
%18 = tail call i32 @mpz_set_str(i32 undef, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 10)
%19 = tail call i32 @mpz_gcdext(i32 undef, i32 undef, i32 undef, i32 undef, i32 undef)
%20 = tail call i32 (i8*, i32, ...) @gmp_printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 undef, i32 undef, i32 undef)
%21 = tail call i32 @mpz_gcd(i32 undef, i32 undef, i32 undef)
%22 = tail call i32 (i8*, i32, ...) @gmp_printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 undef)
%23 = tail call i32 @mpz_powm(i32 undef, i32 undef, i32 undef, i32 undef)
%24 = tail call i32 @mpz_powm(i32 undef, i32 undef, i32 undef, i32 undef)
%25 = tail call i32 @mpz_mul(i32 undef, i32 undef, i32 undef)
%26 = tail call i32 @mpz_powm_ui(i32 undef, i32 undef, i32 1, i32 undef)
%27 = tail call i32 (i8*, i32, ...) @gmp_printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i32 undef, i32 undef)
%28 = tail call i32 (i8*, i32, ...) @gmp_printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 undef, i32 undef)
%29 = tail call i32 (i8*, i32, ...) @gmp_printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 undef)
ret i32 0
}