#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*/ ZowiTone(int, int, int, int);
void S_happy() {
  for (int i = 1500; i < 2500; i = i * 1.05) {
    ZowiTone(10, i, 20, 8);
  }
  for (int i = 2500; i > 1500; i = i / 1.05) {
    ZowiTone(10, i, 25, 8);
  }
}


x86 assembly (clang, -O0):
<S_happy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5dc,-0x4(%rbp)
cmpl   $0x9c4,-0x4(%rbp)
jge    1160 <S_happy+0x50>
mov    -0x4(%rbp),%esi
mov    $0xa,%edi
mov    $0x14,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <S_happy+0xf>
movl   $0x9c4,-0x8(%rbp)
cmpl   $0x5dc,-0x8(%rbp)
jle    11a8 <S_happy+0x98>
mov    -0x8(%rbp),%esi
mov    $0xa,%edi
mov    $0x19,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe68(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
jmp    1167 <S_happy+0x57>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_happy>:
push   %rax
mov    $0xa,%edi
mov    $0x5dc,%esi
mov    $0x14,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x627,%esi
mov    $0x14,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x675,%esi
mov    $0x14,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x6c7,%esi
mov    $0x14,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x71d,%esi
mov    $0x14,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x778,%esi
mov    $0x14,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x7d7,%esi
mov    $0x14,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x83b,%esi
mov    $0x14,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x8a4,%esi
mov    $0x14,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x912,%esi
mov    $0x14,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x986,%esi
mov    $0x14,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x9c4,%esi
mov    $0x19,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x94c,%esi
mov    $0x19,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x8da,%esi
mov    $0x19,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x86e,%esi
mov    $0x19,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x807,%esi
mov    $0x19,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x7a5,%esi
mov    $0x19,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x747,%esi
mov    $0x19,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x6ee,%esi
mov    $0x19,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x699,%esi
mov    $0x19,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x648,%esi
mov    $0x19,%edx
mov    $0x8,%ecx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
mov    $0x5fb,%esi
mov    $0x19,%edx
mov    $0x8,%ecx
pop    %rax
jmp    1030 <ZowiTone@plt>

LLVM IR (-O0):
define void @S_happy() {
%1 = alloca i32
%2 = alloca i32
store i32 1500, i32* %1
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 2500
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %1
%8 = call i32 @ZowiTone(i32 10, i32 %7, i32 20, i32 8)
br label %9
9: ; preds = %6
%10 = load i32, i32* %1
%11 = sitofp i32 %10 to double
%12 = fmul double %11, 1.050000e+00
%13 = fptosi double %12 to i32
store i32 %13, i32* %1
br label %3
14: ; preds = %3
store i32 2500, i32* %2
br label %15
15: ; preds = %21, %14
%16 = load i32, i32* %2
%17 = icmp sgt i32 %16, 1500
br i1 %17, label %18, label %26
18: ; preds = %15
%19 = load i32, i32* %2
%20 = call i32 @ZowiTone(i32 10, i32 %19, i32 25, i32 8)
br label %21
21: ; preds = %18
%22 = load i32, i32* %2
%23 = sitofp i32 %22 to double
%24 = fdiv double %23, 1.050000e+00
%25 = fptosi double %24 to i32
store i32 %25, i32* %2
br label %15
26: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @S_happy() {
%1 = tail call i32 @ZowiTone(i32 10, i32 1500, i32 20, i32 8)
%2 = tail call i32 @ZowiTone(i32 10, i32 1575, i32 20, i32 8)
%3 = tail call i32 @ZowiTone(i32 10, i32 1653, i32 20, i32 8)
%4 = tail call i32 @ZowiTone(i32 10, i32 1735, i32 20, i32 8)
%5 = tail call i32 @ZowiTone(i32 10, i32 1821, i32 20, i32 8)
%6 = tail call i32 @ZowiTone(i32 10, i32 1912, i32 20, i32 8)
%7 = tail call i32 @ZowiTone(i32 10, i32 2007, i32 20, i32 8)
%8 = tail call i32 @ZowiTone(i32 10, i32 2107, i32 20, i32 8)
%9 = tail call i32 @ZowiTone(i32 10, i32 2212, i32 20, i32 8)
%10 = tail call i32 @ZowiTone(i32 10, i32 2322, i32 20, i32 8)
%11 = tail call i32 @ZowiTone(i32 10, i32 2438, i32 20, i32 8)
%12 = tail call i32 @ZowiTone(i32 10, i32 2500, i32 25, i32 8)
%13 = tail call i32 @ZowiTone(i32 10, i32 2380, i32 25, i32 8)
%14 = tail call i32 @ZowiTone(i32 10, i32 2266, i32 25, i32 8)
%15 = tail call i32 @ZowiTone(i32 10, i32 2158, i32 25, i32 8)
%16 = tail call i32 @ZowiTone(i32 10, i32 2055, i32 25, i32 8)
%17 = tail call i32 @ZowiTone(i32 10, i32 1957, i32 25, i32 8)
%18 = tail call i32 @ZowiTone(i32 10, i32 1863, i32 25, i32 8)
%19 = tail call i32 @ZowiTone(i32 10, i32 1774, i32 25, i32 8)
%20 = tail call i32 @ZowiTone(i32 10, i32 1689, i32 25, i32 8)
%21 = tail call i32 @ZowiTone(i32 10, i32 1608, i32 25, i32 8)
%22 = tail call i32 @ZowiTone(i32 10, i32 1531, i32 25, i32 8)
ret void
}