// File: 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 %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x34b0
leaq -0x50(%rbp), %rdi
callq 0x34b0
leaq -0x70(%rbp), %rdi
callq 0x34b0
movq -0xa8(%rbp), %rax
movq -0x10(%rbp), %rdi
movq 0x4c(%rax), %rdx
leaq 0x5ea8(%rip), %rsi      # 0x1c717
movq %rsi, -0xb8(%rbp)
xorl %eax, %eax
movb %al, -0xa9(%rbp)
callq 0x34d0
movq -0xa8(%rbp), %rcx
movb -0xa9(%rbp), %al
movq -0x10(%rbp), %rdi
movl 0x10(%rcx), %edx
leaq 0x5e81(%rip), %rsi      # 0x1c71f
movq %rsi, -0xc8(%rbp)
callq 0x34d0
movq -0xa8(%rbp), %rcx
movb -0xa9(%rbp), %al
movq -0x10(%rbp), %rdi
movzwl 0x14(%rcx), %edx
leaq 0x5e5f(%rip), %rsi      # 0x1c725
movq %rsi, -0xc0(%rbp)
callq 0x34d0
movq -0xc0(%rbp), %rsi
movq -0xa8(%rbp), %rcx
movb -0xa9(%rbp), %al
movq -0x10(%rbp), %rdi
movzwl 0x16(%rcx), %edx
callq 0x34d0
movq -0xc8(%rbp), %rsi
movq -0xa8(%rbp), %rcx
movb -0xa9(%rbp), %al
movq -0x10(%rbp), %rdi
movl 0x54(%rcx), %edx
callq 0x34d0
movq -0xc0(%rbp), %rsi
movq -0xa8(%rbp), %rcx
movb -0xa9(%rbp), %al
movq -0x10(%rbp), %rdi
movzwl 0x58(%rcx), %edx
callq 0x34d0
movq -0xc8(%rbp), %rsi
movq -0xa8(%rbp), %rcx
movb -0xa9(%rbp), %al
movq -0x10(%rbp), %rdi
movl 0x5a(%rcx), %edx
callq 0x34d0
movq -0xc0(%rbp), %rsi
movq -0xa8(%rbp), %rcx
movb -0xa9(%rbp), %al
movq -0x10(%rbp), %rdi
movzwl 0x5e(%rcx), %edx
callq 0x34d0
movq -0xb8(%rbp), %rsi
movq -0xa8(%rbp), %rcx
movb -0xa9(%rbp), %al
movq -0x10(%rbp), %rdi
movq 0x28(%rcx), %rdx
callq 0x34d0
movq -0xa8(%rbp), %rax
movq 0x30(%rax), %rsi
leaq 0x10998(%rip), %rax     # 0x27340
movzbl (%rax), %edx
andl $0x1, %edx
leaq -0x90(%rbp), %rdi
callq 0x17b20
jmp 0x169bc
leaq -0x70(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
leaq -0x90(%rbp), %rsi
movq %rsi, -0xe0(%rbp)
callq 0x3450
movq -0xe0(%rbp), %rdi
callq 0x31d0
movq -0xd8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
callq 0x3120
movq -0xd0(%rbp), %rdi
movq %rax, %rdx
leaq 0x5d1e(%rip), %rsi      # 0x1c72c
xorl %eax, %eax
callq 0x34d0
movq -0xa8(%rbp), %rax
movl 0x38(%rax), %edi
leaq -0x30(%rbp), %rsi
callq 0x18a90
jmp 0x16a2a
movq -0x10(%rbp), %rax
movq %rax, -0xf8(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3120
movq -0xf8(%rbp), %rdi
movq %rax, %rdx
movq -0xa8(%rbp), %rax
movl 0x38(%rax), %ecx
leaq 0x5cd9(%rip), %rsi      # 0x1c732
xorl %eax, %eax
movb %al, -0xe1(%rbp)
callq 0x34d0
movq -0xa8(%rbp), %rcx
movb -0xe1(%rbp), %al
movq -0x10(%rbp), %rdi
movl 0x3c(%rcx), %edx
leaq 0x5c9e(%rip), %rsi      # 0x1c71f
movq %rsi, -0xf0(%rbp)
callq 0x34d0
movq -0xf0(%rbp), %rsi
movq -0xa8(%rbp), %rcx
movb -0xe1(%rbp), %al
movq -0x10(%rbp), %rdi
movl 0x40(%rcx), %edx
callq 0x34d0
movq -0xa8(%rbp), %rax
movl 0x44(%rax), %edi
leaq -0x50(%rbp), %rsi
callq 0x17eb0
jmp 0x16ac2
movq -0x10(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x3120
movq -0x108(%rbp), %rdi
movq %rax, %rdx
movq -0xa8(%rbp), %rax
movl 0x44(%rax), %ecx
leaq 0x5c4d(%rip), %rsi      # 0x1c73e
movb $0x0, %al
callq 0x34d0
movq -0xa8(%rbp), %rax
movq -0x10(%rbp), %rdi
movzwl 0x48(%rax), %edx
leaq 0x5c17(%rip), %rsi      # 0x1c725
movb $0x0, %al
callq 0x34d0
movq -0xa8(%rbp), %rax
movq -0x10(%rbp), %rdi
movzwl 0x4a(%rax), %edx
leaq 0x5bfa(%rip), %rsi      # 0x1c725
movb $0x0, %al
callq 0x34d0
movq -0xa8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x100(%rbp)
addq $0x60, %rdi
callq 0x3120
movq -0x100(%rbp), %rdi
movq %rax, %rdx
leaq 0x5bec(%rip), %rsi      # 0x1c74a
movb $0x0, %al
callq 0x34d0
movq -0x10(%rbp), %rdi
leaq 0x5e21(%rip), %rsi      # 0x1c991
movb $0x0, %al
callq 0x34d0
leaq -0x70(%rbp), %rdi
callq 0x31d0
leaq -0x50(%rbp), %rdi
callq 0x31d0
leaq -0x30(%rbp), %rdi
callq 0x31d0
xorl %eax, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x31d0
leaq -0x50(%rbp), %rdi
callq 0x31d0
leaq -0x30(%rbp), %rdi
callq 0x31d0
movq -0x98(%rbp), %rdi
callq 0x35c0
nopw %cs:(%rax,%rax)