#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 uint64_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ ec_double_256(int *, int *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ hex_out(int /*<<< orphan*/, int *, int);
int /*<<< orphan*/ mp_mod_256(int *, int *);
int /*<<< orphan*/ mp_mul_256(int *, int *, int *);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  uint64_t a[4], b[4], c[8], r[4];
  uint64_t R[12], S[12];
  a[3] = 0x6b17d1f2e12c4247;
  a[2] = 0xf8bce6e563a440f2;
  a[1] = 0x77037d812deb33a0;
  a[0] = 0xf4a13945d898c296;
  b[3] = 0x4fe342e2fe1a7f9b;
  b[2] = 0x8ee7eb4a7c0f9e16;
  b[1] = 0x2bce33576b315ece;
  b[0] = 0xcbb6406837bf51f5;
  S[3] = 0xde2444bebc8d36e6;
  S[2] = 0x82edd27e0f271508;
  S[1] = 0x617519b3221a8fa0;
  S[0] = 0xb77cab3989da97c9;
  S[7] = 0xc093ae7ff36e5380;
  S[6] = 0xfc01a5aad1e66659;
  S[5] = 0x702de80f53cec576;
  S[4] = 0xb6350b243042a256;
  S[11] = 0x0;
  S[10] = 0x0;
  S[9] = 0x0;
  S[8] = 0x1;
  mp_mul_256(c, a, b);
  mp_mod_256(r, c);
  ec_double_256(R, S);
  hex_out(stdout, c, 8);
  fprintf(stdout, " c = a * b\n");
  hex_out(stdout, r, 4);
  fprintf(stdout, " r = c mod p\n");
  hex_out(stdout, R, 4);
  fprintf(stdout, " Rx\n");
  hex_out(stdout, R + 4, 4);
  fprintf(stdout, " Ry\n");
  hex_out(stdout, R + 8, 4);
  fprintf(stdout, " Rz\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xe12c4247,-0x14(%rbp)
movl   $0x63a440f2,-0x18(%rbp)
movl   $0x2deb33a0,-0x1c(%rbp)
movl   $0xd898c296,-0x20(%rbp)
movl   $0xfe1a7f9b,-0x24(%rbp)
movl   $0x7c0f9e16,-0x28(%rbp)
movl   $0x6b315ece,-0x2c(%rbp)
movl   $0x37bf51f5,-0x30(%rbp)
movl   $0xbc8d36e6,-0xb4(%rbp)
36 8d bc
movl   $0xf271508,-0xb8(%rbp)
15 27 0f
movl   $0x221a8fa0,-0xbc(%rbp)
8f 1a 22
movl   $0x89da97c9,-0xc0(%rbp)
97 da 89
movl   $0xf36e5380,-0xa4(%rbp)
53 6e f3
movl   $0xd1e66659,-0xa8(%rbp)
66 e6 d1
movl   $0x53cec576,-0xac(%rbp)
c5 ce 53
movl   $0x3042a256,-0xb0(%rbp)
a2 42 30
movl   $0x0,-0x94(%rbp)
movl   $0x0,-0x98(%rbp)
movl   $0x0,-0x9c(%rbp)
movl   $0x1,-0xa0(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1050 <mp_mul_256@plt>
lea    -0x60(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1030 <mp_mod_256@plt>
lea    -0x90(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
call   1070 <ec_double_256@plt>
mov    0x2d7f(%rip),%rax
mov    (%rax),%edi
lea    -0x50(%rbp),%rsi
mov    $0x8,%edx
call   1040 <hex_out@plt>
mov    0x2d68(%rip),%rax
mov    (%rax),%edi
lea    0xd7f(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2d53(%rip),%rax
mov    (%rax),%edi
lea    -0x60(%rbp),%rsi
mov    $0x4,%edx
call   1040 <hex_out@plt>
mov    0x2d3c(%rip),%rax
mov    (%rax),%edi
lea    0xd5f(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
lea    -0x90(%rbp),%rsi
mov    $0x4,%edx
call   1040 <hex_out@plt>
mov    0x2d0d(%rip),%rax
mov    (%rax),%edi
lea    0xd3e(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2cf8(%rip),%rax
mov    (%rax),%edi
lea    -0x90(%rbp),%rsi
add    $0x10,%rsi
mov    $0x4,%edx
call   1040 <hex_out@plt>
mov    0x2cda(%rip),%rax
mov    (%rax),%edi
lea    0xd10(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2cc5(%rip),%rax
mov    (%rax),%edi
lea    -0x90(%rbp),%rsi
add    $0x20,%rsi
mov    $0x4,%edx
call   1040 <hex_out@plt>
mov    0x2ca7(%rip),%rax
mov    (%rax),%edi
lea    0xce2(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2c8a(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xb8,%rsp
movaps 0xe8b(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe8f(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xe94(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe98(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe9c(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
lea    0x90(%rsp),%r12
lea    0x10(%rsp),%rsi
mov    %rsp,%rdx
mov    %r12,%rdi
call   1050 <mp_mul_256@plt>
lea    0x80(%rsp),%r15
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <mp_mod_256@plt>
lea    0x50(%rsp),%r14
lea    0x20(%rsp),%rsi
mov    %r14,%rdi
call   1070 <ec_double_256@plt>
mov    0x2df3(%rip),%rbx
mov    (%rbx),%edi
mov    %r12,%rsi
mov    $0x8,%edx
call   1040 <hex_out@plt>
mov    (%rbx),%edi
lea    0xe4b(%rip),%rsi
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
mov    $0x4,%edx
call   1040 <hex_out@plt>
mov    (%rbx),%edi
lea    0xe3a(%rip),%rsi
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1040 <hex_out@plt>
mov    (%rbx),%edi
lea    0xe2b(%rip),%rsi
call   1060 <fprintf@plt>
mov    (%rbx),%edi
lea    0x60(%rsp),%rsi
mov    $0x4,%edx
call   1040 <hex_out@plt>
mov    (%rbx),%edi
lea    0xe11(%rip),%rsi
call   1060 <fprintf@plt>
mov    (%rbx),%edi
lea    0x70(%rsp),%rsi
mov    $0x4,%edx
call   1040 <hex_out@plt>
mov    (%rbx),%edi
lea    0xdf7(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2d4f(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [12 x i8] c" c = a * b\0A\00"
@.str.1 = [14 x i8] c" r = c mod p\0A\00"
@.str.2 = [5 x i8] c" Rx\0A\00"
@.str.3 = [5 x i8] c" Ry\0A\00"
@.str.4 = [5 x i8] c" Rz\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i32]
%7 = alloca [4 x i32]
%8 = alloca [8 x i32]
%9 = alloca [4 x i32]
%10 = alloca [12 x i32]
%11 = alloca [12 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 3
store i32 -517193145, i32* %12
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 2
store i32 1671708914, i32* %13
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 1
store i32 770388896, i32* %14
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
store i32 -661077354, i32* %15
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 3
store i32 -31817829, i32* %16
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 2
store i32 2081398294, i32* %17
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 1
store i32 1798397646, i32* %18
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
store i32 935285237, i32* %19
%20 = getelementptr inbounds [12 x i32], [12 x i32]* %11, i64 0, i64 3
store i32 -1131596058, i32* %20
%21 = getelementptr inbounds [12 x i32], [12 x i32]* %11, i64 0, i64 2
store i32 254219528, i32* %21
%22 = getelementptr inbounds [12 x i32], [12 x i32]* %11, i64 0, i64 1
store i32 572166048, i32* %22
%23 = getelementptr inbounds [12 x i32], [12 x i32]* %11, i64 0, i64 0
store i32 -1982162999, i32* %23
%24 = getelementptr inbounds [12 x i32], [12 x i32]* %11, i64 0, i64 7
store i32 -210873472, i32* %24
%25 = getelementptr inbounds [12 x i32], [12 x i32]* %11, i64 0, i64 6
store i32 -773429671, i32* %25
%26 = getelementptr inbounds [12 x i32], [12 x i32]* %11, i64 0, i64 5
store i32 1406059894, i32* %26
%27 = getelementptr inbounds [12 x i32], [12 x i32]* %11, i64 0, i64 4
store i32 809673302, i32* %27
%28 = getelementptr inbounds [12 x i32], [12 x i32]* %11, i64 0, i64 11
store i32 0, i32* %28
%29 = getelementptr inbounds [12 x i32], [12 x i32]* %11, i64 0, i64 10
store i32 0, i32* %29
%30 = getelementptr inbounds [12 x i32], [12 x i32]* %11, i64 0, i64 9
store i32 0, i32* %30
%31 = getelementptr inbounds [12 x i32], [12 x i32]* %11, i64 0, i64 8
store i32 1, i32* %31
%32 = getelementptr inbounds [8 x i32], [8 x i32]* %8, i64 0, i64 0
%33 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%34 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
%35 = call i32 @mp_mul_256(i32* %32, i32* %33, i32* %34)
%36 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%37 = getelementptr inbounds [8 x i32], [8 x i32]* %8, i64 0, i64 0
%38 = call i32 @mp_mod_256(i32* %36, i32* %37)
%39 = getelementptr inbounds [12 x i32], [12 x i32]* %10, i64 0, i64 0
%40 = getelementptr inbounds [12 x i32], [12 x i32]* %11, i64 0, i64 0
%41 = call i32 @ec_double_256(i32* %39, i32* %40)
%42 = load i32, i32* @stdout
%43 = getelementptr inbounds [8 x i32], [8 x i32]* %8, i64 0, i64 0
%44 = call i32 @hex_out(i32 %42, i32* %43, i32 8)
%45 = load i32, i32* @stdout
%46 = call i32 @fprintf(i32 %45, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%47 = load i32, i32* @stdout
%48 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%49 = call i32 @hex_out(i32 %47, i32* %48, i32 4)
%50 = load i32, i32* @stdout
%51 = call i32 @fprintf(i32 %50, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%52 = load i32, i32* @stdout
%53 = getelementptr inbounds [12 x i32], [12 x i32]* %10, i64 0, i64 0
%54 = call i32 @hex_out(i32 %52, i32* %53, i32 4)
%55 = load i32, i32* @stdout
%56 = call i32 @fprintf(i32 %55, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%57 = load i32, i32* @stdout
%58 = getelementptr inbounds [12 x i32], [12 x i32]* %10, i64 0, i64 0
%59 = getelementptr inbounds i32, i32* %58, i64 4
%60 = call i32 @hex_out(i32 %57, i32* %59, i32 4)
%61 = load i32, i32* @stdout
%62 = call i32 @fprintf(i32 %61, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%63 = load i32, i32* @stdout
%64 = getelementptr inbounds [12 x i32], [12 x i32]* %10, i64 0, i64 0
%65 = getelementptr inbounds i32, i32* %64, i64 8
%66 = call i32 @hex_out(i32 %63, i32* %65, i32 4)
%67 = load i32, i32* @stdout
%68 = call i32 @fprintf(i32 %67, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%69 = load i32, i32* @EXIT_SUCCESS
%70 = call i32 @exit(i32 %69)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [12 x i8] c" c = a * b\0A\00"
@.str.1 = [14 x i8] c" r = c mod p\0A\00"
@.str.2 = [5 x i8] c" Rx\0A\00"
@.str.3 = [5 x i8] c" Ry\0A\00"
@.str.4 = [5 x i8] c" Rz\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca <4 x i32>
%4 = alloca <4 x i32>
%5 = alloca [8 x i32]
%6 = alloca [4 x i32]
%7 = alloca [12 x i32]
%8 = alloca [12 x i32]
%9 = bitcast <4 x i32>* %3 to i8*
%10 = bitcast <4 x i32>* %4 to i8*
%11 = bitcast [8 x i32]* %5 to i8*
%12 = bitcast [4 x i32]* %6 to i8*
%13 = bitcast [12 x i32]* %7 to i8*
%14 = bitcast [12 x i32]* %8 to i8*
%15 = getelementptr inbounds <4 x i32>, <4 x i32>* %3, i64 0, i64 0
store <4 x i32> <i32 -661077354, i32 770388896, i32 1671708914, i32 -517193145>, <4 x i32>* %3
%16 = getelementptr inbounds <4 x i32>, <4 x i32>* %4, i64 0, i64 0
store <4 x i32> <i32 935285237, i32 1798397646, i32 2081398294, i32 -31817829>, <4 x i32>* %4
%17 = getelementptr inbounds [12 x i32], [12 x i32]* %8, i64 0, i64 0
%18 = bitcast [12 x i32]* %8 to <4 x i32>*
store <4 x i32> <i32 -1982162999, i32 572166048, i32 254219528, i32 -1131596058>, <4 x i32>* %18
%19 = getelementptr inbounds [12 x i32], [12 x i32]* %8, i64 0, i64 4
%20 = bitcast i32* %19 to <4 x i32>*
store <4 x i32> <i32 809673302, i32 1406059894, i32 -773429671, i32 -210873472>, <4 x i32>* %20
%21 = getelementptr inbounds [12 x i32], [12 x i32]* %8, i64 0, i64 8
%22 = bitcast i32* %21 to <4 x i32>*
store <4 x i32> <i32 1, i32 0, i32 0, i32 0>, <4 x i32>* %22
%23 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 0
%24 = call i32 @mp_mul_256(i32* %23, i32* %15, i32* %16)
%25 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%26 = call i32 @mp_mod_256(i32* %25, i32* %23)
%27 = getelementptr inbounds [12 x i32], [12 x i32]* %7, i64 0, i64 0
%28 = call i32 @ec_double_256(i32* %27, i32* %17)
%29 = load i32, i32* @stdout
%30 = call i32 @hex_out(i32 %29, i32* %23, i32 8)
%31 = load i32, i32* @stdout
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%33 = load i32, i32* @stdout
%34 = call i32 @hex_out(i32 %33, i32* %25, i32 4)
%35 = load i32, i32* @stdout
%36 = call i32 @fprintf(i32 %35, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%37 = load i32, i32* @stdout
%38 = call i32 @hex_out(i32 %37, i32* %27, i32 4)
%39 = load i32, i32* @stdout
%40 = call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%41 = load i32, i32* @stdout
%42 = getelementptr inbounds [12 x i32], [12 x i32]* %7, i64 0, i64 4
%43 = call i32 @hex_out(i32 %41, i32* %42, i32 4)
%44 = load i32, i32* @stdout
%45 = call i32 @fprintf(i32 %44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%46 = load i32, i32* @stdout
%47 = getelementptr inbounds [12 x i32], [12 x i32]* %7, i64 0, i64 8
%48 = call i32 @hex_out(i32 %46, i32* %47, i32 4)
%49 = load i32, i32* @stdout
%50 = call i32 @fprintf(i32 %49, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%51 = load i32, i32* @EXIT_SUCCESS
%52 = call i32 @exit(i32 %51)
unreachable
}