#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 Cmd_Argc();
int /*<<< orphan*/ Cmd_Argv(int);
int /*<<< orphan*/ Com_Printf(char *);
int /*<<< orphan*/ S_StartStreamingSound(int /*<<< orphan*/, int /*<<< orphan*/,
                                         int, int, int);
int atoi(int /*<<< orphan*/);
void S_StreamingSound_f(void) {
  int c;
  c = Cmd_Argc();
  if (c == 2) {
    S_StartStreamingSound(Cmd_Argv(1), 0, -1, 0, 0);
  } else if (c == 5) {
    S_StartStreamingSound(Cmd_Argv(1), 0, atoi(Cmd_Argv(2)), atoi(Cmd_Argv(3)),
                          atoi(Cmd_Argv(4)));
  } else {
    Com_Printf("streamingsound <soundfile> [entnum channel attenuation]\n");
    return;
  }
}


x86 assembly (clang, -O0):
<S_StreamingSound_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    1190 <S_StreamingSound_f+0x40>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%edi
xor    %r8d,%r8d
mov    $0xffffffff,%edx
mov    %r8d,%esi
mov    %r8d,%ecx
call   1050 <S_StartStreamingSound@plt>
jmp    120e <S_StreamingSound_f+0xbe>
cmpl   $0x5,-0x4(%rbp)
jne    11f8 <S_StreamingSound_f+0xa8>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,-0x10(%rbp)
mov    $0x2,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%edi
call   1070 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    $0x3,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%edi
call   1070 <atoi@plt>
mov    %eax,-0x8(%rbp)
mov    $0x4,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%edi
call   1070 <atoi@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    %eax,%r8d
xor    %esi,%esi
call   1050 <S_StartStreamingSound@plt>
jmp    1209 <S_StreamingSound_f+0xb9>
lea    0xe01(%rip),%rdi
call   1040 <Com_Printf@plt>
jmp    120e <S_StreamingSound_f+0xbe>
jmp    120e <S_StreamingSound_f+0xbe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_StreamingSound_f>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x5,%eax
je     117f <S_StreamingSound_f+0x2f>
cmp    $0x2,%eax
jne    11d8 <S_StreamingSound_f+0x88>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    11cf <S_StreamingSound_f+0x7f>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%r14d
mov    $0x2,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%edi
call   1070 <atoi@plt>
mov    %eax,%ebp
mov    $0x3,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%edi
call   1070 <atoi@plt>
mov    %eax,%ebx
mov    $0x4,%edi
call   1060 <Cmd_Argv@plt>
mov    %eax,%edi
call   1070 <atoi@plt>
mov    %r14d,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <S_StartStreamingSound@plt>
lea    0xe21(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <Com_Printf@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"streamingsound <soundfile> [entnum channel attenuation]\0A\00"
define void @S_StreamingSound_f() {
%1 = alloca i32
%2 = call i32 (...) @Cmd_Argc()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 2
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @Cmd_Argv(i32 1)
%7 = call i32 @S_StartStreamingSound(i32 %6, i32 0, i32 -1, i32 0, i32 0)
br label %23
8: ; preds = %0
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 5
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = call i32 @Cmd_Argv(i32 1)
%13 = call i32 @Cmd_Argv(i32 2)
%14 = call i32 @atoi(i32 %13)
%15 = call i32 @Cmd_Argv(i32 3)
%16 = call i32 @atoi(i32 %15)
%17 = call i32 @Cmd_Argv(i32 4)
%18 = call i32 @atoi(i32 %17)
%19 = call i32 @S_StartStreamingSound(i32 %12, i32 0, i32 %14, i32 %16, i32 %18)
br label %22
20: ; preds = %8
%21 = call i32 @Com_Printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
br label %23
22: ; preds = %11
br label %23
23: ; preds = %20, %22, %5
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"streamingsound <soundfile> [entnum channel attenuation]\0A\00"
define void @S_StreamingSound_f() {
%1 = tail call i32 (...) @Cmd_Argc()
switch i32 %1, label %14 [
i32 2, label %2
i32 5, label %5
]
2: ; preds = %0
%3 = tail call i32 @Cmd_Argv(i32 1)
%4 = tail call i32 @S_StartStreamingSound(i32 %3, i32 0, i32 -1, i32 0, i32 0)
br label %16
5: ; preds = %0
%6 = tail call i32 @Cmd_Argv(i32 1)
%7 = tail call i32 @Cmd_Argv(i32 2)
%8 = tail call i32 @atoi(i32 %7)
%9 = tail call i32 @Cmd_Argv(i32 3)
%10 = tail call i32 @atoi(i32 %9)
%11 = tail call i32 @Cmd_Argv(i32 4)
%12 = tail call i32 @atoi(i32 %11)
%13 = tail call i32 @S_StartStreamingSound(i32 %6, i32 0, i32 %8, i32 %10, i32 %12)
br label %16
14: ; preds = %0
%15 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %2, %5, %14
ret void
}