#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 */
struct keyval {
  int dummy;
};

/* Variables and functions */
scalar_t__ is_freeform_true(char const *);
scalar_t__ is_various_artists(char const *);
char *keyvals_get_val(struct keyval const *, char *);
int /*<<< orphan*/ u_strcase_equal(char const *, char const *);
int track_is_compilation(const struct keyval *comments) {
  const char *c, *a, *aa;
  c = keyvals_get_val(comments, "compilation");
  if (c && is_freeform_true(c))
    return 1;
  aa = keyvals_get_val(comments, "albumartist");
  if (aa && is_various_artists(aa))
    return 1;
  a = keyvals_get_val(comments, "artist");
  if (a && is_various_artists(a))
    return 1;
  if (aa && a && !u_strcase_equal(aa, a))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<track_is_compilation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1050 <keyvals_get_val@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     118a <track_is_compilation+0x4a>
mov    -0x18(%rbp),%rdi
call   1030 <is_freeform_true@plt>
cmp    $0x0,%rax
je     118a <track_is_compilation+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1245 <track_is_compilation+0x105>
mov    -0x10(%rbp),%rdi
lea    0xe77(%rip),%rsi
call   1050 <keyvals_get_val@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     11c8 <track_is_compilation+0x88>
mov    -0x28(%rbp),%rdi
call   1040 <is_various_artists@plt>
cmp    $0x0,%rax
je     11c8 <track_is_compilation+0x88>
movl   $0x1,-0x4(%rbp)
jmp    1245 <track_is_compilation+0x105>
mov    -0x10(%rbp),%rdi
lea    0xe3e(%rip),%rsi
call   1050 <keyvals_get_val@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1206 <track_is_compilation+0xc6>
mov    -0x20(%rbp),%rdi
call   1040 <is_various_artists@plt>
cmp    $0x0,%rax
je     1206 <track_is_compilation+0xc6>
movl   $0x1,-0x4(%rbp)
jmp    1245 <track_is_compilation+0x105>
cmpq   $0x0,-0x28(%rbp)
je     123e <track_is_compilation+0xfe>
cmpq   $0x0,-0x20(%rbp)
je     123e <track_is_compilation+0xfe>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <u_strcase_equal@plt>
cmp    $0x0,%eax
jne    123e <track_is_compilation+0xfe>
movl   $0x1,-0x4(%rbp)
jmp    1245 <track_is_compilation+0x105>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<track_is_compilation>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xeb2(%rip),%rsi
call   1050 <keyvals_get_val@plt>
test   %rax,%rax
je     116a <track_is_compilation+0x2a>
mov    %rax,%rdi
call   1030 <is_freeform_true@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    11d2 <track_is_compilation+0x92>
lea    0xe9b(%rip),%rsi
mov    %rbx,%rdi
call   1050 <keyvals_get_val@plt>
mov    %rax,%r14
test   %rax,%rax
je     1193 <track_is_compilation+0x53>
mov    %r14,%rdi
call   1040 <is_various_artists@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    11d2 <track_is_compilation+0x92>
lea    0xe77(%rip),%rsi
mov    %rbx,%rdi
call   1050 <keyvals_get_val@plt>
test   %rax,%rax
je     11d0 <track_is_compilation+0x90>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <is_various_artists@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    11d2 <track_is_compilation+0x92>
test   %r14,%r14
je     11d0 <track_is_compilation+0x90>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <u_strcase_equal@plt>
test   %eax,%eax
je     11d2 <track_is_compilation+0x92>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.keyval = type { i32 }
@.str = [12 x i8] c"compilation\00"
@.str.1 = [12 x i8] c"albumartist\00"
@.str.2 = [7 x i8] c"artist\00"
define i32 @track_is_compilation(%struct.keyval* %0) {
%2 = alloca i32
%3 = alloca %struct.keyval*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store %struct.keyval* %0, %struct.keyval** %3
%7 = load %struct.keyval*, %struct.keyval** %3
%8 = call i8* @keyvals_get_val(%struct.keyval* %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = call i64 @is_freeform_true(i8* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %2
br label %49
16: ; preds = %11, %1
%17 = load %struct.keyval*, %struct.keyval** %3
%18 = call i8* @keyvals_get_val(%struct.keyval* %17, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
store i8* %18, i8** %6
%19 = load i8*, i8** %6
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %26
21: ; preds = %16
%22 = load i8*, i8** %6
%23 = call i64 @is_various_artists(i8* %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %21
store i32 1, i32* %2
br label %49
26: ; preds = %21, %16
%27 = load %struct.keyval*, %struct.keyval** %3
%28 = call i8* @keyvals_get_val(%struct.keyval* %27, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
store i8* %28, i8** %5
%29 = load i8*, i8** %5
%30 = icmp ne i8* %29, null
br i1 %30, label %31, label %36
31: ; preds = %26
%32 = load i8*, i8** %5
%33 = call i64 @is_various_artists(i8* %32)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %31
store i32 1, i32* %2
br label %49
36: ; preds = %31, %26
%37 = load i8*, i8** %6
%38 = icmp ne i8* %37, null
br i1 %38, label %39, label %48
39: ; preds = %36
%40 = load i8*, i8** %5
%41 = icmp ne i8* %40, null
br i1 %41, label %42, label %48
42: ; preds = %39
%43 = load i8*, i8** %6
%44 = load i8*, i8** %5
%45 = call i32 @u_strcase_equal(i8* %43, i8* %44)
%46 = icmp ne i32 %45, 0
br i1 %46, label %48, label %47
47: ; preds = %42
store i32 1, i32* %2
br label %49
48: ; preds = %42, %39, %36
store i32 0, i32* %2
br label %49
49: ; preds = %48, %47, %35, %25, %15
%50 = load i32, i32* %2
ret i32 %50
}

LLVM IR (-O2):
%struct.keyval = type { i32 }
@.str = [12 x i8] c"compilation\00"
@.str.1 = [12 x i8] c"albumartist\00"
@.str.2 = [7 x i8] c"artist\00"
define i32 @track_is_compilation(%struct.keyval* %0) {
%2 = tail call i8* @keyvals_get_val(%struct.keyval* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @is_freeform_true(i8* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %24
7: ; preds = %4, %1
%8 = tail call i8* @keyvals_get_val(%struct.keyval* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = tail call i64 @is_various_artists(i8* %8)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %24
13: ; preds = %10, %7
%14 = tail call i8* @keyvals_get_val(%struct.keyval* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i8* %14, null
br i1 %15, label %23, label %16
16: ; preds = %13
%17 = tail call i64 @is_various_artists(i8* %14)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %16
br i1 %9, label %23, label %20
20: ; preds = %19
%21 = tail call i32 @u_strcase_equal(i8* %8, i8* %14)
%22 = icmp eq i32 %21, 0
br i1 %22, label %24, label %23
23: ; preds = %13, %20, %19
br label %24
24: ; preds = %20, %16, %10, %4, %23
%25 = phi i32 [ 0, %23 ], [ 1, %4 ], [ 1, %10 ], [ 1, %16 ], [ 1, %20 ]
ret i32 %25
}