#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 scalar_t__ time_t;

/* Variables and functions */
scalar_t__ isFileExists(int /*<<< orphan*/);
scalar_t__ strToTime(char *);
scalar_t__ const time(int /*<<< orphan*/ *);
int /*<<< orphan*/ today_new_playlist_fname();
char get_img_pls_exit_code(const time_t next_switch_time, time_t *prev_date) {
  char ex_code = 0;
  if (*prev_date != strToTime("00:00:00")) {
    ex_code = 1;
    *prev_date = strToTime("00:00:00");
  } else if (isFileExists(today_new_playlist_fname()))
    ex_code = 3;
  else if (time(NULL) >= next_switch_time) {
    ex_code = 2;
  } else
    ;
  return ex_code;
}


x86 assembly (clang, -O0):
<get_img_pls_exit_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
lea    0xe9a(%rip),%rdi
call   1050 <strToTime@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
je     119a <get_img_pls_exit_code+0x5a>
movb   $0x1,-0x11(%rbp)
lea    0xe7a(%rip),%rdi
call   1050 <strToTime@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    11e6 <get_img_pls_exit_code+0xa6>
mov    $0x0,%al
call   1030 <today_new_playlist_fname@plt>
mov    %eax,%edi
call   1060 <isFileExists@plt>
cmp    $0x0,%rax
je     11bb <get_img_pls_exit_code+0x7b>
movb   $0x3,-0x11(%rbp)
jmp    11e1 <get_img_pls_exit_code+0xa1>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
cmp    -0x8(%rbp),%rax
jl     11d7 <get_img_pls_exit_code+0x97>
movb   $0x2,-0x11(%rbp)
jmp    11dc <get_img_pls_exit_code+0x9c>
jmp    11dc <get_img_pls_exit_code+0x9c>
jmp    11e1 <get_img_pls_exit_code+0xa1>
jmp    11e6 <get_img_pls_exit_code+0xa6>
movsbl -0x11(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_img_pls_exit_code>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    (%rsi),%rbx
lea    0xeab(%rip),%rdi
call   1050 <strToTime@plt>
cmp    %rax,%rbx
jne    1188 <get_img_pls_exit_code+0x48>
xor    %eax,%eax
call   1030 <today_new_playlist_fname@plt>
mov    %eax,%edi
call   1060 <isFileExists@plt>
mov    %rax,%rcx
mov    $0x3,%al
test   %rcx,%rcx
jne    1199 <get_img_pls_exit_code+0x59>
xor    %edi,%edi
call   1040 <time@plt>
cmp    %r14,%rax
setge  %al
add    %al,%al
jmp    1199 <get_img_pls_exit_code+0x59>
lea    0xe71(%rip),%rdi
call   1050 <strToTime@plt>
mov    %rax,(%r15)
mov    $0x1,%al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"00:00:00\00"
define signext i8 @get_img_pls_exit_code(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i8
store i64 %0, i64* %3
store i64* %1, i64** %4
store i8 0, i8* %5
%6 = load i64*, i64** %4
%7 = load i64, i64* %6
%8 = call i64 @strToTime(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %2
store i8 1, i8* %5
%11 = call i64 @strToTime(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%12 = load i64*, i64** %4
store i64 %11, i64* %12
br label %26
13: ; preds = %2
%14 = call i32 (...) @today_new_playlist_fname()
%15 = call i64 @isFileExists(i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 3, i8* %5
br label %25
18: ; preds = %13
%19 = call i64 @time(i32* null)
%20 = load i64, i64* %3
%21 = icmp sge i64 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i8 2, i8* %5
br label %24
23: ; preds = %18
br label %24
24: ; preds = %23, %22
br label %25
25: ; preds = %24, %17
br label %26
26: ; preds = %25, %10
%27 = load i8, i8* %5
ret i8 %27
}

LLVM IR (-O2):
@.str = [9 x i8] c"00:00:00\00"
define signext i8 @get_img_pls_exit_code(i64 %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = tail call i64 @strToTime(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i64 @strToTime(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i64 %7, i64* %1
br label %16
8: ; preds = %2
%9 = tail call i32 (...) @today_new_playlist_fname()
%10 = tail call i64 @isFileExists(i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = tail call i64 @time(i32* null)
%14 = icmp slt i64 %13, %0
%15 = select i1 %14, i8 0, i8 2
br label %16
16: ; preds = %12, %8, %6
%17 = phi i8 [ 1, %6 ], [ 3, %8 ], [ %15, %12 ]
ret i8 %17
}