#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 */
unsigned long bn_mul_add_words(unsigned long *, unsigned long *, int,
                               unsigned long);
unsigned long bn_mul_words(unsigned long *, unsigned long *, int,
                           unsigned long);
void bn_mul_comba8(unsigned long *r, unsigned long *a, unsigned long *b) {
  r[8] = bn_mul_words(&(r[0]), a, 8, b[0]);
  r[9] = bn_mul_add_words(&(r[1]), a, 8, b[1]);
  r[10] = bn_mul_add_words(&(r[2]), a, 8, b[2]);
  r[11] = bn_mul_add_words(&(r[3]), a, 8, b[3]);
  r[12] = bn_mul_add_words(&(r[4]), a, 8, b[4]);
  r[13] = bn_mul_add_words(&(r[5]), a, 8, b[5]);
  r[14] = bn_mul_add_words(&(r[6]), a, 8, b[6]);
  r[15] = bn_mul_add_words(&(r[7]), a, 8, b[7]);
}


x86 assembly (clang, -O0):
<bn_mul_comba8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    $0x8,%edx
call   1030 <bn_mul_words@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x40(%rax)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rcx
mov    $0x8,%edx
call   1040 <bn_mul_add_words@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x48(%rax)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rcx
mov    $0x8,%edx
call   1040 <bn_mul_add_words@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x50(%rax)
mov    -0x8(%rbp),%rdi
add    $0x18,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rcx
mov    $0x8,%edx
call   1040 <bn_mul_add_words@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x58(%rax)
mov    -0x8(%rbp),%rdi
add    $0x20,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%rcx
mov    $0x8,%edx
call   1040 <bn_mul_add_words@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x60(%rax)
mov    -0x8(%rbp),%rdi
add    $0x28,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    0x28(%rax),%rcx
mov    $0x8,%edx
call   1040 <bn_mul_add_words@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x68(%rax)
mov    -0x8(%rbp),%rdi
add    $0x30,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    0x30(%rax),%rcx
mov    $0x8,%edx
call   1040 <bn_mul_add_words@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x70(%rax)
mov    -0x8(%rbp),%rdi
add    $0x38,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    0x38(%rax),%rcx
mov    $0x8,%edx
call   1040 <bn_mul_add_words@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x78(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bn_mul_comba8>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdx),%rcx
mov    $0x8,%edx
call   1030 <bn_mul_words@plt>
mov    %rax,0x40(%rbx)
lea    0x8(%rbx),%rdi
mov    0x8(%r15),%rcx
mov    %r14,%rsi
mov    $0x8,%edx
call   1040 <bn_mul_add_words@plt>
mov    %rax,0x48(%rbx)
lea    0x10(%rbx),%rdi
mov    0x10(%r15),%rcx
mov    %r14,%rsi
mov    $0x8,%edx
call   1040 <bn_mul_add_words@plt>
mov    %rax,0x50(%rbx)
lea    0x18(%rbx),%rdi
mov    0x18(%r15),%rcx
mov    %r14,%rsi
mov    $0x8,%edx
call   1040 <bn_mul_add_words@plt>
mov    %rax,0x58(%rbx)
lea    0x20(%rbx),%rdi
mov    0x20(%r15),%rcx
mov    %r14,%rsi
mov    $0x8,%edx
call   1040 <bn_mul_add_words@plt>
mov    %rax,0x60(%rbx)
lea    0x28(%rbx),%rdi
mov    0x28(%r15),%rcx
mov    %r14,%rsi
mov    $0x8,%edx
call   1040 <bn_mul_add_words@plt>
mov    %rax,0x68(%rbx)
lea    0x30(%rbx),%rdi
mov    0x30(%r15),%rcx
mov    %r14,%rsi
mov    $0x8,%edx
call   1040 <bn_mul_add_words@plt>
mov    %rax,0x70(%rbx)
lea    0x38(%rbx),%rdi
mov    0x38(%r15),%rcx
mov    %r14,%rsi
mov    $0x8,%edx
call   1040 <bn_mul_add_words@plt>
mov    %rax,0x78(%rbx)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @bn_mul_comba8(i64* %0, i64* %1, i64* %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64*
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%7 = load i64*, i64** %4
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64*, i64** %5
%10 = load i64*, i64** %6
%11 = getelementptr inbounds i64, i64* %10, i64 0
%12 = load i64, i64* %11
%13 = call i64 @bn_mul_words(i64* %8, i64* %9, i32 8, i64 %12)
%14 = load i64*, i64** %4
%15 = getelementptr inbounds i64, i64* %14, i64 8
store i64 %13, i64* %15
%16 = load i64*, i64** %4
%17 = getelementptr inbounds i64, i64* %16, i64 1
%18 = load i64*, i64** %5
%19 = load i64*, i64** %6
%20 = getelementptr inbounds i64, i64* %19, i64 1
%21 = load i64, i64* %20
%22 = call i64 @bn_mul_add_words(i64* %17, i64* %18, i32 8, i64 %21)
%23 = load i64*, i64** %4
%24 = getelementptr inbounds i64, i64* %23, i64 9
store i64 %22, i64* %24
%25 = load i64*, i64** %4
%26 = getelementptr inbounds i64, i64* %25, i64 2
%27 = load i64*, i64** %5
%28 = load i64*, i64** %6
%29 = getelementptr inbounds i64, i64* %28, i64 2
%30 = load i64, i64* %29
%31 = call i64 @bn_mul_add_words(i64* %26, i64* %27, i32 8, i64 %30)
%32 = load i64*, i64** %4
%33 = getelementptr inbounds i64, i64* %32, i64 10
store i64 %31, i64* %33
%34 = load i64*, i64** %4
%35 = getelementptr inbounds i64, i64* %34, i64 3
%36 = load i64*, i64** %5
%37 = load i64*, i64** %6
%38 = getelementptr inbounds i64, i64* %37, i64 3
%39 = load i64, i64* %38
%40 = call i64 @bn_mul_add_words(i64* %35, i64* %36, i32 8, i64 %39)
%41 = load i64*, i64** %4
%42 = getelementptr inbounds i64, i64* %41, i64 11
store i64 %40, i64* %42
%43 = load i64*, i64** %4
%44 = getelementptr inbounds i64, i64* %43, i64 4
%45 = load i64*, i64** %5
%46 = load i64*, i64** %6
%47 = getelementptr inbounds i64, i64* %46, i64 4
%48 = load i64, i64* %47
%49 = call i64 @bn_mul_add_words(i64* %44, i64* %45, i32 8, i64 %48)
%50 = load i64*, i64** %4
%51 = getelementptr inbounds i64, i64* %50, i64 12
store i64 %49, i64* %51
%52 = load i64*, i64** %4
%53 = getelementptr inbounds i64, i64* %52, i64 5
%54 = load i64*, i64** %5
%55 = load i64*, i64** %6
%56 = getelementptr inbounds i64, i64* %55, i64 5
%57 = load i64, i64* %56
%58 = call i64 @bn_mul_add_words(i64* %53, i64* %54, i32 8, i64 %57)
%59 = load i64*, i64** %4
%60 = getelementptr inbounds i64, i64* %59, i64 13
store i64 %58, i64* %60
%61 = load i64*, i64** %4
%62 = getelementptr inbounds i64, i64* %61, i64 6
%63 = load i64*, i64** %5
%64 = load i64*, i64** %6
%65 = getelementptr inbounds i64, i64* %64, i64 6
%66 = load i64, i64* %65
%67 = call i64 @bn_mul_add_words(i64* %62, i64* %63, i32 8, i64 %66)
%68 = load i64*, i64** %4
%69 = getelementptr inbounds i64, i64* %68, i64 14
store i64 %67, i64* %69
%70 = load i64*, i64** %4
%71 = getelementptr inbounds i64, i64* %70, i64 7
%72 = load i64*, i64** %5
%73 = load i64*, i64** %6
%74 = getelementptr inbounds i64, i64* %73, i64 7
%75 = load i64, i64* %74
%76 = call i64 @bn_mul_add_words(i64* %71, i64* %72, i32 8, i64 %75)
%77 = load i64*, i64** %4
%78 = getelementptr inbounds i64, i64* %77, i64 15
store i64 %76, i64* %78
ret void
}

LLVM IR (-O2):
define void @bn_mul_comba8(i64* %0, i64* %1, i64* nocapture %2) {
%4 = load i64, i64* %2
%5 = tail call i64 @bn_mul_words(i64* %0, i64* %1, i32 8, i64 %4)
%6 = getelementptr inbounds i64, i64* %0, i64 8
store i64 %5, i64* %6
%7 = getelementptr inbounds i64, i64* %0, i64 1
%8 = getelementptr inbounds i64, i64* %2, i64 1
%9 = load i64, i64* %8
%10 = tail call i64 @bn_mul_add_words(i64* %7, i64* %1, i32 8, i64 %9)
%11 = getelementptr inbounds i64, i64* %0, i64 9
store i64 %10, i64* %11
%12 = getelementptr inbounds i64, i64* %0, i64 2
%13 = getelementptr inbounds i64, i64* %2, i64 2
%14 = load i64, i64* %13
%15 = tail call i64 @bn_mul_add_words(i64* %12, i64* %1, i32 8, i64 %14)
%16 = getelementptr inbounds i64, i64* %0, i64 10
store i64 %15, i64* %16
%17 = getelementptr inbounds i64, i64* %0, i64 3
%18 = getelementptr inbounds i64, i64* %2, i64 3
%19 = load i64, i64* %18
%20 = tail call i64 @bn_mul_add_words(i64* %17, i64* %1, i32 8, i64 %19)
%21 = getelementptr inbounds i64, i64* %0, i64 11
store i64 %20, i64* %21
%22 = getelementptr inbounds i64, i64* %0, i64 4
%23 = getelementptr inbounds i64, i64* %2, i64 4
%24 = load i64, i64* %23
%25 = tail call i64 @bn_mul_add_words(i64* %22, i64* %1, i32 8, i64 %24)
%26 = getelementptr inbounds i64, i64* %0, i64 12
store i64 %25, i64* %26
%27 = getelementptr inbounds i64, i64* %0, i64 5
%28 = getelementptr inbounds i64, i64* %2, i64 5
%29 = load i64, i64* %28
%30 = tail call i64 @bn_mul_add_words(i64* %27, i64* %1, i32 8, i64 %29)
%31 = getelementptr inbounds i64, i64* %0, i64 13
store i64 %30, i64* %31
%32 = getelementptr inbounds i64, i64* %0, i64 6
%33 = getelementptr inbounds i64, i64* %2, i64 6
%34 = load i64, i64* %33
%35 = tail call i64 @bn_mul_add_words(i64* %32, i64* %1, i32 8, i64 %34)
%36 = getelementptr inbounds i64, i64* %0, i64 14
store i64 %35, i64* %36
%37 = getelementptr inbounds i64, i64* %0, i64 7
%38 = getelementptr inbounds i64, i64* %2, i64 7
%39 = load i64, i64* %38
%40 = tail call i64 @bn_mul_add_words(i64* %37, i64* %1, i32 8, i64 %39)
%41 = getelementptr inbounds i64, i64* %0, i64 15
store i64 %40, i64* %41
ret void
}