// File: /workspace/github_cpp_makefile_star2_O3/JainamS1996[P]Btree_DataStructure/final.cpp
// Function: main
int main(int argc, char *argv[]) {
    int z;
    ifstream file(argv[1]);

    if (file.fail()) {
        //cout<<"File not found";
        exit(1);
    }
    ofstream o_file("output_file.txt");

    string line;
    //PARSING THE INPUT
    
    while (getline(file, line)) {
        
        int i=0;
        int x=0;
        int y=0;
        double a=0;
        double b=0;
        string temp = "";
        string temp2 = "";

        if (isdigit(line[0])) {
      		istringstream buffer(line);
        	int value;
        	buffer >> value;
        	order = value;
        }

        if (line.substr(0,1)=="I")
        {
            if(line.substr(7,1)=="-")
            {
                for (i = 8;line.substr(i,1)!= ",";i++)
                {
                    x++;
                    
                }
                temp = line.substr(8,x);
                a = -stod(temp);
            }
            else {
                for (i = 7;line.substr(i,1)!= ",";i++)
                {
                    x++;
                }
                temp = line.substr(7,x);
                a = stod(temp);
            }
            
			y=i+1;
            x=0;
            
			for (i = y; line.substr(i,1)!=")";i++)
            {
                x++;
            }

            temp2 = line.substr(y,x);
			//cout << "inserting " << a << " "<< temp2 << " " <<endl; 
            insertNode(rootNode,a,temp2);
        }
        if (line.substr(0,1)=="S")
        {
            if(line.substr(7,1)=="-")
            {
                for (i = 8;line.substr(i,1)!= "," && line.substr(i,1)!=")";i++)
                {
                    x++;
                }
                temp = line.substr(8,x);
                a = -stod(temp);
            }
            else {
                for (i = 7;line.substr(i,1)!= "," && line.substr(i,1)!=")";i++)
                {
                    x++;
                }
                temp = line.substr(7,x);
                a = stod(temp);
            }

            if (line.substr(i,1)==",") {
                y=i+1;
                x=0;
                if (line.substr(y,1)=="-") {
                    y=y+1;
                    for (i = y; line.substr(i,1)!=")";i++)
                    {
                        x++;
                    }
                    temp2 = line.substr(y,x);
                    b = -stod(temp2);
                }
                else {
                    for (i = y; line.substr(i,1)!=")";i++)
                    {
                        x++;
                    }
                    temp2 = line.substr(y,x);
                    b = stod(temp2);
                }
				search(rootNode,a,b,o_file);
            }
            else {
				search(rootNode,a,o_file);
            }
        }
    }
    
    file.close();
    o_file.close();
    
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x648, %rsp            # imm = 0x648
movq 0x8(%rsi), %rsi
leaq -0x470(%rbp), %r13
movq %r13, %rdi
movl $0x8, %edx
callq 0x22e0
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x450(%rbp,%rax)
jne 0x3fd9
leaq 0x2ac3(%rip), %rsi      # 0x602a
leaq -0x670(%rbp), %rdi
movl $0x10, %edx
callq 0x21c0
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x258(%rbp), %r15
leaq -0x268(%rbp), %r14
movq -0x470(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %edx
movq %r13, %rdi
leaq -0x48(%rbp), %rsi
callq 0x22f0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
leaq 0x2a56(%rip), %rsi      # 0x6029
jne 0x3ed5
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x68(%rbp), %rdi
movq %rsi, %rbx
movq %rsi, %rdx
callq 0x5e70
leaq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x88(%rbp), %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x5e70
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0x3663
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
movl $0x8, %edx
callq 0x22b0
movq %r14, %rdi
leaq -0xc8(%rbp), %rsi
callq 0x20f0
movl -0xc8(%rbp), %eax
movl %eax, 0x5b48(%rip)      # 0x9190
movq %r14, %rdi
movq 0x597e(%rip), %rsi      # 0x8fd0
callq 0x2210
leaq -0x1f0(%rbp), %rdi
callq 0x20a0
movl $0x1, %ecx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
xorl %edx, %edx
callq 0x21b0
movq %r14, %rdi
leaq 0x29ba(%rip), %rsi      # 0x603a
callq 0x2090
movl %eax, %ebx
movq -0x268(%rbp), %rdi
cmpq %r15, %rdi
je 0x3698
callq 0x2180
xorl %r12d, %r12d
testl %ebx, %ebx
jne 0x3963
movl $0x7, %edx
movl $0x1, %ecx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
callq 0x21b0
movq %r14, %rdi
leaq 0x2979(%rip), %rsi      # 0x603c
callq 0x2090
movl %eax, %ebx
movq -0x268(%rbp), %rdi
cmpq %r15, %rdi
je 0x36db
callq 0x2180
testl %ebx, %ebx
je 0x37a2
movl $0x7, %r12d
movl $0x1, %ecx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
movq %r12, %rdx
callq 0x21b0
movq %r14, %rdi
leaq 0x2919(%rip), %rsi      # 0x6020
callq 0x2090
movl %eax, %ebx
movq -0x268(%rbp), %rdi
cmpq %r15, %rdi
je 0x371f
callq 0x2180
testl %ebx, %ebx
je 0x3728
incq %r12
jmp 0x36e9
leaq -0x7(%r12), %rcx
movl $0x7, %edx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
callq 0x21b0
leaq -0x68(%rbp), %rdi
movq %r14, %rsi
callq 0x21f0
movq -0x268(%rbp), %rdi
cmpq %r15, %rdi
je 0x375b
callq 0x2180
movq -0x68(%rbp), %rbx
callq 0x2050
movq %rax, %r13
movl (%rax), %r15d
movl $0x0, (%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2130
cmpq %rbx, -0x268(%rbp)
je 0x3f55
movl (%r13), %eax
testl %eax, %eax
je 0x3859
cmpl $0x22, %eax
jne 0x386a
jmp 0x3f85
movl $0x8, %r12d
movl $0x1, %ecx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
movq %r12, %rdx
callq 0x21b0
movq %r14, %rdi
leaq 0x285a(%rip), %rsi      # 0x6020
callq 0x2090
movl %eax, %ebx
movq -0x268(%rbp), %rdi
cmpq %r15, %rdi
je 0x37de
callq 0x2180
testl %ebx, %ebx
je 0x37e7
incq %r12
jmp 0x37a8
leaq -0x8(%r12), %rcx
movl $0x8, %edx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
callq 0x21b0
leaq -0x68(%rbp), %rdi
movq %r14, %rsi
callq 0x21f0
movq -0x268(%rbp), %rdi
cmpq %r15, %rdi
je 0x381a
callq 0x2180
movq -0x68(%rbp), %rbx
callq 0x2050
movq %rax, %r13
movl (%rax), %r15d
movl $0x0, (%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2130
cmpq %rbx, -0x268(%rbp)
je 0x3f6d
movl (%r13), %eax
testl %eax, %eax
je 0x385f
cmpl $0x22, %eax
jne 0x3863
jmp 0x3fa9
movl %r15d, (%r13)
jmp 0x386a
movl %r15d, (%r13)
xorps 0x27a6(%rip), %xmm0     # 0x6010
movaps %xmm0, -0xa0(%rbp)
leaq 0x1(%r12), %r15
movl %r12d, %r13d
incq %r13
xorl %r12d, %r12d
leaq (%r12,%r13), %rdx
movl $0x1, %ecx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
callq 0x21b0
movq %r14, %rdi
leaq 0x281f(%rip), %rsi      # 0x60bd
callq 0x2090
movl %eax, %ebx
movq -0x268(%rbp), %rdi
leaq -0x258(%rbp), %rax
cmpq %rax, %rdi
je 0x38bd
callq 0x2180
testl %ebx, %ebx
je 0x38c6
incq %r12
jmp 0x387f
movl %r15d, %edx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
movq %r12, %rcx
callq 0x21b0
leaq -0x88(%rbp), %rdi
movq %r14, %rsi
callq 0x21f0
movq -0x268(%rbp), %rdi
leaq -0x258(%rbp), %r15
cmpq %r15, %rdi
leaq -0x470(%rbp), %r13
je 0x3906
callq 0x2180
movq 0x58a3(%rip), %rbx      # 0x91b0
leaq -0xd8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
addq %rsi, %rdx
leaq -0xe8(%rbp), %rdi
callq 0x42a0
movq %rbx, %rdi
movaps -0xa0(%rbp), %xmm0
leaq -0xe8(%rbp), %rsi
callq 0x2d13
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x3963
callq 0x2180
movl $0x1, %ecx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
xorl %edx, %edx
callq 0x21b0
movq %r14, %rdi
leaq 0x26be(%rip), %rsi      # 0x603e
callq 0x2090
movl %eax, %ebx
movq -0x268(%rbp), %rdi
cmpq %r15, %rdi
je 0x3998
callq 0x2180
testl %ebx, %ebx
jne 0x3ea5
movl $0x7, %edx
movl $0x1, %ecx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
callq 0x21b0
movq %r14, %rdi
leaq 0x267c(%rip), %rsi      # 0x603c
callq 0x2090
movl %eax, %ebx
movq -0x268(%rbp), %rdi
cmpq %r15, %rdi
je 0x39d8
callq 0x2180
testl %ebx, %ebx
je 0x3af5
movl $0x7, %r13d
movl $0x1, %ecx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
movq %r13, %rdx
callq 0x21b0
movq %r14, %rdi
leaq 0x261c(%rip), %rsi      # 0x6020
callq 0x2090
testl %eax, %eax
je 0x3a56
movl $0x1, %ecx
leaq -0xc8(%rbp), %rbx
movq %rbx, %rdi
leaq -0x48(%rbp), %rsi
movq %r13, %rdx
callq 0x21b0
movq %rbx, %rdi
leaq 0x268b(%rip), %rsi      # 0x60bd
callq 0x2090
testl %eax, %eax
setne %bl
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x3a58
callq 0x2180
jmp 0x3a58
xorl %ebx, %ebx
movq -0x268(%rbp), %rdi
cmpq %r15, %rdi
je 0x3a69
callq 0x2180
testb %bl, %bl
je 0x3a75
incq %r13
jmp 0x39e6
movl %r12d, %eax
leaq (%rax,%r13), %rcx
addq $-0x7, %rcx
movl $0x7, %edx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
callq 0x21b0
leaq -0x68(%rbp), %rdi
movq %r14, %rsi
callq 0x21f0
movq -0x268(%rbp), %rdi
cmpq %r15, %rdi
je 0x3aae
callq 0x2180
movq -0x68(%rbp), %rbx
callq 0x2050
movq %rax, %r12
movl (%rax), %r15d
movl $0x0, (%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2130
cmpq %rbx, -0x268(%rbp)
je 0x3f61
movl (%r12), %eax
testl %eax, %eax
je 0x3c02
cmpl $0x22, %eax
jne 0x3c13
jmp 0x3f91
movl $0x8, %r13d
movl $0x1, %ecx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
movq %r13, %rdx
callq 0x21b0
movq %r14, %rdi
leaq 0x2507(%rip), %rsi      # 0x6020
callq 0x2090
testl %eax, %eax
je 0x3b6b
movl $0x1, %ecx
leaq -0xc8(%rbp), %rbx
movq %rbx, %rdi
leaq -0x48(%rbp), %rsi
movq %r13, %rdx
callq 0x21b0
movq %rbx, %rdi
leaq 0x2576(%rip), %rsi      # 0x60bd
callq 0x2090
testl %eax, %eax
setne %bl
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x3b6d
callq 0x2180
jmp 0x3b6d
xorl %ebx, %ebx
movq -0x268(%rbp), %rdi
cmpq %r15, %rdi
je 0x3b7e
callq 0x2180
testb %bl, %bl
je 0x3b8a
incq %r13
jmp 0x3afb
movl %r12d, %eax
leaq (%rax,%r13), %rcx
addq $-0x8, %rcx
movl $0x8, %edx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
callq 0x21b0
leaq -0x68(%rbp), %rdi
movq %r14, %rsi
callq 0x21f0
movq -0x268(%rbp), %rdi
cmpq %r15, %rdi
je 0x3bc3
callq 0x2180
movq -0x68(%rbp), %rbx
callq 0x2050
movq %rax, %r12
movl (%rax), %r15d
movl $0x0, (%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2130
cmpq %rbx, -0x268(%rbp)
je 0x3f79
movl (%r12), %eax
testl %eax, %eax
je 0x3c08
cmpl $0x22, %eax
jne 0x3c0c
jmp 0x3fb5
movl %r15d, (%r12)
jmp 0x3c13
movl %r15d, (%r12)
xorps 0x23fd(%rip), %xmm0     # 0x6010
movaps %xmm0, -0xa0(%rbp)
movl %r13d, %r12d
movl $0x1, %ecx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
movq %r12, %rdx
callq 0x21b0
leaq -0x258(%rbp), %r15
movq %r14, %rdi
leaq 0x23de(%rip), %rsi      # 0x6020
callq 0x2090
movl %eax, %ebx
movq -0x268(%rbp), %rdi
cmpq %r15, %rdi
je 0x3c5a
callq 0x2180
testl %ebx, %ebx
je 0x3c84
movq 0x554b(%rip), %rdi      # 0x91b0
movaps -0xa0(%rbp), %xmm0
leaq -0x670(%rbp), %rsi
callq 0x3032
leaq -0x470(%rbp), %r13
jmp 0x3ea5
leal 0x1(%r13), %edx
movl $0x1, %ecx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
movq %rdx, -0xa8(%rbp)
callq 0x21b0
movq %r14, %rdi
leaq 0x2392(%rip), %rsi      # 0x603c
callq 0x2090
movl %eax, %ebx
movq -0x268(%rbp), %rdi
cmpq %r15, %rdi
je 0x3cc2
callq 0x2180
testl %ebx, %ebx
je 0x3d9b
incq %r12
xorl %ebx, %ebx
leaq (%r12,%rbx), %rdx
movl $0x1, %ecx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
callq 0x21b0
movq %r14, %rdi
leaq 0x23cf(%rip), %rsi      # 0x60bd
callq 0x2090
movl %eax, %r13d
movq -0x268(%rbp), %rdi
cmpq %r15, %rdi
je 0x3d07
callq 0x2180
testl %r13d, %r13d
je 0x3d11
incq %rbx
jmp 0x3ccf
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq %rbx, %rcx
callq 0x21b0
leaq -0x470(%rbp), %r13
leaq -0x88(%rbp), %rdi
movq %r14, %rsi
callq 0x21f0
movq -0x268(%rbp), %rdi
cmpq %r15, %rdi
je 0x3d4e
callq 0x2180
movq -0x88(%rbp), %rbx
callq 0x2050
movq %rax, %r12
movl (%rax), %r15d
movl $0x0, (%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2130
cmpq %rbx, -0x268(%rbp)
je 0x3f9d
movaps %xmm0, %xmm1
movl (%r12), %eax
testl %eax, %eax
je 0x3e73
cmpl $0x22, %eax
jne 0x3e84
jmp 0x3fcd
addq $0x2, %r13
addq $0x2, %r12
xorl %ebx, %ebx
leaq (%r12,%rbx), %rdx
movl $0x1, %ecx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
callq 0x21b0
movq %r14, %rdi
leaq 0x22f9(%rip), %rsi      # 0x60bd
callq 0x2090
movl %eax, %r15d
movq -0x268(%rbp), %rdi
leaq -0x258(%rbp), %rax
cmpq %rax, %rdi
je 0x3de4
callq 0x2180
testl %r15d, %r15d
je 0x3dee
incq %rbx
jmp 0x3da5
movl %r13d, %edx
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
movq %rbx, %rcx
callq 0x21b0
leaq -0x258(%rbp), %rbx
leaq -0x88(%rbp), %rdi
movq %r14, %rsi
callq 0x21f0
movq -0x268(%rbp), %rdi
cmpq %rbx, %rdi
leaq -0x470(%rbp), %r13
je 0x3e2e
callq 0x2180
movq -0x88(%rbp), %rbx
callq 0x2050
movq %rax, %r12
movl (%rax), %r15d
movl $0x0, (%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2130
cmpq %rbx, -0x268(%rbp)
je 0x3fc1
movaps %xmm0, %xmm1
movl (%r12), %eax
testl %eax, %eax
je 0x3e79
cmpl $0x22, %eax
jne 0x3e7d
jmp 0x3fe3
movl %r15d, (%r12)
jmp 0x3e84
movl %r15d, (%r12)
xorps 0x218c(%rip), %xmm1     # 0x6010
movq 0x5325(%rip), %rdi      # 0x91b0
movaps -0xa0(%rbp), %xmm0
leaq -0x670(%rbp), %rsi
callq 0x3271
leaq -0x258(%rbp), %r15
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x3eba
callq 0x2180
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x3599
callq 0x2180
jmp 0x3599
leaq -0x470(%rbp), %rdi
callq 0x2060
leaq -0x670(%rbp), %rdi
callq 0x2200
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x3eff
callq 0x2180
movq 0x50c2(%rip), %rax      # 0x8fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x668(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x670(%rbp,%rcx)
callq 0x2160
leaq -0x578(%rbp), %rdi
callq 0x20a0
leaq -0x470(%rbp), %rdi
callq 0x2070
xorl %eax, %eax
addq $0x648, %rsp            # imm = 0x648
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20ea(%rip), %rdi      # 0x6046
callq 0x20e0
leaq 0x20de(%rip), %rdi      # 0x6046
callq 0x20e0
leaq 0x20d2(%rip), %rdi      # 0x6046
callq 0x20e0
leaq 0x20c6(%rip), %rdi      # 0x6046
callq 0x20e0
leaq 0x20ba(%rip), %rdi      # 0x6046
callq 0x2220
leaq 0x20ae(%rip), %rdi      # 0x6046
callq 0x2220
leaq 0x20a2(%rip), %rdi      # 0x6046
callq 0x20e0
leaq 0x2096(%rip), %rdi      # 0x6046
callq 0x2220
leaq 0x208a(%rip), %rdi      # 0x6046
callq 0x2220
leaq 0x207e(%rip), %rdi      # 0x6046
callq 0x20e0
leaq 0x2072(%rip), %rdi      # 0x6046
callq 0x2220
movl $0x1, %edi
callq 0x21e0
leaq 0x205c(%rip), %rdi      # 0x6046
callq 0x2220
movq %rax, %rbx
jmp 0x4116
jmp 0x40ce
jmp 0x40a7
jmp 0x4027
jmp 0x40ce
jmp 0x4027
jmp 0x40ce
jmp 0x40ce
jmp 0x40ce
jmp 0x4027
jmp 0x403e
jmp 0x40ce
jmp 0x40ce
movq %rax, %rbx
cmpl $0x0, (%r12)
jne 0x40d1
movl %r15d, (%r12)
jmp 0x40d1
movq %rax, %rbx
cmpl $0x0, (%r13)
jne 0x40d1
movl %r15d, (%r13)
jmp 0x40d1
jmp 0x40ce
jmp 0x40ce
movq %rax, %rbx
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
jne 0x40c3
jmp 0x40d1
jmp 0x40ce
jmp 0x40ce
jmp 0x40ce
movq %rax, %rbx
movq 0x4f52(%rip), %rsi      # 0x8fd0
leaq -0x268(%rbp), %rdi
callq 0x2210
leaq -0x1f0(%rbp), %rdi
callq 0x20a0
jmp 0x40d1
jmp 0x40ce
jmp 0x40ce
movq %rax, %rbx
jmp 0x40e6
jmp 0x40ce
jmp 0x40a7
jmp 0x40ce
movq %rax, %rbx
jmp 0x40f8
jmp 0x40ce
jmp 0x40b4
jmp 0x40ce
jmp 0x40ce
movq %rax, %rbx
movq -0x268(%rbp), %rdi
cmpq %r15, %rdi
je 0x40d1
callq 0x2180
jmp 0x40d1
jmp 0x40ce
jmp 0x40ce
movq %rax, %rbx
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x40e6
callq 0x2180
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x40f8
callq 0x2180
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x410a
callq 0x2180
leaq -0x670(%rbp), %rdi
callq 0x2240
leaq -0x470(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x22c0