#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__ uint32_t;
typedef scalar_t__ time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
struct tm *localtime(scalar_t__ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
void fwritetimestamphigh(uint32_t tshigh, FILE *fhd) {
  time_t pkttime;
  struct tm *pkttm;
  char tmbuf[64];
  if (tshigh != 0) {
    pkttime = tshigh;
    pkttm = localtime(&pkttime);
    strftime(tmbuf, sizeof tmbuf, "%d%m%Y", pkttm);
    fprintf(fhd, "%s:", tmbuf);
  } else {
    fprintf(fhd, "00000000:");
  }
  return;
}


x86 assembly (clang, -O0):
<fwritetimestamphigh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1194 <fwritetimestamphigh+0x64>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x40,%esi
lea    0xe8c(%rip),%rdx
call   1050 <strftime@plt>
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rdx
lea    0xe7f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    11a6 <fwritetimestamphigh+0x76>
mov    -0x10(%rbp),%rdi
lea    0xe6c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwritetimestamphigh>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%rbx
test   %rdi,%rdi
je     1196 <fwritetimestamphigh+0x56>
mov    %rdi,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xe9b(%rip),%rdx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0x40,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
lea    0xe86(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe6e(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x58,%rsp
pop    %rbx
pop    %r14
jmp    1060 <fwrite@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [7 x i8] c"%d%m%Y\00"
@.str.1 = [4 x i8] c"%s:\00"
@.str.2 = [10 x i8] c"00000000:\00"
define void @fwritetimestamphigh(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
%5 = alloca i64
%6 = alloca %struct.tm*
%7 = alloca [64 x i8]
store i64 %0, i64* %3
store i32* %1, i32** %4
%8 = load i64, i64* %3
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %2
%11 = load i64, i64* %3
store i64 %11, i64* %5
%12 = call %struct.tm* @localtime(i64* %5)
store %struct.tm* %12, %struct.tm** %6
%13 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%14 = load %struct.tm*, %struct.tm** %6
%15 = call i32 @strftime(i8* %13, i32 64, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.tm* %14)
%16 = load i32*, i32** %4
%17 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%18 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %17)
br label %22
19: ; preds = %2
%20 = load i32*, i32** %4
%21 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %19, %10
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [7 x i8] c"%d%m%Y\00"
@.str.1 = [4 x i8] c"%s:\00"
@.str.2 = [10 x i8] c"00000000:\00"
define void @fwritetimestamphigh(i64 %0, i32* nocapture %1) {
%3 = alloca i64
%4 = alloca [64 x i8]
%5 = bitcast i64* %3 to i8*
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%7 = icmp eq i64 %0, 0
br i1 %7, label %12, label %8
8: ; preds = %2
store i64 %0, i64* %3
%9 = call %struct.tm* @localtime(i64* %3)
%10 = call i32 @strftime(i8* %6, i32 64, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.tm* %9)
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
br label %14
12: ; preds = %2
%13 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i64 9, i64 1, i32* %1)
br label %14
14: ; preds = %12, %8
ret void
}