// File: iamlouk[P]asbi/src/macros.cc
// Function: asbi::Context::load_macros()
void Context::load_macros() {
	static bool seeded = false;
	if (!seeded) {
		seeded = true;
		srand((unsigned)time(nullptr));
	}

	global_env->decl(this, "assert",   Value::macro( macro_assert  ));
	global_env->decl(this, "mod",      Value::macro( macro_mod     ));
	global_env->decl(this, "random",   Value::macro( macro_random  ));
	global_env->decl(this, "toInt",    Value::macro( macro_toInt   ));
	global_env->decl(this, "len",      Value::macro( macro_len     ));
	global_env->decl(this, "__debug",  Value::macro( macro_debug   ));
	global_env->decl(this, "__scope",  Value::macro( macro_scope   ));
	global_env->decl(this, "import",   Value::macro( macro_import  ));
	global_env->decl(this, "typeof",   Value::macro( macro_typeof  ));
	global_env->decl(this, "reduce",   Value::macro( macro_reduce  ));
	global_env->decl(this, "map",      Value::macro( macro_map     ));
	global_env->decl(this, "eval",     Value::macro( macro_eval    ));

	auto io = new MapContainer(this);
	io->set(Value::symbol("print", this), Value::macro(macro_io_print));
	io->set(Value::symbol("println", this), Value::macro(macro_io_println));
	io->set(Value::symbol("readline", this), Value::macro(macro_io_readline));
	global_env->decl(this, "io", Value::map(io));

	auto time = new MapContainer(this);
	time->set(Value::symbol("now", this), Value::macro(macro_time_now));
	time->set(Value::symbol("runat", this), Value::macro(macro_time_runAt));
	global_env->decl(this, "time", Value::map(time));

}

