// File: /workspace/github_c_makefile_star2_O1/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 0x35d11
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 0x35ac8
testl %esi, %esi
je 0x35d11
movb (%rbx), %al
testb %al, %al
je 0x35d11
leaq 0x1(%rbx), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x7a140(%rsp), %r13
leaq 0x6dacb(%rip), %rbp     # 0xa35cc
xorl %r15d, %r15d
xorl %r14d, %r14d
movq %rcx, 0x8(%rsp)
cmpb $0x25, %al
jne 0x35b30
testl %r14d, %r14d
jne 0x35b53
movb $0x0, 0x7a140(%rsp)
movl $0x1, %r14d
movl %r15d, %eax
movq %rax, 0x8(%rsp)
jmp 0x35cfe
testl %r14d, %r14d
je 0x35ba4
movsbl %al, %ecx
movq %r13, %rdi
movq %rbp, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x41b0
movl $0x1, %r14d
jmp 0x35cfe
movq %r13, %rdi
callq 0x34c33
movq %rax, %rdi
callq 0x34d3b
xorl %r14d, %r14d
testq %rax, %rax
je 0x35cfe
movq %rax, %r12
movl (%rax), %eax
cmpq $0x4, %rax
ja 0x35bff
leaq 0x7032b(%rip), %rcx     # 0xa5eb0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x28(%r12), %rsi
testq %rsi, %rsi
je 0x35bf2
leaq 0x20(%rsp), %rdi
callq 0x4270
jmp 0x35bff
xorl %r14d, %r14d
jmp 0x35cfe
leaq 0xf4260(%rsp), %r13
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x39529
movsd 0x28(%r12), %xmm0
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movb $0x1, %al
callq 0x41b0
jmp 0x35bff
movl 0x28(%r12), %edx
leaq 0x20(%rsp), %rdi
leaq 0x77f74(%rip), %rsi     # 0xadb5d
xorl %eax, %eax
callq 0x41b0
jmp 0x35bff
movb $0x0, 0x24(%rsp)
movl $0x4c4c554e, 0x20(%rsp) # imm = 0x4C4C554E
movq %r12, %rdi
callq 0x39194
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 0x35c6d
cmpl %eax, %r15d
movl $0x5f, %r9d
leaq 0x6d987(%rip), %rbp     # 0xa35cc
movq 0x10(%rsp), %r10
jge 0x35cc0
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 0x35c5b
jmp 0x35cc0
cmpl %r12d, %ebp
setge %cl
cmpl %eax, %r15d
setl %dl
andb %cl, %dl
cmpb $0x1, %dl
movl $0x5f, %r9d
leaq 0x6d941(%rip), %rbp     # 0xa35cc
movq 0x10(%rsp), %r10
jne 0x35cc0
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 0x35ca9
testl %r12d, %r12d
leaq 0x7a140(%rsp), %r13
jle 0x35cf8
movl %r12d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movslq 0x8(%rsp), %rcx
addq %rbx, %rcx
xorl %edx, %edx
movzbl 0x20(%rsp,%rdx), %esi
cmpb $0x20, %sil
cmovel %r9d, %esi
movb %sil, (%rcx,%rdx)
incq %rdx
cmpq %rdx, %rax
jne 0x35cdf
addl %r10d, %r15d
addl %r12d, %r15d
movslq %r15d, %r15
movb 0x1(%rbx,%r15), %al
incq %r15
testb %al, %al
jne 0x35b0c
addq $0x16e388, %rsp         # imm = 0x16E388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop