// File: /workspace/github_cpp_makefile_star2_O2/yukioc[P]tscrpt/t-tscrpt.cpp
// Function: t_estrndup()
void t_estrndup(){/*{{{*/
	bool except;
	char* s;
	//! \test NULL ptr => NULL
	s=estrndup(NULL,1);
	mu_assert(s==NULL);

	//! \test zero => ""
	s=estrndup("hello",0);
	mu_assert(s!=NULL);
	mu_assert(strlen(s)==0);
	delete s;

	//! \test hello => hello
	s=estrndup("hello",5);
	mu_assert(s!=NULL);
	mu_assert(strlen(s)==5);
	mu_assert(strcmp(s,"hello")==0);
	delete s;

	//! \test hello,n=4 => hell
	s=estrndup("hello",4);
	mu_assert(s!=NULL);
	mu_assert(strlen(s)==4);
	mu_assert(strcmp(s,"hell")==0);
	delete s;

	//! \test first\\0second,n=12 => first
	s=estrndup("first\0second",12);
	mu_assert(s!=NULL);
	mu_assert(strlen(s)==5);
	mu_assert(strcmp(s,"first")==0);
	delete s;

	//! \test say "hello" => say "hello"
	s=estrndup("say \\\"hello\\\"",13);
	mu_assert(s!=NULL);
	mu_assert(strlen(s)==11);
	mu_assert(strcmp(s,"say \"hello\"")==0);
	delete s;

	//! \test esc chars => unescaped
	s=estrndup("\\a,\\b,\\f,\\n,\\r,\\t,\\v,\\?,\\\\,\\',\\\"$",33);
	mu_assert(s!=NULL);
	mu_assert(strlen(s)==22);
	mu_assert(strcmp(s,"\a,\b,\f,\n,\r,\t,\v,\?,\\,\',\"$")==0);
	delete s;

	//! \test \\x4Fh! => Oh!
	s=estrndup("\\x4Fh!",6);
	mu_assert(s!=NULL);
	mu_assert(strlen(s)==3);
	mu_assert(strcmp(s,"Oh!")==0);
	delete s;

	//! \test \\107ood => Good
	s=estrndup("\\107ood",7);
	mu_assert(s!=NULL);
	mu_assert(strlen(s)==4);
	mu_assert(strcmp(s,"Good")==0);
	delete s;

	//! \test FIRST\\0SECOND => FIRST\\0SECOND\\0
	s=estrndup("FIRST\\0SECOND",13);
	mu_assert(s!=NULL);
	mu_assert(strlen(s)==5);
	mu_assert(memcmp(s,"FIRST\0SECOND\0",13)==0);
	delete s;
	s=0;

	//! \test aaa"bbb => exception
	except=false;
	try {
		s=estrndup("aaa\"bbb",7);
	}catch(std::exception& e){
		except=true;
		mu_assert(typeid(e)==typeid(std::logic_error));
	}
	assert(except==true);

	//! \test \\z => exception
	except=false;
	try {
		s=estrndup("\\z",2);
	}catch(std::exception& e){
		except=true;
		mu_assert(typeid(e)==typeid(std::logic_error));
	}
	assert(except==true);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0x1
popq %rsi
xorl %edi, %edi
callq 0x299d
incl 0x68f9(%rip)            # 0xa194
testq %rax, %rax
je 0x38c5
incl 0x68e6(%rip)            # 0xa18c
leaq 0x3afa(%rip), %rdi      # 0x73a7
leaq 0x3b11(%rip), %rsi      # 0x73c5
leaq 0x3b17(%rip), %rcx      # 0x73d2
pushq $0x15
popq %rdx
xorl %eax, %eax
callq 0x2040
leaq 0x3b0e(%rip), %rdi      # 0x73da
xorl %esi, %esi
callq 0x299d
movq %rax, %rbx
movl 0x68b8(%rip), %eax      # 0xa194
incl %eax
movl %eax, 0x68b0(%rip)      # 0xa194
testq %rbx, %rbx
jne 0x3914
incl 0x689d(%rip)            # 0xa18c
leaq 0x3ab1(%rip), %rdi      # 0x73a7
leaq 0x3ac8(%rip), %rsi      # 0x73c5
leaq 0x3adc(%rip), %rcx      # 0x73e0
pushq $0x19
popq %rdx
xorl %eax, %eax
callq 0x2040
movl 0x6880(%rip), %eax      # 0xa194
incl %eax
movl %eax, 0x6878(%rip)      # 0xa194
cmpb $0x0, (%rbx)
je 0x3946
incl 0x6865(%rip)            # 0xa18c
leaq 0x3a79(%rip), %rdi      # 0x73a7
leaq 0x3a90(%rip), %rsi      # 0x73c5
leaq 0x3aac(%rip), %rcx      # 0x73e8
pushq $0x1a
popq %rdx
xorl %eax, %eax
callq 0x2040
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2160
leaq 0x3a82(%rip), %rdi      # 0x73da
pushq $0x5
popq %rsi
callq 0x299d
movq %rax, %rbx
movl 0x682b(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x6823(%rip)      # 0xa194
testq %rax, %rax
jne 0x39a1
incl 0x6810(%rip)            # 0xa18c
leaq 0x3a24(%rip), %rdi      # 0x73a7
leaq 0x3a3b(%rip), %rsi      # 0x73c5
leaq 0x3a4f(%rip), %rcx      # 0x73e0
pushq $0x1f
popq %rdx
xorl %eax, %eax
callq 0x2040
movl 0x67f3(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x67eb(%rip)      # 0xa194
movq %rbx, %rdi
callq 0x20d0
cmpq $0x5, %rax
je 0x39e2
incl 0x67cf(%rip)            # 0xa18c
leaq 0x39e3(%rip), %rdi      # 0x73a7
leaq 0x39fa(%rip), %rsi      # 0x73c5
leaq 0x3a23(%rip), %rcx      # 0x73f5
pushq $0x20
popq %rdx
xorl %eax, %eax
callq 0x2040
movl 0x67b2(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x67aa(%rip)      # 0xa194
leaq 0x39e9(%rip), %rsi      # 0x73da
movq %rbx, %rdi
callq 0x21c0
testl %eax, %eax
je 0x3a22
incl 0x6789(%rip)            # 0xa18c
leaq 0x399d(%rip), %rdi      # 0x73a7
leaq 0x39b4(%rip), %rsi      # 0x73c5
leaq 0x39ea(%rip), %rcx      # 0x7402
pushq $0x21
popq %rdx
xorl %eax, %eax
callq 0x2040
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2160
leaq 0x39a6(%rip), %rdi      # 0x73da
pushq $0x4
popq %rsi
callq 0x299d
movq %rax, %rbx
movl 0x674f(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x6747(%rip)      # 0xa194
testq %rax, %rax
jne 0x3a7d
incl 0x6734(%rip)            # 0xa18c
leaq 0x3948(%rip), %rdi      # 0x73a7
leaq 0x395f(%rip), %rsi      # 0x73c5
leaq 0x3973(%rip), %rcx      # 0x73e0
pushq $0x26
popq %rdx
xorl %eax, %eax
callq 0x2040
movl 0x6717(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x670f(%rip)      # 0xa194
movq %rbx, %rdi
callq 0x20d0
cmpq $0x4, %rax
je 0x3abe
incl 0x66f3(%rip)            # 0xa18c
leaq 0x3907(%rip), %rdi      # 0x73a7
leaq 0x391e(%rip), %rsi      # 0x73c5
leaq 0x3969(%rip), %rcx      # 0x7417
pushq $0x27
popq %rdx
xorl %eax, %eax
callq 0x2040
movl 0x66d6(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x66ce(%rip)      # 0xa194
leaq 0x3957(%rip), %rsi      # 0x7424
movq %rbx, %rdi
callq 0x21c0
testl %eax, %eax
je 0x3afe
incl 0x66ad(%rip)            # 0xa18c
leaq 0x38c1(%rip), %rdi      # 0x73a7
leaq 0x38d8(%rip), %rsi      # 0x73c5
leaq 0x3935(%rip), %rcx      # 0x7429
pushq $0x28
popq %rdx
xorl %eax, %eax
callq 0x2040
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2160
leaq 0x3f35(%rip), %rdi      # 0x7a45
pushq $0xc
popq %rsi
callq 0x299d
movq %rax, %rbx
movl 0x6673(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x666b(%rip)      # 0xa194
testq %rax, %rax
jne 0x3b59
incl 0x6658(%rip)            # 0xa18c
leaq 0x386c(%rip), %rdi      # 0x73a7
leaq 0x3883(%rip), %rsi      # 0x73c5
leaq 0x3897(%rip), %rcx      # 0x73e0
pushq $0x2d
popq %rdx
xorl %eax, %eax
callq 0x2040
movl 0x663b(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x6633(%rip)      # 0xa194
movq %rbx, %rdi
callq 0x20d0
cmpq $0x5, %rax
je 0x3b9a
incl 0x6617(%rip)            # 0xa18c
leaq 0x382b(%rip), %rdi      # 0x73a7
leaq 0x3842(%rip), %rsi      # 0x73c5
leaq 0x386b(%rip), %rcx      # 0x73f5
pushq $0x2e
popq %rdx
xorl %eax, %eax
callq 0x2040
movl 0x65fa(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x65f2(%rip)      # 0xa194
leaq 0x3894(%rip), %rsi      # 0x743d
movq %rbx, %rdi
callq 0x21c0
testl %eax, %eax
je 0x3bda
incl 0x65d1(%rip)            # 0xa18c
leaq 0x37e5(%rip), %rdi      # 0x73a7
leaq 0x37fc(%rip), %rsi      # 0x73c5
leaq 0x3873(%rip), %rcx      # 0x7443
pushq $0x2f
popq %rdx
xorl %eax, %eax
callq 0x2040
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2160
leaq 0x386c(%rip), %rdi      # 0x7458
pushq $0xd
popq %rsi
callq 0x299d
movq %rax, %rbx
movl 0x6597(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x658f(%rip)      # 0xa194
testq %rax, %rax
jne 0x3c35
incl 0x657c(%rip)            # 0xa18c
leaq 0x3790(%rip), %rdi      # 0x73a7
leaq 0x37a7(%rip), %rsi      # 0x73c5
leaq 0x37bb(%rip), %rcx      # 0x73e0
pushq $0x34
popq %rdx
xorl %eax, %eax
callq 0x2040
movl 0x655f(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x6557(%rip)      # 0xa194
movq %rbx, %rdi
callq 0x20d0
cmpq $0xb, %rax
je 0x3c76
incl 0x653b(%rip)            # 0xa18c
leaq 0x374f(%rip), %rdi      # 0x73a7
leaq 0x3766(%rip), %rsi      # 0x73c5
leaq 0x3800(%rip), %rcx      # 0x7466
pushq $0x35
popq %rdx
xorl %eax, %eax
callq 0x2040
movl 0x651e(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x6516(%rip)      # 0xa194
leaq 0x37ef(%rip), %rsi      # 0x7474
movq %rbx, %rdi
callq 0x21c0
testl %eax, %eax
je 0x3cb6
incl 0x64f5(%rip)            # 0xa18c
leaq 0x3709(%rip), %rdi      # 0x73a7
leaq 0x3720(%rip), %rsi      # 0x73c5
leaq 0x37d4(%rip), %rcx      # 0x7480
pushq $0x36
popq %rdx
xorl %eax, %eax
callq 0x2040
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2160
leaq 0x37d5(%rip), %rdi      # 0x749d
pushq $0x21
popq %rsi
callq 0x299d
movq %rax, %rbx
movl 0x64bb(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x64b3(%rip)      # 0xa194
testq %rax, %rax
jne 0x3d11
incl 0x64a0(%rip)            # 0xa18c
leaq 0x36b4(%rip), %rdi      # 0x73a7
leaq 0x36cb(%rip), %rsi      # 0x73c5
leaq 0x36df(%rip), %rcx      # 0x73e0
pushq $0x3b
popq %rdx
xorl %eax, %eax
callq 0x2040
movl 0x6483(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x647b(%rip)      # 0xa194
movq %rbx, %rdi
callq 0x20d0
cmpq $0x16, %rax
je 0x3d52
incl 0x645f(%rip)            # 0xa18c
leaq 0x3673(%rip), %rdi      # 0x73a7
leaq 0x368a(%rip), %rsi      # 0x73c5
leaq 0x377d(%rip), %rcx      # 0x74bf
pushq $0x3c
popq %rdx
xorl %eax, %eax
callq 0x2040
movl 0x6442(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x643a(%rip)      # 0xa194
leaq 0x376c(%rip), %rsi      # 0x74cd
movq %rbx, %rdi
callq 0x21c0
testl %eax, %eax
je 0x3d92
incl 0x6419(%rip)            # 0xa18c
leaq 0x362d(%rip), %rdi      # 0x73a7
leaq 0x3644(%rip), %rsi      # 0x73c5
leaq 0x375c(%rip), %rcx      # 0x74e4
pushq $0x3d
popq %rdx
xorl %eax, %eax
callq 0x2040
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2160
leaq 0x3771(%rip), %rdi      # 0x7515
pushq $0x6
popq %rsi
callq 0x299d
movq %rax, %rbx
movl 0x63df(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x63d7(%rip)      # 0xa194
testq %rax, %rax
jne 0x3ded
incl 0x63c4(%rip)            # 0xa18c
leaq 0x35d8(%rip), %rdi      # 0x73a7
leaq 0x35ef(%rip), %rsi      # 0x73c5
leaq 0x3603(%rip), %rcx      # 0x73e0
pushq $0x42
popq %rdx
xorl %eax, %eax
callq 0x2040
movl 0x63a7(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x639f(%rip)      # 0xa194
movq %rbx, %rdi
callq 0x20d0
cmpq $0x3, %rax
je 0x3e2e
incl 0x6383(%rip)            # 0xa18c
leaq 0x3597(%rip), %rdi      # 0x73a7
leaq 0x35ae(%rip), %rsi      # 0x73c5
leaq 0x36fe(%rip), %rcx      # 0x751c
pushq $0x43
popq %rdx
xorl %eax, %eax
callq 0x2040
movl 0x6366(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x635e(%rip)      # 0xa194
leaq 0x36ec(%rip), %rsi      # 0x7529
movq %rbx, %rdi
callq 0x21c0
testl %eax, %eax
je 0x3e6e
incl 0x633d(%rip)            # 0xa18c
leaq 0x3551(%rip), %rdi      # 0x73a7
leaq 0x3568(%rip), %rsi      # 0x73c5
leaq 0x36c9(%rip), %rcx      # 0x752d
pushq $0x44
popq %rdx
xorl %eax, %eax
callq 0x2040
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2160
leaq 0x36c0(%rip), %rdi      # 0x7540
pushq $0x7
popq %rsi
callq 0x299d
movq %rax, %rbx
movl 0x6303(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x62fb(%rip)      # 0xa194
testq %rax, %rax
jne 0x3ec9
incl 0x62e8(%rip)            # 0xa18c
leaq 0x34fc(%rip), %rdi      # 0x73a7
leaq 0x3513(%rip), %rsi      # 0x73c5
leaq 0x3527(%rip), %rcx      # 0x73e0
pushq $0x49
popq %rdx
xorl %eax, %eax
callq 0x2040
movl 0x62cb(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x62c3(%rip)      # 0xa194
movq %rbx, %rdi
callq 0x20d0
cmpq $0x4, %rax
je 0x3f0a
incl 0x62a7(%rip)            # 0xa18c
leaq 0x34bb(%rip), %rdi      # 0x73a7
leaq 0x34d2(%rip), %rsi      # 0x73c5
leaq 0x351d(%rip), %rcx      # 0x7417
pushq $0x4a
popq %rdx
xorl %eax, %eax
callq 0x2040
movl 0x628a(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x6282(%rip)      # 0xa194
leaq 0x362f(%rip), %rsi      # 0x7548
movq %rbx, %rdi
callq 0x21c0
testl %eax, %eax
je 0x3f4a
incl 0x6261(%rip)            # 0xa18c
leaq 0x3475(%rip), %rdi      # 0x73a7
leaq 0x348c(%rip), %rsi      # 0x73c5
leaq 0x360d(%rip), %rcx      # 0x754d
pushq $0x4b
popq %rdx
xorl %eax, %eax
callq 0x2040
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2160
leaq 0x3605(%rip), %rdi      # 0x7561
pushq $0xd
popq %rsi
callq 0x299d
movq %rax, %rbx
movl 0x6227(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x621f(%rip)      # 0xa194
testq %rax, %rax
jne 0x3fa5
incl 0x620c(%rip)            # 0xa18c
leaq 0x3420(%rip), %rdi      # 0x73a7
leaq 0x3437(%rip), %rsi      # 0x73c5
leaq 0x344b(%rip), %rcx      # 0x73e0
pushq $0x50
popq %rdx
xorl %eax, %eax
callq 0x2040
movl 0x61ef(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x61e7(%rip)      # 0xa194
movq %rbx, %rdi
callq 0x20d0
cmpq $0x5, %rax
je 0x3fe6
incl 0x61cb(%rip)            # 0xa18c
leaq 0x33df(%rip), %rdi      # 0x73a7
leaq 0x33f6(%rip), %rsi      # 0x73c5
leaq 0x341f(%rip), %rcx      # 0x73f5
pushq $0x51
popq %rdx
xorl %eax, %eax
callq 0x2040
movl 0x61ae(%rip), %ebp      # 0xa194
incl %ebp
movl %ebp, 0x61a6(%rip)      # 0xa194
leaq 0x3a5d(%rip), %rsi      # 0x7a52
pushq $0xd
popq %rdx
movq %rbx, %rdi
callq 0x2180
testl %eax, %eax
je 0x4029
incl 0x6182(%rip)            # 0xa18c
leaq 0x3396(%rip), %rdi      # 0x73a7
leaq 0x33ad(%rip), %rsi      # 0x73c5
leaq 0x3550(%rip), %rcx      # 0x756f
pushq $0x52
popq %rdx
xorl %eax, %eax
callq 0x2040
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2160
leaq 0x3556(%rip), %rdi      # 0x7591
pushq $0x7
popq %rsi
callq 0x299d
leaq 0x3573(%rip), %rdi      # 0x75bd
leaq 0x3374(%rip), %rsi      # 0x73c5
leaq 0x3572(%rip), %rcx      # 0x75ca
pushq $0x5e
popq %rdx
callq 0x2100
movq %rdx, %rbx
cmpl $0x1, %ebx
jne 0x413f
movq %rax, %rdi
callq 0x20c0
incl 0x611a(%rip)            # 0xa194
movq (%rax), %rax
movq -0x8(%rax), %rdi
movq 0x5f58(%rip), %rsi      # 0x9fe0
callq 0x6980
testb %al, %al
jne 0x40b6
incl 0x60f5(%rip)            # 0xa18c
leaq 0x3309(%rip), %rdi      # 0x73a7
leaq 0x3320(%rip), %rsi      # 0x73c5
leaq 0x34ed(%rip), %rcx      # 0x7599
pushq $0x5c
popq %rdx
xorl %eax, %eax
callq 0x2040
callq 0x2240
leaq 0x351a(%rip), %rdi      # 0x75dc
pushq $0x2
popq %rsi
callq 0x299d
leaq 0x34ec(%rip), %rdi      # 0x75bd
leaq 0x32ed(%rip), %rsi      # 0x73c5
leaq 0x34eb(%rip), %rcx      # 0x75ca
pushq $0x68
jmp 0x405a
cmpl %ebx, %edx
jne 0x413f
movq %rax, %rdi
callq 0x20c0
incl 0x609c(%rip)            # 0xa194
movq (%rax), %rax
movq -0x8(%rax), %rdi
movq 0x5eda(%rip), %rsi      # 0x9fe0
callq 0x6980
testb %al, %al
jne 0x4134
incl 0x6077(%rip)            # 0xa18c
leaq 0x328b(%rip), %rdi      # 0x73a7
leaq 0x32a2(%rip), %rsi      # 0x73c5
leaq 0x346f(%rip), %rcx      # 0x7599
pushq $0x66
popq %rdx
xorl %eax, %eax
callq 0x2040
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2240
movq %rax, %rdi
callq 0x2280