// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/savecode.c
// Function: code_1d_array_constant
void code_1d_array_constant(FILE* testcodefile, PROGRAMMING_LANGUAGE_TYPE language, char* arrayname, int size, void* values, int elementtype)
{
 /*!Last Changed 19.10.2007 updated Java*/
 /*!Last Changed 25.06.2006 added elementtype to include integer arrays*/
 /*!Last Changed 05.06.2006*/
 char separator;
	double* dvalues;
	int* ivalues;
 int i;
 switch (language){
   case C_LANGUAGE      :
   case CPP_LANGUAGE    :switch (elementtype){
                           case REAL_TYPE   :fprintf(testcodefile, "const double %s[%d] = {", arrayname, size);
                                             break;
                           case INTEGER_TYPE:fprintf(testcodefile, "const int %s[%d] = {", arrayname, size);
                                             break;
                         };
                         separator = ',';
                         break;
   case JAVA_LANGUAGE   :switch (elementtype){
                           case REAL_TYPE   :fprintf(testcodefile, "final double[] %s = {", arrayname);
                                             break;
                           case INTEGER_TYPE:fprintf(testcodefile, "final int[] %s = {", arrayname);
                                             break;
                         };
                         separator = ',';
                         break;
   case PASCAL_LANGUAGE :switch (elementtype){
			                        case REAL_TYPE   :fprintf(testcodefile, "%s: array[1..%d] of real = (", arrayname, size);
																												                 break;
																											case INTEGER_TYPE:fprintf(testcodefile, "%s: array[1..%d] of integer = (", arrayname, size);
																												                 break;
				                     };
                         separator = ',';
                         break;
   case MATLAB_LANGUAGE :fprintf(testcodefile, "%s = [", arrayname);
                         separator = ' ';
                         break;
   case FORTRAN_LANGUAGE:switch (elementtype){
			                        case REAL_TYPE   :fprintf(testcodefile, "real %s(%d) = (/", arrayname, size);
																												                 break;
																											case INTEGER_TYPE:fprintf(testcodefile, "integer %s(%d) = (/", arrayname, size);
																												                 break;
																									};
				                     separator = ',';   
                         break;
 };  
	switch (elementtype){
	  case REAL_TYPE   :dvalues = (double*) values;
				                 fprintf(testcodefile, "%.6f ", dvalues[0]);
                     for (i = 1; i < size; i++)
                       fprintf(testcodefile, "%c%.6f ", separator, dvalues[i]);
																					break;
			case INTEGER_TYPE:ivalues = (int*) values;
				                 fprintf(testcodefile, "%d ", ivalues[0]);
                     for (i = 1; i < size; i++)
                       fprintf(testcodefile, "%c%d ", separator, ivalues[i]);
																					break;
	};
 switch (language){
   case C_LANGUAGE      :
   case CPP_LANGUAGE    :
   case JAVA_LANGUAGE   :fprintf(testcodefile, "};\n");
                         break;
   case PASCAL_LANGUAGE :fprintf(testcodefile, ");\n");
                         break;
   case MATLAB_LANGUAGE :fprintf(testcodefile, "];\n");
                         break;
   case FORTRAN_LANGUAGE:fprintf(testcodefile, "/);\n");
                         break;
 };  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r13d
movq %r8, %r14
movl %ecx, %r15d
movq %rdi, %rbx
movl %esi, %ebp
cmpl $0x5, %esi
movq %rbp, 0x10(%rsp)
movl %esi, 0xc(%rsp)
ja 0x7e8cc
leaq 0x31772(%rip), %rax     # 0xaff9c
movslq (%rax,%rbp,4), %rcx
addq %rax, %rcx
jmpq *%rcx
testl %r13d, %r13d
je 0x7e94d
movl $0x2c, %r12d
cmpl $0x1, %r13d
jne 0x7e8e8
leaq 0x31e6d(%rip), %rsi     # 0xb06c0
jmp 0x7e8b7
testl %r13d, %r13d
je 0x7e956
movl $0x2c, %r12d
cmpl $0x1, %r13d
jne 0x7e8e8
leaq 0x31e7c(%rip), %rsi     # 0xb06ed
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
jmp 0x7e8c4
testl %r13d, %r13d
je 0x7e969
movl $0x2c, %r12d
cmpl $0x1, %r13d
jne 0x7e8e8
leaq 0x31e7d(%rip), %rsi     # 0xb0716
jmp 0x7e8b7
testl %r13d, %r13d
je 0x7e972
movl $0x2c, %r12d
cmpl $0x1, %r13d
jne 0x7e8e8
leaq 0x31ea3(%rip), %rsi     # 0xb075a
movq %rbx, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x42e0
movl $0x2c, %r12d
jmp 0x7e8fb
xorl %r12d, %r12d
jmp 0x7e8e8
leaq 0x31e7b(%rip), %rsi     # 0xb0753
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
movl $0x20, %r12d
testl %r13d, %r13d
je 0x7e98c
cmpl $0x1, %r13d
jne 0x7e9d1
movsd (%r14), %xmm0
leaq 0x31e7a(%rip), %rsi     # 0xb0781
movq %rbx, %rdi
movb $0x1, %al
callq 0x42e0
cmpl $0x2, %r15d
jl 0x7e9d1
movl %r15d, %r13d
movl $0x1, %ebp
leaq 0x31e55(%rip), %r15     # 0xb077f
movsd (%r14,%rbp,8), %xmm0
movq %rbx, %rdi
movq %r15, %rsi
movl %r12d, %edx
movb $0x1, %al
callq 0x42e0
incq %rbp
cmpq %rbp, %r13
jne 0x7e92a
jmp 0x7e9d1
leaq 0x31d84(%rip), %rsi     # 0xb06d8
jmp 0x7e979
leaq 0x31da6(%rip), %rsi     # 0xb0703
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
jmp 0x7e986
leaq 0x31dc3(%rip), %rsi     # 0xb0733
jmp 0x7e979
leaq 0x31df2(%rip), %rsi     # 0xb076b
movq %rbx, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x42e0
movl $0x2c, %r12d
movl (%r14), %edx
leaq 0x313ef(%rip), %rsi     # 0xafd85
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
cmpl $0x2, %r15d
jl 0x7e9d1
movl %r15d, %r13d
movl $0x1, %ebp
leaq 0x31dd2(%rip), %r15     # 0xb0787
movl (%r14,%rbp,4), %ecx
movq %rbx, %rdi
movq %r15, %rsi
movl %r12d, %edx
xorl %eax, %eax
callq 0x42e0
incq %rbp
cmpq %rbp, %r13
jne 0x7e9b5
cmpl $0x5, 0xc(%rsp)
ja 0x7ea0d
leaq 0x315d5(%rip), %rax     # 0xaffb4
movq 0x10(%rsp), %rcx
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x31d99(%rip), %rdi     # 0xb078d
jmp 0x7ea23
leaq 0x31d99(%rip), %rdi     # 0xb0796
jmp 0x7ea23
leaq 0x31d8f(%rip), %rdi     # 0xb0795
movl $0x4, %esi
jmp 0x7ea28
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x31d6e(%rip), %rdi     # 0xb0791
movl $0x3, %esi
movl $0x1, %edx
movq %rbx, %rcx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x42c0