#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*/ AT_histo_add_single(long const, double const, double const,
                                       long const, double const, double const,
                                       double *);
void AT_histo_add_multi(const long number_of_bins,
                        const double lowest_left_limit, const double step,
                        const long histo_type, const long n_values,
                        const double value[], const double weight[],
                        double frequency[]) {
  long i;
  for (i = 0; i < n_values; i++) {
    AT_histo_add_single(number_of_bins, lowest_left_limit, step, histo_type,
                        value[i], weight[i], frequency);
  }
}


x86 assembly (clang, -O0):
<AT_histo_add_multi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1196 <AT_histo_add_multi+0x86>
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%rax
mov    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x38(%rbp),%rax
mov    -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x40(%rbp),%rdx
call   1030 <AT_histo_add_single@plt>
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    1142 <AT_histo_add_multi+0x32>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AT_histo_add_multi>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %rdx,%rdx
jle    1184 <AT_histo_add_multi+0x74>
mov    %r9,%r15
mov    %r8,%r12
mov    %rcx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %r14d,%r14d
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %rdx,(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
movsd  0x0(%r13,%r14,8),%xmm2
movsd  (%r12,%r14,8),%xmm3
mov    %rbp,%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <AT_histo_add_single@plt>
mov    (%rsp),%rdx
add    $0x1,%r14
cmp    %r14,%rdx
jne    1150 <AT_histo_add_multi+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @AT_histo_add_multi(i64 %0, double %1, double %2, i64 %3, i64 %4, double* %5, double* %6, double* %7) {
%9 = alloca i64
%10 = alloca double
%11 = alloca double
%12 = alloca i64
%13 = alloca i64
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca i64
store i64 %0, i64* %9
store double %1, double* %10
store double %2, double* %11
store i64 %3, i64* %12
store i64 %4, i64* %13
store double* %5, double** %14
store double* %6, double** %15
store double* %7, double** %16
store i64 0, i64* %17
br label %18
18: ; preds = %37, %8
%19 = load i64, i64* %17
%20 = load i64, i64* %13
%21 = icmp slt i64 %19, %20
br i1 %21, label %22, label %40
22: ; preds = %18
%23 = load i64, i64* %9
%24 = load double, double* %10
%25 = load double, double* %11
%26 = load i64, i64* %12
%27 = load double*, double** %14
%28 = load i64, i64* %17
%29 = getelementptr inbounds double, double* %27, i64 %28
%30 = load double, double* %29
%31 = load double*, double** %15
%32 = load i64, i64* %17
%33 = getelementptr inbounds double, double* %31, i64 %32
%34 = load double, double* %33
%35 = load double*, double** %16
%36 = call i32 @AT_histo_add_single(i64 %23, double %24, double %25, i64 %26, double %30, double %34, double* %35)
br label %37
37: ; preds = %22
%38 = load i64, i64* %17
%39 = add nsw i64 %38, 1
store i64 %39, i64* %17
br label %18
40: ; preds = %18
ret void
}

LLVM IR (-O2):
define void @AT_histo_add_multi(i64 %0, double %1, double %2, i64 %3, i64 %4, double* nocapture %5, double* nocapture %6, double* %7) {
%9 = icmp sgt i64 %4, 0
br i1 %9, label %10, label %19
10: ; preds = %8, %10
%11 = phi i64 [ %17, %10 ], [ 0, %8 ]
%12 = getelementptr inbounds double, double* %5, i64 %11
%13 = load double, double* %12
%14 = getelementptr inbounds double, double* %6, i64 %11
%15 = load double, double* %14
%16 = tail call i32 @AT_histo_add_single(i64 %0, double %1, double %2, i64 %3, double %13, double %15, double* %7)
%17 = add nuw nsw i64 %11, 1
%18 = icmp eq i64 %17, %4
br i1 %18, label %19, label %10
19: ; preds = %10, %8
ret void
}