#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*/ S_StartBackgroundTrack(int /*<<< orphan*/,
                                          int /*<<< orphan*/, int);
int atoi(int /*<<< orphan*/);
void S_QueueMusic_f(void) {
  int type = -2;
  int c;
  c = Cmd_Argc();
  if (c == 3) {
    type = atoi(Cmd_Argv(2));
  }
  if (type != -1) {
    type = -2;
  }
  S_StartBackgroundTrack(Cmd_Argv(1), Cmd_Argv(1), type);
}


x86 assembly (clang, -O0):
<S_QueueMusic_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xfffffffe,-0x4(%rbp)
mov    $0x0,%al
call   1040 <Cmd_Argc@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    1177 <S_QueueMusic_f+0x37>
mov    $0x2,%edi
call   1050 <Cmd_Argv@plt>
mov    %eax,%edi
call   1060 <atoi@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     1188 <S_QueueMusic_f+0x48>
movl   $0xfffffffe,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <Cmd_Argv@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%edi
call   1050 <Cmd_Argv@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
mov    -0x4(%rbp),%edx
call   1030 <S_StartBackgroundTrack@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_QueueMusic_f>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <Cmd_Argc@plt>
mov    $0xfffffffe,%ebx
cmp    $0x3,%eax
jne    1170 <S_QueueMusic_f+0x30>
mov    $0x2,%edi
call   1050 <Cmd_Argv@plt>
mov    %eax,%edi
call   1060 <atoi@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
sete   %bl
or     $0xfffffffe,%ebx
mov    $0x1,%edi
call   1050 <Cmd_Argv@plt>
mov    %eax,%ebp
mov    $0x1,%edi
call   1050 <Cmd_Argv@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <S_StartBackgroundTrack@plt>

LLVM IR (-O0):
define void @S_QueueMusic_f() {
%1 = alloca i32
%2 = alloca i32
store i32 -2, i32* %1
%3 = call i32 (...) @Cmd_Argc()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 3
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @Cmd_Argv(i32 2)
%8 = call i32 @atoi(i32 %7)
store i32 %8, i32* %1
br label %9
9: ; preds = %6, %0
%10 = load i32, i32* %1
%11 = icmp ne i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 -2, i32* %1
br label %13
13: ; preds = %12, %9
%14 = call i32 @Cmd_Argv(i32 1)
%15 = call i32 @Cmd_Argv(i32 1)
%16 = load i32, i32* %1
%17 = call i32 @S_StartBackgroundTrack(i32 %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @S_QueueMusic_f() {
%1 = tail call i32 (...) @Cmd_Argc()
%2 = icmp eq i32 %1, 3
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i32 @Cmd_Argv(i32 2)
%5 = tail call i32 @atoi(i32 %4)
%6 = icmp eq i32 %5, -1
%7 = select i1 %6, i32 -1, i32 -2
br label %8
8: ; preds = %3, %0
%9 = phi i32 [ %7, %3 ], [ -2, %0 ]
%10 = tail call i32 @Cmd_Argv(i32 1)
%11 = tail call i32 @Cmd_Argv(i32 1)
%12 = tail call i32 @S_StartBackgroundTrack(i32 %10, i32 %11, i32 %9)
ret void
}