#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 scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ MULT31(scalar_t__, scalar_t__);
void XNPROD31(int32_t a, int32_t b, int32_t t, int32_t v, int32_t *x,
              int32_t *y) {
  *x = MULT31(a, t) - MULT31(b, v);
  *y = MULT31(b, t) + MULT31(a, v);
}


x86 assembly (clang, -O0):
<XNPROD31>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <MULT31@plt>
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <MULT31@plt>
mov    -0x40(%rbp),%rcx
sub    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <MULT31@plt>
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <MULT31@plt>
mov    -0x38(%rbp),%rcx
add    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XNPROD31>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,(%rsp)
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %rdx,%rsi
call   1030 <MULT31@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <MULT31@plt>
sub    %rax,%r14
mov    %r14,(%r15)
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <MULT31@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
mov    %r12,%rsi
call   1030 <MULT31@plt>
add    %rbx,%rax
mov    (%rsp),%rcx
mov    %rax,(%rcx)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @XNPROD31(i64 %0, i64 %1, i64 %2, i64 %3, i64* %4, i64* %5) {
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64*
%12 = alloca i64*
store i64 %0, i64* %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64* %4, i64** %11
store i64* %5, i64** %12
%13 = load i64, i64* %7
%14 = load i64, i64* %9
%15 = call i64 @MULT31(i64 %13, i64 %14)
%16 = load i64, i64* %8
%17 = load i64, i64* %10
%18 = call i64 @MULT31(i64 %16, i64 %17)
%19 = sub nsw i64 %15, %18
%20 = load i64*, i64** %11
store i64 %19, i64* %20
%21 = load i64, i64* %8
%22 = load i64, i64* %9
%23 = call i64 @MULT31(i64 %21, i64 %22)
%24 = load i64, i64* %7
%25 = load i64, i64* %10
%26 = call i64 @MULT31(i64 %24, i64 %25)
%27 = add nsw i64 %23, %26
%28 = load i64*, i64** %12
store i64 %27, i64* %28
ret void
}

LLVM IR (-O2):
define void @XNPROD31(i64 %0, i64 %1, i64 %2, i64 %3, i64* nocapture writeonly %4, i64* nocapture writeonly %5) {
%7 = tail call i64 @MULT31(i64 %0, i64 %2)
%8 = tail call i64 @MULT31(i64 %1, i64 %3)
%9 = sub nsw i64 %7, %8
store i64 %9, i64* %4
%10 = tail call i64 @MULT31(i64 %1, i64 %2)
%11 = tail call i64 @MULT31(i64 %0, i64 %3)
%12 = add nsw i64 %11, %10
store i64 %12, i64* %5
ret void
}