// File: /workspace/github_c_makefile_star2_O2/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 $0x28, %rsp
cmpb $0x0, (%rdi)
jne 0x38e8
movq %rdi, %rbx
movb $0x1, (%rdi)
movq 0x78(%rdi), %rax
movq 0x40(%rax), %rsi
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x2ff8
movq 0x78(%rbx), %rax
movl 0x24(%rax), %esi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x4144
leaq 0x4(%rsp), %r12
leaq 0x29d2(%rip), %rbp      # 0x60c8
movq %r14, %rdi
movq %r12, %rsi
callq 0x277e
movzbl %al, %r13d
leal -0x24(%r13), %eax
cmpl $0xc, %eax
jbe 0x37a4
leal -0x5d(%r13), %eax
cmpl $0x2, %eax
jb 0x36f6
cmpl $0x10, %r13d
je 0x3812
cmpl $0x12, %r13d
je 0x3802
cmpl $0x46, %r13d
je 0x36f6
cmpl $0x60, %r13d
je 0x36f6
cmpl $0x61, %r13d
je 0x37bf
cmpl $0x66, %r13d
je 0x38d3
cmpl $0x68, %r13d
je 0x37bf
cmpl $0x96, %r13d
je 0x38c7
cmpl $0xa0, %r13d
je 0x3888
cmpl $0xa2, %r13d
je 0x38a0
cmpl $0xa3, %r13d
je 0x3823
cmpl $0xab, %r13d
je 0x3860
cmpl $0xd0, %r13d
je 0x36f6
jmp 0x38e2
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
jmpq *%rax
movl 0x4(%rsp), %esi
movq %r15, %rdi
callq 0x416e
jmp 0x36f6
movl 0x4(%rsp), %edi
callq 0x2d54
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3968
movq %rax, %r13
movb $0x1, 0x10(%rax)
movq %r15, %rdi
callq 0x417c
movl %eax, 0x14(%r13)
jmp 0x36f6
movq 0x8(%rsp), %rax
movl -0x4(%rax), %esi
jmp 0x37b2
movq %r15, %rdi
callq 0x417c
jmp 0x36f6
movq %r15, %rdi
callq 0x417c
testl %eax, %eax
jne 0x36f6
movl 0x4(%rsp), %esi
movq %r14, %rdi
callq 0x2a02
jmp 0x36f6
movq %r15, %rdi
callq 0x417c
movl %eax, %r13d
movq %r15, %rdi
callq 0x417c
movl %eax, %ecx
testl %r13d, %r13d
setne %al
testl %ecx, %ecx
setne %dl
testb %dl, %al
je 0x38d3
movl %r13d, %eax
cltd
idivl %ecx
movq %r15, %rdi
movl %eax, %esi
callq 0x416e
jmp 0x36f6
movq %r15, %rdi
callq 0x417c
movl %eax, %r13d
movq %r15, %rdi
callq 0x417c
cmpl %eax, %r13d
jne 0x38d3
movq %r15, %rdi
pushq $0x1
popq %rsi
callq 0x416e
jmp 0x36f6
movq %r15, %rdi
callq 0x417c
movl %eax, %r13d
movq %r15, %rdi
callq 0x417c
addl %eax, %r13d
jmp 0x38b7
movq %r15, %rdi
callq 0x417c
movl %eax, %r13d
movq %r15, %rdi
callq 0x417c
imull %eax, %r13d
movq %r15, %rdi
movl %r13d, %esi
callq 0x416e
jmp 0x36f6
movq %r15, %rdi
callq 0x417c
testl %eax, %eax
je 0x3878
movq %r15, %rdi
xorl %esi, %esi
callq 0x416e
jmp 0x36f6
cmpl $0x47, %r13d
jne 0x38f7
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x56d2(%rip), %rdi      # 0x8fd0
leaq 0x2806(%rip), %rsi      # 0x610b
callq 0x2180
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 0x2290
movq %rax, %rdi
callq 0x20e0
pushq $0x18
popq %rdi
callq 0x20f0
movl $0x8e, (%rax)
leaq 0x27e8(%rip), %rcx      # 0x612f
movq %rcx, 0x8(%rax)
leaq 0x27c1(%rip), %rcx      # 0x6113
movq %rcx, 0x10(%rax)
leaq 0x5433(%rip), %rsi      # 0x8d90
movq %rax, %rdi
xorl %edx, %edx
callq 0x2280
nop