#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);
int /*<<< orphan*/ delay(int);
void S_sleeping() {
  for (int i = 100; i < 500; i = i * 1.04) {
    ZowiTone(10, i, 10, 10);
  }
  delay(500);
  for (int i = 400; i > 100; i = i / 1.04) {
    ZowiTone(10, i, 10, 0);
  }
}


x86 assembly (clang, -O0):
<S_sleeping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
cmpl   $0x1f4,-0x4(%rbp)
jge    116a <S_sleeping+0x4a>
mov    -0x4(%rbp),%esi
mov    $0xa,%ecx
mov    %ecx,%edi
mov    %ecx,%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_sleeping+0xf>
mov    $0x1f4,%edi
call   1040 <delay@plt>
movl   $0x190,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jle    11b3 <S_sleeping+0x93>
mov    -0x8(%rbp),%esi
mov    $0xa,%edx
xor    %ecx,%ecx
mov    %edx,%edi
call   1030 <ZowiTone@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe5d(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
jmp    117b <S_sleeping+0x5b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_sleeping>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
mov    %ebx,%esi
mov    $0xa,%edx
mov    $0xa,%ecx
call   1030 <ZowiTone@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0xeab(%rip),%xmm0
cvttsd2si %xmm0,%ebx
cmp    $0x1f4,%ebx
jl     1130 <S_sleeping+0x10>
mov    $0x1f4,%edi
call   1040 <delay@plt>
mov    $0x190,%ebx
mov    $0xa,%edi
mov    %ebx,%esi
mov    $0xa,%edx
xor    %ecx,%ecx
call   1030 <ZowiTone@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
divsd  0xe6e(%rip),%xmm0
cvttsd2si %xmm0,%ebx
cmp    $0x64,%ebx
jg     1170 <S_sleeping+0x50>
pop    %rbx
ret

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

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