#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*/ strcpy(char *, char *);
int dlna_get_audio_profile_wma(int channels, int bitrate, char *profile,
                               char *mimeType) {
  strcpy(mimeType, "audio/x-ms-wma");
  if (channels == 2 && bitrate < (193 * 1024)) {
    strcpy(profile, "WMABASE");
    return 0;
  } else if (channels == 2) {
    strcpy(profile, "WMAFULL");
    return 0;
  } else if (channels > 2) {
    strcpy(profile, "WMAPRO");
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<dlna_get_audio_profile_wma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xecf(%rip),%rsi
call   1030 <strcpy@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1169 <dlna_get_audio_profile_wma+0x59>
cmpl   $0x30400,-0xc(%rbp)
jge    1169 <dlna_get_audio_profile_wma+0x59>
mov    -0x18(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x4(%rbp)
jmp    11c6 <dlna_get_audio_profile_wma+0xb6>
cmpl   $0x2,-0x8(%rbp)
jne    118f <dlna_get_audio_profile_wma+0x7f>
mov    -0x18(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x4(%rbp)
jmp    11c6 <dlna_get_audio_profile_wma+0xb6>
cmpl   $0x2,-0x8(%rbp)
jle    11b5 <dlna_get_audio_profile_wma+0xa5>
mov    -0x18(%rbp),%rdi
lea    0xe7b(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x4(%rbp)
jmp    11c6 <dlna_get_audio_profile_wma+0xb6>
jmp    11ba <dlna_get_audio_profile_wma+0xaa>
jmp    11bf <dlna_get_audio_profile_wma+0xaf>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlna_get_audio_profile_wma>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xede(%rip),%rsi
mov    %rcx,%rdi
call   1030 <strcpy@plt>
cmp    $0x30400,%ebp
lea    0xed8(%rip),%rsi
lea    0xed9(%rip),%rax
cmovge %rax,%rsi
cmp    $0x2,%ebx
cmovne %rax,%rsi
je     1159 <dlna_get_audio_profile_wma+0x49>
mov    $0xffffffff,%eax
jle    1163 <dlna_get_audio_profile_wma+0x53>
lea    0xec6(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"audio/x-ms-wma\00"
@.str.1 = [8 x i8] c"WMABASE\00"
@.str.2 = [8 x i8] c"WMAFULL\00"
@.str.3 = [7 x i8] c"WMAPRO\00"
define i32 @dlna_get_audio_profile_wma(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%10 = load i8*, i8** %9
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %20
14: ; preds = %4
%15 = load i32, i32* %7
%16 = icmp slt i32 %15, 197632
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i8*, i8** %8
%19 = call i32 @strcpy(i8* %18, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %5
br label %35
20: ; preds = %14, %4
%21 = load i32, i32* %6
%22 = icmp eq i32 %21, 2
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i8*, i8** %8
%25 = call i32 @strcpy(i8* %24, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %5
br label %35
26: ; preds = %20
%27 = load i32, i32* %6
%28 = icmp sgt i32 %27, 2
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = load i8*, i8** %8
%31 = call i32 @strcpy(i8* %30, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %5
br label %35
32: ; preds = %26
br label %33
33: ; preds = %32
br label %34
34: ; preds = %33
store i32 -1, i32* %5
br label %35
35: ; preds = %34, %29, %23, %17
%36 = load i32, i32* %5
ret i32 %36
}

LLVM IR (-O2):
@.str = [15 x i8] c"audio/x-ms-wma\00"
@.str.1 = [8 x i8] c"WMABASE\00"
@.str.2 = [8 x i8] c"WMAFULL\00"
@.str.3 = [7 x i8] c"WMAPRO\00"
define i32 @dlna_get_audio_profile_wma(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %0, 2
%7 = icmp slt i32 %1, 197632
%8 = and i1 %6, %7
%9 = select i1 %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
br i1 %6, label %12, label %10
10: ; preds = %4
%11 = icmp sgt i32 %0, 2
br i1 %11, label %12, label %15
12: ; preds = %4, %10
%13 = phi i8* [ %9, %4 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %10 ]
%14 = tail call i32 @strcpy(i8* %2, i8* %13)
br label %15
15: ; preds = %12, %10
%16 = phi i32 [ -1, %10 ], [ 0, %12 ]
ret i32 %16
}