#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 file_header {
  int dummy;
};
typedef int flags;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
scalar_t__ strlen(char *);
char *print_raw_timestamp(void *parm, int action, char *cur_date,
                          char *cur_time, unsigned long long itv,
                          struct file_header *file_hdr, unsigned int flags) {
  int utc = !(((flags)&0x00004000) == 0x00004000) &&
            !(((flags)&0x00000020) == 0x00000020);
  static char pre[80];
  if (action & 0x01) {
    snprintf(pre, 80, "%s%s", cur_time, strlen(cur_date) && utc ? " UTC" : "");
    pre[79] = '\0';
    return pre;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<print_raw_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    0x10(%rbp),%ecx
and    $0x4000,%ecx
xor    %eax,%eax
cmp    $0x4000,%ecx
mov    %al,-0x3d(%rbp)
je     116d <print_raw_timestamp+0x4d>
mov    0x10(%rbp),%eax
and    $0x20,%eax
cmp    $0x20,%eax
sete   %al
xor    $0xff,%al
mov    %al,-0x3d(%rbp)
mov    -0x3d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11ff <print_raw_timestamp+0xdf>
mov    -0x28(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x3e(%rbp)
je     11b4 <print_raw_timestamp+0x94>
cmpl   $0x0,-0x3c(%rbp)
setne  %al
mov    %al,-0x3e(%rbp)
mov    -0x48(%rbp),%rcx
mov    -0x3e(%rbp),%dl
lea    0xe47(%rip),%r8
lea    0xe3c(%rip),%rax
test   $0x1,%dl
cmovne %rax,%r8
lea    0x2e69(%rip),%rdi
mov    $0x50,%esi
lea    0xe1d(%rip),%rdx
call   1040 <snprintf@plt>
movb   $0x0,0x2ea0(%rip)
lea    0x2e4a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <print_raw_timestamp+0xe7>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_raw_timestamp>:
push   %rbx
test   $0x1,%sil
jne    111b <print_raw_timestamp+0xb>
xor    %ebx,%ebx
jmp    115e <print_raw_timestamp+0x4e>
cmpb   $0x0,(%rdx)
lea    0xee0(%rip),%r8
lea    0xedd(%rip),%rax
cmove  %rax,%r8
testl  $0x4020,0x10(%rsp)
cmovne %rax,%r8
lea    0x2efd(%rip),%rbx
lea    0xeb6(%rip),%rdx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1030 <snprintf@plt>
movb   $0x0,0x2f31(%rip)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.file_header = type { i32 }
@print_raw_timestamp.pre = internal global [80 x i8] zeroinitializer
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [5 x i8] c" UTC\00"
@.str.2 = [1 x i8] zeroinitializer
define i8* @print_raw_timestamp(i8* %0, i32 %1, i8* %2, i8* %3, i64 %4, %struct.file_header* %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i64
%14 = alloca %struct.file_header*
%15 = alloca i32
%16 = alloca i32
store i8* %0, i8** %9
store i32 %1, i32* %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i64 %4, i64* %13
store %struct.file_header* %5, %struct.file_header** %14
store i32 %6, i32* %15
%17 = load i32, i32* %15
%18 = and i32 %17, 16384
%19 = icmp eq i32 %18, 16384
br i1 %19, label %25, label %20
20: ; preds = %7
%21 = load i32, i32* %15
%22 = and i32 %21, 32
%23 = icmp eq i32 %22, 32
%24 = xor i1 %23, true
br label %25
25: ; preds = %20, %7
%26 = phi i1 [ false, %7 ], [ %24, %20 ]
%27 = zext i1 %26 to i32
store i32 %27, i32* %16
%28 = load i32, i32* %10
%29 = and i32 %28, 1
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %44
31: ; preds = %25
%32 = load i8*, i8** %12
%33 = load i8*, i8** %11
%34 = call i64 @strlen(i8* %33)
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %31
%37 = load i32, i32* %16
%38 = icmp ne i32 %37, 0
br label %39
39: ; preds = %36, %31
%40 = phi i1 [ false, %31 ], [ %38, %36 ]
%41 = zext i1 %40 to i64
%42 = select i1 %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%43 = call i32 @snprintf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @print_raw_timestamp.pre, i64 0, i64 0), i32 80, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %32, i8* %42)
store i8 0, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @print_raw_timestamp.pre, i64 0, i64 79)
store i8* getelementptr inbounds ([80 x i8], [80 x i8]* @print_raw_timestamp.pre, i64 0, i64 0), i8** %8
br label %45
44: ; preds = %25
store i8* null, i8** %8
br label %45
45: ; preds = %44, %39
%46 = load i8*, i8** %8
ret i8* %46
}

LLVM IR (-O2):
%struct.file_header = type { i32 }
@print_raw_timestamp.pre = internal global [80 x i8] zeroinitializer
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [5 x i8] c" UTC\00"
@.str.2 = [1 x i8] zeroinitializer
define i8* @print_raw_timestamp(i8* nocapture readnone %0, i32 %1, i8* nocapture %2, i8* %3, i64 %4, %struct.file_header* nocapture readnone %5, i32 %6) {
%8 = and i32 %1, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %18, label %10
10: ; preds = %7
%11 = and i32 %6, 16416
%12 = icmp eq i32 %11, 0
%13 = load i8, i8* %2
%14 = icmp ne i8 %13, 0
%15 = and i1 %12, %14
%16 = select i1 %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%17 = tail call i32 @snprintf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @print_raw_timestamp.pre, i64 0, i64 0), i32 80, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %16)
store i8 0, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @print_raw_timestamp.pre, i64 0, i64 79)
br label %18
18: ; preds = %7, %10
%19 = phi i8* [ getelementptr inbounds ([80 x i8], [80 x i8]* @print_raw_timestamp.pre, i64 0, i64 0), %10 ], [ null, %7 ]
ret i8* %19
}