// File: /workspace/github_cpp_makefile_star2_O3/jliesch[P]ofxget/ofxget.cc
// Function: ofxget::OfxGetContext::AddInstitution(int)
OfxGetContext& OfxGetContext::AddInstitution(int id) {
  if (is_error()) return *this;
  std::string id_str = std::to_string(id);
  string filename = "institutions.txt";
  pugi::xml_document doc;
  pugi::xml_parse_result result = doc.load_file(filename.c_str());
  if (!result) {
    error_string_ = "Could not parse " + filename;
    return *this;
  }
  auto inst = doc.find_child_by_attribute("institution", "id", id_str.c_str());
  if (inst.empty()) {
    error_string_ = "Could not find institution " + id_str;
    return *this;
  }
  std::vector<string> var_names {"org", "fid", "brokerid", "bankid", "url"};
  for (string name : var_names) {
    auto var = inst.child(name.c_str());
    if (var) {
      for (std::size_t i = 0; i < name.size(); i++) {
        name[i] = toupper(name[i]);
      }
      vars_map_[name] = var.child_value();
    }
  }
  return *this;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, %r12
cmpq $0x0, 0x38(%rdi)
jne 0x8e44
movl %esi, %r14d
movl %esi, %ebp
negl %ebp
cmovsl %esi, %ebp
movl $0x1, %r15d
cmpl $0xa, %ebp
jb 0x8adb
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x8ad2
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x8ad8
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x8adb
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x8a9f
addl $-0x3, %r15d
jmp 0x8adb
addl $-0x2, %r15d
jmp 0x8adb
decl %r15d
movq %r12, (%rsp)
shrl $0x1f, %r14d
leal (%r15,%r14), %esi
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movl $0x2d, %edx
callq 0x6400
addq (%r12), %r14
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0xa142
leaq 0x28(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x27572(%rip), %rsi     # 0x30095
leaq 0x2757b(%rip), %rdx     # 0x300a5
leaq 0x18(%rsp), %rdi
callq 0xa246
leaq 0x128(%rsp), %rdi
callq 0x22408
movq 0x18(%rsp), %rdx
leaq 0x110(%rsp), %rdi
leaq 0x128(%rsp), %rsi
movl $0x74, %ecx
xorl %r8d, %r8d
callq 0x2310a
movq (%rsp), %r12
leaq 0x110(%rsp), %rdi
callq 0x223e0
testb %al, %al
je 0x8bc1
movq 0x38(%rsp), %rcx
leaq 0x27533(%rip), %rsi     # 0x300b7
leaq 0x27559(%rip), %rdx     # 0x300e4
leaq 0x128(%rsp), %rdi
callq 0x2100c
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
callq 0x1d790
testb %al, %al
je 0x8c07
leaq 0x27513(%rip), %rsi     # 0x300c3
leaq 0x70(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x9ed9
jmp 0x8bd7
leaq 0x274de(%rip), %rsi     # 0x300a6
leaq 0x70(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x9ed9
leaq 0x30(%r12), %rdi
leaq 0x70(%rsp), %r14
movq %r14, %rsi
callq 0x6370
movq (%r14), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x8e14
callq 0x63b0
jmp 0x8e14
leaq 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x274c5(%rip), %rsi     # 0x300df
leaq 0x274c1(%rip), %rdx     # 0x300e2
leaq 0x70(%rsp), %r14
movq %r14, %rdi
callq 0xa246
leaq 0x90(%rsp), %r15
leaq 0xa0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2749a(%rip), %rsi     # 0x300e3
leaq 0x27496(%rip), %rdx     # 0x300e6
movq %r15, %rdi
callq 0xa246
leaq 0xb0(%rsp), %r15
leaq 0xc0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x27474(%rip), %rsi     # 0x300e7
leaq 0x27475(%rip), %rdx     # 0x300ef
movq %r15, %rdi
callq 0xa246
leaq 0xd0(%rsp), %r15
leaq 0xe0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x27453(%rip), %rsi     # 0x300f0
leaq 0x27452(%rip), %rdx     # 0x300f6
movq %r15, %rdi
callq 0xa246
leaq 0xf0(%rsp), %r15
leaq 0x100(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x274a5(%rip), %rsi     # 0x3016d
leaq 0x274a1(%rip), %rdx     # 0x30170
movq %r15, %rdi
callq 0xa246
leaq 0x58(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x8(%rsp), %rcx
movl $0x5, %edx
callq 0x9f5a
leaq 0x100(%rsp), %rbx
xorl %r14d, %r14d
movq 0xf0(%rsp,%r14), %rdi
leaq (%rbx,%r14), %rax
cmpq %rdi, %rax
je 0x8d11
callq 0x63b0
addq $-0x20, %r14
cmpq $-0xa0, %r14
jne 0x8cfb
movq 0x58(%rsp), %rbx
movq 0x60(%rsp), %r14
cmpq %r14, %rbx
je 0x8e01
leaq 0x8(%rsp), %r12
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xa1b0
movq 0x70(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x1d6e8
movq %rax, 0x8(%rsp)
movq %r12, %rdi
callq 0x1d638
testq %rax, %rax
je 0x8ddd
cmpq $0x0, 0x78(%rsp)
je 0x8da2
xorl %r15d, %r15d
movq 0x70(%rsp), %r13
movsbl (%r13,%r15), %edi
callq 0x6130
movb %al, (%r13,%r15)
incq %r15
cmpq 0x78(%rsp), %r15
jb 0x8d83
movq %r12, %rdi
callq 0x1da42
movq %rax, %r13
movq (%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x9f9c
movq %rax, %rbp
movq 0x8(%rax), %r15
movq %r13, %rdi
callq 0x6270
movq %rbp, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r13, %rcx
movq %rax, %r8
callq 0x6350
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x8df4
callq 0x63b0
addq $0x20, %rbx
cmpq %r14, %rbx
jne 0x8d36
leaq 0x58(%rsp), %rdi
callq 0xa030
leaq 0x28(%rsp), %rbx
movq (%rsp), %r12
leaq 0x128(%rsp), %rdi
callq 0x22494
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x8e30
callq 0x63b0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x8e44
callq 0x63b0
movq %r12, %rax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq $-0xa0, %r14
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x8e72
callq 0x63b0
addq $-0x20, %r12
addq $0x20, %r14
jne 0x8e63
jmp 0x8eeb
jmp 0x8e84
jmp 0x8e84
jmp 0x8e84
movq %rax, %rbx
addq $-0x10, %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x8e99
callq 0x63b0
leaq -0x20(%r15), %rax
addq $-0x10, %r15
cmpq %r14, %r15
movq %rax, %r15
jne 0x8e8b
jmp 0x8eeb
jmp 0x8ebd
jmp 0x8ebd
jmp 0x8ebd
jmp 0x8ebd
movq %rax, %rbx
jmp 0x8ef8
movq %rax, %rbx
jmp 0x8f0c
movq %rax, %rbx
jmp 0x8eeb
movq %rax, %rbx
jmp 0x8ee1
movq %rax, %rbx
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x8ee1
callq 0x63b0
leaq 0x58(%rsp), %rdi
callq 0xa030
leaq 0x128(%rsp), %rdi
callq 0x22494
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x8f0c
callq 0x63b0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x8f20
callq 0x63b0
movq %rbx, %rdi
callq 0x6430