// File: yukioc[P]tscrpt/t-tscrpt.cpp
// Function: t_rem()
void t_rem(){ /*{{{*/
	bool except;
	tscrpt_t sc;
	obj_t*o;

	//! \test 15 % 5 => 0
	o = sc.eval("15 % 5");
	mu_assert(o!=NULL);
	mu_assert(o->type=='N');
	mu_assert(o->value()==0);
	delete o;

	//! \test 16 % 6 => 4
	o = sc.eval("16 % 6");
	mu_assert(o!=NULL);
	mu_assert(o->type=='N');
	mu_assert(o->value()==4);
	delete o;

	//! \test -17 % 7 => -3
	o = sc.eval("-17 % 7");
	mu_assert(o!=NULL);
	mu_assert(o->type=='N');
	mu_assert(o->value()==-3);
	delete o;
	o=0;

	//! \test 18 % -10 => 8
	o = sc.eval("18 % -10");
	mu_assert(o!=NULL);
	mu_assert(o->type=='N');
	mu_assert(o->value()==8);
	delete o;
	o=0;

	//! \test 9 % 0 => runtime_error
	except=false;
	try {
		o=sc.eval("9 % 0");
	}catch(std::exception& e){
		except=true;
		mu_assert(typeid(e)==typeid(std::runtime_error));
	}
	mu_assert(except==true);

	//! \test "rrr" % 7 => exception
	o = sc.eval("\"rrr\" % 7");
	mu_assert(o!=NULL);
	mu_assert(o->type=='N');
	mu_assert(o->value()==0);

	//! \test 12 % "rrr" => exception
	except=false;
	try {
		o = sc.eval("12 % \"rrr\"");
	}catch(std::exception& e){
		except=true;
		mu_assert(typeid(e)==typeid(std::runtime_error));
	}
	mu_assert(except==true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
leaq -0x10(%rbp), %rdi
movq %rdi, -0x48(%rbp)
callq 0x25b0
movq -0x48(%rbp), %rdi
leaq 0x2f46(%rip), %rsi      # 0xa919
callq 0x2670
movq %rax, -0x40(%rbp)
jmp 0x79de
movq -0x40(%rbp), %rax
movq %rax, -0x18(%rbp)
movl 0x6810(%rip), %eax      # 0xe1fc
addl $0x1, %eax
movl %eax, 0x6807(%rip)      # 0xe1fc
cmpq $0x0, -0x18(%rbp)
jne 0x7a40
movl 0x67f2(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x67ea(%rip)      # 0xe1f4
leaq 0x2acb(%rip), %rdi      # 0xa4dc
leaq 0x2ae2(%rip), %rsi      # 0xa4fa
leaq 0x2cf5(%rip), %rcx      # 0xa714
xorl %eax, %eax
movl $0x120, %edx            # imm = 0x120
callq 0x2040
jmp 0x7a2d
jmp 0x7a40
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x82a4
jmp 0x7a42
jmp 0x7a44
jmp 0x7a46
movl 0x67b0(%rip), %eax      # 0xe1fc
addl $0x1, %eax
movl %eax, 0x67a7(%rip)      # 0xe1fc
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x4e, %eax
je 0x7a94
movl 0x678d(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x6785(%rip)      # 0xe1f4
leaq 0x2a66(%rip), %rdi      # 0xa4dc
leaq 0x2a7d(%rip), %rsi      # 0xa4fa
leaq 0x2c98(%rip), %rcx      # 0xa71c
xorl %eax, %eax
movl $0x121, %edx            # imm = 0x121
callq 0x2040
jmp 0x7a92
jmp 0x7a94
jmp 0x7a96
jmp 0x7a98
jmp 0x7a9a
movl 0x675c(%rip), %eax      # 0xe1fc
incl %eax
movl %eax, 0x6754(%rip)      # 0xe1fc
movq -0x18(%rbp), %rdi
callq 0x2480
movl %eax, -0x4c(%rbp)
jmp 0x7ab6
movl -0x4c(%rbp), %eax
cmpl $0x0, %eax
je 0x7af1
movl 0x6730(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x6728(%rip)      # 0xe1f4
leaq 0x2a09(%rip), %rdi      # 0xa4dc
leaq 0x2a20(%rip), %rsi      # 0xa4fa
leaq 0x2d93(%rip), %rcx      # 0xa874
xorl %eax, %eax
movl $0x122, %edx            # imm = 0x122
callq 0x2040
jmp 0x7aef
jmp 0x7af1
jmp 0x7af3
jmp 0x7af5
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0x7b1a
movq -0x58(%rbp), %rdi
callq 0x4480
movq -0x58(%rbp), %rdi
movl $0x30, %esi
callq 0x21d0
leaq 0x2dff(%rip), %rsi      # 0xa920
leaq -0x10(%rbp), %rdi
callq 0x2670
movq %rax, -0x60(%rbp)
jmp 0x7b30
movq -0x60(%rbp), %rax
movq %rax, -0x18(%rbp)
movl 0x66be(%rip), %eax      # 0xe1fc
addl $0x1, %eax
movl %eax, 0x66b5(%rip)      # 0xe1fc
cmpq $0x0, -0x18(%rbp)
jne 0x7b81
movl 0x66a0(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x6698(%rip)      # 0xe1f4
leaq 0x2979(%rip), %rdi      # 0xa4dc
leaq 0x2990(%rip), %rsi      # 0xa4fa
leaq 0x2ba3(%rip), %rcx      # 0xa714
xorl %eax, %eax
movl $0x127, %edx            # imm = 0x127
callq 0x2040
jmp 0x7b7f
jmp 0x7b81
jmp 0x7b83
jmp 0x7b85
jmp 0x7b87
movl 0x666f(%rip), %eax      # 0xe1fc
addl $0x1, %eax
movl %eax, 0x6666(%rip)      # 0xe1fc
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x4e, %eax
je 0x7bd5
movl 0x664c(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x6644(%rip)      # 0xe1f4
leaq 0x2925(%rip), %rdi      # 0xa4dc
leaq 0x293c(%rip), %rsi      # 0xa4fa
leaq 0x2b57(%rip), %rcx      # 0xa71c
xorl %eax, %eax
movl $0x128, %edx            # imm = 0x128
callq 0x2040
jmp 0x7bd3
jmp 0x7bd5
jmp 0x7bd7
jmp 0x7bd9
jmp 0x7bdb
movl 0x661b(%rip), %eax      # 0xe1fc
incl %eax
movl %eax, 0x6613(%rip)      # 0xe1fc
movq -0x18(%rbp), %rdi
callq 0x2480
movl %eax, -0x64(%rbp)
jmp 0x7bf7
movl -0x64(%rbp), %eax
cmpl $0x4, %eax
je 0x7c32
movl 0x65ef(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x65e7(%rip)      # 0xe1f4
leaq 0x28c8(%rip), %rdi      # 0xa4dc
leaq 0x28df(%rip), %rsi      # 0xa4fa
leaq 0x2d05(%rip), %rcx      # 0xa927
xorl %eax, %eax
movl $0x129, %edx            # imm = 0x129
callq 0x2040
jmp 0x7c30
jmp 0x7c32
jmp 0x7c34
jmp 0x7c36
movq -0x18(%rbp), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, %rax
je 0x7c5b
movq -0x70(%rbp), %rdi
callq 0x4480
movq -0x70(%rbp), %rdi
movl $0x30, %esi
callq 0x21d0
leaq 0x2cd3(%rip), %rsi      # 0xa935
leaq -0x10(%rbp), %rdi
callq 0x2670
movq %rax, -0x78(%rbp)
jmp 0x7c71
movq -0x78(%rbp), %rax
movq %rax, -0x18(%rbp)
movl 0x657d(%rip), %eax      # 0xe1fc
addl $0x1, %eax
movl %eax, 0x6574(%rip)      # 0xe1fc
cmpq $0x0, -0x18(%rbp)
jne 0x7cc2
movl 0x655f(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x6557(%rip)      # 0xe1f4
leaq 0x2838(%rip), %rdi      # 0xa4dc
leaq 0x284f(%rip), %rsi      # 0xa4fa
leaq 0x2a62(%rip), %rcx      # 0xa714
xorl %eax, %eax
movl $0x12e, %edx            # imm = 0x12E
callq 0x2040
jmp 0x7cc0
jmp 0x7cc2
jmp 0x7cc4
jmp 0x7cc6
jmp 0x7cc8
movl 0x652e(%rip), %eax      # 0xe1fc
addl $0x1, %eax
movl %eax, 0x6525(%rip)      # 0xe1fc
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x4e, %eax
je 0x7d16
movl 0x650b(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x6503(%rip)      # 0xe1f4
leaq 0x27e4(%rip), %rdi      # 0xa4dc
leaq 0x27fb(%rip), %rsi      # 0xa4fa
leaq 0x2a16(%rip), %rcx      # 0xa71c
xorl %eax, %eax
movl $0x12f, %edx            # imm = 0x12F
callq 0x2040
jmp 0x7d14
jmp 0x7d16
jmp 0x7d18
jmp 0x7d1a
jmp 0x7d1c
movl 0x64da(%rip), %eax      # 0xe1fc
incl %eax
movl %eax, 0x64d2(%rip)      # 0xe1fc
movq -0x18(%rbp), %rdi
callq 0x2480
movl %eax, -0x7c(%rbp)
jmp 0x7d38
movl -0x7c(%rbp), %eax
cmpl $-0x3, %eax
je 0x7d73
movl 0x64ae(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x64a6(%rip)      # 0xe1f4
leaq 0x2787(%rip), %rdi      # 0xa4dc
leaq 0x279e(%rip), %rsi      # 0xa4fa
leaq 0x2bda(%rip), %rcx      # 0xa93d
xorl %eax, %eax
movl $0x130, %edx            # imm = 0x130
callq 0x2040
jmp 0x7d71
jmp 0x7d73
jmp 0x7d75
jmp 0x7d77
movq -0x18(%rbp), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, %rax
je 0x7da5
movq -0x88(%rbp), %rdi
callq 0x4480
movq -0x88(%rbp), %rdi
movl $0x30, %esi
callq 0x21d0
movq $0x0, -0x18(%rbp)
leaq 0x2b98(%rip), %rsi      # 0xa94c
leaq -0x10(%rbp), %rdi
callq 0x2670
movq %rax, -0x90(%rbp)
jmp 0x7dc6
movq -0x90(%rbp), %rax
movq %rax, -0x18(%rbp)
movl 0x6425(%rip), %eax      # 0xe1fc
addl $0x1, %eax
movl %eax, 0x641c(%rip)      # 0xe1fc
cmpq $0x0, -0x18(%rbp)
jne 0x7e1a
movl 0x6407(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x63ff(%rip)      # 0xe1f4
leaq 0x26e0(%rip), %rdi      # 0xa4dc
leaq 0x26f7(%rip), %rsi      # 0xa4fa
leaq 0x290a(%rip), %rcx      # 0xa714
xorl %eax, %eax
movl $0x136, %edx            # imm = 0x136
callq 0x2040
jmp 0x7e18
jmp 0x7e1a
jmp 0x7e1c
jmp 0x7e1e
jmp 0x7e20
movl 0x63d6(%rip), %eax      # 0xe1fc
addl $0x1, %eax
movl %eax, 0x63cd(%rip)      # 0xe1fc
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x4e, %eax
je 0x7e6e
movl 0x63b3(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x63ab(%rip)      # 0xe1f4
leaq 0x268c(%rip), %rdi      # 0xa4dc
leaq 0x26a3(%rip), %rsi      # 0xa4fa
leaq 0x28be(%rip), %rcx      # 0xa71c
xorl %eax, %eax
movl $0x137, %edx            # imm = 0x137
callq 0x2040
jmp 0x7e6c
jmp 0x7e6e
jmp 0x7e70
jmp 0x7e72
jmp 0x7e74
movl 0x6382(%rip), %eax      # 0xe1fc
incl %eax
movl %eax, 0x637a(%rip)      # 0xe1fc
movq -0x18(%rbp), %rdi
callq 0x2480
movl %eax, -0x94(%rbp)
jmp 0x7e93
movl -0x94(%rbp), %eax
cmpl $0x8, %eax
je 0x7ed1
movl 0x6350(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x6348(%rip)      # 0xe1f4
leaq 0x2629(%rip), %rdi      # 0xa4dc
leaq 0x2640(%rip), %rsi      # 0xa4fa
leaq 0x2a94(%rip), %rcx      # 0xa955
xorl %eax, %eax
movl $0x138, %edx            # imm = 0x138
callq 0x2040
jmp 0x7ecf
jmp 0x7ed1
jmp 0x7ed3
jmp 0x7ed5
movq -0x18(%rbp), %rax
movq %rax, -0xa0(%rbp)
cmpq $0x0, %rax
je 0x7f03
movq -0xa0(%rbp), %rdi
callq 0x4480
movq -0xa0(%rbp), %rdi
movl $0x30, %esi
callq 0x21d0
movq $0x0, -0x18(%rbp)
movb $0x0, -0x1(%rbp)
leaq 0x2a4d(%rip), %rsi      # 0xa963
leaq -0x10(%rbp), %rdi
callq 0x2670
movq %rax, -0xa8(%rbp)
jmp 0x7f28
movq -0xa8(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x7fe2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x82a4
movq -0x20(%rbp), %rdi
callq 0x20d0
movq %rax, -0x30(%rbp)
movb $0x1, -0x1(%rbp)
movl 0x6291(%rip), %eax      # 0xe1fc
addl $0x1, %eax
movl %eax, 0x6288(%rip)      # 0xe1fc
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rdi
movq 0x6072(%rip), %rsi      # 0xdff8
callq 0x9950
testb $0x1, %al
jne 0x7fd5
movl 0x625f(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x6257(%rip)      # 0xe1f4
leaq 0x2538(%rip), %rdi      # 0xa4dc
leaq 0x254f(%rip), %rsi      # 0xa4fa
leaq 0x292c(%rip), %rcx      # 0xa8de
xorl %eax, %eax
movl $0x142, %edx            # imm = 0x142
callq 0x2040
jmp 0x7fc0
jmp 0x7fd5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x22f0
jmp 0x8033
jmp 0x7fd7
jmp 0x7fd9
callq 0x22f0
jmp 0x7fe0
jmp 0x7fe2
jmp 0x7fe4
movl 0x6212(%rip), %eax      # 0xe1fc
addl $0x1, %eax
movl %eax, 0x6209(%rip)      # 0xe1fc
movb -0x1(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
je 0x8038
movl 0x61ee(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x61e6(%rip)      # 0xe1f4
leaq 0x24c7(%rip), %rdi      # 0xa4dc
leaq 0x24de(%rip), %rsi      # 0xa4fa
leaq 0x26cf(%rip), %rcx      # 0xa6f2
xorl %eax, %eax
movl $0x144, %edx            # imm = 0x144
callq 0x2040
jmp 0x8031
jmp 0x8038
jmp 0x82a4
jmp 0x803a
jmp 0x803c
leaq 0x2926(%rip), %rsi      # 0xa969
leaq -0x10(%rbp), %rdi
callq 0x2670
movq %rax, -0xb0(%rbp)
jmp 0x8055
movq -0xb0(%rbp), %rax
movq %rax, -0x18(%rbp)
movl 0x6196(%rip), %eax      # 0xe1fc
addl $0x1, %eax
movl %eax, 0x618d(%rip)      # 0xe1fc
cmpq $0x0, -0x18(%rbp)
jne 0x80a9
movl 0x6178(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x6170(%rip)      # 0xe1f4
leaq 0x2451(%rip), %rdi      # 0xa4dc
leaq 0x2468(%rip), %rsi      # 0xa4fa
leaq 0x267b(%rip), %rcx      # 0xa714
xorl %eax, %eax
movl $0x148, %edx            # imm = 0x148
callq 0x2040
jmp 0x80a7
jmp 0x80a9
jmp 0x80ab
jmp 0x80ad
jmp 0x80af
movl 0x6147(%rip), %eax      # 0xe1fc
addl $0x1, %eax
movl %eax, 0x613e(%rip)      # 0xe1fc
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x4e, %eax
je 0x80fd
movl 0x6124(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x611c(%rip)      # 0xe1f4
leaq 0x23fd(%rip), %rdi      # 0xa4dc
leaq 0x2414(%rip), %rsi      # 0xa4fa
leaq 0x262f(%rip), %rcx      # 0xa71c
xorl %eax, %eax
movl $0x149, %edx            # imm = 0x149
callq 0x2040
jmp 0x80fb
jmp 0x80fd
jmp 0x80ff
jmp 0x8101
jmp 0x8103
movl 0x60f3(%rip), %eax      # 0xe1fc
incl %eax
movl %eax, 0x60eb(%rip)      # 0xe1fc
movq -0x18(%rbp), %rdi
callq 0x2480
movl %eax, -0xb4(%rbp)
jmp 0x8122
movl -0xb4(%rbp), %eax
cmpl $0x0, %eax
je 0x8160
movl 0x60c1(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x60b9(%rip)      # 0xe1f4
leaq 0x239a(%rip), %rdi      # 0xa4dc
leaq 0x23b1(%rip), %rsi      # 0xa4fa
leaq 0x2724(%rip), %rcx      # 0xa874
xorl %eax, %eax
movl $0x14a, %edx            # imm = 0x14A
callq 0x2040
jmp 0x815e
jmp 0x8160
jmp 0x8162
jmp 0x8164
movb $0x0, -0x1(%rbp)
leaq 0x2804(%rip), %rsi      # 0xa973
leaq -0x10(%rbp), %rdi
callq 0x2670
movq %rax, -0xc0(%rbp)
jmp 0x8181
movq -0xc0(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x823b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x82a4
movq -0x20(%rbp), %rdi
callq 0x20d0
movq %rax, -0x38(%rbp)
movb $0x1, -0x1(%rbp)
movl 0x6038(%rip), %eax      # 0xe1fc
addl $0x1, %eax
movl %eax, 0x602f(%rip)      # 0xe1fc
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rax), %rdi
movq 0x5e19(%rip), %rsi      # 0xdff8
callq 0x9950
testb $0x1, %al
jne 0x822e
movl 0x6006(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x5ffe(%rip)      # 0xe1f4
leaq 0x22df(%rip), %rdi      # 0xa4dc
leaq 0x22f6(%rip), %rsi      # 0xa4fa
leaq 0x26d3(%rip), %rcx      # 0xa8de
xorl %eax, %eax
movl $0x152, %edx            # imm = 0x152
callq 0x2040
jmp 0x8219
jmp 0x822e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x22f0
jmp 0x828c
jmp 0x8230
jmp 0x8232
callq 0x22f0
jmp 0x8239
jmp 0x823b
jmp 0x823d
movl 0x5fb9(%rip), %eax      # 0xe1fc
addl $0x1, %eax
movl %eax, 0x5fb0(%rip)      # 0xe1fc
movb -0x1(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
je 0x828e
movl 0x5f95(%rip), %eax      # 0xe1f4
incl %eax
movl %eax, 0x5f8d(%rip)      # 0xe1f4
leaq 0x226e(%rip), %rdi      # 0xa4dc
leaq 0x2285(%rip), %rsi      # 0xa4fa
leaq 0x2476(%rip), %rcx      # 0xa6f2
xorl %eax, %eax
movl $0x154, %edx            # imm = 0x154
callq 0x2040
jmp 0x828a
jmp 0x828e
jmp 0x82a4
jmp 0x8290
jmp 0x8292
leaq -0x10(%rbp), %rdi
callq 0x25d0
addq $0xc0, %rsp
popq %rbp
retq
leaq -0x10(%rbp), %rdi
callq 0x25d0
movq -0x20(%rbp), %rdi
callq 0x2330
movq %rax, %rdi
callq 0x4240
nop