#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 */

/* Variables and functions */
int /*<<< orphan*/ bn_add_words(unsigned int *, unsigned int *, unsigned int *,
                                int);
int /*<<< orphan*/ bn_mul_low_normal(unsigned int *, unsigned int *,
                                     unsigned int *, int);
int /*<<< orphan*/ bn_mul_recursive(unsigned int *, unsigned int *,
                                    unsigned int *, int, int /*<<< orphan*/,
                                    int /*<<< orphan*/, unsigned int *);
void bn_mul_low_recursive(unsigned int *r, unsigned int *a, unsigned int *b,
                          int n2, unsigned int *t) {
  int n = n2 / 2;
  bn_mul_recursive(r, a, b, n, 0, 0, &(t[0]));
  if (n >= (32)) {
    bn_mul_low_recursive(&(t[0]), &(a[0]), &(b[n]), n, &(t[n2]));
    bn_add_words(&(r[n]), &(r[n]), &(t[0]), n);
    bn_mul_low_recursive(&(t[0]), &(a[n]), &(b[0]), n, &(t[n2]));
    bn_add_words(&(r[n]), &(r[n]), &(t[0]), n);
  } else {
    bn_mul_low_normal(&(t[0]), &(a[0]), &(b[n]), n);
    bn_mul_low_normal(&(t[n]), &(a[n]), &(b[0]), n);
    bn_add_words(&(r[n]), &(r[n]), &(t[0]), n);
    bn_add_words(&(r[n]), &(r[n]), &(t[n]), n);
  }
}


x86 assembly (clang, -O0):
<bn_mul_low_recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    -0x28(%rbp),%rax
xor    %r9d,%r9d
mov    %r9d,%r8d
mov    %rax,(%rsp)
call   1030 <bn_mul_recursive@plt>
cmpl   $0x20,-0x2c(%rbp)
jl     124a <bn_mul_low_recursive+0x10a>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x2c(%rbp),%ecx
mov    -0x28(%rbp),%r8
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%r8
call   1050 <bn_mul_low_recursive@plt>
mov    -0x8(%rbp),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1060 <bn_add_words@plt>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    -0x28(%rbp),%r8
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%r8
call   1050 <bn_mul_low_recursive@plt>
mov    -0x8(%rbp),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1060 <bn_add_words@plt>
jmp    12f2 <bn_mul_low_recursive+0x1b2>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x2c(%rbp),%ecx
call   1040 <bn_mul_low_normal@plt>
mov    -0x28(%rbp),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1040 <bn_mul_low_normal@plt>
mov    -0x8(%rbp),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1060 <bn_add_words@plt>
mov    -0x8(%rbp),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%rdx
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x2c(%rbp),%ecx
call   1060 <bn_add_words@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bn_mul_low_recursive>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8,%r14
mov    %ecx,%ebp
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r13
mov    %ecx,%ebx
shr    $0x1f,%ebx
add    %ecx,%ebx
sar    %ebx
mov    %r8,(%rsp)
mov    %ebx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <bn_mul_recursive@plt>
movslq %ebx,%rbx
lea    (%r15,%rbx,4),%rdx
cmp    $0x40,%ebp
jl     11d6 <bn_mul_low_recursive+0x96>
mov    %ebp,%eax
lea    (%r14,%rax,4),%r8
mov    %r8,0x10(%rsp)
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebx,%ecx
call   1050 <bn_mul_low_recursive@plt>
lea    0x0(,%rbx,4),%rbp
add    %r13,%rbp
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
mov    %ebx,%ecx
call   1060 <bn_add_words@plt>
lea    (%r12,%rbx,4),%rsi
mov    %r14,%rdi
mov    %r15,%rdx
mov    %ebx,%ecx
mov    0x10(%rsp),%r8
call   1050 <bn_mul_low_recursive@plt>
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
jmp    121c <bn_mul_low_recursive+0xdc>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebx,%ecx
call   1040 <bn_mul_low_normal@plt>
lea    (%r14,%rbx,4),%rdi
lea    (%r12,%rbx,4),%rsi
mov    %rdi,%r12
mov    %r15,%rdx
mov    %ebx,%ecx
call   1040 <bn_mul_low_normal@plt>
lea    0x0(,%rbx,4),%rbp
add    %r13,%rbp
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
mov    %ebx,%ecx
call   1060 <bn_add_words@plt>
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
mov    %ebx,%ecx
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <bn_add_words@plt>

