// File: /workspace/github_cpp_makefile_star2_O1/SMT-COMP[P]scrambler/scrambler.cpp
// Function: print_scrambled(std::ostream&, annotation_mode)
void print_scrambled(std::ostream &out, annotation_mode keep_annotations)
{
    if (!no_scramble) {
        // identify consecutive declarations and shuffle them
        for (size_t i = 0; i < commands.size(); ) {
            if (commands[i]->symbol == "declare-fun") {
                size_t j = i+1;
                while (j < commands.size() &&
                       commands[j]->symbol == "declare-fun") {
                    ++j;
                }
                if (j - i > 1) {
                    shuffle_list(&commands, i, j);
                }
                i = j;
            } else {
                ++i;
            }
        }

        // identify consecutive assertions and shuffle them
        for (size_t i = 0; i < commands.size(); ) {
            if (commands[i]->symbol == "assert") {
                size_t j = i+1;
                while (j < commands.size() &&
                       commands[j]->symbol == "assert"){
                    ++j;
                }
                if (j - i > 1) {
                    shuffle_list(&commands, i, j);
                }
                i = j;
            } else {
                ++i;
            }
        }

        // Generate a random permutation of name ids. Note that index
        // 0 is unused in the permuted_name_ids vector (but present to
        // simplify indexing), and index next_name_id is out of range.
        size_t old_size = permuted_name_ids.size();
        assert(old_size <= next_name_id);
        // Since the print_scrambled function may be called multiple
        // times (for different parts of the benchmark), we only need
        // to permute those name ids that have been declared since the
        // last call to print_scrambled.
        if (old_size < next_name_id) {
            permuted_name_ids.reserve(next_name_id);
            for (size_t i = old_size; i < next_name_id; ++i) {
                permuted_name_ids.push_back(i);
                assert(permuted_name_ids[i] == i);
            }
            assert(permuted_name_ids.size() == next_name_id);
            // index 0 must not be shuffled
            if (old_size == 0) {
                old_size = 1;
            }
            // Knuth shuffle
            for (size_t i = old_size; i < next_name_id - 1; ++i) {
                size_t j = i + next_rand_int(next_name_id - i);
                std::swap(permuted_name_ids[i], permuted_name_ids[j]);
            }
        }
    }

    // print all commands
    for (size_t i = 0; i < commands.size(); ++i) {
        print_command(out, commands[i], keep_annotations);
        del_node(commands[i]);
    }
    commands.clear();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r14
cmpb $0x0, 0xe40e(%rip)      # 0x132a8
jne 0x514e
movl %ebx, 0x14(%rsp)
movq 0xe44d(%rip), %rax      # 0x132f8
cmpq %rax, 0xe44e(%rip)      # 0x13300
je 0x4f58
xorl %r13d, %r13d
leaq 0x7442(%rip), %r15      # 0xc304
movq (%rax,%r13,8), %rdi
movq %r15, %rsi
callq 0x30a0
testl %eax, %eax
je 0x4eda
incq %r13
movq %r13, %rbp
jmp 0x4f37
leaq (,%r13,8), %r12
movl $0x1, %ecx
movq %rcx, %rbx
leaq (%rcx,%r13), %rbp
movq 0xe40b(%rip), %rcx      # 0x13300
movq 0xe3fc(%rip), %rax      # 0x132f8
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %rbp
jae 0x4f1f
addq %r12, %rax
movq (%rax,%rbx,8), %rdi
movq %r15, %rsi
callq 0x30a0
leaq 0x1(%rbx), %rcx
testl %eax, %eax
je 0x4ee7
cmpq $0x2, %rbx
jb 0x4f37
leaq 0xe3cc(%rip), %rdi      # 0x132f8
movq %r13, %rsi
movq %rbp, %rdx
callq 0x417f
movq 0xe3c2(%rip), %rcx      # 0x13300
movq 0xe3b3(%rip), %rax      # 0x132f8
subq %rax, %rcx
sarq $0x3, %rcx
movq %rbp, %r13
cmpq %rcx, %rbp
jb 0x4ec2
movq 0xe399(%rip), %rax      # 0x132f8
cmpq %rax, 0xe39a(%rip)      # 0x13300
je 0x500c
xorl %r13d, %r13d
leaq 0x91e8(%rip), %r15      # 0xe15e
movq (%rax,%r13,8), %rdi
movq %r15, %rsi
callq 0x30a0
testl %eax, %eax
je 0x4f8e
incq %r13
movq %r13, %rbp
jmp 0x4feb
leaq (,%r13,8), %r12
movl $0x1, %ecx
movq %rcx, %rbx
leaq (%rcx,%r13), %rbp
movq 0xe357(%rip), %rcx      # 0x13300
movq 0xe348(%rip), %rax      # 0x132f8
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %rbp
jae 0x4fd3
addq %r12, %rax
movq (%rax,%rbx,8), %rdi
movq %r15, %rsi
callq 0x30a0
leaq 0x1(%rbx), %rcx
testl %eax, %eax
je 0x4f9b
cmpq $0x2, %rbx
jb 0x4feb
leaq 0xe318(%rip), %rdi      # 0x132f8
movq %r13, %rsi
movq %rbp, %rdx
callq 0x417f
movq 0xe30e(%rip), %rcx      # 0x13300
movq 0xe2ff(%rip), %rax      # 0x132f8
subq %rax, %rcx
sarq $0x3, %rcx
movq %rbp, %r13
cmpq %rcx, %rbp
jb 0x4f76
movq 0xe30d(%rip), %r13      # 0x13320
subq 0xe2fe(%rip), %r13      # 0x13318
sarq $0x3, %r13
movq 0xe22b(%rip), %rsi      # 0x13250
cmpq %rsi, %r13
movl 0x14(%rsp), %ebx
ja 0x51dc
jae 0x514e
leaq 0xe2d9(%rip), %rdi      # 0x13318
callq 0x6582
movq %r13, 0x8(%rsp)
movq 0xe200(%rip), %rdx      # 0x13250
cmpq %rdx, %r13
jae 0x50b9
leaq 0xe2bc(%rip), %r15      # 0x13318
leaq 0x8(%rsp), %r12
movq %r13, %rax
movq 0xe2b5(%rip), %rsi      # 0x13320
cmpq 0xe2b6(%rip), %rsi      # 0x13328
je 0x5084
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0xe29e(%rip)      # 0x13320
jmp 0x508f
movq %r15, %rdi
movq %r12, %rdx
callq 0x7146
movq 0x8(%rsp), %rax
movq 0xe27d(%rip), %rcx      # 0x13318
cmpq %rax, (%rcx,%rax,8)
jne 0x51bd
incq %rax
movq %rax, 0x8(%rsp)
movq 0xe19c(%rip), %rdx      # 0x13250
cmpq %rdx, %rax
jb 0x5064
movq 0xe260(%rip), %rax      # 0x13320
movq 0xe251(%rip), %rcx      # 0x13318
subq %rcx, %rax
sarq $0x3, %rax
cmpq %rdx, %rax
jne 0x51fb
cmpq $0x1, %r13
adcq $0x0, %r13
movq 0xe16a(%rip), %r8       # 0x13250
leaq -0x1(%r8), %rax
cmpq %rax, %r13
jae 0x514e
movq %r13, %rsi
negq %rsi
movabsq $0x5deece66d, %rdi      # imm = 0x5DEECE66D
addq %rsi, %r8
movq 0xe197(%rip), %rax      # 0x132a0
imulq %rdi, %rax
addq $0xb, %rax
btrq $0x31, %rax
movq %rax, 0xe183(%rip)      # 0x132a0
shrq $0x10, %rax
xorl %edx, %edx
divq %r8
leaq (%rcx,%r13,8), %rax
movq (%rax), %r8
movq (%rax,%rdx,8), %r9
movq %r9, (%rax)
movq %r8, (%rax,%rdx,8)
incq %r13
movq 0xe10e(%rip), %r8       # 0x13250
leaq -0x1(%r8), %rax
decq %rsi
cmpq %rax, %r13
jb 0x50ff
movq 0xe1ab(%rip), %rcx      # 0x13300
movq 0xe19c(%rip), %rax      # 0x132f8
cmpq %rax, %rcx
je 0x51a2
xorl %r15d, %r15d
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
movl %ebx, %edx
callq 0x4e4f
movq 0xe17f(%rip), %rax      # 0x132f8
movq (%rax,%r15,8), %rdi
callq 0x411b
incq %r15
movq 0xe174(%rip), %rcx      # 0x13300
movq 0xe165(%rip), %rax      # 0x132f8
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rdx, %r15
jb 0x5164
cmpq %rax, %rcx
je 0x51ae
movq %rax, 0xe152(%rip)      # 0x13300
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x719b(%rip), %rdi      # 0xc35f
leaq 0x6e62(%rip), %rsi      # 0xc02d
leaq 0x7157(%rip), %rcx      # 0xc329
movl $0x2d6, %edx            # imm = 0x2D6
callq 0x3190
leaq 0x712d(%rip), %rdi      # 0xc310
leaq 0x6e43(%rip), %rsi      # 0xc02d
leaq 0x7138(%rip), %rcx      # 0xc329
movl $0x2cd, %edx            # imm = 0x2CD
callq 0x3190
leaq 0x7177(%rip), %rdi      # 0xc379
leaq 0x6e24(%rip), %rsi      # 0xc02d
leaq 0x7119(%rip), %rcx      # 0xc329
movl $0x2d8, %edx            # imm = 0x2D8
callq 0x3190