// File: /workspace/github_cpp_makefile_star2_O3/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 $0xf8, %rsp
movq %rdx, %rbx
movq %rsi, -0xd8(%rbp)
leaq 0x8(%rdi), %rax
movq %rax, -0x50(%rbp)
leaq 0x20(%rdi), %rax
movq %rax, -0x48(%rbp)
leaq 0x38(%rdi), %rax
movq %rax, -0x40(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rdi)
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x8(%rdi)
movq %rdi, -0x30(%rbp)
movq $0x0, 0x48(%rdi)
movl $0x18, %edi
callq 0x2140
movq %rax, %r14
leaq -0x118(%rbp), %rdi
movq %rbx, %rsi
callq 0x2fa2
leaq -0x118(%rbp), %rsi
movq %r14, %rdi
callq 0x4120
movq -0x30(%rbp), %rax
movq %r14, (%rax)
leaq -0x118(%rbp), %rdi
callq 0x3036
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
sarq $0x5, %rsi
movq -0x40(%rbp), %rdi
callq 0x30a4
movq (%rbx), %r12
movq 0x8(%rbx), %rax
movq %rax, %rsi
subq %r12, %rsi
je 0x281c
movq $0x0, -0x38(%rbp)
movq %rbx, -0x70(%rbp)
cmpq %r12, %rax
je 0x2822
movl $0x8, %r13d
movq -0x38(%rbp), %rax
leaq (%rax,%rax,2), %rcx
movq %rcx, -0xe0(%rbp)
leaq (,%rcx,8), %rcx
movq %rcx, -0x100(%rbp)
shlq $0x5, %rax
movq %rax, -0xe8(%rbp)
xorl %r14d, %r14d
movq -0x40(%rbp), %rax
movq (%rax), %r15
addq -0x100(%rbp), %r15
cmpq %r14, -0x38(%rbp)
jne 0x2638
movq $0x0, -0x58(%rbp)
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
je 0x273b
movq $0x0, (%rsi)
addq $0x8, 0x8(%r15)
jmp 0x27e5
movl $0x40, %edi
callq 0x2140
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rbx
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0xe8(%rbp), %rax
movq (%r12,%rax), %rsi
movq 0x8(%r12,%rax), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %r12
movq %r12, %rdi
callq 0x32e0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x41f2
movl %eax, -0x5c(%rbp)
leaq -0xd0(%rbp), %r12
movq -0x30(%rbp), %rax
movq (%rax), %rbx
movq -0x70(%rbp), %rax
movq (%rax), %rax
leaq -0xc0(%rbp), %rcx
movq %rcx, -0xd0(%rbp)
movq -0x8(%rax,%r13), %rsi
movq (%rax,%r13), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x32e0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x41f2
leaq -0xb0(%rbp), %r12
movl %eax, %ebx
leaq -0xa0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xd8(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x32e0
movq %r14, -0xf0(%rbp)
movq %r13, -0xf8(%rbp)
movb $0x1, %r14b
movq -0x68(%rbp), %r13
movq %r13, %rdi
movl -0x5c(%rbp), %esi
movl %ebx, %edx
movq %r12, %rcx
callq 0x44d4
movq -0x70(%rbp), %rbx
movq %r13, -0x58(%rbp)
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
je 0x274c
movq %r13, (%rsi)
addq $0x8, 0x8(%r15)
jmp 0x275b
movq %r15, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3672
jmp 0x27e5
xorl %r14d, %r14d
movq %r15, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3672
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x277d
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
movq -0xf8(%rbp), %r13
movq -0xf0(%rbp), %r14
je 0x27ad
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x27c9
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq -0xe0(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq -0x8(%rax), %rdi
callq 0x4544
incq %r14
movq (%rbx), %r12
movq 0x8(%rbx), %rax
movq %rax, %rsi
subq %r12, %rsi
sarq $0x5, %rsi
addq $0x20, %r13
cmpq %r14, %rsi
ja 0x25fd
movq -0x38(%rbp), %rdx
incq %rdx
movq %rdx, -0x38(%rbp)
cmpq %rdx, %rsi
ja 0x25c2
jmp 0x2824
sarq $0x5, %rsi
jmp 0x2824
xorl %esi, %esi
movq -0x50(%rbp), %rdi
callq 0x30e8
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
sarq $0x5, %rsi
movq -0x48(%rbp), %rdi
callq 0x30e8
movq 0x8(%rbx), %rax
subq (%rbx), %rax
fldz
fldz
je 0x288d
fstp %st(1)
fstp %st(0)
sarq $0x5, %rax
movq -0x50(%rbp), %rcx
movq (%rcx), %rcx
cmpq $0x1, %rax
adcq $0x0, %rax
movq -0x48(%rbp), %rdx
movq (%rdx), %rdx
xorl %esi, %esi
flds 0x3790(%rip)            # 0x6004
flds 0x378e(%rip)            # 0x6008
fld %st(1)
fstpt (%rcx,%rsi)
fld %st(0)
fstpt (%rdx,%rsi)
addq $0x10, %rsi
decq %rax
jne 0x287a
fstp %st(1)
fstp %st(0)
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
callq 0x3036
jmp 0x28b7
movq %rax, %rbx
movl $0x18, %esi
movq %r14, %rdi
jmp 0x2974
jmp 0x28d2
jmp 0x28d2
jmp 0x28d2
movq %rax, %rbx
jmp 0x296b
movq %rax, %rbx
jmp 0x2979
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x2928
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2150
jmp 0x2928
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x296b
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2150
jmp 0x296b
movq %rax, %rbx
movb $0x1, %r14b
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x294a
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x2966
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2150
testb %r14b, %r14b
je 0x2979
movl $0x40, %esi
movq -0x68(%rbp), %rdi
callq 0x2150
movq -0x40(%rbp), %rdi
callq 0x3122
movq -0x48(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x299e
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0x50(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x29ba
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rsi
subq %rdi, %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x21f0