// File: /workspace/github_c_makefile_star2_O1/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, %r12d
movq %rdi, %rbx
movl %esi, %edi
cmpl $0x5, %esi
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
ja 0x7cf6d
leaq 0x2ffd7(%rip), %rax     # 0xacec4
movslq (%rax,%rdi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0x2c, %r15d
testl %r13d, %r13d
je 0x7cf8b
cmpl $0x1, %r13d
jne 0x7cfc4
leaq 0x30712(%rip), %rsi     # 0xad628
jmp 0x7cfb7
movl $0x2c, %r15d
testl %r13d, %r13d
je 0x7cf94
cmpl $0x1, %r13d
jne 0x7cfc4
leaq 0x3071e(%rip), %rsi     # 0xad655
jmp 0x7cf9b
movl $0x2c, %r15d
testl %r13d, %r13d
je 0x7cfa7
cmpl $0x1, %r13d
jne 0x7cfc4
leaq 0x3072d(%rip), %rsi     # 0xad67e
jmp 0x7cfb7
movl $0x2c, %r15d
testl %r13d, %r13d
je 0x7cfb0
cmpl $0x1, %r13d
jne 0x7cfc4
leaq 0x30757(%rip), %rsi     # 0xad6c2
jmp 0x7cfb7
xorl %r15d, %r15d
jmp 0x7cfc4
leaq 0x30742(%rip), %rsi     # 0xad6bb
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
movl $0x20, %r15d
jmp 0x7cfc4
leaq 0x306ae(%rip), %rsi     # 0xad640
jmp 0x7cfb7
leaq 0x306d0(%rip), %rsi     # 0xad66b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
jmp 0x7cfc4
leaq 0x306ed(%rip), %rsi     # 0xad69b
jmp 0x7cfb7
leaq 0x3071c(%rip), %rsi     # 0xad6d3
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x42e0
testl %r13d, %r13d
je 0x7d01e
cmpl $0x1, %r13d
jne 0x7d063
movsd (%r14), %xmm0
leaq 0x3070a(%rip), %rsi     # 0xad6e9
movq %rbx, %rdi
movb $0x1, %al
callq 0x42e0
cmpl $0x2, %r12d
jl 0x7d063
movl %r12d, %r13d
movl $0x1, %ebp
leaq 0x306e9(%rip), %r12     # 0xad6e7
movsd (%r14,%rbp,8), %xmm0
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
movb $0x1, %al
callq 0x42e0
incq %rbp
cmpq %rbp, %r13
jne 0x7cffe
jmp 0x7d063
movl (%r14), %edx
leaq 0x2fc85(%rip), %rsi     # 0xaccad
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
cmpl $0x2, %r12d
jl 0x7d063
movl %r12d, %r13d
movl $0x1, %ebp
leaq 0x306a8(%rip), %r12     # 0xad6ef
movl (%r14,%rbp,4), %ecx
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
xorl %eax, %eax
callq 0x42e0
incq %rbp
cmpq %rbp, %r13
jne 0x7d047
cmpl $0x5, 0xc(%rsp)
ja 0x7d09f
leaq 0x2fe6b(%rip), %rax     # 0xacedc
movq 0x10(%rsp), %rcx
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x3066f(%rip), %rdi     # 0xad6f5
jmp 0x7d0b5
leaq 0x3066f(%rip), %rdi     # 0xad6fe
jmp 0x7d0b5
leaq 0x30665(%rip), %rdi     # 0xad6fd
movl $0x4, %esi
jmp 0x7d0ba
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x30644(%rip), %rdi     # 0xad6f9
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