void mp_mulh(int n, int radix, int in1[], int in2[], int out[], int nfft,
             double in1fft[], double outfft[], int ip[], double w[]) {
  void rdft(int n, int isgn, double *a, int *ip, double *w);
  void mp_mul_i2d(int n, int radix, int nfft, int shift, int in[],
                  double dout[]);
  void mp_mul_cmul(int nfft, double din[], double dinout[]);
  void mp_mul_d2i(int n, int radix, int nfft, double din[], int out[]);
  mp_mul_i2d(n, radix, nfft, 0, in1, in1fft);
  rdft(nfft, 1, &in1fft[1], ip, w);
  mp_mul_i2d(n, radix, nfft, 0, in2, outfft);
  rdft(nfft, 1, &outfft[1], ip, w);
  mp_mul_cmul(nfft, in1fft, outfft);
  rdft(nfft, -1, &outfft[1], ip, w);
  mp_mul_d2i(n, radix, nfft, outfft, out);
}


x86 assembly (clang, -O0):
<mp_mulh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x10(%rbp),%r8
mov    0x10(%rbp),%r9
xor    %ecx,%ecx
call   1030 <mp_mul_i2d@plt>
mov    -0x24(%rbp),%edi
mov    0x10(%rbp),%rdx
add    $0x8,%rdx
mov    0x20(%rbp),%rcx
mov    0x28(%rbp),%r8
mov    $0x1,%esi
call   1040 <rdft@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    0x18(%rbp),%r9
xor    %ecx,%ecx
call   1030 <mp_mul_i2d@plt>
mov    -0x24(%rbp),%edi
mov    0x18(%rbp),%rdx
add    $0x8,%rdx
mov    0x20(%rbp),%rcx
mov    0x28(%rbp),%r8
mov    $0x1,%esi
call   1040 <rdft@plt>
mov    -0x24(%rbp),%edi
mov    0x10(%rbp),%rsi
mov    0x18(%rbp),%rdx
call   1050 <mp_mul_cmul@plt>
mov    -0x24(%rbp),%edi
mov    0x18(%rbp),%rdx
add    $0x8,%rdx
mov    0x20(%rbp),%rcx
mov    0x28(%rbp),%r8
mov    $0xffffffff,%esi
call   1040 <rdft@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1060 <mp_mul_d2i@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_mulh>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9d,%ebp
mov    %r8,0x30(%rsp)
mov    %rcx,0x28(%rsp)
mov    %rdx,%r8
mov    0x78(%rsp),%rax
mov    %rax,0x20(%rsp)
mov    0x80(%rsp),%r14
mov    %r14,0x10(%rsp)
mov    0x88(%rsp),%r13
mov    %r13,0x18(%rsp)
mov    0x70(%rsp),%r15
mov    %edi,%r12d
mov    %edi,0x8(%rsp)
mov    %esi,%ebx
mov    %esi,0xc(%rsp)
mov    %r9d,%edx
xor    %ecx,%ecx
mov    %r15,%r9
call   1030 <mp_mul_i2d@plt>
lea    0x8(%r15),%rdx
mov    %ebp,%edi
mov    $0x1,%esi
mov    %r14,%rcx
mov    %r13,%r8
call   1040 <rdft@plt>
mov    %r12d,%edi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
mov    0x28(%rsp),%r8
mov    0x20(%rsp),%r14
mov    %r14,%r9
call   1030 <mp_mul_i2d@plt>
lea    0x8(%r14),%r12
mov    %ebp,%edi
mov    $0x1,%esi
mov    %r12,%rdx
mov    0x10(%rsp),%r13
mov    %r13,%rcx
mov    0x18(%rsp),%rbx
mov    %rbx,%r8
call   1040 <rdft@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r14,%rdx
call   1050 <mp_mul_cmul@plt>
mov    %ebp,%edi
mov    $0xffffffff,%esi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
call   1040 <rdft@plt>
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%esi
mov    %ebp,%edx
mov    %r14,%rcx
mov    0x30(%rsp),%r8
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <mp_mul_d2i@plt>

LLVM IR (-O0):
define void @mp_mulh(i32 %0, i32 %1, i32* %2, i32* %3, i32* %4, i32 %5, double* %6, double* %7, i32* %8, double* %9) {
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32
%17 = alloca double*
%18 = alloca double*
%19 = alloca i32*
%20 = alloca double*
store i32 %0, i32* %11
store i32 %1, i32* %12
store i32* %2, i32** %13
store i32* %3, i32** %14
store i32* %4, i32** %15
store i32 %5, i32* %16
store double* %6, double** %17
store double* %7, double** %18
store i32* %8, i32** %19
store double* %9, double** %20
%21 = load i32, i32* %11
%22 = load i32, i32* %12
%23 = load i32, i32* %16
%24 = load i32*, i32** %13
%25 = load double*, double** %17
%26 = load i32, i32* %16
%27 = load double*, double** %17
%28 = getelementptr inbounds double, double* %27, i64 1
%29 = load i32*, i32** %19
%30 = load double*, double** %20
%31 = load i32, i32* %11
%32 = load i32, i32* %12
%33 = load i32, i32* %16
%34 = load i32*, i32** %14
%35 = load double*, double** %18
%36 = load i32, i32* %16
%37 = load double*, double** %18
%38 = getelementptr inbounds double, double* %37, i64 1
%39 = load i32*, i32** %19
%40 = load double*, double** %20
%41 = load i32, i32* %16
%42 = load double*, double** %17
%43 = load double*, double** %18
%44 = load i32, i32* %16
%45 = load double*, double** %18
%46 = getelementptr inbounds double, double* %45, i64 1
%47 = load i32*, i32** %19
%48 = load double*, double** %20
%49 = load i32, i32* %11
%50 = load i32, i32* %12
%51 = load i32, i32* %16
%52 = load double*, double** %18
%53 = load i32*, i32** %15
ret void
}

LLVM IR (-O2):
define void @mp_mulh(i32 %0, i32 %1, i32* %2, i32* %3, i32* %4, i32 %5, double* %6, double* %7, i32* %8, double* %9) {
tail call void @mp_mul_i2d(i32 %0, i32 %1, i32 %5, i32 0, i32* %2, double* %6)
%11 = getelementptr inbounds double, double* %6, i64 1
tail call void @rdft(i32 %5, i32 1, double* %11, i32* %8, double* %9)
tail call void @mp_mul_i2d(i32 %0, i32 %1, i32 %5, i32 0, i32* %3, double* %7)
%12 = getelementptr inbounds double, double* %7, i64 1
tail call void @rdft(i32 %5, i32 1, double* %12, i32* %8, double* %9)
tail call void @mp_mul_cmul(i32 %5, double* %6, double* %7)
tail call void @rdft(i32 %5, i32 -1, double* %12, i32* %8, double* %9)
tail call void @mp_mul_d2i(i32 %0, i32 %1, i32 %5, double* %7, i32* %4)
ret void
}