#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 */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ get_current_datetime(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, int /*<<< orphan*/);
char *today_playlist_fname() {
  char *pls_nm = NULL;
  pls_nm = (char *)calloc(300, sizeof(char));
  if (!pls_nm)
    return NULL;
  snprintf(pls_nm, 300, "%s%s.pls.img", "/data/media/playlist/",
           get_current_datetime("%b%d-%Y"));
  return pls_nm;
}


x86 assembly (clang, -O0):
<today_playlist_fname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x10(%rbp)
mov    $0x12c,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <today_playlist_fname+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    11a6 <today_playlist_fname+0x76>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xea9(%rip),%rdi
call   1030 <get_current_datetime@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%r8d
mov    $0x12c,%esi
lea    0xe6e(%rip),%rdx
lea    0xe74(%rip),%rcx
call   1040 <snprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<today_playlist_fname>:
push   %rbx
mov    $0x12c,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
test   %rax,%rax
je     1174 <today_playlist_fname+0x44>
mov    %rax,%rbx
lea    0xed4(%rip),%rdi
call   1030 <get_current_datetime@plt>
lea    0xea5(%rip),%rdx
lea    0xeab(%rip),%rcx
mov    %rbx,%rdi
mov    $0x12c,%esi
mov    %eax,%r8d
call   1040 <snprintf@plt>
jmp    1176 <today_playlist_fname+0x46>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%s%s.pls.img\00"
@.str.1 = [22 x i8] c"/data/media/playlist/\00"
@.str.2 = [8 x i8] c"%b%d-%Y\00"
define i8* @today_playlist_fname() {
%1 = alloca i8*
%2 = alloca i8*
store i8* null, i8** %2
%3 = call i64 @calloc(i32 300, i32 1)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %0
store i8* null, i8** %1
br label %13
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = call i32 @get_current_datetime(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @snprintf(i8* %9, i32 300, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i8*, i8** %2
store i8* %12, i8** %1
br label %13
13: ; preds = %8, %7
%14 = load i8*, i8** %1
ret i8* %14
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s%s.pls.img\00"
@.str.1 = [22 x i8] c"/data/media/playlist/\00"
@.str.2 = [8 x i8] c"%b%d-%Y\00"
define i8* @today_playlist_fname() {
%1 = tail call i64 @calloc(i32 300, i32 1)
%2 = inttoptr i64 %1 to i8*
%3 = icmp eq i64 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 @get_current_datetime(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @snprintf(i8* %2, i32 300, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %0, %4
%8 = phi i8* [ %2, %4 ], [ null, %0 ]
ret i8* %8
}