// File: Luthaf[P]zeopp/networkio.cc
// Function: parseFilename(char const*, char*, char*)
void parseFilename(const char * fileName, char *name, char *extension){
  string s(fileName);
  size_t index = s.find_last_of(".");
  if(index == string::npos){
    cerr << "Improper input filename " << fileName << "\n";
    cerr << "No . extension found. Exiting ..." << "\n";
    exit(1);
  }
  else{
    string prefix = s.substr(0, index);
    string suffix = s.substr(index + 1);
    strncpy(name, prefix.data(), prefix.size()); name[prefix.size()] = '\0';
    strncpy(extension, suffix.data(), suffix.size()); extension[suffix.size()] = '\0';
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x5900
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x47530
jmp 0x4b05b
leaq -0x39(%rbp), %rdi
callq 0x55d0
leaq -0x38(%rbp), %rdi
leaq 0x1b0b53(%rip), %rsi    # 0x1fbbc2
movq $-0x1, %rdx
callq 0x54e0
movq %rax, -0x58(%rbp)
cmpq $-0x1, -0x58(%rbp)
jne 0x4b13a
movq 0x227f5f(%rip), %rdi    # 0x272ff0
leaq 0x1a7b3c(%rip), %rsi    # 0x1f2bd4
callq 0x5540
movq %rax, -0xb0(%rbp)
jmp 0x4b0a6
movq -0xb0(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x5540
movq %rax, -0xb8(%rbp)
jmp 0x4b0bf
movq -0xb8(%rbp), %rdi
leaq 0x1ae558(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0x4b0d4
movq 0x227f15(%rip), %rdi    # 0x272ff0
leaq 0x1a7b0b(%rip), %rsi    # 0x1f2bed
callq 0x5540
movq %rax, -0xc0(%rbp)
jmp 0x4b0f0
movq -0xc0(%rbp), %rdi
leaq 0x1ae527(%rip), %rsi    # 0x1f9625
callq 0x5540
jmp 0x4b105
movl $0x1, %edi
callq 0x67c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x55d0
jmp 0x4b27b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4b272
movq -0x58(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x78(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x5590
jmp 0x4b151
movq -0x58(%rbp), %rdx
incq %rdx
leaq -0x98(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movq $-0x1, %rcx
callq 0x5590
jmp 0x4b171
movq -0x10(%rbp), %rax
movq %rax, -0xf0(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x52c0
movq %rax, -0xe8(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x5360
movq -0xf0(%rbp), %rdi
movq -0xe8(%rbp), %rsi
movq %rax, %rdx
callq 0x5280
movq -0x10(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x5360
movq %rax, %rcx
movq -0xe0(%rbp), %rax
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x52c0
movq %rax, -0xd0(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x5360
movq -0xd8(%rbp), %rdi
movq -0xd0(%rbp), %rsi
movq %rax, %rdx
callq 0x5280
movq -0x18(%rbp), %rax
movq %rax, -0xc8(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x5360
movq %rax, %rcx
movq -0xc8(%rbp), %rax
movb $0x0, (%rax,%rcx)
leaq -0x98(%rbp), %rdi
callq 0x5300
leaq -0x78(%rbp), %rdi
callq 0x5300
jmp 0x4b260
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x5300
jmp 0x4b272
leaq -0x38(%rbp), %rdi
callq 0x5300
addq $0xf0, %rsp
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x5300
movq -0x48(%rbp), %rdi
callq 0x58f0
nopw %cs:(%rax,%rax)