#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ hex_out(int /*<<< orphan*/, int *, int);
int /*<<< orphan*/ mp_mod_256k1(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];
  a[3] = 0x79BE667EF9DCBBAC;
  a[2] = 0x55A06295CE870B07;
  a[1] = 0x029BFCDB2DCE28D9;
  a[0] = 0x59F2815B16F81798;
  b[3] = 0x483ADA7726A3C465;
  b[2] = 0x5DA4FBFC0E1108A8;
  b[1] = 0xFD17B448A6855419;
  b[0] = 0x9C47D08FFB10D4B8;
  mp_mul_256(c, a, b);
  mp_mod_256k1(r, c);
  hex_out(stdout, c, 8);
  hex_out(stdout, r, 4);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xf9dcbbac,-0x14(%rbp)
movl   $0xce870b07,-0x18(%rbp)
movl   $0x2dce28d9,-0x1c(%rbp)
movl   $0x16f81798,-0x20(%rbp)
movl   $0x26a3c465,-0x24(%rbp)
movl   $0xe1108a8,-0x28(%rbp)
movl   $0xa6855419,-0x2c(%rbp)
movl   $0xfb10d4b8,-0x30(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1040 <mp_mul_256@plt>
lea    -0x60(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1060 <mp_mod_256k1@plt>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
lea    -0x50(%rbp),%rsi
mov    $0x8,%edx
call   1030 <hex_out@plt>
mov    0x2e16(%rip),%rax
mov    (%rax),%edi
lea    -0x60(%rbp),%rsi
mov    $0x4,%edx
call   1030 <hex_out@plt>
mov    0x2df7(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x30(%rsp),%rbx
lea    0x10(%rsp),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1040 <mp_mul_256@plt>
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <mp_mod_256k1@plt>
mov    0x2e54(%rip),%r15
mov    (%r15),%edi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <hex_out@plt>
mov    (%r15),%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <hex_out@plt>
mov    0x2e25(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@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]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 3
store i32 -102974548, i32* %10
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 2
store i32 -830010617, i32* %11
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 1
store i32 768485593, i32* %12
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
store i32 385357720, i32* %13
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 3
store i32 648266853, i32* %14
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 2
store i32 235997352, i32* %15
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 1
store i32 -1501211623, i32* %16
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
store i32 -82783048, i32* %17
%18 = getelementptr inbounds [8 x i32], [8 x i32]* %8, i64 0, i64 0
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%20 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
%21 = call i32 @mp_mul_256(i32* %18, i32* %19, i32* %20)
%22 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%23 = getelementptr inbounds [8 x i32], [8 x i32]* %8, i64 0, i64 0
%24 = call i32 @mp_mod_256k1(i32* %22, i32* %23)
%25 = load i32, i32* @stdout
%26 = getelementptr inbounds [8 x i32], [8 x i32]* %8, i64 0, i64 0
%27 = call i32 @hex_out(i32 %25, i32* %26, i32 8)
%28 = load i32, i32* @stdout
%29 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%30 = call i32 @hex_out(i32 %28, i32* %29, i32 4)
%31 = load i32, i32* @EXIT_SUCCESS
%32 = call i32 @exit(i32 %31)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@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 = bitcast <4 x i32>* %3 to i8*
%8 = bitcast <4 x i32>* %4 to i8*
%9 = bitcast [8 x i32]* %5 to i8*
%10 = bitcast [4 x i32]* %6 to i8*
%11 = getelementptr inbounds <4 x i32>, <4 x i32>* %3, i64 0, i64 0
store <4 x i32> <i32 385357720, i32 768485593, i32 -830010617, i32 -102974548>, <4 x i32>* %3
%12 = getelementptr inbounds <4 x i32>, <4 x i32>* %4, i64 0, i64 0
store <4 x i32> <i32 -82783048, i32 -1501211623, i32 235997352, i32 648266853>, <4 x i32>* %4
%13 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 0
%14 = call i32 @mp_mul_256(i32* %13, i32* %11, i32* %12)
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%16 = call i32 @mp_mod_256k1(i32* %15, i32* %13)
%17 = load i32, i32* @stdout
%18 = call i32 @hex_out(i32 %17, i32* %13, i32 8)
%19 = load i32, i32* @stdout
%20 = call i32 @hex_out(i32 %19, i32* %15, i32 4)
%21 = load i32, i32* @EXIT_SUCCESS
%22 = call i32 @exit(i32 %21)
unreachable
}