#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 plist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ask_for_tags(struct plist *, scalar_t__);
scalar_t__ get_tags_setting();
int /*<<< orphan*/ iface_set_status(char *);
int /*<<< orphan*/ internal_logit(char *, int, char *, char *);
scalar_t__ recv_server_plist(struct plist *);
int /*<<< orphan*/ switch_titles_tags(struct plist *);
int get_server_playlist(struct plist *plist) {
  iface_set_status("Getting the playlist...");
  internal_logit("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/ecthiender/mocp-git/refs/"
                 "heads/master/interface.c",
                 1439, "UNKNOWN_FUNC", "Getting the playlist...");
  if (recv_server_plist(plist)) {
    if (get_tags_setting())
      ask_for_tags(plist, get_tags_setting());
    switch_titles_tags(plist);
    iface_set_status("");
    return 1;
  }
  iface_set_status("");
  return 0;
}


x86 assembly (clang, -O0):
<get_server_playlist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xe8d(%rip),%rdi
call   1050 <iface_set_status@plt>
lea    0xe99(%rip),%rdi
mov    $0x59f,%esi
lea    0xf19(%rip),%rdx
lea    0xe6e(%rip),%rcx
call   1080 <internal_logit@plt>
mov    -0x10(%rbp),%rdi
call   1040 <recv_server_plist@plt>
cmp    $0x0,%rax
je     11f7 <get_server_playlist+0x97>
mov    $0x0,%al
call   1070 <get_tags_setting@plt>
cmp    $0x0,%rax
je     11d6 <get_server_playlist+0x76>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1070 <get_tags_setting@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
call   1060 <ask_for_tags@plt>
mov    -0x10(%rbp),%rdi
call   1030 <switch_titles_tags@plt>
lea    0xe31(%rip),%rdi
call   1050 <iface_set_status@plt>
movl   $0x1,-0x4(%rbp)
jmp    120a <get_server_playlist+0xaa>
lea    0xe19(%rip),%rdi
call   1050 <iface_set_status@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_server_playlist>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xe92(%rip),%rbx
mov    %rbx,%rdi
call   1050 <iface_set_status@plt>
lea    0xe9b(%rip),%rdi
lea    0xf20(%rip),%rdx
mov    $0x59f,%esi
mov    %rbx,%rcx
call   1080 <internal_logit@plt>
mov    %r14,%rdi
call   1040 <recv_server_plist@plt>
test   %rax,%rax
je     11cb <get_server_playlist+0x6b>
xor    %eax,%eax
call   1070 <get_tags_setting@plt>
test   %rax,%rax
je     11bc <get_server_playlist+0x5c>
xor    %eax,%eax
call   1070 <get_tags_setting@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1060 <ask_for_tags@plt>
mov    %r14,%rdi
call   1030 <switch_titles_tags@plt>
mov    $0x1,%ebx
jmp    11cd <get_server_playlist+0x6d>
xor    %ebx,%ebx
lea    0xe43(%rip),%rdi
call   1050 <iface_set_status@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.plist = type { i32 }
@.str = [24 x i8] c"Getting the playlist...\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ecthiender/mocp-git/refs/heads/master/interface.c\00"
@.str.2 = [13 x i8] c"UNKNOWN_FUNC\00"
@.str.3 = [1 x i8] zeroinitializer
define i32 @get_server_playlist(%struct.plist* %0) {
%2 = alloca i32
%3 = alloca %struct.plist*
store %struct.plist* %0, %struct.plist** %3
%4 = call i32 @iface_set_status(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @internal_logit(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 1439, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = load %struct.plist*, %struct.plist** %3
%7 = call i64 @recv_server_plist(%struct.plist* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %1
%10 = call i64 (...) @get_tags_setting()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load %struct.plist*, %struct.plist** %3
%14 = call i64 (...) @get_tags_setting()
%15 = call i32 @ask_for_tags(%struct.plist* %13, i64 %14)
br label %16
16: ; preds = %12, %9
%17 = load %struct.plist*, %struct.plist** %3
%18 = call i32 @switch_titles_tags(%struct.plist* %17)
%19 = call i32 @iface_set_status(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %2
br label %22
20: ; preds = %1
%21 = call i32 @iface_set_status(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %22
22: ; preds = %20, %16
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
%struct.plist = type { i32 }
@.str = [24 x i8] c"Getting the playlist...\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ecthiender/mocp-git/refs/heads/master/interface.c\00"
@.str.2 = [13 x i8] c"UNKNOWN_FUNC\00"
@.str.3 = [1 x i8] zeroinitializer
define i32 @get_server_playlist(%struct.plist* %0) {
%2 = tail call i32 @iface_set_status(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @internal_logit(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 1439, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = tail call i64 @recv_server_plist(%struct.plist* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = tail call i64 (...) @get_tags_setting()
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = tail call i64 (...) @get_tags_setting()
%11 = tail call i32 @ask_for_tags(%struct.plist* %0, i64 %10)
br label %12
12: ; preds = %9, %6
%13 = tail call i32 @switch_titles_tags(%struct.plist* %0)
br label %14
14: ; preds = %1, %12
%15 = phi i32 [ 1, %12 ], [ 0, %1 ]
%16 = tail call i32 @iface_set_status(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
ret i32 %15
}