void mp_mulh_use_in1fft(int n, int radix, double in1fft[], int shift, int in2[],
                        int out[], int nfft, 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[]);
  int n_h;
  while (n > shift) {
    if (in2[shift + 2] != 0) {
      break;
    }
    shift++;
  }
  n_h = n / 2 + 1;
  if (n_h < n - shift) {
    n_h = n - shift;
  }
  mp_mul_i2d(n, radix, nfft, shift, 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_h, radix, nfft, outfft, out);
}


x86 assembly (clang, -O0):
<mp_mulh_use_in1fft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    11a2 <mp_mulh_use_in1fft+0x62>
mov    -0x20(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1194 <mp_mulh_use_in1fft+0x54>
jmp    11a2 <mp_mulh_use_in1fft+0x62>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116c <mp_mulh_use_in1fft+0x2c>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    11cd <mp_mulh_use_in1fft+0x8d>
mov    -0x4(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    0x18(%rbp),%r9
call   1030 <mp_mul_i2d@plt>
mov    0x10(%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    0x10(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x18(%rbp),%rdx
call   1050 <mp_mul_cmul@plt>
mov    0x10(%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    -0x2c(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x10(%rbp),%edx
mov    0x18(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1060 <mp_mul_d2i@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_mulh_use_in1fft>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,0x10(%rsp)
mov    %rdx,0x8(%rsp)
mov    0x68(%rsp),%r13
mov    0x60(%rsp),%rbx
mov    0x58(%rsp),%r12
mov    0x50(%rsp),%ebp
cmp    %edi,%ecx
jge    1192 <mp_mulh_use_in1fft+0x52>
movslq %ecx,%rax
lea    (%r8,%rax,4),%rax
add    $0x8,%rax
nopw   0x0(%rax,%rax,1)
cmpl   $0x0,(%rax)
jne    1192 <mp_mulh_use_in1fft+0x52>
add    $0x1,%ecx
add    $0x4,%rax
cmp    %ecx,%edi
jne    1180 <mp_mulh_use_in1fft+0x40>
mov    %edi,%ecx
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
add    $0x1,%eax
mov    %edi,%r14d
sub    %ecx,%r14d
cmp    %r14d,%eax
cmovge %eax,%r14d
mov    %esi,0x4(%rsp)
mov    %ebp,%edx
mov    %r12,%r9
call   1030 <mp_mul_i2d@plt>
lea    0x8(%r12),%r15
mov    %ebp,%edi
mov    $0x1,%esi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %r13,%r8
call   1040 <rdft@plt>
mov    %ebp,%edi
mov    0x8(%rsp),%rsi
mov    %r12,%rdx
call   1050 <mp_mul_cmul@plt>
mov    %ebp,%edi
mov    $0xffffffff,%esi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %r13,%r8
call   1040 <rdft@plt>
mov    %r14d,%edi
mov    0x4(%rsp),%esi
mov    %ebp,%edx
mov    %r12,%rcx
mov    0x10(%rsp),%r8
add    $0x18,%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_use_in1fft(i32 %0, i32 %1, double* %2, i32 %3, i32* %4, i32* %5, i32 %6, double* %7, i32* %8, double* %9) {
%11 = alloca i32
%12 = alloca i32
%13 = alloca double*
%14 = alloca i32
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32
%18 = alloca double*
%19 = alloca i32*
%20 = alloca double*
%21 = alloca i32
store i32 %0, i32* %11
store i32 %1, i32* %12
store double* %2, double** %13
store i32 %3, i32* %14
store i32* %4, i32** %15
store i32* %5, i32** %16
store i32 %6, i32* %17
store double* %7, double** %18
store i32* %8, i32** %19
store double* %9, double** %20
br label %22
22: ; preds = %35, %10
%23 = load i32, i32* %11
%24 = load i32, i32* %14
%25 = icmp sgt i32 %23, %24
br i1 %25, label %26, label %38
26: ; preds = %22
%27 = load i32*, i32** %15
%28 = load i32, i32* %14
%29 = add nsw i32 %28, 2
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %27, i64 %30
%32 = load i32, i32* %31
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %26
br label %38
35: ; preds = %26
%36 = load i32, i32* %14
%37 = add nsw i32 %36, 1
store i32 %37, i32* %14
br label %22
38: ; preds = %34, %22
%39 = load i32, i32* %11
%40 = sdiv i32 %39, 2
%41 = add nsw i32 %40, 1
store i32 %41, i32* %21
%42 = load i32, i32* %21
%43 = load i32, i32* %11
%44 = load i32, i32* %14
%45 = sub nsw i32 %43, %44
%46 = icmp slt i32 %42, %45
br i1 %46, label %47, label %51
47: ; preds = %38
%48 = load i32, i32* %11
%49 = load i32, i32* %14
%50 = sub nsw i32 %48, %49
store i32 %50, i32* %21
br label %51
51: ; preds = %47, %38
%52 = load i32, i32* %11
%53 = load i32, i32* %12
%54 = load i32, i32* %17
%55 = load i32, i32* %14
%56 = load i32*, i32** %15
%57 = load double*, double** %18
%58 = load i32, i32* %17
%59 = load double*, double** %18
%60 = getelementptr inbounds double, double* %59, i64 1
%61 = load i32*, i32** %19
%62 = load double*, double** %20
%63 = load i32, i32* %17
%64 = load double*, double** %13
%65 = load double*, double** %18
%66 = load i32, i32* %17
%67 = load double*, double** %18
%68 = getelementptr inbounds double, double* %67, i64 1
%69 = load i32*, i32** %19
%70 = load double*, double** %20
%71 = load i32, i32* %21
%72 = load i32, i32* %12
%73 = load i32, i32* %17
%74 = load double*, double** %18
%75 = load i32*, i32** %16
ret void
}

LLVM IR (-O2):
define void @mp_mulh_use_in1fft(i32 %0, i32 %1, double* %2, i32 %3, i32* %4, i32* %5, i32 %6, double* %7, i32* %8, double* %9) {
%11 = icmp slt i32 %3, %0
br i1 %11, label %12, label %26
12: ; preds = %10
%13 = sext i32 %3 to i64
br label %14
14: ; preds = %12, %20
%15 = phi i64 [ %13, %12 ], [ %21, %20 ]
%16 = add nsw i64 %15, 2
%17 = getelementptr inbounds i32, i32* %4, i64 %16
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %14
%21 = add nsw i64 %15, 1
%22 = trunc i64 %21 to i32
%23 = icmp eq i32 %22, %0
br i1 %23, label %26, label %14
24: ; preds = %14
%25 = trunc i64 %15 to i32
br label %26
26: ; preds = %20, %24, %10
%27 = phi i32 [ %3, %10 ], [ %25, %24 ], [ %0, %20 ]
%28 = sdiv i32 %0, 2
%29 = add nsw i32 %28, 1
%30 = sub nsw i32 %0, %27
%31 = icmp slt i32 %29, %30
%32 = select i1 %31, i32 %30, i32 %29
tail call void @mp_mul_i2d(i32 %0, i32 %1, i32 %6, i32 %27, i32* %4, double* %7)
%33 = getelementptr inbounds double, double* %7, i64 1
tail call void @rdft(i32 %6, i32 1, double* %33, i32* %8, double* %9)
tail call void @mp_mul_cmul(i32 %6, double* %2, double* %7)
tail call void @rdft(i32 %6, i32 -1, double* %33, i32* %8, double* %9)
tail call void @mp_mul_d2i(i32 %32, i32 %1, i32 %6, double* %7, i32* %5)
ret void
}