#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 */
float expf(int);
void release_prev(float *out, int stop, float srate) {
  int i;
  for (i = 0; i < stop; i++) {
    out[i] *= expf(-i * 200.0 / srate);
  }
}


x86 assembly (clang, -O0):
<release_prev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1182 <release_prev+0x72>
xor    %eax,%eax
sub    -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeb8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <expf@plt>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mulss  (%rax,%rcx,4),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <release_prev+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<release_prev>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
test   %esi,%esi
jle    1175 <release_prev+0x65>
mov    %rdi,%r15
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %esi,%r14d
neg    %r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0xeb1(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <expf@plt>
mulss  (%r15),%xmm0
movss  %xmm0,(%r15)
add    $0xffffffffffffffff,%rbx
add    $0x4,%r15
cmp    %rbx,%r14
jne    1140 <release_prev+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @release_prev(float* nocapture %0, i32 %1, float %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %22
5: ; preds = %3
%6 = fpext float %2 to double
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %20, %8 ]
%10 = trunc i64 %9 to i32
%11 = sub i32 0, %10
%12 = sitofp i32 %11 to double
%13 = fmul double %12, 2.000000e+02
%14 = fdiv double %13, %6
%15 = fptosi double %14 to i32
%16 = tail call float @expf(i32 %15)
%17 = getelementptr inbounds float, float* %0, i64 %9
%18 = load float, float* %17
%19 = fmul float %16, %18
store float %19, float* %17
%20 = add nuw nsw i64 %9, 1
%21 = icmp eq i64 %20, %7
br i1 %21, label %22, label %8
22: ; preds = %8, %3
ret void
}