#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__ fixmul32b(scalar_t__, scalar_t__);
void CMUL(int32_t *pre, int32_t *pim, int32_t are, int32_t aim, int32_t bre,
          int32_t bim) {
  int32_t _aref = are;
  int32_t _aimf = aim;
  int32_t _bref = bre;
  int32_t _bimf = bim;
  int32_t _r1 = fixmul32b(_bref, _aref);
  int32_t _r2 = fixmul32b(_bimf, _aimf);
  int32_t _r3 = fixmul32b(_bref, _aimf);
  int32_t _r4 = fixmul32b(_bimf, _aref);
  *pre = _r1 - _r2;
  *pim = _r3 + _r4;
}


x86 assembly (clang, -O0):
<CMUL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%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    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1030 <fixmul32b@plt>
mov    %rax,-0x58(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1030 <fixmul32b@plt>
mov    %rax,-0x60(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1030 <fixmul32b@plt>
mov    %rax,-0x68(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1030 <fixmul32b@plt>
mov    %rax,-0x70(%rbp)
mov    -0x58(%rbp),%rcx
sub    -0x60(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x68(%rbp),%rcx
add    -0x70(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x70,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @CMUL(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
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
%20 = 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
%21 = load i64, i64* %9
store i64 %21, i64* %13
%22 = load i64, i64* %10
store i64 %22, i64* %14
%23 = load i64, i64* %11
store i64 %23, i64* %15
%24 = load i64, i64* %12
store i64 %24, i64* %16
%25 = load i64, i64* %15
%26 = load i64, i64* %13
%27 = call i64 @fixmul32b(i64 %25, i64 %26)
store i64 %27, i64* %17
%28 = load i64, i64* %16
%29 = load i64, i64* %14
%30 = call i64 @fixmul32b(i64 %28, i64 %29)
store i64 %30, i64* %18
%31 = load i64, i64* %15
%32 = load i64, i64* %14
%33 = call i64 @fixmul32b(i64 %31, i64 %32)
store i64 %33, i64* %19
%34 = load i64, i64* %16
%35 = load i64, i64* %13
%36 = call i64 @fixmul32b(i64 %34, i64 %35)
store i64 %36, i64* %20
%37 = load i64, i64* %17
%38 = load i64, i64* %18
%39 = sub nsw i64 %37, %38
%40 = load i64*, i64** %7
store i64 %39, i64* %40
%41 = load i64, i64* %19
%42 = load i64, i64* %20
%43 = add nsw i64 %41, %42
%44 = load i64*, i64** %8
store i64 %43, i64* %44
ret void
}

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