LLVM IR (-O0):
define void @bn_mul_low_recursive(i32* %0, i32* %1, i32* %2, i32 %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%12 = load i32, i32* %9
%13 = sdiv i32 %12, 2
store i32 %13, i32* %11
%14 = load i32*, i32** %6
%15 = load i32*, i32** %7
%16 = load i32*, i32** %8
%17 = load i32, i32* %11
%18 = load i32*, i32** %10
%19 = getelementptr inbounds i32, i32* %18, i64 0
%20 = call i32 @bn_mul_recursive(i32* %14, i32* %15, i32* %16, i32 %17, i32 0, i32 0, i32* %19)
%21 = load i32, i32* %11
%22 = icmp sge i32 %21, 32
br i1 %22, label %23, label %74
23: ; preds = %5
%24 = load i32*, i32** %10
%25 = getelementptr inbounds i32, i32* %24, i64 0
%26 = load i32*, i32** %7
%27 = getelementptr inbounds i32, i32* %26, i64 0
%28 = load i32*, i32** %8
%29 = load i32, i32* %11
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
%32 = load i32, i32* %11
%33 = load i32*, i32** %10
%34 = load i32, i32* %9
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i32, i32* %33, i64 %35
%37 = load i32*, i32** %6
%38 = load i32, i32* %11
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %37, i64 %39
%41 = load i32*, i32** %6
%42 = load i32, i32* %11
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i32, i32* %41, i64 %43
%45 = load i32*, i32** %10
%46 = getelementptr inbounds i32, i32* %45, i64 0
%47 = load i32, i32* %11
%48 = call i32 @bn_add_words(i32* %40, i32* %44, i32* %46, i32 %47)
%49 = load i32*, i32** %10
%50 = getelementptr inbounds i32, i32* %49, i64 0
%51 = load i32*, i32** %7
%52 = load i32, i32* %11
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i32, i32* %51, i64 %53
%55 = load i32*, i32** %8
%56 = getelementptr inbounds i32, i32* %55, i64 0
%57 = load i32, i32* %11
%58 = load i32*, i32** %10
%59 = load i32, i32* %9
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i32, i32* %58, i64 %60
%62 = load i32*, i32** %6
%63 = load i32, i32* %11
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i32, i32* %62, i64 %64
%66 = load i32*, i32** %6
%67 = load i32, i32* %11
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i32, i32* %66, i64 %68
%70 = load i32*, i32** %10
%71 = getelementptr inbounds i32, i32* %70, i64 0
%72 = load i32, i32* %11
%73 = call i32 @bn_add_words(i32* %65, i32* %69, i32* %71, i32 %72)
br label %123
74: ; preds = %5
%75 = load i32*, i32** %10
%76 = getelementptr inbounds i32, i32* %75, i64 0
%77 = load i32*, i32** %7
%78 = getelementptr inbounds i32, i32* %77, i64 0
%79 = load i32*, i32** %8
%80 = load i32, i32* %11
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i32, i32* %79, i64 %81
%83 = load i32, i32* %11
%84 = call i32 @bn_mul_low_normal(i32* %76, i32* %78, i32* %82, i32 %83)
%85 = load i32*, i32** %10
%86 = load i32, i32* %11
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i32, i32* %85, i64 %87
%89 = load i32*, i32** %7
%90 = load i32, i32* %11
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i32, i32* %89, i64 %91
%93 = load i32*, i32** %8
%94 = getelementptr inbounds i32, i32* %93, i64 0
%95 = load i32, i32* %11
%96 = call i32 @bn_mul_low_normal(i32* %88, i32* %92, i32* %94, i32 %95)
%97 = load i32*, i32** %6
%98 = load i32, i32* %11
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i32, i32* %97, i64 %99
%101 = load i32*, i32** %6
%102 = load i32, i32* %11
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i32, i32* %101, i64 %103
%105 = load i32*, i32** %10
%106 = getelementptr inbounds i32, i32* %105, i64 0
%107 = load i32, i32* %11
%108 = call i32 @bn_add_words(i32* %100, i32* %104, i32* %106, i32 %107)
%109 = load i32*, i32** %6
%110 = load i32, i32* %11
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds i32, i32* %109, i64 %111
%113 = load i32*, i32** %6
%114 = load i32, i32* %11
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i32, i32* %113, i64 %115
%117 = load i32*, i32** %10
%118 = load i32, i32* %11
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds i32, i32* %117, i64 %119
%121 = load i32, i32* %11
%122 = call i32 @bn_add_words(i32* %112, i32* %116, i32* %120, i32 %121)
br label %123
123: ; preds = %74, %23
ret void
}

LLVM IR (-O2):
define void @bn_mul_low_recursive(i32* %0, i32* %1, i32* %2, i32 %3, i32* %4) {
%6 = sdiv i32 %3, 2
%7 = tail call i32 @bn_mul_recursive(i32* %0, i32* %1, i32* %2, i32 %6, i32 0, i32 0, i32* %4)
%8 = icmp sgt i32 %3, 63
%9 = sext i32 %6 to i64
%10 = getelementptr inbounds i32, i32* %2, i64 %9
br i1 %8, label %12, label %19
11: ; preds = %19, %12
ret void
12: ; preds = %5
%13 = zext i32 %3 to i64
%14 = getelementptr inbounds i32, i32* %4, i64 %13
tail call void @bn_mul_low_recursive(i32* %4, i32* %1, i32* %10, i32 %6, i32* %14)
%15 = getelementptr inbounds i32, i32* %0, i64 %9
%16 = tail call i32 @bn_add_words(i32* %15, i32* %15, i32* %4, i32 %6)
%17 = getelementptr inbounds i32, i32* %1, i64 %9
tail call void @bn_mul_low_recursive(i32* %4, i32* %17, i32* %2, i32 %6, i32* %14)
%18 = tail call i32 @bn_add_words(i32* %15, i32* %15, i32* %4, i32 %6)
br label %11
19: ; preds = %5
%20 = tail call i32 @bn_mul_low_normal(i32* %4, i32* %1, i32* %10, i32 %6)
%21 = getelementptr inbounds i32, i32* %4, i64 %9
%22 = getelementptr inbounds i32, i32* %1, i64 %9
%23 = tail call i32 @bn_mul_low_normal(i32* %21, i32* %22, i32* %2, i32 %6)
%24 = getelementptr inbounds i32, i32* %0, i64 %9
%25 = tail call i32 @bn_add_words(i32* %24, i32* %24, i32* %4, i32 %6)
%26 = tail call i32 @bn_add_words(i32* %24, i32* %24, i32* %21, i32 %6)
br label %11
}