#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_fastAlarm() {
  for (int i = 1220; i < 2720; i = i * 1.04) {
    ZowiTone(10, i, 20, 10);
  }
  delay(30);
  for (int i = 1220; i < 4720; i = i * 1.04) {
    ZowiTone(10, i, 10, 10);
  }
}


x86 assembly (clang, -O0):
<S_fastAlarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4c4,-0x4(%rbp)
cmpl   $0xaa0,-0x4(%rbp)
jge    116d <S_fastAlarm+0x4d>
mov    -0x4(%rbp),%esi
mov    $0xa,%ecx
mov    $0x14,%edx
mov    %ecx,%edi
call   1030 <ZowiTone@plt>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xea3(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <S_fastAlarm+0xf>
mov    $0x1e,%edi
call   1040 <delay@plt>
movl   $0x4c4,-0x8(%rbp)
cmpl   $0x1270,-0x8(%rbp)
jge    11b9 <S_fastAlarm+0x99>
mov    -0x8(%rbp),%esi
mov    $0xa,%ecx
mov    %ecx,%edi
mov    %ecx,%edx
call   1030 <ZowiTone@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe57(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
jmp    117e <S_fastAlarm+0x5e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_fastAlarm>:
push   %rbx
mov    $0x4c4,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
mov    %ebx,%esi
mov    $0x14,%edx
mov    $0xa,%ecx
call   1030 <ZowiTone@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0xeab(%rip),%xmm0
cvttsd2si %xmm0,%ebx
cmp    $0xaa0,%ebx
jl     1130 <S_fastAlarm+0x10>
mov    $0x1e,%edi
call   1040 <delay@plt>
mov    $0x4c4,%ebx
mov    $0xa,%edi
mov    %ebx,%esi
mov    $0xa,%edx
mov    $0xa,%ecx
call   1030 <ZowiTone@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0xe6b(%rip),%xmm0
cvttsd2si %xmm0,%ebx
cmp    $0x1270,%ebx
jl     1170 <S_fastAlarm+0x50>
pop    %rbx
ret

LLVM IR (-O0):
define void @S_fastAlarm() {
%1 = alloca i32
%2 = alloca i32
store i32 1220, i32* %1
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 2720
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 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 30)
store i32 1220, i32* %2
br label %16
16: ; preds = %22, %14
%17 = load i32, i32* %2
%18 = icmp slt i32 %17, 4720
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 10)
br label %22
22: ; preds = %19
%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 %16
27: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @S_fastAlarm() {
br label %3
1: ; preds = %3
%2 = tail call i32 @delay(i32 30)
br label %11
3: ; preds = %0, %3
%4 = phi i32 [ 1220, %0 ], [ %8, %3 ]
%5 = tail call i32 @ZowiTone(i32 10, i32 %4, i32 20, 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, 2720
br i1 %9, label %3, label %1
10: ; preds = %11
ret void
11: ; preds = %1, %11
%12 = phi i32 [ 1220, %1 ], [ %16, %11 ]
%13 = tail call i32 @ZowiTone(i32 10, i32 %12, i32 10, 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, 4720
br i1 %17, label %11, label %10
}