#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, double, int, int);
int /*<<< orphan*/ delay(int);
void S_OhOoh() {
  for (int i = 880; i < 2000; i = i * 1.04) {
    ZowiTone(10, i, 8, 3);
  }
  delay(200);
  for (int i = 880; i < 2000; i = i * 1.04) {
    ZowiTone(10, 987.77, 5, 10);
  }
}


x86 assembly (clang, -O0):
<S_OhOoh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x370,-0x4(%rbp)
cmpl   $0x7d0,-0x4(%rbp)
jge    1172 <S_OhOoh+0x52>
cvtsi2sdl -0x4(%rbp),%xmm0
mov    $0xa,%edi
mov    $0x8,%esi
mov    $0x3,%edx
call   1030 <ZowiTone@plt>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xea6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <S_OhOoh+0xf>
mov    $0xc8,%edi
call   1040 <delay@plt>
movl   $0x370,-0x8(%rbp)
cmpl   $0x7d0,-0x8(%rbp)
jge    11c6 <S_OhOoh+0xa6>
mov    $0xa,%edx
movsd  0xe63(%rip),%xmm0
mov    $0x5,%esi
mov    %edx,%edi
call   1030 <ZowiTone@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe52(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
jmp    1183 <S_OhOoh+0x63>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_OhOoh>:
push   %rbx
sub    $0x10,%rsp
mov    $0x370,%eax
nopw   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0xa,%edi
mov    $0x8,%esi
mov    $0x3,%edx
call   1030 <ZowiTone@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0xea1(%rip),%xmm0
cvttsd2si %xmm0,%eax
cmp    $0x7d0,%eax
jl     1130 <S_OhOoh+0x10>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0x370,%ebx
nopl   0x0(%rax)
mov    $0xa,%edi
movsd  0xe7b(%rip),%xmm0
mov    $0x5,%esi
mov    $0xa,%edx
call   1030 <ZowiTone@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0xe55(%rip),%xmm0
cvttsd2si %xmm0,%ebx
cmp    $0x7d0,%ebx
jl     1180 <S_OhOoh+0x60>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @S_OhOoh() {
br label %3
1: ; preds = %3
%2 = tail call i32 @delay(i32 200)
br label %11
3: ; preds = %0, %3
%4 = phi i32 [ 880, %0 ], [ %8, %3 ]
%5 = sitofp i32 %4 to double
%6 = tail call i32 @ZowiTone(i32 10, double %5, i32 8, i32 3)
%7 = fmul double %5, 1.040000e+00
%8 = fptosi double %7 to i32
%9 = icmp slt i32 %8, 2000
br i1 %9, label %3, label %1
10: ; preds = %11
ret void
11: ; preds = %1, %11
%12 = phi i32 [ 880, %1 ], [ %16, %11 ]
%13 = tail call i32 @ZowiTone(i32 10, double 0x408EDE28F5C28F5C, i32 5, i32 10)
%14 = sitofp i32 %12 to double
%15 = fmul double %14, 1.040000e+00
%16 = fptosi double %15 to i32
%17 = icmp slt i32 %16, 2000
br i1 %17, label %11, label %10
}