// File: /workspace/github_cpp_makefile_star2_O2/cmirnov[P]triangular-arbitrage/exchange.cpp
// Function: Exchange::Exchange(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>)
Exchange::Exchange(std::string url, std::vector<std::string> currency) {
	converter = new Converter(currency);

	matrix.resize(currency.size());
	for (int i = 0; i < currency.size(); ++i) {
		for (int j = 0; j < currency.size(); ++j) {
			if (i != j) {
				matrix[i].push_back(new Orderbook(converter->nameToInt(currency[i]), converter->nameToInt(currency[j]), url));
				matrix[i].back()->update();
			} else {
				matrix[i].push_back(NULL);
			}
		}
	}

	sellFee.resize(currency.size());
	buyFee.resize(currency.size());
	for (int i = 0; i < currency.size(); ++i) {
		sellFee[i] = 1.5;
		buyFee[i] = 2.5;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdx, %rbx
movq %rsi, -0x70(%rbp)
leaq 0x8(%rdi), %rax
movq %rax, -0x40(%rbp)
leaq 0x20(%rdi), %rax
movq %rax, -0x38(%rbp)
leaq 0x38(%rdi), %rax
movq %rax, -0x30(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rdi)
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x8(%rdi)
movq %rdi, -0x48(%rbp)
andq $0x0, 0x48(%rdi)
pushq $0x18
popq %rdi
callq 0x2150
movq %rax, %r14
leaq -0xa8(%rbp), %rdi
movq %rbx, -0x58(%rbp)
movq %rbx, %rsi
callq 0x2b2e
leaq -0xa8(%rbp), %rsi
movq %r14, %rdi
callq 0x3ebc
movq -0x48(%rbp), %rax
movq %r14, (%rax)
leaq -0xa8(%rbp), %rdi
callq 0x2b82
movq -0x58(%rbp), %r14
movq 0x8(%r14), %rsi
subq (%r14), %rsi
sarq $0x5, %rsi
movq -0x30(%rbp), %rdi
callq 0x2bae
movq (%r14), %r15
movq 0x8(%r14), %rax
xorl %ebx, %ebx
movq %rax, %rsi
subq %r15, %rsi
sarq $0x5, %rsi
cmpq %rbx, %rsi
jbe 0x2617
imulq $0x18, %rbx, %r12
movq %rbx, %rcx
shlq $0x5, %rcx
movq %rcx, -0x88(%rbp)
movq $0x0, -0x68(%rbp)
xorl %edx, %edx
movq %rbx, -0x80(%rbp)
movq %r12, -0x78(%rbp)
movq %rax, %rcx
subq %r15, %rcx
sarq $0x5, %rcx
cmpq %rdx, %rcx
jbe 0x260f
movq -0x30(%rbp), %rax
movq (%rax), %r13
addq %r12, %r13
movq %rdx, -0x90(%rbp)
cmpq %rdx, %rbx
jne 0x2512
andq $0x0, -0x50(%rbp)
movq %r13, %rdi
leaq -0x50(%rbp), %rsi
callq 0x327c
jmp 0x25f4
pushq $0x40
popq %rdi
callq 0x2150
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rbx
addq -0x88(%rbp), %r15
leaq -0xe8(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2180
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3f7a
leaq -0xc8(%rbp), %r12
movl %eax, %r15d
movq -0x48(%rbp), %rax
movq (%rax), %rbx
movq (%r14), %rsi
addq -0x68(%rbp), %rsi
movq %r12, %rdi
callq 0x2180
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3f7a
leaq -0x108(%rbp), %r12
movl %eax, %ebx
movq %r12, %rdi
movq -0x70(%rbp), %rsi
callq 0x2180
movb $0x1, %r14b
movl %r15d, %esi
movq -0x60(%rbp), %r15
movq %r15, %rdi
movl %ebx, %edx
movq %r12, %rcx
callq 0x4200
movq %r15, -0x50(%rbp)
xorl %r14d, %r14d
movq %r13, %rdi
leaq -0x50(%rbp), %rsi
callq 0x327c
movq %r12, %rdi
callq 0x2080
leaq -0xc8(%rbp), %rdi
callq 0x2080
leaq -0xe8(%rbp), %rdi
callq 0x2080
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x78(%rbp), %r12
movq 0x8(%rax,%r12), %rax
movq -0x8(%rax), %rdi
callq 0x4264
movq -0x58(%rbp), %r14
movq -0x80(%rbp), %rbx
movq -0x90(%rbp), %rdx
incq %rdx
movq (%r14), %r15
movq 0x8(%r14), %rax
addq $0x20, -0x68(%rbp)
jmp 0x24d3
incq %rbx
jmp 0x249c
movq -0x40(%rbp), %rdi
callq 0x2bf0
movq 0x8(%r14), %rsi
subq (%r14), %rsi
sarq $0x5, %rsi
movq -0x38(%rbp), %rdi
callq 0x2bf0
movq 0x8(%r14), %rax
subq (%r14), %rax
sarq $0x5, %rax
movq -0x40(%rbp), %rcx
movq (%rcx), %rcx
movq -0x38(%rbp), %rdx
movq (%rdx), %rdx
xorl %esi, %esi
flds 0x29af(%rip)            # 0x5004
flds 0x29ad(%rip)            # 0x5008
subq $0x1, %rax
jb 0x2671
fld %st(1)
fstpt (%rcx,%rsi)
fld %st(0)
fstpt (%rdx,%rsi)
addq $0x10, %rsi
jmp 0x265b
fstp %st(1)
fstp %st(0)
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x2b82
jmp 0x269b
movq %rax, %rbx
pushq $0x18
popq %rsi
movq %r14, %rdi
jmp 0x26f6
jmp 0x26ae
movq %rax, %rbx
jmp 0x26ef
jmp 0x26ae
jmp 0x26ae
movq %rax, %rbx
jmp 0x26fb
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
callq 0x2080
jmp 0x26d2
movq %rax, %rbx
movb $0x1, %r14b
jmp 0x26de
movq %rax, %rbx
movb $0x1, %r14b
leaq -0xc8(%rbp), %rdi
callq 0x2080
leaq -0xe8(%rbp), %rdi
callq 0x2080
testb %r14b, %r14b
je 0x26fb
pushq $0x40
popq %rsi
movq -0x60(%rbp), %rdi
callq 0x2160
movq -0x30(%rbp), %rdi
callq 0x2c2a
movq -0x38(%rbp), %rdi
callq 0x2de8
movq -0x40(%rbp), %rdi
callq 0x2de8
movq %rbx, %rdi
callq 0x2200