// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/process.c
// Function: export_file_name
char* export_file_name(Datasetptr dataset, int exporttype, int runno, int foldno, int partno)
{
 /*!Last Changed 03.08.2006 added partno*/
 /*!Last Changed 31.10.2005*/
 char *fname, *st, converted[10];
 int i, len, len2, j = 0, k;
 fname = (char *)safemalloc(100, "definition_file_name", 2);
 st = exportfiletemplates[exporttype];
 len = strlen(st);
 if (len == 0)
  { 
   safe_free(fname);
   return NULL;
  }
 for (i = 0; i < len; i++)
   switch (st[i])
    {
     case 'D':len2 = strlen(dataset->name);
              for (k = 0; k < len2; k++, j++)
                fname[j] = dataset->name[k];
              break;
     case 'R':sprintf(converted, "%d", runno);
              len2 = strlen(converted);
              for (k = 0; k < len2; k++, j++)
                fname[j] = converted[k];
              break;
     case 'F':sprintf(converted, "%d", foldno);
              len2 = strlen(converted);
              for (k = 0; k < len2; k++, j++)
                fname[j] = converted[k];
              break;
     case 'P':sprintf(converted, "%d", partno);
              len2 = strlen(converted);
              for (k = 0; k < len2; k++, j++)
                fname[j] = converted[k];
              break;
     default :fname[j] = st[i];
              j++;
              break;
    }
 fname[j] = '\0';
 return fname;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, 0x18(%rsp)
movl %ecx, 0x14(%rsp)
movl %edx, 0x10(%rsp)
movl %esi, %ebp
movq %rdi, %r12
leaq 0x47f79(%rip), %rsi     # 0xa41c6
movl $0x64, %edi
movl $0x2, %edx
callq 0x390f5
movq %rax, %rbx
movslq %ebp, %rax
imulq $0x7a120, %rax, %rax    # imm = 0x7A120
leaq 0x76620(%rip), %r13     # 0xd2890
addq %rax, %r13
movq %r13, %rdi
callq 0x4190
movq %rax, %rbp
testl %ebp, %ebp
je 0x5c39d
xorl %eax, %eax
testl %ebp, %ebp
jle 0x5c397
movq %rbx, 0x8(%rsp)
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
leaq 0x1e(%rsp), %r14
xorl %ebx, %ebx
xorl %r15d, %r15d
movq %rbp, (%rsp)
movsbl (%r13,%rbx), %eax
leal -0x44(%rax), %ecx
rorl %ecx
cmpl $0x7, %ecx
ja 0x5c375
leaq 0x4bb34(%rip), %rdx     # 0xa7df8
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq 0x8(%r12), %rdi
callq 0x4190
testl %eax, %eax
jle 0x5c383
movslq %r15d, %rcx
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq 0x8(%rsp), %rcx
xorl %edx, %edx
movq 0x8(%r12), %rsi
movb (%rsi,%rdx), %sil
movb %sil, (%rcx,%rdx)
incq %rdx
cmpq %rdx, %rax
jne 0x5c2ee
addl %edx, %r15d
jmp 0x5c383
movq %r14, %rdi
leaq 0x5184b(%rip), %rsi     # 0xadb5d
movl 0x18(%rsp), %edx
jmp 0x5c336
movq %r14, %rdi
leaq 0x5183b(%rip), %rsi     # 0xadb5d
movl 0x14(%rsp), %edx
jmp 0x5c336
movq %r14, %rdi
leaq 0x5182b(%rip), %rsi     # 0xadb5d
movl 0x10(%rsp), %edx
xorl %eax, %eax
callq 0x41b0
movq %r14, %rdi
callq 0x4190
movq %r14, %rbp
movq %rax, %r14
testl %r14d, %r14d
jle 0x5c36c
movslq %r15d, %rdi
addq 0x8(%rsp), %rdi
movl %r14d, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq %rbp, %rsi
callq 0x4310
addl %r14d, %r15d
movq %rbp, %r14
movq (%rsp), %rbp
jmp 0x5c383
movslq %r15d, %rcx
movq 0x8(%rsp), %rdx
movb %al, (%rdx,%rcx)
incl %r15d
incq %rbx
cmpq %rbp, %rbx
jne 0x5c2a9
movslq %r15d, %rax
movq 0x8(%rsp), %rbx
movb $0x0, (%rbx,%rax)
jmp 0x5c3a7
movq %rbx, %rdi
callq 0x39194
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq