#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*/ musicoff();
int /*<<< orphan*/ sound1upoff();
int /*<<< orphan*/ soundbonusoff();
int /*<<< orphan*/ soundbreakoff();
int /*<<< orphan*/ soundddieoff();
int /*<<< orphan*/ soundeatmoff();
int /*<<< orphan*/ soundemeraldoff();
int /*<<< orphan*/ soundemoff();
int /*<<< orphan*/ soundexplodeoff(int);
int /*<<< orphan*/ soundfalloff();
int /*<<< orphan*/ soundfireoff(int);
int /*<<< orphan*/ soundgoldoff();
int /*<<< orphan*/ soundwobbleoff();
void soundstop(void) {
  int i;
  soundfalloff();
  soundwobbleoff();
  for (i = 0; i < 2; i++)
    soundfireoff(i);
  musicoff();
  soundbonusoff();
  for (i = 0; i < 2; i++)
    soundexplodeoff(i);
  soundbreakoff();
  soundemoff();
  soundemeraldoff();
  soundgoldoff();
  soundeatmoff();
  soundddieoff();
  sound1upoff();
}


x86 assembly (clang, -O0):
<soundstop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <soundfalloff@plt>
mov    $0x0,%al
call   10f0 <soundwobbleoff@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    120d <soundstop+0x3d>
mov    -0x4(%rbp),%edi
call   10d0 <soundfireoff@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11ed <soundstop+0x1d>
mov    $0x0,%al
call   1030 <musicoff@plt>
mov    $0x0,%al
call   10c0 <soundbonusoff@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1242 <soundstop+0x72>
mov    -0x4(%rbp),%edi
call   1090 <soundexplodeoff@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1222 <soundstop+0x52>
mov    $0x0,%al
call   1080 <soundbreakoff@plt>
mov    $0x0,%al
call   10b0 <soundemoff@plt>
mov    $0x0,%al
call   1070 <soundemeraldoff@plt>
mov    $0x0,%al
call   10a0 <soundgoldoff@plt>
mov    $0x0,%al
call   10e0 <soundeatmoff@plt>
mov    $0x0,%al
call   1040 <soundddieoff@plt>
mov    $0x0,%al
call   1050 <sound1upoff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soundstop>:
push   %rax
xor    %eax,%eax
call   1060 <soundfalloff@plt>
xor    %eax,%eax
call   10f0 <soundwobbleoff@plt>
xor    %edi,%edi
call   10d0 <soundfireoff@plt>
mov    $0x1,%edi
call   10d0 <soundfireoff@plt>
xor    %eax,%eax
call   1030 <musicoff@plt>
xor    %eax,%eax
call   10c0 <soundbonusoff@plt>
xor    %edi,%edi
call   1090 <soundexplodeoff@plt>
mov    $0x1,%edi
call   1090 <soundexplodeoff@plt>
xor    %eax,%eax
call   1080 <soundbreakoff@plt>
xor    %eax,%eax
call   10b0 <soundemoff@plt>
xor    %eax,%eax
call   1070 <soundemeraldoff@plt>
xor    %eax,%eax
call   10a0 <soundgoldoff@plt>
xor    %eax,%eax
call   10e0 <soundeatmoff@plt>
xor    %eax,%eax
call   1040 <soundddieoff@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <sound1upoff@plt>

LLVM IR (-O0):
define void @soundstop() {
%1 = alloca i32
%2 = call i32 (...) @soundfalloff()
%3 = call i32 (...) @soundwobbleoff()
store i32 0, i32* %1
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %1
%9 = call i32 @soundfireoff(i32 %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %4
13: ; preds = %4
%14 = call i32 (...) @musicoff()
%15 = call i32 (...) @soundbonusoff()
store i32 0, i32* %1
br label %16
16: ; preds = %22, %13
%17 = load i32, i32* %1
%18 = icmp slt i32 %17, 2
br i1 %18, label %19, label %25
19: ; preds = %16
%20 = load i32, i32* %1
%21 = call i32 @soundexplodeoff(i32 %20)
br label %22
22: ; preds = %19
%23 = load i32, i32* %1
%24 = add nsw i32 %23, 1
store i32 %24, i32* %1
br label %16
25: ; preds = %16
%26 = call i32 (...) @soundbreakoff()
%27 = call i32 (...) @soundemoff()
%28 = call i32 (...) @soundemeraldoff()
%29 = call i32 (...) @soundgoldoff()
%30 = call i32 (...) @soundeatmoff()
%31 = call i32 (...) @soundddieoff()
%32 = call i32 (...) @sound1upoff()
ret void
}

LLVM IR (-O2):
define void @soundstop() {
%1 = tail call i32 (...) @soundfalloff()
%2 = tail call i32 (...) @soundwobbleoff()
%3 = tail call i32 @soundfireoff(i32 0)
%4 = tail call i32 @soundfireoff(i32 1)
%5 = tail call i32 (...) @musicoff()
%6 = tail call i32 (...) @soundbonusoff()
%7 = tail call i32 @soundexplodeoff(i32 0)
%8 = tail call i32 @soundexplodeoff(i32 1)
%9 = tail call i32 (...) @soundbreakoff()
%10 = tail call i32 (...) @soundemoff()
%11 = tail call i32 (...) @soundemeraldoff()
%12 = tail call i32 (...) @soundgoldoff()
%13 = tail call i32 (...) @soundeatmoff()
%14 = tail call i32 (...) @soundddieoff()
%15 = tail call i32 (...) @sound1upoff()
ret void
}