// File: /workspace/github_cpp_makefile_star2_O1/zerolfx[P]P-Machine/mod.cpp
// Function: Mod::execute(StackMachine*)
void Mod::execute(StackMachine *stack) {
    if(typeid(StackInteger) != typeid(*(stack->fStore[stack->fSP])))
        throw ExecutionError("instruction mod: SP does not point to element of type integer.");
    if(typeid(StackInteger) != typeid(*(stack->fStore[stack->fSP - 1])))
        throw ExecutionError("instruction mod: SP - 1 does not point to element of type integer.");


    // actual addition
    stack->fStore[stack->fSP - 1]->mod(stack->fStore[stack->fSP]);

    // SP := SP - 1
    delete stack->fStore[stack->fSP];
    stack->fStore[stack->fSP] = 0;
    stack->fStore.pop_back();
    --stack->fSP;

    stack->fTime.count("mod");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movslq 0xb4(%rsi), %r12
movq 0x18(%rsi), %r13
movq (%r13,%r12,8), %r14
testq %r14, %r14
je 0x77d5
movq %rsi, %rbx
movq (%r14), %rax
movq -0x8(%rax), %rax
leaq 0x2c429(%rip), %rcx     # 0x33af8
movq 0x8(%rcx), %r15
movq 0x8(%rax), %rsi
cmpq %rsi, %r15
je 0x76f6
cmpb $0x2a, (%r15)
je 0x77da
movq %r15, %rdi
callq 0x6310
testl %eax, %eax
jne 0x77da
movq -0x8(%r13,%r12,8), %r12
testq %r12, %r12
je 0x77d5
movq (%r12), %r13
movq -0x8(%r13), %rax
movq 0x8(%rax), %rsi
cmpq %rsi, %r15
je 0x772f
cmpb $0x2a, (%r15)
je 0x7831
movq %r15, %rdi
callq 0x6310
testl %eax, %eax
jne 0x7831
movq %r12, %rdi
movq %r14, %rsi
callq *0x20(%r13)
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rcx,%rax,8), %r14
testq %r14, %r14
je 0x7762
movq %r14, %rdi
callq 0x1a5cc
movl $0x8, %esi
movq %r14, %rdi
callq 0x6210
movslq 0xb4(%rbx), %rax
movq 0x18(%rbx), %rcx
movq $0x0, (%rcx,%rax,8)
addq $-0x8, 0x20(%rbx)
decl %eax
movl %eax, 0xb4(%rbx)
leaq -0x38(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1b94a(%rip), %rsi     # 0x230db
leaq 0x1b946(%rip), %rdx     # 0x230de
leaq -0x48(%rbp), %rdi
callq 0x746c
addq $0x78, %rbx
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x1ce78
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x77c6
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x6210
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x6250
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1b862(%rip), %rsi     # 0x23059
leaq 0x1b899(%rip), %rdx     # 0x23097
leaq -0x48(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x2b268(%rip), %rsi     # 0x32a88
leaq 0x13c0f(%rip), %rdx     # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0x7886
movl $0x20, %edi
callq 0x6100
movq %rax, %r14
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1b84a(%rip), %rsi     # 0x23098
leaq 0x1b885(%rip), %rdx     # 0x230da
leaq -0x48(%rbp), %rdi
callq 0x746c
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x1b418
xorl %r15d, %r15d
leaq 0x2b211(%rip), %rsi     # 0x32a88
leaq 0x13bb8(%rip), %rdx     # 0x1b436
movq %r14, %rdi
callq 0x63e0
jmp 0x788a
jmp 0x78a4
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x78aa
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x78aa
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x78d6
movq %r14, %rdi
callq 0x6170
jmp 0x78d6
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x78d6
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x6210
jmp 0x78d6
movq %rax, %rbx
movq %rbx, %rdi
callq 0x6410