// File: /workspace/github_c_makefile_star2_O2/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, 0x1c(%rsp)
movl %ecx, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movl %esi, %ebx
movq %rdi, %r12
leaq 0x41fad(%rip), %rsi     # 0x971a8
pushq $0x64
popq %rdi
pushq $0x2
popq %rdx
callq 0x34f59
movq %rax, %r15
movslq %ebx, %rax
imulq $0x7a120, %rax, %rax    # imm = 0x7A120
leaq 0x78676(%rip), %rdi     # 0xcd890
addq %rax, %rdi
movq %rdi, 0x20(%rsp)
callq 0x4190
movq %rax, %rbx
testl %ebx, %ebx
je 0x553a6
xorl %eax, %eax
testl %ebx, %ebx
cmovlel %eax, %ebx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq %r15, %rsi
movq %r15, (%rsp)
movslq %ebp, %r15
cmpq %rbx, %r14
je 0x5539f
movq 0x20(%rsp), %rax
movsbl (%rax,%r14), %eax
leal -0x44(%rax), %ecx
rorl %ecx
cmpl $0x7, %ecx
ja 0x55393
leaq 0x45b78(%rip), %rdx     # 0x9ade8
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq 0x8(%r12), %rdi
callq 0x4190
movq (%rsp), %rsi
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
addq %rsi, %r15
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x55389
movq 0x8(%r12), %rdx
movb (%rdx,%rcx), %dl
movb %dl, (%r15,%rcx)
incq %rcx
jmp 0x55296
leaq 0xa(%rsp), %r13
movq %r13, %rdi
leaq 0x4b89a(%rip), %rsi     # 0xa0b59
movl 0x1c(%rsp), %edx
xorl %eax, %eax
callq 0x41b0
movq %r13, %rdi
callq 0x4190
movq (%rsp), %rsi
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
addq %rsi, %r15
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x55389
movb 0xa(%rsp,%rcx), %dl
movb %dl, (%r15,%rcx)
incq %rcx
jmp 0x552e5
leaq 0xa(%rsp), %r13
movq %r13, %rdi
leaq 0x4b84f(%rip), %rsi     # 0xa0b59
movl 0x18(%rsp), %edx
xorl %eax, %eax
callq 0x41b0
movq %r13, %rdi
callq 0x4190
movq (%rsp), %rsi
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
addq %rsi, %r15
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x55389
movb 0xa(%rsp,%rcx), %dl
movb %dl, (%r15,%rcx)
incq %rcx
jmp 0x55330
leaq 0xa(%rsp), %r13
movq %r13, %rdi
leaq 0x4b808(%rip), %rsi     # 0xa0b59
movl 0x14(%rsp), %edx
xorl %eax, %eax
callq 0x41b0
movq %r13, %rdi
callq 0x4190
movq (%rsp), %rsi
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
addq %rsi, %r15
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x55389
movb 0xa(%rsp,%rcx), %dl
movb %dl, (%r15,%rcx)
incq %rcx
jmp 0x55377
addl %ecx, %ebp
incq %r14
jmp 0x55245
movb %al, (%rsi,%r15)
incl %r15d
movl %r15d, %ebp
jmp 0x5538b
movb $0x0, (%rsi,%r15)
jmp 0x553b0
movq %r15, %rdi
callq 0x34ff7
xorl %esi, %esi
movq %rsi, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq