// File: /workspace/github_cpp_makefile_star2_O2/4n6ist[P]usn_analytics/lib/usnrecord.cpp
// Function: UsnRecord::WriteRecord(_IO_FILE*)
int UsnRecord::WriteRecord(FILE *fp) {
  string reasons_s, attrs_s, timestamp_s;
  fprintf(fp, "\"%llu\"\t", offset);
  fprintf(fp, "\"%u\"\t", usn_record.RecordLength);
  fprintf(fp, "\"%hu\"\t", usn_record.MajorVersion);
  fprintf(fp, "\"%hu\"\t", usn_record.MinorVersion);
  fprintf(fp, "\"%u\"\t", cid);
  fprintf(fp, "\"%hu\"\t", cid_seq);
  fprintf(fp, "\"%u\"\t", pid);
  fprintf(fp, "\"%hu\"\t", pid_seq);
  fprintf(fp, "\"%llu\"\t", usn_record.Usn);
  timestamp_s = parse_datetimemicro(usn_record.TimeStamp, lt);
  fprintf(fp, "\"%s\"\t", timestamp_s.c_str());
  parse_reason(usn_record.Reason, &(reasons_s));
  fprintf(fp, "\"%s(%08x)\"\t", reasons_s.c_str(), usn_record.Reason);
  fprintf(fp, "\"%u\"\t", usn_record.SourceInfo);
  fprintf(fp, "\"%u\"\t", usn_record.SecurityId);
  parse_file_attr(usn_record.FileAttributes, &(attrs_s));
  fprintf(fp, "\"%s(%04x)\"\t", attrs_s.c_str(), usn_record.FileAttributes);
  fprintf(fp, "\"%hu\"\t", usn_record.FileNameLength);
  fprintf(fp, "\"%hu\"\t", usn_record.FileNameOffset);  
  fprintf(fp, "\"%s\"", file_name.c_str());
  fprintf(fp, "\n");
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rsi, %rbx
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rdi, %r14
xorl %ecx, %ecx
leaq 0x50(%rsp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
leaq 0x30(%rsp), %rsi
movq %rsi, -0x10(%rsi)
andq $0x0, -0x8(%rsi)
movb %cl, (%rax)
movb %cl, (%rdx)
movb %cl, (%rsi)
movq 0x4c(%rdi), %rdx
leaq 0x29b8(%rip), %r15      # 0xc717
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3380
movl 0x10(%r14), %edx
leaq 0x29a8(%rip), %r12      # 0xc71f
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x3380
movzwl 0x14(%r14), %edx
leaq 0x2995(%rip), %r13      # 0xc725
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x3380
movzwl 0x16(%r14), %edx
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x3380
movl 0x54(%r14), %edx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x3380
movzwl 0x58(%r14), %edx
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x3380
movl 0x5a(%r14), %edx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x3380
movzwl 0x5e(%r14), %edx
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x3380
movq 0x28(%r14), %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3380
movq 0x30(%r14), %rsi
leaq 0x8487(%rip), %rax      # 0x12298
movzbl (%rax), %edx
leaq 0x60(%rsp), %rdi
callq 0xa840
leaq 0x20(%rsp), %r15
leaq 0x60(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x3320
movq %r12, %rdi
callq 0x3100
movq (%r15), %rdx
leaq 0x28e7(%rip), %rsi      # 0xc72c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3380
movl 0x38(%r14), %edi
movq %rsp, %rsi
callq 0xaecf
movq (%rsp), %rdx
movl 0x38(%r14), %ecx
leaq 0x28c8(%rip), %rsi      # 0xc732
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3380
movl 0x3c(%r14), %edx
leaq 0x28a0(%rip), %r15      # 0xc71f
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3380
movl 0x40(%r14), %edx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3380
movl 0x44(%r14), %edi
leaq 0x40(%rsp), %rsi
callq 0xaa46
leaq 0x40(%rsp), %r15
movq (%r15), %rdx
movl 0x44(%r14), %ecx
leaq 0x2880(%rip), %rsi      # 0xc73e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3380
movzwl 0x48(%r14), %edx
leaq 0x2851(%rip), %r12      # 0xc725
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x3380
movzwl 0x4a(%r14), %edx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x3380
movq 0x60(%r14), %rdx
leaq 0x284c(%rip), %rsi      # 0xc74a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3380
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x3330
leaq 0x20(%rsp), %rdi
callq 0x3100
movq %r15, %rdi
callq 0x3100
movq %rsp, %rdi
callq 0x3100
xorl %eax, %eax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x9f42
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3100
leaq 0x40(%rsp), %rdi
callq 0x3100
movq %rsp, %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3480
nop