// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/lang.c
// Function: change_according_to_variables
void change_according_to_variables(char* st)
{
 /*!Last Changed 03.01.2006*/
	/*!Last Changed 19.01.2005 added _ for space*/
	/*!Last Changed 27.01.2004*/
	/*!Last Changed 05.11.2003 Added File variable with type 4*/
 /*!Last Changed 02.05.2002*/
 int i, len, start, percindex, removed, added, j, found = 0;
	char st3[READLINELENGTH], temp[READLINELENGTH], temp2[READLINELENGTH];
	variableptr myvar;
 Expnodeptr list;
	len = strlen(st);
 for (i = 0; i < len; i++)
			if (st[i] == '%')
				 found = 1;
	if (!found)
		 return;
	i = 0;
	start = 0;
 while (st[i])
	 {
		 if (st[i] == '%')
				 if (!start)
					 {
						 start = 1;
							percindex = i;
							strcpy(st3, "");
					 }
					else
					 {
						 start = 0;
       list = create_expression_list(st3);
       myvar = evaluate_expression_list(list);
       if (myvar)
							 {
         switch (myvar->type)
										{
           case INTEGER_TYPE:sprintf(temp, "%d", myvar->value.intvalue);
                             break;
           case REAL_TYPE   :set_precision(temp2, NULL, NULL);
												                 sprintf(temp, temp2, myvar->value.floatvalue);
                             break;
           case STRING_TYPE :
											case FILE_TYPE   :if (myvar->value.stringvalue)
                               sprintf(temp,"%s", myvar->value.stringvalue);
                             else
                               sprintf(temp,"NULL");
                             break;
           default          :break;
										}
         safe_free(myvar);
         removed = i - percindex + 1;
									added = strlen(temp);
									len = strlen(st);
									if (added > removed)
										 for (j = len; j > i; j--)
												 st[added - removed + j] = st[j];
									else
									  if (added < removed)
												 for (j = i + 1; j <= len; j++)
														 st[j + added - removed] = st[j];
									for (j = 0; j < added; j++)
										 if (temp[j] != ' ')
  										 st[percindex + j] = temp[j];
											else
												 st[percindex + j] = '_';
									i = i + added - removed;
						  }
					 }
			else
			  if (start)
						 sprintf(st3, "%s%c", st3, st[i]);
			i++;
	 }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x16e378, %rsp         # imm = 0x16E378
movq %rdi, %rbx
callq 0x4190
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
pushq $0x1
popq %r12
xorl %edx, %edx
cmpq %rcx, %rax
je 0x31e9b
cmpb $0x25, (%rbx,%rcx)
cmovel %r12d, %edx
incq %rcx
jmp 0x31e89
testl %edx, %edx
je 0x32073
movq %rax, (%rsp)
xorl %eax, %eax
xorl %ebp, %ebp
movslq %ebp, %r14
movsbl (%rbx,%r14), %ecx
testl %ecx, %ecx
je 0x32073
cmpb $0x25, %cl
jne 0x31ed4
testl %eax, %eax
jne 0x31efd
movb $0x0, 0x7a130(%rsp)
movl %ebp, %eax
movq %rax, (%rsp)
jmp 0x31ef5
testl %eax, %eax
je 0x3204a
leaq 0x7a130(%rsp), %rdi
leaq 0x646c5(%rip), %rsi     # 0x965b0
movq %rdi, %rdx
xorl %eax, %eax
callq 0x41b0
movl %r12d, %eax
jmp 0x3204c
leaq 0x7a130(%rsp), %rdi
callq 0x31120
movq %rax, %rdi
callq 0x31243
movq %rax, %r12
xorl %eax, %eax
testq %r12, %r12
je 0x31f50
movl (%r12), %eax
cmpq $0x4, %rax
ja 0x31fac
leaq 0x66f1f(%rip), %rcx     # 0x98e50
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x28(%r12), %rsi
testq %rsi, %rsi
je 0x31f9f
leaq 0x10(%rsp), %rdi
callq 0x4270
jmp 0x31fac
pushq $0x1
popq %r12
jmp 0x3204c
leaq 0xf4250(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x35305
movsd 0x28(%r12), %xmm0
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x41b0
jmp 0x31fac
movl 0x28(%r12), %edx
leaq 0x10(%rsp), %rdi
leaq 0x6ebc3(%rip), %rsi     # 0xa0b59
xorl %eax, %eax
callq 0x41b0
jmp 0x31fac
movb $0x0, 0x14(%rsp)
movl $0x4c4c554e, 0x10(%rsp) # imm = 0x4C4C554E
movq %r12, %rdi
callq 0x34ff7
movl %ebp, %r12d
subl (%rsp), %r12d
leal 0x1(%r12), %eax
movl %eax, 0xc(%rsp)
movl %r12d, %r13d
notl %r13d
leaq 0x10(%rsp), %rdi
callq 0x4190
movq %rax, %r15
movq %rbx, %rdi
callq 0x4190
cmpl %r15d, 0xc(%rsp)
jge 0x32009
leal (%r15,%r13), %ecx
cltq
movslq %ecx, %rcx
addq %rbx, %rcx
pushq $0x1
popq %r12
pushq $0x5f
popq %rdi
cmpq %r14, %rax
jle 0x32015
movb (%rbx,%rax), %dl
movb %dl, (%rcx,%rax)
decq %rax
jmp 0x31ff9
cmpl %r15d, %r12d
pushq $0x1
popq %r12
pushq $0x5f
popq %rdi
jge 0x32053
movslq (%rsp), %rax
testl %r15d, %r15d
movl $0x0, %ecx
cmovgl %r15d, %ecx
addq %rbx, %rax
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x32044
movzbl 0x10(%rsp,%rdx), %esi
cmpb $0x20, %sil
cmovel %edi, %esi
movb %sil, (%rax,%rdx)
incq %rdx
jmp 0x3202a
addl %r13d, %ebp
addl %r15d, %ebp
xorl %eax, %eax
incl %ebp
jmp 0x31eab
cltq
movq (%rsp), %rcx
addl %r15d, %ecx
cmpq %rax, %r14
jge 0x32015
movb 0x1(%rbx,%r14), %dl
incq %r14
movslq %ecx, %rcx
movb %dl, (%rbx,%rcx)
incl %ecx
jmp 0x3205c
addq $0x16e378, %rsp         # imm = 0x16E378
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)