#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 interv2cents(int /*<<< orphan*/);
int /*<<< orphan*/ pow(double, double);
int equaltemp(int n, double m, double scale[]) {
  int i;
  for (i = 0; i < n; i++)
    scale[i] = interv2cents(pow(m, (double)i / (double)n));
  return n;
}


x86 assembly (clang, -O0):
<equaltemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1181 <equaltemp+0x61>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
cvtsi2sdl -0x4(%rbp),%xmm2
divsd  %xmm2,%xmm1
call   1040 <pow@plt>
mov    %eax,%edi
call   1030 <interv2cents@plt>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113b <equaltemp+0x1b>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equaltemp>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%r14d
test   %edi,%edi
jle    117e <equaltemp+0x5e>
mov    %rsi,%r15
cvtsi2sd %r14d,%xmm1
movsd  %xmm1,0x8(%rsp)
mov    %r14d,%ebp
xor    %ebx,%ebx
movsd  %xmm0,0x10(%rsp)
nopw   0x0(%rax,%rax,1)
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
divsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
call   1040 <pow@plt>
mov    %eax,%edi
call   1030 <interv2cents@plt>
movsd  %xmm0,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1150 <equaltemp+0x30>
mov    %r14d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @equaltemp(i32 %0, double %1, double* %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double*
%7 = alloca i32
store i32 %0, i32* %4
store double %1, double* %5
store double* %2, double** %6
store i32 0, i32* %7
br label %8
8: ; preds = %25, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %28
12: ; preds = %8
%13 = load double, double* %5
%14 = load i32, i32* %7
%15 = sitofp i32 %14 to double
%16 = load i32, i32* %4
%17 = sitofp i32 %16 to double
%18 = fdiv double %15, %17
%19 = call i32 @pow(double %13, double %18)
%20 = call double @interv2cents(i32 %19)
%21 = load double*, double** %6
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %21, i64 %23
store double %20, double* %24
br label %25
25: ; preds = %12
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
store i32 %27, i32* %7
br label %8
28: ; preds = %8
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
define i32 @equaltemp(i32 returned %0, double %1, double* nocapture writeonly %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sitofp i32 %0 to double
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %16, %8 ]
%10 = trunc i64 %9 to i32
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, %6
%13 = tail call i32 @pow(double %1, double %12)
%14 = tail call double @interv2cents(i32 %13)
%15 = getelementptr inbounds double, double* %2, i64 %9
store double %14, double* %15
%16 = add nuw nsw i64 %9, 1
%17 = icmp eq i64 %16, %7
br i1 %17, label %18, label %8
18: ; preds = %8, %3
ret i32 %0
}