#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 */
double exp(double);
void meyer(double *p, double *x, int m, int n, void *data) {
  register int i;
  double ui;
  for (i = 0; i < n; ++i) {
    ui = 0.45 + 0.05 * i;
    x[i] = p[0] * exp(10.0 * p[1] / (ui + p[2]) - 13.0);
  }
}


x86 assembly (clang, -O0):
<meyer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11c7 <meyer+0xb7>
cvtsi2sdl -0x24(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xe90(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
movsd  -0x30(%rbp),%xmm1
mov    -0x8(%rbp),%rax
addsd  0x10(%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe69(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1131 <meyer+0x21>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<meyer>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %ecx,%ecx
jle    118d <meyer+0x7d>
mov    %rsi,%r14
mov    %rdi,%r12
mov    %ecx,%r15d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
mulsd  0xec1(%rip),%xmm1
addsd  0xec1(%rip),%xmm1
movsd  (%r12),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%r12),%xmm0
mulsd  0xeaf(%rip),%xmm0
addsd  0x10(%r12),%xmm1
divsd  %xmm1,%xmm0
addsd  0xea4(%rip),%xmm0
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <meyer+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @meyer(double* %0, double* %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
store i32 0, i32* %11
br label %13
13: ; preds = %41, %5
%14 = load i32, i32* %11
%15 = load i32, i32* %9
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %44
17: ; preds = %13
%18 = load i32, i32* %11
%19 = sitofp i32 %18 to double
%20 = call double @llvm.fmuladd.f64(double 5.000000e-02, double %19, double 4.500000e-01)
store double %20, double* %12
%21 = load double*, double** %6
%22 = getelementptr inbounds double, double* %21, i64 0
%23 = load double, double* %22
%24 = load double*, double** %6
%25 = getelementptr inbounds double, double* %24, i64 1
%26 = load double, double* %25
%27 = fmul double 1.000000e+01, %26
%28 = load double, double* %12
%29 = load double*, double** %6
%30 = getelementptr inbounds double, double* %29, i64 2
%31 = load double, double* %30
%32 = fadd double %28, %31
%33 = fdiv double %27, %32
%34 = fsub double %33, 1.300000e+01
%35 = call double @exp(double %34)
%36 = fmul double %23, %35
%37 = load double*, double** %7
%38 = load i32, i32* %11
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %37, i64 %39
store double %36, double* %40
br label %41
41: ; preds = %17
%42 = load i32, i32* %11
%43 = add nsw i32 %42, 1
store i32 %43, i32* %11
br label %13
44: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @meyer(double* nocapture %0, double* nocapture writeonly %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = icmp sgt i32 %3, 0
br i1 %6, label %7, label %28
7: ; preds = %5
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = getelementptr inbounds double, double* %0, i64 2
%10 = zext i32 %3 to i64
br label %11
11: ; preds = %7, %11
%12 = phi i64 [ 0, %7 ], [ %26, %11 ]
%13 = trunc i64 %12 to i32
%14 = sitofp i32 %13 to double
%15 = tail call double @llvm.fmuladd.f64(double %14, double 5.000000e-02, double 4.500000e-01)
%16 = load double, double* %0
%17 = load double, double* %8
%18 = fmul double %17, 1.000000e+01
%19 = load double, double* %9
%20 = fadd double %15, %19
%21 = fdiv double %18, %20
%22 = fadd double %21, -1.300000e+01
%23 = tail call double @exp(double %22)
%24 = fmul double %16, %23
%25 = getelementptr inbounds double, double* %1, i64 %12
store double %24, double* %25
%26 = add nuw nsw i64 %12, 1
%27 = icmp eq i64 %26, %10
br i1 %27, label %28, label %11
28: ; preds = %11, %5
ret void
}