// File: /workspace/github_c_makefile_star2_O2/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
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, %esi
cmpl $0x5, %ebp
movq %rsi, 0x10(%rsp)
movl %ebp, 0xc(%rsp)
ja 0x73d6b
leaq 0x2c1ed(%rip), %rax     # 0x9fed0
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
testl %r13d, %r13d
je 0x73ddf
cmpl $0x1, %r13d
jne 0x73d67
leaq 0x2c922(%rip), %rsi     # 0xa0624
jmp 0x73d54
testl %r13d, %r13d
je 0x73de8
cmpl $0x1, %r13d
jne 0x73d67
leaq 0x2c937(%rip), %rsi     # 0xa0651
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
jmp 0x73d61
testl %r13d, %r13d
je 0x73dfb
cmpl $0x1, %r13d
jne 0x73d67
leaq 0x2c93e(%rip), %rsi     # 0xa067a
jmp 0x73d54
testl %r13d, %r13d
je 0x73e04
cmpl $0x1, %r13d
jne 0x73d67
leaq 0x2c96a(%rip), %rsi     # 0xa06be
movq %rbx, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x42e0
pushq $0x2c
popq %r12
jmp 0x73d98
pushq $0x2c
jmp 0x73d83
xorl %r12d, %r12d
jmp 0x73d85
leaq 0x2c940(%rip), %rsi     # 0xa06b7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
pushq $0x20
popq %r12
testl %r13d, %r13d
je 0x73e1c
cmpl $0x1, %r13d
jne 0x73e5b
movsd (%r14), %xmm0
leaq 0x2c941(%rip), %rsi     # 0xa06e5
movq %rbx, %rdi
movb $0x1, %al
callq 0x42e0
movslq %r15d, %r13
pushq $0x1
popq %rbp
leaq 0x2c928(%rip), %r15     # 0xa06e3
cmpq %r13, %rbp
jge 0x73e5b
movsd (%r14,%rbp,8), %xmm0
movq %rbx, %rdi
movq %r15, %rsi
movl %r12d, %edx
movb $0x1, %al
callq 0x42e0
incq %rbp
jmp 0x73dbb
leaq 0x2c856(%rip), %rsi     # 0xa063c
jmp 0x73e0b
leaq 0x2c878(%rip), %rsi     # 0xa0667
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
jmp 0x73e18
leaq 0x2c895(%rip), %rsi     # 0xa0697
jmp 0x73e0b
leaq 0x2c8c4(%rip), %rsi     # 0xa06cf
movq %rbx, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x42e0
pushq $0x2c
popq %r12
movl (%r14), %edx
leaq 0x2be92(%rip), %rsi     # 0x9fcb8
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42e0
movslq %r15d, %r13
pushq $0x1
popq %rbp
leaq 0x2c8ae(%rip), %r15     # 0xa06eb
cmpq %r13, %rbp
jge 0x73e5b
movl (%r14,%rbp,4), %ecx
movq %rbx, %rdi
movq %r15, %rsi
movl %r12d, %edx
xorl %eax, %eax
callq 0x42e0
incq %rbp
jmp 0x73e3d
cmpl $0x5, 0xc(%rsp)
ja 0x73e94
leaq 0x2c07f(%rip), %rax     # 0x9fee8
movq 0x10(%rsp), %rcx
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x2c873(%rip), %rdi     # 0xa06f1
jmp 0x73eaa
leaq 0x2c873(%rip), %rdi     # 0xa06fa
jmp 0x73eaa
leaq 0x2c869(%rip), %rdi     # 0xa06f9
pushq $0x4
jmp 0x73eac
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2c84b(%rip), %rdi     # 0xa06f5
pushq $0x3
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x42c0