// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0x64, %edi
leaq 0x5eac2(%rip), %rsi     # 0xe3fee
movl $0x2, %edx
callq 0x52d70
movq %rax, -0x28(%rbp)
movslq -0x14(%rbp), %rcx
leaq 0x8031b(%rip), %rax     # 0x105860
imulq $0x7a120, %rcx, %rcx    # imm = 0x7A120
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x4150
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x8557b
movq -0x28(%rbp), %rdi
callq 0x52e80
movq $0x0, -0x8(%rbp)
jmp 0x85763
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x8574f
movq -0x30(%rbp), %rax
movslq -0x40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
addl $-0x44, %eax
movl %eax, %ecx
movq %rcx, -0x58(%rbp)
subl $0xe, %eax
ja 0x85720
movq -0x58(%rbp), %rax
leaq 0x62349(%rip), %rcx     # 0xe7900
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x4150
movl %eax, -0x48(%rbp)
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x8560d
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x50(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x28(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x855d7
jmp 0x8573f
leaq -0x3a(%rbp), %rdi
movl -0x18(%rbp), %edx
leaq 0x67c45(%rip), %rsi     # 0xed265
movb $0x0, %al
callq 0x4170
leaq -0x3a(%rbp), %rdi
callq 0x4150
movl %eax, -0x48(%rbp)
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x85669
movslq -0x50(%rbp), %rax
movb -0x3a(%rbp,%rax), %dl
movq -0x28(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x8563a
jmp 0x8573f
leaq -0x3a(%rbp), %rdi
movl -0x1c(%rbp), %edx
leaq 0x67be9(%rip), %rsi     # 0xed265
movb $0x0, %al
callq 0x4170
leaq -0x3a(%rbp), %rdi
callq 0x4150
movl %eax, -0x48(%rbp)
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x856c5
movslq -0x50(%rbp), %rax
movb -0x3a(%rbp,%rax), %dl
movq -0x28(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x85696
jmp 0x8573f
leaq -0x3a(%rbp), %rdi
movl -0x20(%rbp), %edx
leaq 0x67b90(%rip), %rsi     # 0xed265
movb $0x0, %al
callq 0x4170
leaq -0x3a(%rbp), %rdi
callq 0x4150
movl %eax, -0x48(%rbp)
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x8571e
movslq -0x50(%rbp), %rax
movb -0x3a(%rbp,%rax), %dl
movq -0x28(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x856ef
jmp 0x8573f
movq -0x30(%rbp), %rax
movslq -0x40(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x28(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x85741
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x85582
movq -0x28(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)