// File: 4n6ist[P]usn_analytics/lib/usnjrnl.cpp
// Function: UsnJrnl::UsnJrnl(char*, char*)
UsnJrnl::UsnJrnl(char *ifname, char *odname) {
  offset = 0;

  if((fp_in = fopen(ifname, "rb")) == NULL) {
    perror("Input File Error");
    exit(EXIT_FAILURE);
  }
  
  string ofreport;
  ofreport = string(odname) + SEP + "usn_analytics_report.txt";
  fp_ofreport = fopen(ofreport.c_str(), "w");
      
  if(fp_ofreport == NULL ) {
    perror("Output File Error");
    exit(EXIT_FAILURE);
  }

  file_size = get_file_size(ifname);
  printf("%llu bytes (%s)\n", file_size, ifname);  
  fprintf(fp_ofreport, "%llu bytes (%s)\n", file_size, ifname);     
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
addq $0x20, %rdi
movq %rdi, -0xf0(%rbp)
callq 0xa2e0
movq -0xc0(%rbp), %rdi
addq $0x38, %rdi
movq %rdi, -0xe8(%rbp)
callq 0xa2e0
movq -0xc0(%rbp), %rdi
addq $0x50, %rdi
movq %rdi, -0xe0(%rbp)
callq 0xa300
movq -0xc0(%rbp), %rdi
addq $0x68, %rdi
movq %rdi, -0xd8(%rbp)
callq 0xa320
movq -0xc0(%rbp), %rdi
addq $0x98, %rdi
movq %rdi, -0xd0(%rbp)
callq 0xa340
movq -0xc0(%rbp), %rdi
addq $0xc8, %rdi
movq %rdi, -0xc8(%rbp)
callq 0xa340
movq -0xc0(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rdi
leaq 0x186a3(%rip), %rsi     # 0x1c048
callq 0x3420
movq %rax, -0xb8(%rbp)
jmp 0x39b3
movq -0xb8(%rbp), %rax
movq -0xc0(%rbp), %rcx
movq %rax, 0x10(%rcx)
cmpq $0x0, %rax
jne 0x39f4
leaq 0x18679(%rip), %rdi     # 0x1c04b
callq 0x32a0
jmp 0x39d9
movl $0x1, %edi
callq 0x3440
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x3be0
leaq -0x48(%rbp), %rdi
callq 0x34b0
movq -0x18(%rbp), %rax
movq %rax, -0x100(%rbp)
leaq -0xa9(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x35d0
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
leaq -0xa8(%rbp), %rdi
callq 0xa400
jmp 0x3a37
leaq 0x23903(%rip), %rax     # 0x27341
movsbl (%rax), %edx
leaq -0x88(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0xa3b0
jmp 0x3a56
leaq 0x185ff(%rip), %rdx     # 0x1c05c
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xa360
jmp 0x3a6f
leaq -0x48(%rbp), %rdi
movq %rdi, -0x110(%rbp)
leaq -0x68(%rbp), %rsi
movq %rsi, -0x118(%rbp)
callq 0x3450
movq -0x118(%rbp), %rdi
callq 0x31d0
leaq -0x88(%rbp), %rdi
callq 0x31d0
leaq -0xa8(%rbp), %rdi
callq 0x31d0
leaq -0xa9(%rbp), %rdi
callq 0x33c0
movq -0x110(%rbp), %rdi
callq 0x3120
movq %rax, %rdi
leaq 0x1905e(%rip), %rsi     # 0x1cb2e
callq 0x3420
movq %rax, -0x108(%rbp)
jmp 0x3ade
movq -0xc0(%rbp), %rax
movq -0x108(%rbp), %rcx
movq %rcx, 0x18(%rax)
cmpq $0x0, 0x18(%rax)
jne 0x3b6b
leaq 0x18577(%rip), %rdi     # 0x1c075
callq 0x32a0
jmp 0x3b05
movl $0x1, %edi
callq 0x3440
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x3b4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x3b43
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x31d0
leaq -0xa8(%rbp), %rdi
callq 0x31d0
leaq -0xa9(%rbp), %rdi
callq 0x33c0
jmp 0x3bd7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x3bd7
movq -0x10(%rbp), %rdi
callq 0x17830
movq %rax, -0x120(%rbp)
jmp 0x3b7d
movq -0xc0(%rbp), %rax
movq -0x120(%rbp), %rcx
movq %rcx, (%rax)
movq (%rax), %rsi
movq -0x10(%rbp), %rdx
leaq 0x184eb(%rip), %rdi     # 0x1c087
xorl %eax, %eax
callq 0x3060
jmp 0x3ba5
movq -0xc0(%rbp), %rax
movq 0x18(%rax), %rdi
movq (%rax), %rdx
movq -0x10(%rbp), %rcx
leaq 0x184c9(%rip), %rsi     # 0x1c087
movb $0x0, %al
callq 0x34d0
leaq -0x48(%rbp), %rdi
callq 0x31d0
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0x31d0
movq -0xc8(%rbp), %rdi
callq 0xa1e0
movq -0xd0(%rbp), %rdi
callq 0xa1e0
movq -0xd8(%rbp), %rdi
callq 0xa200
movq -0xe0(%rbp), %rdi
callq 0xa220
movq -0xe8(%rbp), %rdi
callq 0xa280
movq -0xf0(%rbp), %rdi
callq 0xa280
movq -0x20(%rbp), %rdi
callq 0x35c0
nopw %cs:(%rax,%rax)