// File: /workspace/github_cpp_makefile_star2_O1/AshOlogn[P]ash-language-interpreter/src/parsetoken.cpp
// Function: toStringParseData(ParseData)
char* toStringParseData(ParseData d) {

  switch(d.type) {

    case INT8_T: {
      int8_t val = (int8_t) d.value.integer;
      std::string str = std::to_string(val);
      return copyString(str.c_str());
    }

    case INT16_T: {
      int16_t val = (int16_t) d.value.integer;  
      std::string str = std::to_string(val);
      return copyString(str.c_str());
    }

    case INT32_T: {
      int32_t val = (int32_t) d.value.integer;
      std::string str = std::to_string(val);
      return copyString(str.c_str());
    }

    case INT64_T: {
      int64_t val = (int64_t) d.value.integer;
      std::string str = std::to_string(val);
      return copyString(str.c_str());
    }

    case UINT8_T: {
      uint8_t val = (uint8_t) d.value.integer;
      std::string str = std::to_string(val);
      return copyString(str.c_str());
    }

    case UINT16_T: {
      uint16_t val = (uint16_t) d.value.integer;  
      std::string str = std::to_string(val);
      return copyString(str.c_str());
    }

    case UINT32_T: {
      uint32_t val = (uint32_t) d.value.integer;
      std::string str = std::to_string(val);
      return copyString(str.c_str());
    }

    case UINT64_T: {
      uint64_t val = (uint64_t) d.value.integer;
      std::string str = std::to_string(val);
      return copyString(str.c_str());
    }

    case CHAR_T: {
      char val = (char) ((uint8_t) d.value.integer);
      char* c = new char[2];
      c[0] = val;
      c[1] = '\0';
      return c; 
    }

    case DOUBLE_T: {
      std::string str = std::to_string((double) d.value.floatingPoint);
      return copyString(str.c_str());
    }
    
    case BOOL_T: {
     
      if(d.value.integer) {
        return copyString("true");
      } else {
        return copyString("false");
      }
    }

    case STRING_T: {
      return copyString((char*) d.value.allocated);
    }

		case ARRAY_T: {

			Array* arr = (Array*) d.value.allocated;
			uint32_t length = arr->length;
			ParseData* values = arr->values;

			std::string str("[");

			if(length > 0)
				str.append(toStringParseData(values[0]));
			
			for(uint32_t i = 1; i < length; i++) {
				str.append(", ");
				str.append(toStringParseData(values[i]));
			}
			str.append("]");

			return copyString(str.c_str());
		}
		
		case VOID_T: {
			return copyString("VOID");
		}

    default: {
      return copyString("INVALID");
    }

  }

  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0xf, %edi
ja 0x87d3
movq %rsi, %rbx
movl %edi, %eax
leaq 0x16827(%rip), %rcx     # 0x1eb64
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movsbl %bl, %r14d
movl %r14d, %ebx
negl %ebx
cmovsl %r14d, %ebx
cmpl $0x64, %ebx
movl $0x3, %eax
sbbl $0x0, %eax
cmpl $0xa, %ebx
movl $0x1, %r15d
cmovael %eax, %r15d
shrl $0x1f, %r14d
leal (%r15,%r14), %esi
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
leaq -0x48(%rbp), %r12
movq %r12, %rdi
movl $0x2d, %edx
callq 0x4250
addq (%r12), %r14
movq %r14, %rdi
movl %r15d, %esi
movl %ebx, %edx
callq 0x5c72
movq (%r12), %rdi
callq 0x176b0
jmp 0x8891
leaq 0x16cbc(%rip), %rdi     # 0x1f06e
jmp 0x87e3
movq %rbx, %xmm0
movq 0x23bf5(%rip), %rsi     # 0x2bfb8
leaq 0x16ca9(%rip), %rcx     # 0x1f073
leaq -0x48(%rbp), %rbx
movl $0x148, %edx            # imm = 0x148
movq %rbx, %rdi
movb $0x1, %al
callq 0x8a11
movq (%rbx), %rdi
callq 0x176b0
movq %rax, %r14
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0x84fa
movzbl %bl, %ebx
cmpl $0x64, %ebx
movl $0x3, %eax
sbbl $0x0, %eax
cmpl $0xa, %ebx
movl $0x1, %r14d
cmovael %eax, %r14d
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
leaq -0x48(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x2d, %edx
callq 0x4250
movq (%r15), %rdi
movl %r14d, %esi
movl %ebx, %edx
callq 0x5c72
movq (%r15), %rdi
callq 0x176b0
jmp 0x8571
movl 0x4(%rbx), %r12d
movq 0x8(%rbx), %r13
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x16cef(%rip), %rsi     # 0x1f14d
leaq 0x16ce9(%rip), %rdx     # 0x1f14e
leaq -0x48(%rbp), %rdi
callq 0x5ce4
testq %r12, %r12
je 0x848c
movl (%r13), %edi
movq 0x8(%r13), %rsi
callq 0x8317
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x43a0
cmpl $0x2, %r12d
jb 0x84d6
shlq $0x4, %r12
addq $-0x10, %r12
xorl %r15d, %r15d
leaq 0x16bc7(%rip), %rbx     # 0x1f06b
leaq -0x48(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x43a0
movl 0x10(%r13,%r15), %edi
movq 0x18(%r13,%r15), %rsi
callq 0x8317
movq %r14, %rdi
movq %rax, %rsi
callq 0x43a0
addq $0x10, %r15
cmpq %r15, %r12
jne 0x84a8
leaq 0x164d5(%rip), %rsi     # 0x1e9b2
leaq -0x48(%rbp), %rdi
callq 0x43a0
movq -0x48(%rbp), %rdi
callq 0x176b0
movq %rax, %r14
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
jne 0x889d
jmp 0x88a2
movzwl %bx, %ebx
movl $0x1, %r14d
cmpl $0xa, %ebx
jb 0x853f
movl $0x2, %r14d
cmpl $0x64, %ebx
jb 0x853f
movl $0x3, %r14d
cmpl $0x3e8, %ebx            # imm = 0x3E8
jb 0x853f
cmpl $0x2710, %ebx           # imm = 0x2710
movl $0x5, %r14d
sbbl $0x0, %r14d
movl %r14d, %esi
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
leaq -0x48(%rbp), %r15
movq %r15, %rdi
movl $0x2d, %edx
callq 0x4250
movq (%r15), %rdi
movl %r14d, %esi
movl %ebx, %edx
callq 0x5c72
movq (%r15), %rdi
callq 0x176b0
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
jne 0x889d
jmp 0x88a2
movq %rbx, %rdi
jmp 0x87e3
movq %rbx, %r14
negq %r14
cmovsq %rbx, %r14
movl $0x1, %r15d
cmpq $0xa, %r14
jb 0x8815
movl $0x4, %r15d
movabsq $0x346dc5d63886594b, %rsi # imm = 0x346DC5D63886594B
movq %r14, %rcx
cmpq $0x63, %rcx
jbe 0x87f6
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x8812
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x8815
movq %rcx, %rax
mulq %rsi
shrq $0xb, %rdx
addl $0x4, %r15d
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x85bb
addl $-0x3, %r15d
jmp 0x8815
movl %ebx, %r14d
negl %r14d
cmovsl %ebx, %r14d
movl $0x1, %r15d
cmpl $0xa, %r14d
jb 0x8856
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r14d, %ecx
cmpl $0x63, %ecx
jbe 0x87fc
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x8853
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x8856
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x862a
addl $-0x3, %r15d
jmp 0x8856
movswl %bx, %r14d
movl %r14d, %ebx
negl %ebx
cmovsl %r14d, %ebx
movl $0x1, %r15d
cmpl $0xa, %ebx
jb 0x86ad
movl $0x2, %r15d
cmpl $0x64, %ebx
jb 0x86ad
movl $0x3, %r15d
cmpl $0x3e8, %ebx            # imm = 0x3E8
jb 0x86ad
cmpl $0x2710, %ebx           # imm = 0x2710
movl $0x5, %r15d
sbbl $0x0, %r15d
shrl $0x1f, %r14d
leal (%r15,%r14), %esi
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
leaq -0x48(%rbp), %r12
movq %r12, %rdi
movl $0x2d, %edx
callq 0x4250
addq (%r12), %r14
movq %r14, %rdi
movl %r15d, %esi
movl %ebx, %edx
callq 0x5c72
movq (%r12), %rdi
callq 0x176b0
jmp 0x8891
movl $0x1, %eax
cmpl $0xa, %ebx
jb 0x88b6
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebx, %edx
cmpl $0x63, %edx
jbe 0x8802
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0x88b4
cmpl $0x2710, %edx           # imm = 0x2710
jb 0x88b6
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0x8707
addl $-0x3, %eax
jmp 0x88b6
movl $0x1, %esi
cmpq $0xa, %rbx
jb 0x88e8
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %rbx, %rcx
cmpq $0x63, %rcx
jbe 0x880a
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x88e6
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x88e8
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x8768
addl $-0x3, %esi
jmp 0x88e8
testq %rbx, %rbx
je 0x87dc
leaq 0x15f61(%rip), %rdi     # 0x1e71a
jmp 0x87e3
movl $0x2, %edi
callq 0x4030
movq %rax, %r14
movb %bl, (%rax)
movb $0x0, 0x1(%rax)
jmp 0x88a2
leaq 0x16654(%rip), %rdi     # 0x1ee2e
jmp 0x87e3
leaq 0x15f3c(%rip), %rdi     # 0x1e71f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x176b0
addl $-0x2, %r15d
jmp 0x8815
addl $-0x2, %r15d
jmp 0x8856
addl $-0x2, %eax
jmp 0x88b6
addl $-0x2, %esi
jmp 0x88e8
decl %r15d
shrq $0x3f, %rbx
leal (%rbx,%r15), %esi
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
leaq -0x48(%rbp), %r12
movq %r12, %rdi
movl $0x2d, %edx
callq 0x4250
addq (%r12), %rbx
movq %rbx, %rdi
movl %r15d, %esi
movq %r14, %rdx
callq 0x8991
movq (%r12), %rdi
callq 0x176b0
jmp 0x8891
decl %r15d
shrl $0x1f, %ebx
leal (%r15,%rbx), %esi
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
leaq -0x48(%rbp), %r12
movq %r12, %rdi
movl $0x2d, %edx
callq 0x4250
addq (%r12), %rbx
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x5c72
movq (%r12), %rdi
callq 0x176b0
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x88a2
callq 0x41e0
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
decl %eax
movl %eax, %esi
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
leaq -0x48(%rbp), %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0x4250
movq (%r14), %rdi
movl 0x8(%r14), %esi
movl %ebx, %edx
callq 0x5c72
movq (%r14), %rdi
callq 0x176b0
jmp 0x8917
decl %esi
movl %esi, %esi
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
leaq -0x48(%rbp), %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0x4250
movq (%r14), %rdi
movl 0x8(%r14), %esi
movq %rbx, %rdx
callq 0x8991
movq (%r14), %rdi
callq 0x176b0
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
jne 0x889d
jmp 0x88a2
jmp 0x892e
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
jne 0x8984
jmp 0x8989
jmp 0x8944
jmp 0x8944
jmp 0x8944
jmp 0x8957
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
jne 0x8984
jmp 0x8989
movq %rax, %rbx
jmp 0x8989
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
jne 0x8984
jmp 0x8989
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0x897f
jmp 0x8974
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x8989
callq 0x41e0
movq %rbx, %rdi
callq 0x4380