// File: /workspace/github_cpp_makefile_star2_O1/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, -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 -0x110(%rbp), %rdi
movq %rbx, %rsi
callq 0x2f6e
leaq -0x110(%rbp), %rsi
movq %r14, %rdi
callq 0x40e0
movq -0x30(%rbp), %rax
movq %r14, (%rax)
leaq -0x110(%rbp), %rdi
callq 0x3002
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
sarq $0x5, %rsi
movq -0x40(%rbp), %rdi
callq 0x306c
movq 0x8(%rbx), %rsi
movq (%rbx), %rax
subq %rax, %rsi
je 0x2817
movq $0x0, -0x38(%rbp)
movq %rbx, -0x70(%rbp)
movq (%rbx), %r12
cmpq %r12, 0x8(%rbx)
je 0x27f6
movl $0x8, %r13d
movq -0x38(%rbp), %rax
leaq (%rax,%rax,2), %rcx
movq %rcx, -0xe0(%rbp)
leaq (,%rcx,8), %rcx
movq %rcx, -0xf8(%rbp)
shlq $0x5, %rax
movq %rax, -0xe8(%rbp)
xorl %r14d, %r14d
movq -0x40(%rbp), %rax
movq (%rax), %r15
addq -0xf8(%rbp), %r15
cmpq %r14, -0x38(%rbp)
jne 0x2639
movq $0x0, -0x58(%rbp)
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
je 0x2735
movq $0x0, (%rsi)
addq $0x8, 0x8(%r15)
jmp 0x27d8
movl $0x40, %edi
callq 0x2140
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rbx
leaq -0xc0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xe8(%rbp), %rax
movq (%r12,%rax), %rsi
movq 0x8(%r12,%rax), %rdx
addq %rsi, %rdx
leaq -0xd0(%rbp), %r12
movq %r12, %rdi
callq 0x32a2
movq %rbx, %rdi
movq %r12, %rsi
callq 0x41b2
movl %eax, -0x5c(%rbp)
leaq -0xb0(%rbp), %r12
movq -0x30(%rbp), %rax
movq (%rax), %rbx
movq -0x70(%rbp), %rax
movq (%rax), %rax
leaq -0xa0(%rbp), %rcx
movq %rcx, -0xb0(%rbp)
movq -0x8(%rax,%r13), %rsi
movq (%rax,%r13), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x32a2
movq %rbx, %rdi
movq %r12, %rsi
callq 0x41b2
leaq -0x90(%rbp), %r12
movl %eax, %ebx
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0xd8(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x32a2
movq %r13, -0xf0(%rbp)
movb $0x1, %r13b
movq %r12, %rcx
movq -0x68(%rbp), %r12
movq %r12, %rdi
movl -0x5c(%rbp), %esi
movl %ebx, %edx
callq 0x44e4
movq -0x70(%rbp), %rbx
movq %r12, -0x58(%rbp)
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
je 0x2746
movq %r12, (%rsi)
addq $0x8, 0x8(%r15)
jmp 0x2755
movq %r15, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3630
jmp 0x27d8
xorl %r13d, %r13d
movq %r15, %rdi
leaq -0x58(%rbp), %rdx
callq 0x3630
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x2771
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
movq -0xf0(%rbp), %r13
je 0x279a
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x27bc
movq -0xc0(%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 0x4554
incq %r14
movq (%rbx), %r12
movq 0x8(%rbx), %rax
subq %r12, %rax
sarq $0x5, %rax
addq $0x20, %r13
cmpq %r14, %rax
ja 0x25fe
movq -0x38(%rbp), %rcx
incq %rcx
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
sarq $0x5, %rsi
movq %rcx, -0x38(%rbp)
cmpq %rcx, %rsi
ja 0x25bf
jmp 0x281b
sarq $0x5, %rsi
movq -0x50(%rbp), %rdi
callq 0x30b0
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
sarq $0x5, %rsi
movq -0x48(%rbp), %rdi
callq 0x30b0
movq 0x8(%rbx), %rax
subq (%rbx), %rax
fldz
fldz
je 0x2884
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 0x3799(%rip)            # 0x6004
flds 0x3797(%rip)            # 0x6008
fld %st(1)
fstpt (%rcx,%rsi)
fld %st(0)
fstpt (%rdx,%rsi)
addq $0x10, %rsi
decq %rax
jne 0x2871
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 -0x110(%rbp), %rdi
callq 0x3002
jmp 0x28ae
movq %rax, %rbx
movl $0x18, %esi
movq %r14, %rdi
jmp 0x2952
jmp 0x28c9
jmp 0x28c9
jmp 0x28c9
movq %rax, %rbx
movb $0x1, %r13b
jmp 0x2944
movq %rax, %rbx
jmp 0x2957
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x28f8
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2150
jmp 0x28f8
movq %rax, %rbx
movb $0x1, %r13b
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x2922
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2150
jmp 0x2922
movq %rax, %rbx
movb $0x1, %r13b
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x2944
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x2150
testb %r13b, %r13b
je 0x2957
movl $0x40, %esi
movq -0x68(%rbp), %rdi
callq 0x2150
movq -0x40(%rbp), %rdi
callq 0x30ea
movq -0x48(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x297c
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0x50(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x2998
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rsi
subq %rdi, %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x21f0