// Assembly:
subq $0x268, %rsp            # imm = 0x268
movq %rdi, 0x260(%rsp)
movq 0x260(%rsp), %rax
movq %rax, 0xb8(%rsp)
testb $0x1, 0x22940(%rip)     # 0x4c486
jne 0x29b5f
movb $0x1, 0x22937(%rip)     # 0x4c486
xorl %eax, %eax
movl %eax, %edi
callq 0x6400
movl %eax, %edi
callq 0x6430
movq 0xb8(%rsp), %rdi
addq $0x4f8, %rdi            # imm = 0x4F8
movq %rdi, 0xa0(%rsp)
callq 0x7bd0
movq %rax, 0x48(%rsp)
leaq 0x7c9(%rip), %rdi       # 0x2a350
callq 0x2cd00
movq 0x48(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl %eax, 0x250(%rsp)
movq %rdx, 0x258(%rsp)
movl 0x250(%rsp), %ecx
movq 0x258(%rsp), %r8
leaq 0xf66a(%rip), %rdx      # 0x39228
callq 0x26260
movq 0xa0(%rsp), %rdi
callq 0x7bd0
movq %rax, 0x50(%rsp)
leaq 0x9e4(%rip), %rdi       # 0x2a5c0
callq 0x2cd00
movq 0x50(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl %eax, 0x240(%rsp)
movq %rdx, 0x248(%rsp)
movl 0x240(%rsp), %ecx
movq 0x248(%rsp), %r8
leaq 0xf61c(%rip), %rdx      # 0x3922f
callq 0x26260
movq 0xa0(%rsp), %rdi
callq 0x7bd0
movq %rax, 0x58(%rsp)
leaq 0xabf(%rip), %rdi       # 0x2a6f0
callq 0x2cd00
movq 0x58(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl %eax, 0x230(%rsp)
movq %rdx, 0x238(%rsp)
movl 0x230(%rsp), %ecx
movq 0x238(%rsp), %r8
leaq 0xf5cb(%rip), %rdx      # 0x39233
callq 0x26260
movq 0xa0(%rsp), %rdi
callq 0x7bd0
movq %rax, 0x60(%rsp)
leaq 0xb1a(%rip), %rdi       # 0x2a7a0
callq 0x2cd00
movq 0x60(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl %eax, 0x220(%rsp)
movq %rdx, 0x228(%rsp)
movl 0x220(%rsp), %ecx
movq 0x228(%rsp), %r8
leaq 0xf57d(%rip), %rdx      # 0x3923a
callq 0x26260
movq 0xa0(%rsp), %rdi
callq 0x7bd0
movq %rax, 0x68(%rsp)
leaq 0xbd5(%rip), %rdi       # 0x2a8b0
callq 0x2cd00
movq 0x68(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl %eax, 0x210(%rsp)
movq %rdx, 0x218(%rsp)
movl 0x210(%rsp), %ecx
movq 0x218(%rsp), %r8
leaq 0xf52e(%rip), %rdx      # 0x39240
callq 0x26260
movq 0xa0(%rsp), %rdi
callq 0x7bd0
movq %rax, 0x70(%rsp)
leaq 0xd10(%rip), %rdi       # 0x2aa40
callq 0x2cd00
movq 0x70(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl %eax, 0x200(%rsp)
movq %rdx, 0x208(%rsp)
movl 0x200(%rsp), %ecx
movq 0x208(%rsp), %r8
leaq 0xf4dd(%rip), %rdx      # 0x39244
callq 0x26260
movq 0xa0(%rsp), %rdi
callq 0x7bd0
movq %rax, 0x78(%rsp)
leaq 0xe8b(%rip), %rdi       # 0x2ac10
callq 0x2cd00
movq 0x78(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl %eax, 0x1f0(%rsp)
movq %rdx, 0x1f8(%rsp)
movl 0x1f0(%rsp), %ecx
movq 0x1f8(%rsp), %r8
leaq 0xf490(%rip), %rdx      # 0x3924c
callq 0x26260
movq 0xa0(%rsp), %rdi
callq 0x7bd0
movq %rax, 0x80(%rsp)
leaq 0xee3(%rip), %rdi       # 0x2acc0
callq 0x2cd00
movq 0x80(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl %eax, 0x1e0(%rsp)
movq %rdx, 0x1e8(%rsp)
movl 0x1e0(%rsp), %ecx
movq 0x1e8(%rsp), %r8
leaq 0xf43d(%rip), %rdx      # 0x39254
callq 0x26260
movq 0xa0(%rsp), %rdi
callq 0x7bd0
movq %rax, 0x88(%rsp)
leaq 0x14a8(%rip), %rdi      # 0x2b2e0
callq 0x2cd00
movq 0x88(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl %eax, 0x1d0(%rsp)
movq %rdx, 0x1d8(%rsp)
movl 0x1d0(%rsp), %ecx
movq 0x1d8(%rsp), %r8
leaq 0xf3e9(%rip), %rdx      # 0x3925b
callq 0x26260
movq 0xa0(%rsp), %rdi
callq 0x7bd0
movq %rax, 0x90(%rsp)
leaq 0x161d(%rip), %rdi      # 0x2b4b0
callq 0x2cd00
movq 0x90(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl %eax, 0x1c0(%rsp)
movq %rdx, 0x1c8(%rsp)
movl 0x1c0(%rsp), %ecx
movq 0x1c8(%rsp), %r8
leaq 0xf395(%rip), %rdx      # 0x39262
callq 0x26260
movq 0xa0(%rsp), %rdi
callq 0x7bd0
movq %rax, 0x98(%rsp)
leaq 0x1b02(%rip), %rdi      # 0x2b9f0
callq 0x2cd00
movq 0x98(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl %eax, 0x1b0(%rsp)
movq %rdx, 0x1b8(%rsp)
movl 0x1b0(%rsp), %ecx
movq 0x1b8(%rsp), %r8
leaq 0xee73(%rip), %rdx      # 0x38d9b
callq 0x26260
movq 0xa0(%rsp), %rdi
callq 0x7bd0
movq %rax, 0xa8(%rsp)
leaq 0x2097(%rip), %rdi      # 0x2bfe0
callq 0x2cd00
movq 0xa8(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl %eax, 0x1a0(%rsp)
movq %rdx, 0x1a8(%rsp)
movl 0x1a0(%rsp), %ecx
movq 0x1a8(%rsp), %r8
leaq 0xe08a(%rip), %rdx      # 0x3800d
callq 0x26260
movl $0x68, %edi
callq 0x6460
movq 0xb8(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0xb0(%rsp)
callq 0x212d0
jmp 0x29faf
movq 0xb8(%rsp), %rsi
movq 0xb0(%rsp), %rax
movq %rax, 0x198(%rsp)
movq 0x198(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0xf28e(%rip), %rdi      # 0x39269
callq 0x217d0
movl %eax, 0x178(%rsp)
movq %rdx, 0x180(%rsp)
leaq 0x22ca(%rip), %rdi      # 0x2c2c0
callq 0x2cd00
movq 0x20(%rsp), %rdi
movl %eax, 0x168(%rsp)
movq %rdx, 0x170(%rsp)
movl 0x178(%rsp), %esi
movq 0x180(%rsp), %rdx
movl 0x168(%rsp), %ecx
movq 0x170(%rsp), %r8
callq 0x21550
movq 0xb8(%rsp), %rsi
movq 0x198(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0xf221(%rip), %rdi      # 0x3926f
callq 0x217d0
movl %eax, 0x158(%rsp)
movq %rdx, 0x160(%rsp)
leaq 0x2327(%rip), %rdi      # 0x2c390
callq 0x2cd00
movq 0x28(%rsp), %rdi
movl %eax, 0x148(%rsp)
movq %rdx, 0x150(%rsp)
movl 0x158(%rsp), %esi
movq 0x160(%rsp), %rdx
movl 0x148(%rsp), %ecx
movq 0x150(%rsp), %r8
callq 0x21550
movq 0xb8(%rsp), %rsi
movq 0x198(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0xf1b6(%rip), %rdi      # 0x39277
callq 0x217d0
movl %eax, 0x138(%rsp)
movq %rdx, 0x140(%rsp)
leaq 0x2394(%rip), %rdi      # 0x2c470
callq 0x2cd00
movq 0x30(%rsp), %rdi
movl %eax, 0x128(%rsp)
movq %rdx, 0x130(%rsp)
movl 0x138(%rsp), %esi
movq 0x140(%rsp), %rdx
movl 0x128(%rsp), %ecx
movq 0x130(%rsp), %r8
callq 0x21550
movq 0xb8(%rsp), %rdi
addq $0x4f8, %rdi            # imm = 0x4F8
callq 0x7bd0
movq %rax, 0x38(%rsp)
movq 0x198(%rsp), %rdi
callq 0x7be0
movq 0x38(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl %eax, 0x118(%rsp)
movq %rdx, 0x120(%rsp)
movl 0x118(%rsp), %ecx
movq 0x120(%rsp), %r8
leaq 0xf110(%rip), %rdx      # 0x39280
callq 0x26260
movl $0x68, %edi
callq 0x6460
movq 0xb8(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x40(%rsp)
callq 0x212d0
jmp 0x2a199
movq 0xb8(%rsp), %rsi
movq 0x40(%rsp), %rax
movq %rax, 0x110(%rsp)
movq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0xf0c1(%rip), %rdi      # 0x39283
callq 0x217d0
movl %eax, 0x100(%rsp)
movq %rdx, 0x108(%rsp)
leaq 0x2423(%rip), %rdi      # 0x2c600
callq 0x2cd00
movq 0x8(%rsp), %rdi
movl %eax, 0xf0(%rsp)
movq %rdx, 0xf8(%rsp)
movl 0x100(%rsp), %esi
movq 0x108(%rsp), %rdx
movl 0xf0(%rsp), %ecx
movq 0xf8(%rsp), %r8
callq 0x21550
movq 0xb8(%rsp), %rsi
movq 0x110(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0xf052(%rip), %rdi      # 0x39287
callq 0x217d0
movl %eax, 0xe0(%rsp)
movq %rdx, 0xe8(%rsp)
leaq 0x2460(%rip), %rdi      # 0x2c6b0
callq 0x2cd00
movq 0x10(%rsp), %rdi
movl %eax, 0xd0(%rsp)
movq %rdx, 0xd8(%rsp)
movl 0xe0(%rsp), %esi
movq 0xe8(%rsp), %rdx
movl 0xd0(%rsp), %ecx
movq 0xd8(%rsp), %r8
callq 0x21550
movq 0xb8(%rsp), %rdi
addq $0x4f8, %rdi            # imm = 0x4F8
callq 0x7bd0
movq %rax, 0x18(%rsp)
movq 0x110(%rsp), %rdi
callq 0x7be0
movq 0x18(%rsp), %rdi
movq 0xb8(%rsp), %rsi
movl %eax, 0xc0(%rsp)
movq %rdx, 0xc8(%rsp)
movl 0xc0(%rsp), %ecx
movq 0xc8(%rsp), %r8
leaq 0xefa9(%rip), %rdx      # 0x3928d
callq 0x26260
addq $0x268, %rsp            # imm = 0x268
retq
movq 0xb0(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x190(%rsp)
movl %eax, 0x18c(%rsp)
movl $0x68, %esi
callq 0x6470
jmp 0x2a33c
movq 0x40(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x190(%rsp)
movl %eax, 0x18c(%rsp)
movl $0x68, %esi
callq 0x6470
movq 0x190(%rsp), %rdi
callq 0x67a0
nopl (%rax)