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

/* Variables and functions */
int /*<<< orphan*/ wfile_date(char *, struct tm *);
scalar_t__ wfile_is_gzfile(char *);
int wfile_status(char *);
int /*<<< orphan*/ wzfile_convert_to_compressed_name(char *, char *);
int /*<<< orphan*/ wzfile_convert_to_uncompressed_name(char *, char *);
void wzfile_date(char *filename, struct tm *date) {
  static char newname[512];
  if (wfile_status(filename) == 1) {
    wfile_date(filename, date);
    return;
  }
  if (wfile_is_gzfile(filename))
    wzfile_convert_to_uncompressed_name(newname, filename);
  else
    wzfile_convert_to_compressed_name(newname, filename);
  wfile_date(newname, date);
}


x86 assembly (clang, -O0):
<wzfile_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <wfile_status@plt>
cmp    $0x1,%eax
jne    1184 <wzfile_date+0x34>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <wfile_date@plt>
jmp    11cc <wzfile_date+0x7c>
mov    -0x8(%rbp),%rdi
call   1060 <wfile_is_gzfile@plt>
cmp    $0x0,%rax
je     11ac <wzfile_date+0x5c>
mov    -0x8(%rbp),%rsi
lea    0x2ebe(%rip),%rdi
call   1040 <wzfile_convert_to_uncompressed_name@plt>
jmp    11bc <wzfile_date+0x6c>
mov    -0x8(%rbp),%rsi
lea    0x2ea9(%rip),%rdi
call   1050 <wzfile_convert_to_compressed_name@plt>
mov    -0x10(%rbp),%rsi
lea    0x2e99(%rip),%rdi
call   1030 <wfile_date@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wzfile_date>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1070 <wfile_status@plt>
cmp    $0x1,%eax
je     118e <wzfile_date+0x3e>
mov    %rbx,%rdi
call   1060 <wfile_is_gzfile@plt>
lea    0x2eec(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
test   %rax,%rax
je     1186 <wzfile_date+0x36>
call   1040 <wzfile_convert_to_uncompressed_name@plt>
jmp    118b <wzfile_date+0x3b>
call   1050 <wzfile_convert_to_compressed_name@plt>
mov    %r15,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <wfile_date@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@wzfile_date.newname = internal global [512 x i8] zeroinitializer
define void @wzfile_date(i8* %0, %struct.tm* %1) {
%3 = alloca i8*
%4 = alloca %struct.tm*
store i8* %0, i8** %3
store %struct.tm* %1, %struct.tm** %4
%5 = load i8*, i8** %3
%6 = call i32 @wfile_status(i8* %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load %struct.tm*, %struct.tm** %4
%11 = call i32 @wfile_date(i8* %9, %struct.tm* %10)
br label %25
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = call i64 @wfile_is_gzfile(i8* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i8*, i8** %3
%18 = call i32 @wzfile_convert_to_uncompressed_name(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @wzfile_date.newname, i64 0, i64 0), i8* %17)
br label %22
19: ; preds = %12
%20 = load i8*, i8** %3
%21 = call i32 @wzfile_convert_to_compressed_name(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @wzfile_date.newname, i64 0, i64 0), i8* %20)
br label %22
22: ; preds = %19, %16
%23 = load %struct.tm*, %struct.tm** %4
%24 = call i32 @wfile_date(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @wzfile_date.newname, i64 0, i64 0), %struct.tm* %23)
br label %25
25: ; preds = %22, %8
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@wzfile_date.newname = internal global [512 x i8] zeroinitializer
define void @wzfile_date(i8* %0, %struct.tm* %1) {
%3 = tail call i32 @wfile_status(i8* %0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i64 @wfile_is_gzfile(i8* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @wzfile_convert_to_uncompressed_name(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @wzfile_date.newname, i64 0, i64 0), i8* %0)
br label %12
10: ; preds = %5
%11 = tail call i32 @wzfile_convert_to_compressed_name(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @wzfile_date.newname, i64 0, i64 0), i8* %0)
br label %12
12: ; preds = %8, %10, %2
%13 = phi i8* [ %0, %2 ], [ getelementptr inbounds ([512 x i8], [512 x i8]* @wzfile_date.newname, i64 0, i64 0), %10 ], [ getelementptr inbounds ([512 x i8], [512 x i8]* @wzfile_date.newname, i64 0, i64 0), %8 ]
%14 = tail call i32 @wfile_date(i8* %13, %struct.tm* %1)
ret void
}