LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/suhasjains[P]AMR-Solver/src/field.cpp
// Function: myOctree::Field::Field(myOctree::Field const&)
Field::Field(const Field &obj) {

        //      std::cerr << "copy constructor of field is working" << std::endl;

        Nx = obj.Nx;
        Ny = obj.Ny;
        Nz = obj.Nz;
        N = obj.N;
        name = obj.name;
        //      std::cerr << "field is" << name <<  std::endl;

        val = new double** [Nx];
        for(int i=0;i<Nx;i++) {
                val[i] = new double* [Ny];
                for(int j=0;j<Ny;j++) {
                        val[i][j] = new double [Nz];
                        memcpy(val[i][j],obj.val[i][j],sizeof(double)*Nz);
                }
        }

        for(int i = 0; i < 3; ++ i) {
                memcpy(&(bc[i][0]), &(obj.bc[i][0]), 2 * sizeof(FieldBc));
        }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x28(%rdi), %rax
movq %rax, 0x18(%rdi)
andq $0x0, 0x20(%rdi)
movq %rsi, %r15
addq $0x18, %rdi
movb $0x0, 0x28(%rbx)
movl (%rsi), %eax
movl %eax, (%rbx)
movl 0x4(%rsi), %eax
movl %eax, 0x4(%rbx)
movl 0x8(%rsi), %eax
movl %eax, 0x8(%rbx)
movl 0xc(%rsi), %eax
movl %eax, 0xc(%rbx)
addq $0x18, %rsi
movq %rdi, -0x30(%rbp)
callq 0x2130
movslq (%rbx), %r12
leaq (,%r12,8), %rdi
testq %r12, %r12
pushq $-0x1
popq %rax
cmovsq %rax, %rdi
callq 0x2030
movq %rax, 0x10(%rbx)
xorl %r14d, %r14d
movslq %r12d, %rax
cmpq %rax, %r14
jge 0x6571
movslq 0x4(%rbx), %r12
leaq (,%r12,8), %rdi
testq %r12, %r12
pushq $-0x1
popq %rax
cmovsq %rax, %rdi
callq 0x2030
movq 0x10(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
xorl %r13d, %r13d
movslq %r12d, %rax
cmpq %rax, %r13
jge 0x6566
movslq 0x8(%rbx), %rax
leaq (,%rax,8), %r12
testq %rax, %rax
movq %r12, %rdi
pushq $-0x1
popq %rax
cmovsq %rax, %rdi
callq 0x2030
movq 0x10(%rbx), %rcx
movq (%rcx,%r14,8), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x10(%rbx), %rax
movq (%rax,%r14,8), %rax
movq (%rax,%r13,8), %rdi
movq 0x10(%r15), %rax
movq (%rax,%r14,8), %rax
movq (%rax,%r13,8), %rsi
movq %r12, %rdx
callq 0x2180
incq %r13
movl 0x4(%rbx), %r12d
jmp 0x650b
incq %r14
movl (%rbx), %r12d
jmp 0x64d9
xorl %eax, %eax
cmpq $0x3, %rax
je 0x6588
movq 0x38(%r15,%rax,8), %rcx
movq %rcx, 0x38(%rbx,%rax,8)
incq %rax
jmp 0x6573
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x659b
jmp 0x659b
movq %rax, %rbx
movq -0x30(%rbp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2320
nop
// File: /workspace/github_cpp_makefile_star2_O2/suhasjains[P]AMR-Solver/src/field.cpp
// Function: myOctree::Field::~Field()
Field::~Field() {
        //      std::cerr << "delete constructor of field is working" << std::endl;

        for (int i = 0; i < Nx; ++i) {
                for (int j = 0; j < Ny; ++j)
                        delete [] val[i][j];

                delete [] val[i];
                }

        delete [] val;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movslq (%rbx), %rax
cmpq %rax, %r14
jge 0x65fe
xorl %r15d, %r15d
movslq 0x4(%rbx), %rax
movq 0x10(%rbx), %rcx
movq (%rcx,%r14,8), %rdi
cmpq %rax, %r15
jge 0x65ef
movq (%rdi,%r15,8), %rdi
testq %rdi, %rdi
je 0x65ea
callq 0x2250
incq %r15
jmp 0x65cb
testq %rdi, %rdi
je 0x65f9
callq 0x2250
incq %r14
jmp 0x65c0
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x660c
callq 0x2250
addq $0x18, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2100
nop
// File: /workspace/github_cpp_makefile_star2_O2/suhasjains[P]AMR-Solver/src/output.cpp
// Function: std::NodeBc_to_string[abi:cxx11](myOctree::node_boundary_flags)
string NodeBc_to_string(myOctree::NodeBc bcc) {

	string bc;

	if(bcc==myOctree::NONE) 
		bc = "N";

	if(bcc==myOctree::BOUNDARY) 
		bc = "B";

	if(bcc==myOctree::MPI_BOUNDARY) 
		bc = "MB";


	return bc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
cmpl $0x3, %esi
jae 0x98af
movl %esi, %eax
leaq 0x5b84(%rip), %rcx      # 0xf424
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
movq %rbx, %rdi
callq 0x2350
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O2/suhasjains[P]AMR-Solver/src/input.cpp
// Function: std::string_to_NodeBc(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
myOctree::NodeBc string_to_NodeBc(string bc) {

	myOctree::NodeBc bcc;

	if(bc=="N")
		bcc = myOctree::NONE;

	if(bc=="B")
		bcc = myOctree::BOUNDARY;

	if(bc=="MPI_BOUNDARY")
		bcc = myOctree::MPI_BOUNDARY;
		
	return bcc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x5638(%rip), %rsi      # 0xf3f1
callq 0xb6d5
leaq 0x562f(%rip), %rsi      # 0xf3f4
movq %rbx, %rdi
callq 0xb6d5
movzbl %al, %r14d
leaq 0x5658(%rip), %rsi      # 0xf430
movq %rbx, %rdi
callq 0xb6d5
testb %al, %al
pushq $0x2
popq %rax
cmovel %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/suhasjains[P]AMR-Solver/src/input.cpp
// Function: std::string_to_FieldBc(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
myOctree::FieldBc string_to_FieldBc(string bc) {

	myOctree::FieldBc bcc;

	if(bc=="N")
		bcc = myOctree::none;

	if(bc=="D")
		bcc = myOctree::dirichlet;
	
	if(bc=="NE")
		bcc = myOctree::neumann;

	if(bc=="MB")
		bcc = myOctree::mpi_boundary;
		
	return bcc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x55ef(%rip), %rsi      # 0xf3f1
callq 0xb6d5
leaq 0x562f(%rip), %rsi      # 0xf43d
movq %rbx, %rdi
callq 0xb6d5
movzbl %al, %r14d
leaq 0x561e(%rip), %rsi      # 0xf43f
movq %rbx, %rdi
callq 0xb6d5
testb %al, %al
pushq $0x2
popq %r15
cmovel %r14d, %r15d
leaq 0x55b9(%rip), %rsi      # 0xf3f3
movq %rbx, %rdi
callq 0xb6d5
testb %al, %al
pushq $0x3
popq %rax
cmovel %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/suhasjains[P]AMR-Solver/src/input.cpp
// Function: std::read_scalar_fields(std::basic_ifstream<char, std::char_traits<char>>&)
void read_scalar_fields(ifstream& file) {

	string line, str;

	//Skips if a line is empty		
	getline(file, line);
	while(line.empty()) {
		getline(file, line);
	}

	if(line=="scalar_fields") {

		file >> str;
                if(str != "{") {
                        cerr << "Expected an opening bracket" <<endl;
                        exit(1);
                }
		
		cerr << "\nUser defined scalar fields" << endl;

		while(file) { 
	
		
			if(file >> str && str == "}") break;
                        else    myOctree::scalar_fields.push_back(str);
			cerr << str << endl;

		}	
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq -0x48(%rbp), %rsi
callq 0x2060
leaq -0x48(%rbp), %r14
cmpq $0x0, -0x40(%rbp)
jne 0x9eab
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2060
jmp 0x9e97
leaq 0x5590(%rip), %rsi      # 0xf442
leaq -0x48(%rbp), %rdi
callq 0xb6d5
testb %al, %al
je 0x9f71
leaq -0x68(%rbp), %rsi
movq %rbx, %rdi
callq 0x2240
leaq 0x557a(%rip), %rsi      # 0xf450
leaq -0x68(%rbp), %rdi
callq 0xb6e5
testb %al, %al
jne 0x9f92
movq 0x9102(%rip), %rdi      # 0x12ff0
leaq 0x5579(%rip), %rsi      # 0xf46e
callq 0x21d0
movq %rax, %rdi
callq 0x2110
leaq -0x68(%rbp), %r14
leaq 0x557d(%rip), %r15      # 0xf48a
leaq 0x9704(%rip), %r12      # 0x13618
movq 0x90d5(%rip), %r13      # 0x12ff0
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rbx,%rax)
jne 0x9f71
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x9f51
movq %r14, %rdi
movq %r15, %rsi
callq 0xb6d5
testb %al, %al
jne 0x9f71
movq %r12, %rdi
movq %r14, %rsi
callq 0xb6f2
movq %r13, %rdi
movq %r14, %rsi
callq 0x21a0
movq %rax, %rdi
callq 0x2110
jmp 0x9f1b
leaq -0x68(%rbp), %rdi
callq 0x2100
leaq -0x48(%rbp), %rdi
callq 0x2100
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x9057(%rip), %rdi      # 0x12ff0
leaq 0x54b2(%rip), %rsi      # 0xf452
callq 0x21d0
movq %rax, %rdi
callq 0x2110
pushq $0x1
popq %rdi
callq 0x2220
jmp 0x9fb9
jmp 0x9fb9
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x2100
leaq -0x48(%rbp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O2/suhasjains[P]AMR-Solver/src/input.cpp
// Function: std::read_vector_fields(std::basic_ifstream<char, std::char_traits<char>>&)
void read_vector_fields(ifstream& file) {

	string line, str;
	
	//Skips if a line is empty		
	getline(file, line);
	while(line.empty()) {
		getline(file, line);
	}

	if(line=="vector_fields") {

		file >> str;
	        if(str != "{") {
	                cerr << "Expected an opening bracket" <<endl;
	                exit(1);
	        }
		
		cerr << "\nUser defined vector Fields" << endl;

		while(file) { 
	
		
			if(file >> str && str == "}") break;
	                else    myOctree::vector_fields.push_back(str);
			cerr << str << endl;	
		}	
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq -0x48(%rbp), %rsi
callq 0x2060
leaq -0x48(%rbp), %r14
cmpq $0x0, -0x40(%rbp)
jne 0xa02b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2060
jmp 0xa017
leaq 0x545a(%rip), %rsi      # 0xf48c
leaq -0x48(%rbp), %rdi
callq 0xb6d5
testb %al, %al
je 0xa0f1
leaq -0x68(%rbp), %rsi
movq %rbx, %rdi
callq 0x2240
leaq 0x53fa(%rip), %rsi      # 0xf450
leaq -0x68(%rbp), %rdi
callq 0xb6e5
testb %al, %al
jne 0xa112
movq 0x8f82(%rip), %rdi      # 0x12ff0
leaq 0x5425(%rip), %rsi      # 0xf49a
callq 0x21d0
movq %rax, %rdi
callq 0x2110
leaq -0x68(%rbp), %r14
leaq 0x53fd(%rip), %r15      # 0xf48a
leaq 0x959c(%rip), %r12      # 0x13630
movq 0x8f55(%rip), %r13      # 0x12ff0
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rbx,%rax)
jne 0xa0f1
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xa0d1
movq %r14, %rdi
movq %r15, %rsi
callq 0xb6d5
testb %al, %al
jne 0xa0f1
movq %r12, %rdi
movq %r14, %rsi
callq 0xb6f2
movq %r13, %rdi
movq %r14, %rsi
callq 0x21a0
movq %rax, %rdi
callq 0x2110
jmp 0xa09b
leaq -0x68(%rbp), %rdi
callq 0x2100
leaq -0x48(%rbp), %rdi
callq 0x2100
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8ed7(%rip), %rdi      # 0x12ff0
leaq 0x5332(%rip), %rsi      # 0xf452
callq 0x21d0
movq %rax, %rdi
callq 0x2110
pushq $0x1
popq %rdi
callq 0x2220
jmp 0xa139
jmp 0xa139
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x2100
leaq -0x48(%rbp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O2/suhasjains[P]AMR-Solver/src/input.cpp
// Function: std::read_max_level(std::basic_ifstream<char, std::char_traits<char>>&)
void read_max_level(ifstream& file) {

	string line, str;
	
	//Skips if a line is empty		
	getline(file, line);
	while(line.empty()) {
		getline(file, line);
	}

	if(line=="max_level") {

		file >> myOctree::max_level;
	
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq -0x20(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq -0x30(%rbp), %rsi
callq 0x2060
leaq -0x30(%rbp), %r14
cmpq $0x0, -0x28(%rbp)
jne 0xb50d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2060
jmp 0xb4f9
leaq 0x4039(%rip), %rsi      # 0xf54d
leaq -0x30(%rbp), %rdi
callq 0xb6d5
testb %al, %al
je 0xb530
leaq 0x80dc(%rip), %rsi      # 0x13604
movq %rbx, %rdi
callq 0x2140
leaq -0x50(%rbp), %rdi
callq 0x2100
leaq -0x30(%rbp), %rdi
callq 0x2100
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0xb54d
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2100
leaq -0x30(%rbp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O2/suhasjains[P]AMR-Solver/src/input.cpp
// Function: std::read_input_file()
void read_input_file() {

	int blocknumber;
	string line, str;

	ifstream file ("../input/input.pfs"); 
	if(file.fail()) {
		cerr << "Error opening input file\n";
		exit(1);
	}

	if(file.peek() == ifstream::traits_type::eof()) {
		cerr << "Nothing in the input file\n";
		exit(1);
	}

	else {

		cerr << "\nReading input files" << endl;

		read_scalar_fields(file);

		read_vector_fields(file);
	
		blocknumber = read_blocks(file);

		read_scalar_field_Bc(file, blocknumber);

		read_vector_field_Bc(file, blocknumber);

		read_max_level(file);

	}

	file.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0x18(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0x3fba(%rip), %rsi      # 0xf557
leaq -0x250(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x2340
movq -0x250(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x230(%rbp,%rax)
jne 0xb677
leaq -0x250(%rbp), %rdi
callq 0x20c0
cmpl $-0x1, %eax
je 0xb68c
movq 0x7a0f(%rip), %rdi      # 0x12ff0
leaq 0x3f9d(%rip), %rsi      # 0xf585
callq 0x21d0
movq %rax, %rdi
callq 0x2110
leaq -0x250(%rbp), %rdi
callq 0x9e56
leaq -0x250(%rbp), %rdi
callq 0x9fd6
leaq -0x250(%rbp), %rdi
callq 0xa156
movl %eax, %ebx
leaq -0x250(%rbp), %rdi
movl %eax, %esi
callq 0xa611
leaq -0x250(%rbp), %rdi
movl %ebx, %esi
callq 0xab1a
leaq -0x250(%rbp), %rdi
callq 0xb4be
leaq -0x250(%rbp), %rdi
callq 0x2070
leaq -0x250(%rbp), %rdi
callq 0x2080
leaq -0x28(%rbp), %rdi
callq 0x2100
leaq -0x48(%rbp), %rdi
callq 0x2100
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %rbp
retq
movq 0x7972(%rip), %rdi      # 0x12ff0
leaq 0x3d7c(%rip), %rsi      # 0xf401
callq 0x21d0
jmp 0xb69f
movq 0x795d(%rip), %rdi      # 0x12ff0
leaq 0x3ed0(%rip), %rsi      # 0xf56a
callq 0x21d0
pushq $0x1
popq %rdi
callq 0x2220
movq %rax, %rbx
jmp 0xb6bb
movq %rax, %rbx
leaq -0x250(%rbp), %rdi
callq 0x2080
leaq -0x28(%rbp), %rdi
callq 0x2100
leaq -0x48(%rbp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O2/suhasjains[P]AMR-Solver/src/poisson.cpp
// Function: amrsolver::jacobi(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void jacobi(int level, std::string name) {

	myOctree::create_lists_of_level_nodes();

	if(myOctree::level_nodes[level].empty()) {
        	std::cerr << "No blocks in level " << level << std::endl;
	 	exit(1);
	}

	double global_res = 1.0;

	long int loop = 0;

	//iteration loop
	while(loop <250 ) {
	//while(global_res > pow(10,-7)) {

		global_res = 0.0;
		
		//exchange ghost values
		exchange_ghost_val(level, name);

		//loop over all the nodes
		for (std::list<Octree*>::iterator it = level_nodes[level].begin(), end = level_nodes[level].end(); it != end; ++it) {
	
			for(int l = 0; l<myOctree::scalar_fields.size() ; l++) {
	
				Field *f = (*it)->get_block_data()->scalarfields[l];
							//	std::cerr << f->name << std::endl;
	
				if( f->name == name ) {
					
					global_res = jacobi_for_field(*it, f, global_res);	

				}	
			}
		}

		std::cout << "Residual " << global_res << std::endl;

		loop++;

	}	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movl %edi, %ebx
callq 0x2e8e
movl %ebx, -0x2c(%rbp)
movslq %ebx, %rax
imulq $0x18, %rax, %rax
leaq 0x78ec(%rip), %rcx      # 0x13240
leaq (%rcx,%rax), %rdx
movq %rdx, -0x40(%rbp)
cmpq %rdx, (%rcx,%rax)
je 0xba4d
xorl %eax, %eax
leaq -0x68(%rbp), %rbx
leaq 0x7ca5(%rip), %r15      # 0x13618
cmpq $0xfa, %rax
je 0xba3e
movq %rax, -0x48(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2270
movl -0x2c(%rbp), %edi
movq %rbx, %rsi
callq 0x6c98
movq %rbx, %rdi
callq 0x2100
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x40(%rbp), %r13
movq (%r13), %r13
cmpq -0x40(%rbp), %r13
je 0xba06
xorl %ebx, %ebx
movq 0x8(%r15), %rax
subq (%r15), %rax
sarq $0x5, %rax
cmpq %rbx, %rax
jbe 0xb9ad
movq 0x10(%r13), %rdi
callq 0x3db0
movq 0x10(%rax), %rax
movq (%rax,%rbx,8), %r12
leaq 0x18(%r12), %rdi
movq %r14, %rsi
callq 0x6c56
testb %al, %al
je 0xba01
movq 0x10(%r13), %rdi
movq %r12, %rsi
movsd -0x38(%rbp), %xmm0
callq 0xba8f
movsd %xmm0, -0x38(%rbp)
incq %rbx
jmp 0xb9b9
movq 0x75c3(%rip), %rdi      # 0x12fd0
leaq 0x3bbc(%rip), %rsi      # 0xf5d0
callq 0x21d0
movq %rax, %rdi
movsd -0x38(%rbp), %xmm0
callq 0x22e0
movq %rax, %rdi
callq 0x2110
movq -0x48(%rbp), %rax
incq %rax
leaq -0x68(%rbp), %rbx
jmp 0xb973
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x759c(%rip), %rdi      # 0x12ff0
leaq 0x3ba0(%rip), %rsi      # 0xf5fb
callq 0x21d0
movq %rax, %rdi
movl -0x2c(%rbp), %esi
callq 0x2310
movq %rax, %rdi
callq 0x2110
pushq $0x1
popq %rdi
callq 0x2220
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O2/suhasjains[P]AMR-Solver/src/multigrid.cpp
// Function: amrsolver::restrict(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void restrict(int level, std::string name) {

	myOctree::create_lists_of_level_nodes();
	
	if(myOctree::level_nodes[level].empty()) {
                std::cerr << "Error! No blocks in level " << level << std::endl;
                exit(1);
        }
	

	//loop over nodes
	for (std::list<Octree*>::iterator it = level_nodes[level].begin(), end = level_nodes[level].end(); it != end; ++it) {


		//skip if its a leaf node
		if((*it)->isLeafNode()) {	
			continue;
		}
		
            	//loop over scalar fields
            	for(int l = 0; l<myOctree::scalar_fields.size() ; l++) {

			//field and block
       			Field *f = (*it)->get_block_data()->scalarfields[l];
               		if( f->name == name ) {

  				for(int i=0; i<f->Nx; i++) {
         				for(int j=0; j<f->Ny; j++) {
                         			for(int k=0; k<f->Nz; k++) {
			
					//	std::cout << i << " " << j << " " << k << std::endl;
				
							f->val[i][j][k] = restrict_at((*it),l,i,j,k);

						}
          				}
                 		}
       			}
         	}
        }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, -0x40(%rbp)
movl %edi, %r14d
callq 0x2e8e
movslq %r14d, %rax
imulq $0x18, %rax, %rax
leaq 0x5171(%rip), %rcx      # 0x13240
leaq (%rcx,%rax), %rdx
movq (%rcx,%rax), %rbx
movq %rdx, -0x38(%rbp)
cmpq %rdx, %rbx
je 0xe1be
cmpq -0x38(%rbp), %rbx
je 0xe1af
movq 0x10(%rbx), %rdi
callq 0x3d8c
testb %al, %al
je 0xe100
movq (%rbx), %rbx
jmp 0xe0e4
xorl %r15d, %r15d
movq %rbx, -0x30(%rbp)
leaq 0x550a(%rip), %rcx      # 0x13618
movq 0x8(%rcx), %rax
subq (%rcx), %rax
sarq $0x5, %rax
cmpq %r15, %rax
jbe 0xe0fb
movq 0x10(%rbx), %rdi
callq 0x3db0
movq 0x10(%rax), %rax
movq %r15, %r14
movq (%rax,%r15,8), %rbx
leaq 0x18(%rbx), %rdi
movq -0x40(%rbp), %rsi
callq 0x6c56
testb %al, %al
je 0xe1a0
xorl %r15d, %r15d
movslq (%rbx), %rax
cmpq %rax, %r15
jge 0xe1a0
xorl %r12d, %r12d
movslq 0x4(%rbx), %rax
cmpq %rax, %r12
jge 0xe19b
xorl %r13d, %r13d
movslq 0x8(%rbx), %rax
cmpq %rax, %r13
jge 0xe196
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movl %r14d, %esi
movl %r15d, %edx
movl %r12d, %ecx
movl %r13d, %r8d
callq 0xd63b
movq 0x10(%rbx), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r12,8), %rax
movsd %xmm0, (%rax,%r13,8)
incq %r13
jmp 0xe15d
incq %r12
jmp 0xe151
incq %r15
jmp 0xe146
movq %r14, %r15
incq %r15
movq -0x30(%rbp), %rbx
jmp 0xe107
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4e2b(%rip), %rdi      # 0x12ff0
leaq 0x1428(%rip), %rsi      # 0xf5f4
callq 0x21d0
movq %rax, %rdi
movl %r14d, %esi
callq 0x2310
movq %rax, %rdi
callq 0x2110
pushq $0x1
popq %rdi
callq 0x2220
// File: /workspace/github_cpp_makefile_star2_O2/suhasjains[P]AMR-Solver/src/multigrid.cpp
// Function: amrsolver::multigrid(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void multigrid(std::string name) {

     	gauss_seidel(0, name);


	for(int i=1; i<=myOctree::max_level; i++) {
        	prolongate_ghost(i,name);
       		prolongate_domain(i,name);
     		gauss_seidel(i, name);
	}

	for(int i=myOctree::max_level-1; i>=0; i--) {
		restrict(i,name);
		gauss_seidel(i,name);		
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %r14
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2270
xorl %edi, %edi
movq %rbx, %rsi
callq 0xbe8e
leaq -0x48(%rbp), %rdi
callq 0x2100
pushq $0x1
popq %r13
leaq -0xe8(%rbp), %rbx
leaq -0xa8(%rbp), %r12
leaq 0x53c6(%rip), %rax      # 0x13604
movl (%rax), %r15d
cmpl %r15d, %r13d
jg 0xe2ac
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2270
movl %r13d, %edi
movq %rbx, %rsi
callq 0xd914
movq %rbx, %rdi
callq 0x2100
leaq -0xc8(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x2270
movl %r13d, %edi
movq %r15, %rsi
callq 0xdcdc
movq %r15, %rdi
callq 0x2100
movq %r12, %rdi
movq %r14, %rsi
callq 0x2270
movl %r13d, %edi
movq %r12, %rsi
callq 0xbe8e
movq %r12, %rdi
callq 0x2100
incl %r13d
jmp 0xe237
leaq -0x88(%rbp), %rbx
leaq -0x68(%rbp), %r12
testl %r15d, %r15d
jle 0xe2fd
decl %r15d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2270
movl %r15d, %edi
movq %rbx, %rsi
callq 0xe0a4
movq %rbx, %rdi
callq 0x2100
movq %r12, %rdi
movq %r14, %rsi
callq 0x2270
movl %r15d, %edi
movq %r12, %rsi
callq 0xbe8e
movq %r12, %rdi
callq 0x2100
jmp 0xe2b7
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe315
jmp 0xe322
jmp 0xe315
movq %rax, %r14
jmp 0xe328
movq %rax, %r14
movq %r15, %rbx
jmp 0xe328
movq %rax, %r14
movq %r12, %rbx
movq %rbx, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O2/xiangzejun[P]Optimizing_Implementations_of_Linear_Layers/strategy.cpp
// Function: strgy2(std::vector<std::bitset<32ul>, std::allocator<std::bitset<32ul>>>&)
vector<xpair> strgy2(vector<ROW> &m)
{
	vector<ROW> trans_m;
	get_trans_matrix(trans_m, m);
	vector<xpair> seq = strgy1(trans_m);
	for(int i = 0; i < seq.size(); i++)
	{
		seq[i].flag = true;
	}
	get_trans_matrix(m, trans_m);

	int tab[SIZE] = {0};
	build_table(m, tab);//get TABLE
	vector<xpair> final_seq = update_seq_str(seq, tab);
	return final_seq;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x29e4
movq %rsp, %rdi
leaq 0x78(%rsp), %rsi
callq 0x305c
leaq 0x78(%rsp), %rdi
callq 0x2bbe
leaq 0x18(%rsp), %rdi
movq %rsp, %rsi
callq 0x2d64
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rax
subq %rcx, %rax
pushq $0xc
popq %rsi
cqto
idivq %rsi
addq $0x8, %rcx
subq $0x1, %rax
jb 0x2f21
movb $0x1, (%rcx)
addq $0xc, %rcx
jmp 0x2f12
leaq 0x60(%rsp), %rdi
movq %rsp, %rsi
callq 0x29e4
leaq 0x60(%rsp), %rsi
movq %r14, %rdi
callq 0x305c
leaq 0x60(%rsp), %rdi
callq 0x2bbe
xorps %xmm0, %xmm0
movaps %xmm0, 0x100(%rsp)
movaps %xmm0, 0xf0(%rsp)
movaps %xmm0, 0xe0(%rsp)
movaps %xmm0, 0xd0(%rsp)
movaps %xmm0, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
callq 0x29e4
leaq 0x48(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x3135
leaq 0x48(%rsp), %rdi
callq 0x2bbe
leaq 0x30(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x2a34
leaq 0x30(%rsp), %rsi
leaq 0x90(%rsp), %rdx
movq %rbx, %rdi
callq 0x31b3
leaq 0x30(%rsp), %rdi
callq 0x2c54
leaq 0x18(%rsp), %rdi
callq 0x2c54
movq %rsp, %rdi
callq 0x2bbe
movq %rbx, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2c54
jmp 0x3042
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
jmp 0x3020
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x2bbe
jmp 0x3042
jmp 0x303f
jmp 0x303a
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x2bbe
jmp 0x304c
movq %rax, %rbx
jmp 0x304c
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x2c54
movq %rsp, %rdi
callq 0x2bbe
movq %rbx, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O2/xiangzejun[P]Optimizing_Implementations_of_Linear_Layers/strategy.cpp
// Function: get_trans_matrix(std::vector<std::bitset<32ul>, std::allocator<std::bitset<32ul>>>&, std::vector<std::bitset<32ul>, std::allocator<std::bitset<32ul>>>)
void get_trans_matrix(vector<ROW> &trans_m, vector<ROW> m)
{   
	trans_m.clear();
	for(int i = 0; i < m.size(); i++)
	{  
		bitset<SIZE> tmp(0);
		for (int j = 0; j < m.size(); j++)
		{
		tmp[m[0].size() - 1 - j] = m[j][m[0].size() - i - 1];
		}
		trans_m.push_back(tmp);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
cmpq %rax, 0x8(%rdi)
je 0x307d
movq %rax, 0x8(%r14)
xorl %esi, %esi
leaq 0x10(%rsp), %r15
movq %r14, (%rsp)
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0x3126
andq $0x0, 0x10(%rsp)
pushq $0x1f
popq %rdx
movl %edx, %r14d
movq %rsi, 0x8(%rsp)
subl %esi, %r14d
andl $0x3f, %r14d
pushq $0x1f
popq %rbp
xorl %r12d, %r12d
xorl %r13d, %r13d
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r13, %rcx
jbe 0x310d
addq %r12, %rax
movq %rax, 0x28(%rsp)
movq %r14, 0x30(%rsp)
movq %r15, 0x18(%rsp)
movl %ebp, %eax
andl $0x3f, %eax
movq %rax, 0x20(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x39f4
incq %r13
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
addq $0x8, %r12
decq %rbp
jmp 0x30c3
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x3a20
movq 0x8(%rsp), %rsi
incq %rsi
jmp 0x3088
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/xiangzejun[P]Optimizing_Implementations_of_Linear_Layers/strategy.cpp
// Function: build_table(std::vector<std::bitset<32ul>, std::allocator<std::bitset<32ul>>>, int*)
void build_table(vector<ROW> m, int tab[SIZE])
{
	int ind = 0;
	for (int i = 0; i < m.size(); i++)
	{
		for (int j = 0; j < m.size(); j++)
		{
			if (m[i].test(j))
			{
				ind = m.size() - 1 - j;
				break;
			}
		}
		tab[ind] = i;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
xorl %r12d, %r12d
xorl %r13d, %r13d
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
jbe 0x31a9
xorl %r15d, %r15d
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0x319d
leaq (%rax,%r12,8), %rdi
movq %r15, %rsi
callq 0x2b50
incq %r15
testb %al, %al
je 0x3160
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq %rcx, %r13
subq %rax, %r13
shrq $0x3, %r13
subl %r15d, %r13d
movslq %r13d, %rdx
movl %r12d, (%rbx,%rdx,4)
incq %r12
jmp 0x3151
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/xiangzejun[P]Optimizing_Implementations_of_Linear_Layers/strategy.cpp
// Function: update_seq_str(std::vector<xpair, std::allocator<xpair>>, int*)
vector<xpair> update_seq_str(vector<xpair> seq, int tab[SIZE])
{	
	vector<xpair> tmp_seq;
	for(int i = 0; i < seq.size(); i++)
	{	
		if(!seq[i].flag)
		{
			tmp_seq.push_back(seq[i]);
		}
	}

	for(int i = seq.size() - 1; i >= 0; i--)
	{	

		if(seq[i].flag)
		{	
			xpair new_ele;
			new_ele.src = tab[seq[i].dst];
			new_ele.dst = tab[seq[i].src];
			new_ele.flag = false;
			tmp_seq.push_back(new_ele);
		}
	}
	return tmp_seq;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
movups %xmm0, (%rdi)
xorl %r12d, %r12d
pushq $0xc
popq %r13
xorl %ebp, %ebp
movq (%r15), %rsi
movq 0x8(%r15), %rax
subq %rsi, %rax
cqto
idivq %r13
cmpq %rbp, %rax
jbe 0x320e
cmpb $0x0, 0x8(%rsi,%r12)
jne 0x3205
addq %r12, %rsi
movq %rbx, %rdi
callq 0x394c
incq %rbp
addq $0xc, %r12
jmp 0x31de
movl %eax, %r13d
decq %r13
leaq 0xc(%rsp), %r12
testl %r13d, %r13d
js 0x3264
movl %r13d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq (%r15), %rax
imulq $0xc, %rcx, %rcx
cmpb $0x0, 0x8(%rax,%rcx)
je 0x325f
addq %rcx, %rax
movslq 0x4(%rax), %rcx
movl (%r14,%rcx,4), %ecx
movl %ecx, 0xc(%rsp)
movslq (%rax), %rax
movl (%r14,%rax,4), %eax
movl %eax, 0x10(%rsp)
movb $0x0, 0x14(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x394c
decq %r13
jmp 0x3219
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3278
movq %rax, %r14
movq %rbx, %rdi
callq 0x2c54
movq %r14, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O2/xiangzejun[P]Optimizing_Implementations_of_Linear_Layers/strategy.cpp
// Function: get_ones(std::vector<std::bitset<32ul>, std::allocator<std::bitset<32ul>>>)
int get_ones(vector<ROW> m)
{
	int s = 0;
	for(int i = 0; i < m.size(); i++)
		s += m[i].count();
	return s;
}

// Assembly:
pushq %rbx
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
xorl %esi, %esi
movabsq $0x5555555555555555, %rdi # imm = 0x5555555555555555
movabsq $0x3333333333333333, %r8 # imm = 0x3333333333333333
movabsq $0xf0f0f0f0f0f0f0f, %r9 # imm = 0xF0F0F0F0F0F0F0F
movabsq $0x101010101010101, %r10 # imm = 0x101010101010101
xorl %eax, %eax
cmpq %rsi, %rdx
je 0x37ae
movq (%rcx,%rsi,8), %r11
movq %r11, %rbx
shrq %rbx
andq %rdi, %rbx
subq %rbx, %r11
movq %r11, %rbx
andq %r8, %rbx
shrq $0x2, %r11
andq %r8, %r11
addq %rbx, %r11
movq %r11, %rbx
shrq $0x4, %rbx
addq %r11, %rbx
andq %r9, %rbx
imulq %r10, %rbx
shrq $0x38, %rbx
addl %ebx, %eax
incq %rsi
jmp 0x376d
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/xiangzejun[P]Optimizing_Implementations_of_Linear_Layers/reduce.cpp
// Function: get_reduced_matrix(std::vector<xpair, std::allocator<xpair>>, std::vector<std::bitset<32ul>, std::allocator<std::bitset<32ul>>>)
vector<ROW> get_reduced_matrix(vector<xpair> seq, vector<ROW> m)
{
	vector<ROW> tmp_m(m);
	for(int i = 0; i < seq.size(); i++)
		tmp_m[seq[i].dst] ^= tmp_m[seq[i].src];
	return tmp_m;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, %rsi
callq 0x29e4
movq (%r14), %rcx
movq 0x8(%r14), %rax
subq %rcx, %rax
pushq $0xc
popq %rsi
cqto
idivq %rsi
movq (%rbx), %rdx
addq $0x4, %rcx
xorl %esi, %esi
cmpq %rsi, %rax
jbe 0x409a
movslq -0x4(%rcx), %rdi
movslq (%rcx), %r8
movq (%rdx,%rdi,8), %rdi
xorq %rdi, (%rdx,%r8,8)
incq %rsi
addq $0xc, %rcx
jmp 0x407d
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/xiangzejun[P]Optimizing_Implementations_of_Linear_Layers/reduce.cpp
// Function: get_identity()
vector<ROW> get_identity()
{
	vector<ROW> m;
	ROW tmp(0);
	for(int i = 0; i < SIZE; i++)
	{
		m.push_back(tmp);
		m[i][SIZE - 1 - i] = 1;
	}
	return m;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
leaq 0x8(%rsp), %r14
andq $0x0, (%r14)
movups %xmm0, (%rdi)
pushq $0x1f
popq %r15
xorl %r12d, %r12d
pushq $0x1
popq %r13
cmpq $-0x1, %r15
je 0x40fe
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3a20
movq %r13, %rax
movl %r15d, %ecx
shlq %cl, %rax
movq (%rbx), %rcx
orq %rax, (%rcx,%r12)
decq %r15
addq $0x8, %r12
jmp 0x40d4
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x2bbe
movq %r14, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O2/xiangzejun[P]Optimizing_Implementations_of_Linear_Layers/reduce.cpp
// Function: get_table(std::vector<xpair, std::allocator<xpair>>, int**, int, int)
int** get_table(vector<xpair> seq, int ** table, int osize, int nsize)
{
	if(table != NULL)
	{
		for(int i = 0; i < osize; i++)
			delete[] table[i];
		delete[] table;
	}
	table = new int*[nsize];
	for(int i = 0; i < nsize; i++)
		table[i] = new int[nsize];

	int s = seq.size();
	for(int i = 0; i < s; i++)
	{
		table[i][i] = 1;
		for(int j = i + 1; j < s; j++)
		{
			if(exchange(seq[i], seq[j]))
				table[i][j] = 1;
			else
			{
				for(int k = j; k < s; k++)
					table[i][k] = 0;
				break;
			}
		}
		for(int j = i - 1; j >= 0; j--)
		{
			if(exchange(seq[i], seq[j]))
				table[i][j] = 1;
			else
			{
				for(int k = j; k >= 0; k--)
					table[i][k] = 0;
				break;
			}
		}
	}
	return table;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebx
movq %rdi, %r14
testq %rsi, %rsi
je 0x4199
movl %edx, %r12d
movq %rsi, %r15
xorl %r13d, %r13d
testl %edx, %edx
cmovlel %r13d, %r12d
cmpq %r13, %r12
je 0x4191
movq (%r15,%r13,8), %rdi
testq %rdi, %rdi
je 0x418c
callq 0x21b0
incq %r13
jmp 0x4179
movq %r15, %rdi
callq 0x21b0
movslq %ebx, %r15
leaq (,%r15,8), %rdi
xorl %r13d, %r13d
testl %r15d, %r15d
pushq $-0x1
popq %r12
cmovsq %r12, %rdi
movl $0x0, %ebp
cmovgl %r15d, %ebp
callq 0x2030
movq %rax, (%rsp)
shlq $0x2, %r15
cmpq %r13, %rbp
je 0x41e2
movq %r15, %rdi
callq 0x2030
movq (%rsp), %rcx
movq %rax, (%rcx,%r13,8)
incq %r13
jmp 0x41c8
movq (%r14), %rdi
movq 0x8(%r14), %rax
subq %rdi, %rax
pushq $0xc
popq %rcx
cqto
idivq %rcx
xorl %r14d, %r14d
testl %eax, %eax
movl $0x0, %ecx
cmovgl %eax, %ecx
movq %rcx, 0x10(%rsp)
leaq 0xc(%rdi), %rsi
movq %rdi, 0x8(%rsp)
addq $-0xc, %rdi
pushq $0x1
popq %r8
cmpq 0x10(%rsp), %r14
je 0x4301
movq (%rsp), %rcx
movq (%rcx,%r14,8), %r10
movl $0x1, (%r10,%r14,4)
leaq 0x1(%r14), %r9
imulq $0xc, %r14, %r11
addq 0x8(%rsp), %r11
movq %rsi, %r15
movq %r8, %r13
cmpl %eax, %r13d
jge 0x4294
movq (%r11), %rdx
movq (%r15), %rbx
movq %rdx, %rcx
shrq $0x20, %rcx
movq %rbx, %rbp
shrq $0x20, %rbp
cmpq %rbp, %rcx
je 0x426f
cmpl %ebx, %edx
je 0x426f
cmpl %ebp, %edx
je 0x428c
cmpl %ebx, %ecx
je 0x428c
movl $0x1, (%r10,%r13,4)
incq %r13
addq $0xc, %r15
incq %r14
jmp 0x4245
andl $0x0, 0x4(%r10,%r14,4)
incq %r14
leal 0x1(%r14), %ecx
cmpl %eax, %ecx
jl 0x4283
movq %rdi, %r15
movq %r12, %r14
leaq 0x1(%r14), %rcx
testq %rcx, %rcx
jle 0x42eb
movq (%r11), %rcx
movq (%r15), %r13
movq %rcx, %rbp
shrq $0x20, %rbp
movq %r13, %rdx
shrq $0x20, %rdx
cmpq %rdx, %rbp
je 0x42ca
cmpl %r13d, %ecx
je 0x42ca
cmpl %edx, %ecx
je 0x42e6
cmpl %r13d, %ebp
je 0x42e6
movl $0x1, (%r10,%r14,4)
decq %r14
addq $-0xc, %r15
jmp 0x429a
movl %r14d, %ecx
andl $0x0, (%r10,%rcx,4)
decl %r14d
testl %r14d, %r14d
jns 0x42db
incq %r8
addq $0xc, %rsi
incq %r12
addq $0xc, %rdi
movq %r9, %r14
jmp 0x4217
movq (%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/xiangzejun[P]Optimizing_Implementations_of_Linear_Layers/reduce.cpp
// Function: delete_table(int**, int)
void delete_table(int** table, int size)
{
	if(table != NULL)
	{
		for(int i = 0; i < size; i++)
			delete[] table[i];
		delete[] table;
	}
}

// Assembly:
testq %rdi, %rdi
je 0x4352
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
xorl %r15d, %r15d
testl %esi, %esi
cmovlel %r15d, %r14d
cmpq %r15, %r14
je 0x4345
movq (%rbx,%r15,8), %rdi
testq %rdi, %rdi
je 0x4340
callq 0x21b0
incq %r15
jmp 0x432d
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x21b0
retq
// File: /workspace/github_cpp_makefile_star2_O2/xiangzejun[P]Optimizing_Implementations_of_Linear_Layers/reduce.cpp
// Function: exchange_set(std::vector<xpair, std::allocator<xpair>>, int, int, xpair)
bool exchange_set(vector<xpair> seq, int start, int end, xpair p)
{
	if(start <= end)
	{
		for(int i = start; i <= end; i++)
		{
			if(!exchange(p, seq[i]))
				return false;
		}
	}
	else
	{
		for(int i = start; i >= end; i--)
		{
			if(!exchange(p, seq[i]))
				return false;
		}
	}
	return true;
}

// Assembly:
pushq %rbp
pushq %rbx
movq %rcx, %r8
shrq $0x20, %r8
movslq %esi, %r9
movslq %edx, %r10
cmpl %edx, %esi
jle 0x43a4
imulq $0xc, %r9, %rdx
cmpq %r10, %r9
setl %al
jl 0x43e2
movq (%rdi), %rsi
movq (%rsi,%rdx), %rsi
movq %rsi, %r11
shrq $0x20, %r11
cmpl %r11d, %r8d
sete %bl
cmpl %esi, %ecx
sete %bpl
orb %bl, %bpl
jne 0x439b
cmpl %r11d, %ecx
je 0x43e2
cmpl %esi, %r8d
je 0x43e2
decq %r9
addq $-0xc, %rdx
jmp 0x436a
imulq $0xc, %r9, %rdx
cmpq %r10, %r9
setg %al
jg 0x43e2
movq (%rdi), %rsi
movq (%rsi,%rdx), %rsi
movq %rsi, %r11
shrq $0x20, %r11
cmpl %r11d, %r8d
sete %bl
cmpl %esi, %ecx
sete %bpl
orb %bl, %bpl
jne 0x43d9
cmpl %r11d, %ecx
je 0x43e2
cmpl %esi, %r8d
je 0x43e2
incq %r9
addq $0xc, %rdx
jmp 0x43a8
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/xiangzejun[P]Optimizing_Implementations_of_Linear_Layers/reduce.cpp
// Function: reduce3(std::vector<xpair, std::allocator<xpair>>&, int**)
bool reduce3(vector<xpair> &seq, int** table)
{
	int s = seq.size();
	int index;

	for(int i = 0; i < s; i++)
	{
		for(int j = i + 1; j < s; j++)
		{
			if((table[i][j - 1] == 0) && (table[j][i + 1] == 0))
				break;
			if(seq[j].dst != seq[i].src)
				continue;
			if(seq[j].src != seq[i].dst)
				continue;
			if(table[i][j - 1])
				index = j - 1;
			else
				index = i;
			xpair tmp = seq[j];
			seq.erase(seq.begin() + j);
			seq.erase(seq.begin() + i);
			seq.insert(seq.begin() + index, tmp);
			int mask = seq[index].dst ^ seq[index].src;
			for(int k = index + 1; k < s; k++)
			{
				if((seq[k].dst == seq[index].dst) || (seq[k].dst == seq[index].src))
					seq[k].dst ^= mask;
				if((seq[k].src == seq[index].dst) || (seq[k].src == seq[index].src))
					seq[k].src ^= mask;
			}
			return true;
		}
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
subq %rcx, %rax
pushq $0xc
popq %rdi
cqto
idivq %rdi
movslq %eax, %r12
xorl %r13d, %r13d
testl %r12d, %r12d
movl $0x0, %edx
cmovgl %r12d, %edx
pushq $0x1
popq %rdi
cmpq %rdx, %r13
je 0x4fdf
movslq %edi, %rbp
imulq $0xc, %rbp, %rax
addq %rcx, %rax
leaq 0x1(%r13), %r8
imulq $0xc, %r13, %r14
leaq (%rcx,%r14), %r9
cmpq %r12, %rbp
jge 0x4f44
movq (%rsi,%r13,8), %r10
movl -0x4(%r10,%rbp,4), %r10d
testl %r10d, %r10d
jne 0x4f29
movq (%rsi,%rbp,8), %r11
cmpl $0x0, (%r11,%r8,4)
je 0x4f44
movl 0x4(%rax), %r11d
cmpl (%r9), %r11d
jne 0x4f3b
movl (%rax), %r11d
cmpl 0x4(%r9), %r11d
je 0x4f4b
incq %rbp
addq $0xc, %rax
jmp 0x4f0b
incl %edi
movq %r8, %r13
jmp 0x4eec
decl %ebp
testl %r10d, %r10d
cmoveq %r13, %rbp
movl 0x8(%rax), %ecx
leaq 0x8(%rsp), %r15
movl %ecx, 0x8(%r15)
movq (%rax), %rcx
movq %rcx, (%r15)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5760
addq (%rbx), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5760
movslq %ebp, %r14
imulq $0xc, %r14, %rbp
movq (%rbx), %rsi
addq %rbp, %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x579a
movq (%rbx), %rcx
leaq (%rcx,%rbp), %rax
addq %rbp, %rcx
addq $0x10, %rcx
movl -0xc(%rcx), %esi
movl -0x10(%rcx), %edx
xorl %esi, %edx
incq %r14
cmpq %r12, %r14
jge 0x4fdf
movl (%rcx), %edi
cmpl %esi, %edi
je 0x4fbf
cmpl (%rax), %edi
jne 0x4fc6
xorl %edx, %edi
movl %edi, (%rcx)
movl 0x4(%rax), %esi
movl -0x4(%rcx), %edi
cmpl %esi, %edi
je 0x4fd1
cmpl (%rax), %edi
jne 0x4fd6
xorl %edx, %edi
movl %edi, -0x4(%rcx)
incq %r14
addq $0xc, %rcx
jmp 0x4fb0
cmpq %r12, %r13
setl %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/xiangzejun[P]Optimizing_Implementations_of_Linear_Layers/reduce.cpp
// Function: get_equivalent_seq(std::vector<xpair, std::allocator<xpair>>&, int, int)
void get_equivalent_seq(vector<xpair> &seq, int gap, int start)
{

	vector<ROW> m;
	bitset<SIZE> tmp;
	for (int i = 0; i < SIZE; i++)
	{
		tmp = 0;
		tmp[SIZE - 1 - i]=1;
		m.push_back(tmp);
	}
	for(int i = start + gap - 1; i >= start; i--)
	{
		m[seq[i].dst] ^= m[seq[i].src];
	}

	vector<xpair> seq_here(strgy3(m));
 	seq.erase(seq.begin() + start, seq.begin() + start + gap);
 	seq.insert(seq.begin() + start, seq_here.begin(), seq_here.end());
 	int tab[SIZE] = {0};
 	build_table(m, tab);
 	update_seq(seq, tab, start + seq_here.size());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %edx, %ebx
movq %rsi, 0x20(%rsp)
movq %rdi, %r14
movq %rsp, %r12
andq $0x0, 0x10(%r12)
leaq 0x28(%rsp), %r13
andq $0x0, (%r13)
xorps %xmm0, %xmm0
movaps %xmm0, (%r12)
pushq $0x1f
popq %rbp
pushq $0x1
popq %r15
cmpq $-0x1, %rbp
je 0x52cc
movq %r15, %rax
movl %ebp, %ecx
shlq %cl, %rax
movq %rax, 0x28(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x3a20
decq %rbp
jmp 0x52a9
movq 0x20(%rsp), %r15
leal (%rbx,%r15), %ecx
movq (%r14), %rdx
movq (%rsp), %rax
movslq %ecx, %rcx
movslq %ebx, %r12
imulq $0xc, %rcx, %rsi
addq %rsi, %rdx
addq $-0x8, %rdx
cmpq %r12, %rcx
jle 0x530a
decq %rcx
movslq -0x4(%rdx), %rsi
movslq (%rdx), %rdi
movq (%rax,%rsi,8), %rsi
xorq %rsi, (%rax,%rdi,8)
addq $-0xc, %rdx
jmp 0x52ed
leaq 0x30(%rsp), %rdi
movq %rsp, %rsi
callq 0x328b
imulq $0xc, %r12, %r12
movq (%r14), %rsi
addq %r12, %rsi
movslq %r15d, %rax
imulq $0xc, %rax, %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x5810
addq (%r14), %r12
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %rcx
movq %r14, %rdi
movq %r12, %rsi
callq 0x39d4
xorps %xmm0, %xmm0
movaps %xmm0, 0xd0(%rsp)
movaps %xmm0, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
leaq 0x48(%rsp), %rdi
movq %rsp, %rsi
callq 0x29e4
leaq 0x48(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x3135
leaq 0x48(%rsp), %rdi
callq 0x2bbe
leaq 0x30(%rsp), %r15
movq 0x8(%r15), %rax
subq (%r15), %rax
pushq $0xc
popq %rcx
cqto
idivq %rcx
addl %eax, %ebx
leaq 0x60(%rsp), %rsi
movq %r14, %rdi
movl %ebx, %edx
callq 0x5229
movq %r15, %rdi
callq 0x2c54
movq %rsp, %rdi
callq 0x2bbe
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x2bbe
jmp 0x540b
jmp 0x5408
jmp 0x5408
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2c54
jmp 0x541c
jmp 0x5419
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2bbe
movq %rbx, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O2/xiangzejun[P]Optimizing_Implementations_of_Linear_Layers/reduce.cpp
// Function: check_consistence(std::vector<xpair, std::allocator<xpair>>)
bool check_consistence(vector<xpair> seq)
{
	vector<ROW> m = get_matrix();
	for(int i = 0; i < seq.size(); i++)
		m[seq[i].dst] ^= m[seq[i].src];
	if(get_ones(m) == SIZE)
		return true;
	else
		return false;

}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x3f58
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
subq %rcx, %rax
pushq $0xc
popq %rsi
cqto
idivq %rsi
movq (%r14), %rdx
addq $0x4, %rcx
xorl %esi, %esi
cmpq %rsi, %rax
jbe 0x549c
movslq -0x4(%rcx), %rdi
movslq (%rcx), %r8
movq (%rdx,%rdi,8), %rdi
xorq %rdi, (%rdx,%r8,8)
incq %rsi
addq $0xc, %rcx
jmp 0x547f
leaq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x29e4
leaq 0x8(%rsp), %rdi
callq 0x3732
cmpl $0x20, %eax
sete %bl
leaq 0x8(%rsp), %rdi
callq 0x2bbe
leaq 0x20(%rsp), %rdi
callq 0x2bbe
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2bbe
jmp 0x54eb
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2bbe
movq %rbx, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/sampler_test.cpp
// Function: printUsage()
void
printUsage()
{
  std::cout << "Usage: sampler_test [parameters] base_name weights" << std::endl;
  std::cout << "  -b   Use backward edge weights (locate for LF, display for Psi)." << std::endl;
  std::cout << "  -g#  Select # (float) part of samples greedily, and the rest at regular intervals." << std::endl;
  std::cout << "  -m#  Multiply weights by # (float)." << std::endl;
  std::cout << "  -t#  Use # threads." << std::endl;
  std::cout << "  -w   Write the sampled positions into sample file." << std::endl;
}

// Assembly:
pushq %rbx
movq 0x190ac(%rip), %rbx     # 0x1cfd0
leaq 0xf1a6(%rip), %rsi      # 0x130d1
movq %rbx, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3100
leaq 0xf1c2(%rip), %rsi      # 0x13104
movq %rbx, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3100
leaq 0xf1ee(%rip), %rsi      # 0x13147
movq %rbx, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3100
leaq 0xf22c(%rip), %rsi      # 0x1319c
movq %rbx, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3100
leaq 0xf23b(%rip), %rsi      # 0x131c2
movq %rbx, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3100
leaq 0xf23a(%rip), %rsi      # 0x131d8
movq %rbx, %rdi
callq 0x3200
movq %rax, %rdi
popq %rbx
jmp 0x3100
// File: /workspace/github_cpp_makefile_star2_O2/adamnovak[P]rlcsa/rlcsa.cpp
// Function: CSA::RLCSA::RLCSA(unsigned char*, unsigned int, unsigned int, unsigned int, unsigned int, bool)
RLCSA::RLCSA(uchar* data, usint bytes, usint block_size, usint sa_sample_rate, usint threads, bool delete_data) :
  ok(false),
  alphabet(0),
  sa_samples(0), support_locate(false), support_display(false),
  sample_rate(sa_sample_rate), end_points(0)
{
  for(usint c = 0; c < CHARS; c++) { this->array[c] = 0; }
 
  if(!data || bytes == 0)
  {
    std::cerr << "RLCSA: No input data given!" << std::endl;
    if(delete_data) { delete[] data; }
    return;
  }
  if(block_size < 2 * sizeof(usint) || block_size % sizeof(usint) != 0)
  {
    std::cerr << "RLCSA: Block size must be a multiple of " << sizeof(usint) << " bytes!" << std::endl;
    if(delete_data) { delete[] data; }
    return;
  }

  this->buildRLCSA(data, 0, bytes, block_size, threads, 0, true, delete_data);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %ecx, %eax
movl %edx, %ecx
movq %rsi, %rbx
movb 0x40(%rsp), %bpl
movb $0x0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x808(%rdi)
andw $0x0, 0x818(%rdi)
movl %r8d, 0x81c(%rdi)
andq $0x0, 0x828(%rdi)
pushq $0x1
popq %rdx
cmpq $0x101, %rdx            # imm = 0x101
je 0x4fa0
andq $0x0, (%rdi,%rdx,8)
incq %rdx
jmp 0x4f8d
testq %rbx, %rbx
sete %dl
testl %ecx, %ecx
sete %sil
orb %dl, %sil
je 0x4fde
testq %rbx, %rbx
sete %r14b
movq 0x18031(%rip), %rdi     # 0x1cff0
leaq 0xe3b6(%rip), %rsi      # 0x1337c
callq 0x3200
movq %rax, %rdi
callq 0x3100
xorb $0x1, %bpl
orb %r14b, %bpl
je 0x504d
jmp 0x505d
cmpl $0x8, %eax
setae %dl
testb $0x3, %al
sete %sil
testb %sil, %dl
je 0x5013
movzbl %bpl, %edx
andq $0x0, (%rsp)
movl %edx, 0x10(%rsp)
movl $0x1, 0x8(%rsp)
movq %rbx, %rsi
xorl %edx, %edx
movl %eax, %r8d
callq 0x5066
jmp 0x505d
movq 0x17fd6(%rip), %rdi     # 0x1cff0
leaq 0xe377(%rip), %rsi      # 0x13398
callq 0x3200
pushq $0x4
popq %rsi
movq %rax, %rdi
callq 0x3160
leaq 0xe389(%rip), %rsi      # 0x133c1
movq %rax, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3100
testb %bpl, %bpl
je 0x505d
movq %rbx, %rdi
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x32b0
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq