// File: /workspace/github_c_makefile_star2_O3/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 $0x16e388, %rsp         # imm = 0x16E388
movq %rdi, %rbx
callq 0x4190
testl %eax, %eax
jle 0x366dc
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
movl $0x1, %edx
xorl %esi, %esi
cmpb $0x25, (%rbx,%rcx)
cmovel %edx, %esi
incq %rcx
cmpq %rcx, %rax
jne 0x36492
testl %esi, %esi
je 0x366dc
movb (%rbx), %al
testb %al, %al
je 0x366dc
leaq 0x1(%rbx), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x7a140(%rsp), %r13
leaq 0x70145(%rip), %rbp     # 0xa6610
xorl %r15d, %r15d
xorl %r14d, %r14d
movq %rcx, 0x8(%rsp)
cmpb $0x25, %al
jne 0x364fa
testl %r14d, %r14d
jne 0x3651d
movb $0x0, 0x7a140(%rsp)
movl $0x1, %r14d
movl %r15d, %eax
movq %rax, 0x8(%rsp)
jmp 0x366c9
testl %r14d, %r14d
je 0x3656e
movsbl %al, %ecx
movq %r13, %rdi
movq %rbp, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x41b0
movl $0x1, %r14d
jmp 0x366c9
movq %r13, %rdi
callq 0x35620
movq %rax, %rdi
callq 0x35728
xorl %r14d, %r14d
testq %rax, %rax
je 0x366c9
movq %rax, %r12
movl (%rax), %eax
cmpq $0x4, %rax
ja 0x365c9
leaq 0x72991(%rip), %rcx     # 0xa8ee0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x28(%r12), %rsi
testq %rsi, %rsi
je 0x365bc
leaq 0x20(%rsp), %rdi
callq 0x4270
jmp 0x365c9
xorl %r14d, %r14d
jmp 0x366c9
leaq 0xf4260(%rsp), %r13
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3a535
movsd 0x28(%r12), %xmm0
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movb $0x1, %al
callq 0x41b0
jmp 0x365c9
movl 0x28(%r12), %edx
leaq 0x20(%rsp), %rdi
leaq 0x7a642(%rip), %rsi     # 0xb0bf5
xorl %eax, %eax
callq 0x41b0
jmp 0x365c9
movb $0x0, 0x24(%rsp)
movl $0x4c4c554e, 0x20(%rsp) # imm = 0x4C4C554E
movq %r12, %rdi
callq 0x3a180
movl %r15d, %ebp
subl 0x8(%rsp), %ebp
leal 0x1(%rbp), %r13d
movl %ebp, %eax
notl %eax
movq %rax, 0x10(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x4190
movq %rax, %r12
movq %rbx, %rdi
callq 0x4190
cmpl %r12d, %r13d
jge 0x36637
cmpl %eax, %r15d
movl $0x5f, %r9d
leaq 0x70001(%rip), %rbp     # 0xa6610
movq 0x10(%rsp), %r10
jge 0x3668a
leal (%r12,%r10), %ecx
cltq
movslq %ecx, %rcx
movslq %r15d, %rdx
addq %rbx, %rcx
movb (%rbx,%rax), %sil
movb %sil, (%rcx,%rax)
decq %rax
cmpq %rdx, %rax
jg 0x36625
jmp 0x3668a
cmpl %r12d, %ebp
setge %cl
cmpl %eax, %r15d
setl %dl
andb %cl, %dl
cmpb $0x1, %dl
movl $0x5f, %r9d
leaq 0x6ffbb(%rip), %rbp     # 0xa6610
movq 0x10(%rsp), %r10
jne 0x3668a
movslq %r15d, %rcx
cltq
subq %rcx, %rax
movq 0x8(%rsp), %rdx
addl %r12d, %edx
addq 0x18(%rsp), %rcx
xorl %esi, %esi
movb (%rcx,%rsi), %dil
leal (%rdx,%rsi), %r8d
movslq %r8d, %r8
movb %dil, (%rbx,%r8)
incq %rsi
cmpq %rsi, %rax
jne 0x36673
testl %r12d, %r12d
leaq 0x7a140(%rsp), %r13
jle 0x366c3
movslq 0x8(%rsp), %rax
movl %r12d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
addq %rbx, %rax
xorl %edx, %edx
movzbl 0x20(%rsp,%rdx), %esi
cmpb $0x20, %sil
cmovel %r9d, %esi
movb %sil, (%rax,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0x366aa
addl %r10d, %r15d
addl %r12d, %r15d
movslq %r15d, %r15
movb 0x1(%rbx,%r15), %al
incq %r15
testb %al, %al
jne 0x364d6
addq $0x16e388, %rsp         # imm = 0x16E388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop