// File: /workspace/github_cpp_makefile_star2_O3/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 0x2f54
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 0x2f4d
leaq (%r12,%r14), %rbp
leaq 0x41ea(%rip), %r15      # 0x7004
movq %rbx, %r13
cmpq %rbp, %r12
je 0x2f4d
testq %r14, %r14
je 0x2f4d
cmpb $0x5c, %al
je 0x2e5e
movzbl %al, %ecx
cmpl $0x22, %ecx
je 0x2f68
movb %al, (%r13)
movq %r12, %rdi
decq %r14
incq %r13
movb 0x1(%rdi), %al
incq %rdi
movq %rdi, %r12
testb %al, %al
jne 0x2e1d
jmp 0x2f4d
leaq 0x1(%r12), %rdi
decq %r14
movb 0x1(%r12), %al
movzbl %al, %ecx
cmpl $0x61, %ecx
jg 0x2e8e
cmpl $0x3e, %ecx
jle 0x2ea6
cmpl $0x3f, %ecx
je 0x2ed9
cmpl $0x5c, %ecx
je 0x2ee3
cmpl $0x61, %ecx
jne 0x2eed
movb $0x7, (%r13)
jmp 0x2e46
leal -0x6e(%rcx), %edx
cmpl $0xa, %edx
ja 0x2eb7
movslq (%r15,%rdx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
movb $0xa, (%r13)
jmp 0x2e46
cmpl $0x22, %ecx
je 0x2ecf
cmpl $0x27, %ecx
jne 0x2eed
movb $0x27, (%r13)
jmp 0x2e46
cmpl $0x62, %ecx
je 0x2f43
cmpl $0x66, %ecx
jne 0x2eed
movb $0xc, (%r13)
jmp 0x2e46
movb $0x22, (%r13)
jmp 0x2e46
movb $0x3f, (%r13)
jmp 0x2e46
movb $0x5c, (%r13)
jmp 0x2e46
andb $-0x8, %al
cmpb $0x30, %al
jne 0x2fa7
movq %rsp, %rsi
movl $0x8, %edx
jmp 0x2f10
addq $0x2, %r12
movq %r12, %rdi
movq %rsp, %rsi
movl $0x10, %edx
callq 0x21a0
movb %al, (%r13)
movq (%rsp), %rdi
decq %rdi
jmp 0x2e46
movb $0xb, (%r13)
jmp 0x2e46
movb $0xd, (%r13)
jmp 0x2e46
movb $0x9, (%r13)
jmp 0x2e46
movb $0x8, (%r13)
jmp 0x2e46
movb $0x0, (%r13)
jmp 0x2f56
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 0x43a3(%rip), %rsi      # 0x732c
movq %rax, %rdi
callq 0x21b0
movq 0x7048(%rip), %rsi      # 0x9fe0
movq 0x7031(%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 0x4338(%rip), %rsi      # 0x7300
movq %rax, %rdi
callq 0x21b0
jmp 0x2f91
jmp 0x2fd4
movq %rax, %r14
movq %rbx, %rdi
callq 0x2120
movq %r14, %rdi
callq 0x2240
nop