// File: /workspace/github_c_makefile_star2_O1/FirestonnneTFM[P]tfm_key_parser/src/class_info.cpp
// Function: class_info::do_static_init()
void class_info::do_static_init() {
	if (static_init_already_done)
		return;
	static_init_already_done = true;
	abc_executer exec(static_ctor->code.begin());
	bool ret = true;
	int_stack stack(static_ctor->max_stack);
	while (ret) {
		int32_t param;
		uint8_t op = exec.step(&param);
		switch (op) {
		case OP_returnvoid:
			ret = false;
			break;
		case OP_pushint:
		case OP_pushuint:
		case OP_pushbyte:
		case OP_pushshort:
			stack.push(param);
			break;
		case OP_pushfalse:
		case OP_pushstring:
		case OP_getproperty:
			stack.push(0);
			break;
		case OP_pushtrue:
			stack.push(1);
			break;
		case OP_not:
			if (stack.pop())
				stack.push(0);
			else
				stack.push(1);
			break;
		case OP_equals:
			if (stack.pop() == stack.pop())
				stack.push(1);
			else
				stack.push(0);
			break;
		case OP_dup:
			stack.push(stack.top());
			break;
		case OP_pop:
			stack.pop();
			break;
		case OP_add:
			stack.push(stack.pop() + stack.pop());
			break;
		case OP_multiply:
			stack.push(stack.pop() * stack.pop());
			break;
		case OP_divide: {
			int p = stack.pop();
			int q = stack.pop();
			if (p == 0 || q == 0)
				stack.push(0);
			else
				stack.push(p / q);
			break;
		}
		case OP_setproperty:
		case OP_initproperty: {
			traits_info *t = get_trait_by_name(abc_file::get_multiname(param));
			t->has_loaded_value = true;
			t->loaded_value = stack.pop();
			break;
		}
		case OP_jump:
			exec.rel_jmp(param);
			break;
		case OP_iffalse:
			if (stack.pop() == 0)
				exec.rel_jmp(param);
			break;
		case OP_getlocal_0:
		case OP_pushscope:
		case OP_findproperty:
		case OP_findpropstrict:
		case OP_getlex:
		case OP_callproperty:
			// do nothing
			break;
		default:
			std::cout << "op = 0x" << std::hex << +op << std::endl;
			fatal("static init not handling op");
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
cmpb $0x0, (%rdi)
je 0x3806
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %rbx
movb $0x1, (%rdi)
movq 0x78(%rdi), %rax
movq 0x40(%rax), %rsi
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x3024
movq %rbx, 0x10(%rsp)
movq 0x78(%rbx), %rax
movl 0x24(%rax), %esi
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x419c
movb $0x1, %bl
leaq 0xc(%rsp), %r12
leaq 0x2880(%rip), %rbp      # 0x60c8
movq %r14, %rdi
movq %r12, %rsi
callq 0x2802
movzbl %al, %r13d
cmpl $0x46, %r13d
jg 0x388a
cmpl $0x23, %r13d
jle 0x3981
leal -0x24(%r13), %eax
cmpl $0xc, %eax
ja 0x39b2
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
jmpq *%rax
movl 0xc(%rsp), %esi
movq %r15, %rdi
jmp 0x3a43
cmpl $0x95, %r13d
jg 0x38bf
cmpl $0x60, %r13d
jg 0x390d
leal -0x5d(%r13), %eax
cmpl $0x2, %eax
jb 0x3a48
cmpl $0x47, %r13d
je 0x3a89
cmpl $0x60, %r13d
je 0x3a48
jmp 0x3a8d
cmpl $0xa2, %r13d
jg 0x3955
cmpl $0x96, %r13d
je 0x39d8
cmpl $0xa0, %r13d
je 0x3a23
cmpl $0xa2, %r13d
jne 0x3a8d
movq %r15, %rdi
callq 0x41d8
movl %eax, %ebp
movq %r15, %rdi
callq 0x41d8
imull %eax, %ebp
jmp 0x3a37
cmpl $0x61, %r13d
je 0x3927
cmpl $0x66, %r13d
je 0x39e4
cmpl $0x68, %r13d
jne 0x3a8d
movl 0xc(%rsp), %edi
callq 0x2ea6
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x3b00
movq %rax, %r13
movb $0x1, 0x10(%rax)
movq %r15, %rdi
callq 0x41d8
movl %eax, 0x14(%r13)
jmp 0x3a48
cmpl $0xa3, %r13d
je 0x39f5
cmpl $0xab, %r13d
je 0x3a56
cmpl $0xd0, %r13d
je 0x3a48
jmp 0x3a8d
cmpl $0x10, %r13d
je 0x39a1
cmpl $0x12, %r13d
jne 0x3a8d
movq %r15, %rdi
callq 0x41d8
testl %eax, %eax
jne 0x3a48
movl 0xc(%rsp), %esi
movq %r14, %rdi
callq 0x2ab0
jmp 0x3a48
cmpl $0x46, %r13d
je 0x3a48
jmp 0x3a8d
movq 0x18(%rsp), %rax
movl -0x4(%rax), %esi
jmp 0x3882
movq %r15, %rdi
callq 0x41d8
jmp 0x3a48
movq %r15, %rdi
callq 0x41d8
testl %eax, %eax
je 0x39eb
movq %r15, %rdi
xorl %esi, %esi
jmp 0x3a43
movq %r15, %rdi
movl $0x1, %esi
jmp 0x3a43
movq %r15, %rdi
callq 0x41d8
movl %eax, %ebp
movq %r15, %rdi
callq 0x41d8
movl %eax, %ecx
testl %ebp, %ebp
setne %al
testl %ecx, %ecx
setne %dl
testb %dl, %al
je 0x3a76
movl %ebp, %eax
cltd
idivl %ecx
movq %r15, %rdi
movl %eax, %esi
jmp 0x3a7b
movq %r15, %rdi
callq 0x41d8
movl %eax, %ebp
movq %r15, %rdi
callq 0x41d8
addl %eax, %ebp
movq %r15, %rdi
movl %ebp, %esi
leaq 0x2685(%rip), %rbp      # 0x60c8
callq 0x41ca
testb $0x1, %bl
jne 0x3848
jmp 0x37f7
movq %r15, %rdi
callq 0x41d8
movl %eax, %ebp
movq %r15, %rdi
callq 0x41d8
cmpl %eax, %ebp
jne 0x3a76
movq %r15, %rdi
movl $0x1, %esi
jmp 0x3a7b
movq %r15, %rdi
xorl %esi, %esi
callq 0x41ca
leaq 0x2641(%rip), %rbp      # 0x60c8
jmp 0x3a48
xorl %ebx, %ebx
jmp 0x3a48
movq 0x553c(%rip), %rdi      # 0x8fd0
leaq 0x2670(%rip), %rsi      # 0x610b
callq 0x21c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movl %r13d, %esi
callq 0x22e0
movq %rax, %rdi
callq 0x20f0
movl $0x18, %edi
callq 0x2100
movl $0x8e, (%rax)
leaq 0x2650(%rip), %rcx      # 0x612f
movq %rcx, 0x8(%rax)
leaq 0x2629(%rip), %rcx      # 0x6113
movq %rcx, 0x10(%rax)
leaq 0x529b(%rip), %rsi      # 0x8d90
movq %rax, %rdi
xorl %edx, %edx
callq 0x22d0
nop