#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 */
typedef int /*<<< orphan*/ name;

/* Variables and functions */
int Cmd_Argc();
int /*<<< orphan*/ Cmd_Argv(int);
int /*<<< orphan*/ Com_Printf(char *);
int /*<<< orphan*/ Sound_StartLocalSound(char *);
int /*<<< orphan*/ com_strlcpy(char *, int /*<<< orphan*/, int);
void Sound_Play_f(void) {
  int i = 1;
  char name[64];
  if (Cmd_Argc() == 1) {
    Com_Printf("Usage: play <soundfile>\n");
    return;
  }
  while (i < Cmd_Argc()) {
    com_strlcpy(name, Cmd_Argv(i), sizeof(name));
    Sound_StartLocalSound(name);
    i++;
  }
}


x86 assembly (clang, -O0):
<Sound_Play_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
cmp    $0x1,%eax
jne    1180 <Sound_Play_f+0x30>
lea    0xe8a(%rip),%rdi
call   1040 <Com_Printf@plt>
jmp    11d6 <Sound_Play_f+0x86>
jmp    1185 <Sound_Play_f+0x35>
mov    -0x4(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
cmp    %ecx,%eax
jge    11d6 <Sound_Play_f+0x86>
lea    -0x50(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <Cmd_Argv@plt>
mov    -0x60(%rbp),%rdi
mov    %eax,%esi
mov    $0x40,%edx
call   1050 <com_strlcpy@plt>
lea    -0x50(%rbp),%rdi
call   1070 <Sound_StartLocalSound@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <Sound_Play_f+0x35>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sound_Play_f>:
push   %r14
push   %rbx
sub    $0x48,%rsp
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x1,%eax
jne    1176 <Sound_Play_f+0x26>
lea    0xe96(%rip),%rdi
add    $0x48,%rsp
pop    %rbx
pop    %r14
jmp    1040 <Com_Printf@plt>
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
jl     11bc <Sound_Play_f+0x6c>
mov    $0x1,%ebx
mov    %rsp,%r14
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1060 <Cmd_Argv@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x40,%edx
call   1050 <com_strlcpy@plt>
mov    %r14,%rdi
call   1070 <Sound_StartLocalSound@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    %eax,%ebx
jl     1190 <Sound_Play_f+0x40>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: play <soundfile>\0A\00"
define void @Sound_Play_f() {
%1 = alloca i32
%2 = alloca [64 x i8]
store i32 1, i32* %1
%3 = call i32 (...) @Cmd_Argc()
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @Com_Printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %21
7: ; preds = %0
br label %8
8: ; preds = %12, %7
%9 = load i32, i32* %1
%10 = call i32 (...) @Cmd_Argc()
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%14 = load i32, i32* %1
%15 = call i32 @Cmd_Argv(i32 %14)
%16 = call i32 @com_strlcpy(i8* %13, i32 %15, i32 64)
%17 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%18 = call i32 @Sound_StartLocalSound(i8* %17)
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %8
21: ; preds = %5, %8
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Usage: play <soundfile>\0A\00"
define void @Sound_Play_f() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @Cmd_Argc()
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = call i32 (...) @Cmd_Argc()
%7 = icmp sgt i32 %6, 1
br i1 %7, label %10, label %18
8: ; preds = %0
%9 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %18
10: ; preds = %5, %10
%11 = phi i32 [ %15, %10 ], [ 1, %5 ]
%12 = call i32 @Cmd_Argv(i32 %11)
%13 = call i32 @com_strlcpy(i8* %2, i32 %12, i32 64)
%14 = call i32 @Sound_StartLocalSound(i8* %2)
%15 = add nuw nsw i32 %11, 1
%16 = call i32 (...) @Cmd_Argc()
%17 = icmp slt i32 %15, %16
br i1 %17, label %10, label %18
18: ; preds = %10, %5, %8
ret void
}