// File: DCTewi[P]Truthtable-Calculator/functions.cpp
// Function: prepareWork(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void prepareWork(std::string &s)
{
    size_t plc = 0;
    while ((plc = s.find("&&")) != std::string::npos)
    {
        s = s.replace(plc, 2, "&");
    }
    while ((plc = s.find("||")) != std::string::npos)
    {
        s = s.replace(plc, 2, "|");
    }
    while ((plc = s.find("->")) != std::string::npos)
    {
        s = s.replace(plc, 2, "-");
    }
    while ((plc = s.find("==")) != std::string::npos)
    {
        s = s.replace(plc, 2, "=");
    }

    for (int i = 1; i < static_cast<int>(s.size()); i++)
    {
        while (s[i] == '!' && s[i - 1] == '!')
        {
            s = s.substr(0, i - 1) + s.substr(std::min(i + 1, static_cast<int>(s.size())));
        }
    }
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq $0x0, 0x98(%rsp)
movq 0xa0(%rsp), %rdi
leaq 0xaa2a(%rip), %rsi      # 0xd004
xorl %eax, %eax
movl %eax, %edx
callq 0x2340
movq %rax, 0x98(%rsp)
cmpq $-0x1, %rax
je 0x2624
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rsi
movl $0x2, %edx
leaq 0xa9f8(%rip), %rcx      # 0xd005
callq 0x2120
movq %rax, %rsi
movq 0xa0(%rsp), %rdi
callq 0x2040
jmp 0x25cb
jmp 0x2626
movq 0xa0(%rsp), %rdi
leaq 0xa9d2(%rip), %rsi      # 0xd007
xorl %eax, %eax
movl %eax, %edx
callq 0x2340
movq %rax, 0x98(%rsp)
cmpq $-0x1, %rax
je 0x267f
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rsi
movl $0x2, %edx
leaq 0xa9a0(%rip), %rcx      # 0xd008
callq 0x2120
movq %rax, %rsi
movq 0xa0(%rsp), %rdi
callq 0x2040
jmp 0x2626
jmp 0x2681
movq 0xa0(%rsp), %rdi
leaq 0xa97a(%rip), %rsi      # 0xd00a
xorl %eax, %eax
movl %eax, %edx
callq 0x2340
movq %rax, 0x98(%rsp)
cmpq $-0x1, %rax
je 0x26da
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rsi
movl $0x2, %edx
leaq 0xa94a(%rip), %rcx      # 0xd00d
callq 0x2120
movq %rax, %rsi
movq 0xa0(%rsp), %rdi
callq 0x2040
jmp 0x2681
jmp 0x26dc
movq 0xa0(%rsp), %rdi
leaq 0xa924(%rip), %rsi      # 0xd00f
xorl %eax, %eax
movl %eax, %edx
callq 0x2340
movq %rax, 0x98(%rsp)
cmpq $-0x1, %rax
je 0x2735
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %rsi
movl $0x2, %edx
leaq 0xa8f2(%rip), %rcx      # 0xd010
callq 0x2120
movq %rax, %rsi
movq 0xa0(%rsp), %rdi
callq 0x2040
jmp 0x26dc
movl $0x1, 0x94(%rsp)
movl 0x94(%rsp), %eax
movl %eax, 0x18(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x2160
movq %rax, %rcx
movl 0x18(%rsp), %eax
cmpl %ecx, %eax
jge 0x28d8
jmp 0x2769
movq 0xa0(%rsp), %rdi
movslq 0x94(%rsp), %rsi
callq 0x2350
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x21, %ecx
movb %al, 0x17(%rsp)
jne 0x27b3
movq 0xa0(%rsp), %rdi
movl 0x94(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x2350
movsbl (%rax), %eax
cmpl $0x21, %eax
sete %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x27c0
jmp 0x28c0
movq 0xa0(%rsp), %rsi
movl 0x94(%rsp), %eax
decl %eax
movslq %eax, %rcx
xorl %eax, %eax
movl %eax, %edx
leaq 0x50(%rsp), %rdi
callq 0x21e0
movq 0xa0(%rsp), %rax
movq %rax, (%rsp)
movl 0x94(%rsp), %eax
incl %eax
movl %eax, 0x2c(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x2160
movl %eax, 0x28(%rsp)
leaq 0x2c(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x4a30
movq %rax, 0x8(%rsp)
jmp 0x2822
movq (%rsp), %rsi
movq 0x8(%rsp), %rax
movslq (%rax), %rdx
leaq 0x30(%rsp), %rdi
movq $-0x1, %rcx
callq 0x21e0
jmp 0x2841
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x4940
jmp 0x2857
movq 0xa0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x2250
leaq 0x70(%rsp), %rdi
callq 0x2130
leaq 0x30(%rsp), %rdi
callq 0x2130
leaq 0x50(%rsp), %rdi
callq 0x2130
jmp 0x2769
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
jmp 0x28b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x2130
leaq 0x50(%rsp), %rdi
callq 0x2130
jmp 0x28e0
jmp 0x28c2
movl 0x94(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x94(%rsp)
jmp 0x2740
addq $0xa8, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x2310
nopw (%rax,%rax)