// File: /workspace/github_cpp_makefile_star2_O1/yukioc[P]tscrpt/tscrpt.cpp
// Function: estrndup(char const*, unsigned long)
char* estrndup(const char*s, size_t n){
	if (s==NULL)return NULL;
	char *ret(new char[n+1]),*t(ret),*p;
	const char *e(&s[n]);
	for(;*s!='\0'&&s!=e&&n>0;--n,++s,++t){
//		printf("estrndup: s=%c\n",*s);
		if(*s=='\\'){
			++s;--n;
			switch(*s){
				case 'a':*t='\a';break;
				case 'b':*t='\b';break;
				case 'f':*t='\f';break;
				case 'n':*t='\n';break;
				case 'r':*t='\r';break;
				case 't':*t='\t';break;
				case 'v':*t='\v';break;
				case '?':*t='\?';break;
				case '\\':*t='\\';break;
				case '\'':*t='\'';break;
				case '\"':*t='\"';break;
				case 'x':*t=(char)strtol(s+1,&p,16);s=p-1;break;
				default:
					if(*s>='0'&&*s<='7'){ *t=strtol(s,&p,8);s=p-1;break; }
					else {
						delete ret; 
						throw std::logic_error("estrndup: contained wrong escaped character");
					}
			}
		}else if(*s=='"'){
			delete ret;
			throw std::logic_error("estrndup: contained un-escaped '\"'");
		}else{
			*t=*s;
		}
	}
	*t='\0';
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2f68
movq %rsi, %r14
movq %rdi, %r12
leaq 0x1(%rsi), %rdi
callq 0x2030
movq %rax, %rbx
movb (%r12), %al
movq %rbx, %r13
testb %al, %al
je 0x2f61
leaq (%r12,%r14), %rbp
leaq 0x41d6(%rip), %r15      # 0x7004
movq %rbx, %r13
cmpq %rbp, %r12
je 0x2f61
testq %r14, %r14
je 0x2f61
cmpb $0x5c, %al
je 0x2e72
movzbl %al, %ecx
cmpl $0x22, %ecx
je 0x2f7c
movb %al, (%r13)
movq %r12, %rdi
decq %r14
incq %r13
movb 0x1(%rdi), %al
incq %rdi
movq %rdi, %r12
testb %al, %al
jne 0x2e31
jmp 0x2f61
leaq 0x1(%r12), %rdi
decq %r14
movb 0x1(%r12), %al
movzbl %al, %ecx
cmpl $0x61, %ecx
jg 0x2ea2
cmpl $0x3e, %ecx
jle 0x2eba
cmpl $0x3f, %ecx
je 0x2eed
cmpl $0x5c, %ecx
je 0x2ef7
cmpl $0x61, %ecx
jne 0x2f01
movb $0x7, (%r13)
jmp 0x2e5a
leal -0x6e(%rcx), %edx
cmpl $0xa, %edx
ja 0x2ecb
movslq (%r15,%rdx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
movb $0xa, (%r13)
jmp 0x2e5a
cmpl $0x22, %ecx
je 0x2ee3
cmpl $0x27, %ecx
jne 0x2f01
movb $0x27, (%r13)
jmp 0x2e5a
cmpl $0x62, %ecx
je 0x2f57
cmpl $0x66, %ecx
jne 0x2f01
movb $0xc, (%r13)
jmp 0x2e5a
movb $0x22, (%r13)
jmp 0x2e5a
movb $0x3f, (%r13)
jmp 0x2e5a
movb $0x5c, (%r13)
jmp 0x2e5a
andb $-0x8, %al
cmpb $0x30, %al
jne 0x2fbb
movq %rsp, %rsi
movl $0x8, %edx
jmp 0x2f24
addq $0x2, %r12
movq %r12, %rdi
movq %rsp, %rsi
movl $0x10, %edx
callq 0x21a0
movb %al, (%r13)
movq (%rsp), %rdi
decq %rdi
jmp 0x2e5a
movb $0xb, (%r13)
jmp 0x2e5a
movb $0xd, (%r13)
jmp 0x2e5a
movb $0x9, (%r13)
jmp 0x2e5a
movb $0x8, (%r13)
jmp 0x2e5a
movb $0x0, (%r13)
jmp 0x2f6a
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %esi
movq %rbx, %rdi
callq 0x2150
movl $0x10, %edi
callq 0x20e0
movq %rax, %rbx
leaq 0x4392(%rip), %rsi      # 0x732f
movq %rax, %rdi
callq 0x21b0
movq 0x7034(%rip), %rsi      # 0x9fe0
movq 0x701d(%rip), %rdx      # 0x9fd0
movq %rbx, %rdi
callq 0x2220
movl $0x1, %esi
movq %rbx, %rdi
callq 0x2150
movl $0x10, %edi
callq 0x20e0
movq %rax, %rbx
leaq 0x4327(%rip), %rsi      # 0x7303
movq %rax, %rdi
callq 0x21b0
jmp 0x2fa5
jmp 0x2fe8
movq %rax, %r14
movq %rbx, %rdi
callq 0x2120
movq %r14, %rdi
callq 0x2240
nop