// File: /workspace/github_cpp_makefile_star2_O1/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 0x8c5c
movl %esi, %r14d
movl %esi, %ebp
negl %ebp
cmovsl %esi, %ebp
movl $0x1, %r15d
cmpl $0xa, %ebp
jb 0x88f3
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x88ea
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x88f0
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x88f3
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x88b7
addl $-0x3, %r15d
jmp 0x88f3
addl $-0x2, %r15d
jmp 0x88f3
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 0x9f6c
leaq 0x28(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x2875a(%rip), %rsi     # 0x31095
leaq 0x28763(%rip), %rdx     # 0x310a5
leaq 0x18(%rsp), %rdi
callq 0xa06a
leaq 0x128(%rsp), %rdi
callq 0x226c0
movq 0x18(%rsp), %rdx
leaq 0x110(%rsp), %rdi
leaq 0x128(%rsp), %rsi
movl $0x74, %ecx
xorl %r8d, %r8d
callq 0x2347c
movq (%rsp), %r12
leaq 0x110(%rsp), %rdi
callq 0x22698
testb %al, %al
je 0x89d9
movq 0x38(%rsp), %rcx
leaq 0x2871b(%rip), %rsi     # 0x310b7
leaq 0x28741(%rip), %rdx     # 0x310e4
leaq 0x128(%rsp), %rdi
callq 0x21202
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
callq 0x1d6bc
testb %al, %al
je 0x8a1f
leaq 0x286fb(%rip), %rsi     # 0x310c3
leaq 0x70(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x9d0b
jmp 0x89ef
leaq 0x286c6(%rip), %rsi     # 0x310a6
leaq 0x70(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x9d0b
leaq 0x30(%r12), %rdi
leaq 0x70(%rsp), %r14
movq %r14, %rsi
callq 0x6370
movq (%r14), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x8c2c
callq 0x63b0
jmp 0x8c2c
leaq 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x286ad(%rip), %rsi     # 0x310df
leaq 0x286a9(%rip), %rdx     # 0x310e2
leaq 0x70(%rsp), %r15
movq %r15, %rdi
callq 0xa06a
leaq 0x90(%rsp), %r14
leaq 0xa0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x28682(%rip), %rsi     # 0x310e3
leaq 0x2867e(%rip), %rdx     # 0x310e6
movq %r14, %rdi
callq 0xa06a
leaq 0xb0(%rsp), %r14
leaq 0xc0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2865c(%rip), %rsi     # 0x310e7
leaq 0x2865d(%rip), %rdx     # 0x310ef
movq %r14, %rdi
callq 0xa06a
leaq 0xd0(%rsp), %r14
leaq 0xe0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2863b(%rip), %rsi     # 0x310f0
leaq 0x2863a(%rip), %rdx     # 0x310f6
movq %r14, %rdi
callq 0xa06a
leaq 0xf0(%rsp), %r14
leaq 0x100(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x2868d(%rip), %rsi     # 0x3116d
leaq 0x28689(%rip), %rdx     # 0x31170
movq %r14, %rdi
callq 0xa06a
leaq 0x58(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x8(%rsp), %rcx
movl $0x5, %edx
callq 0x9d8c
leaq 0x100(%rsp), %rbx
xorl %r14d, %r14d
movq 0xf0(%rsp,%r14), %rdi
leaq (%rbx,%r14), %rax
cmpq %rdi, %rax
je 0x8b29
callq 0x63b0
addq $-0x20, %r14
cmpq $-0xa0, %r14
jne 0x8b13
movq 0x58(%rsp), %rbx
movq 0x60(%rsp), %r14
cmpq %r14, %rbx
je 0x8c19
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 0x9fda
movq 0x70(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x1d612
movq %rax, 0x8(%rsp)
movq %r12, %rdi
callq 0x1d562
testq %rax, %rax
je 0x8bf5
cmpq $0x0, 0x78(%rsp)
je 0x8bba
xorl %r15d, %r15d
movq 0x70(%rsp), %r13
movsbl (%r13,%r15), %edi
callq 0x6130
movb %al, (%r13,%r15)
incq %r15
cmpq 0x78(%rsp), %r15
jb 0x8b9b
movq %r12, %rdi
callq 0x1d970
movq %rax, %r13
movq (%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x9dce
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 0x8c0c
callq 0x63b0
addq $0x20, %rbx
cmpq %r14, %rbx
jne 0x8b4e
leaq 0x58(%rsp), %rdi
callq 0x9e60
leaq 0x28(%rsp), %rbx
movq (%rsp), %r12
leaq 0x128(%rsp), %rdi
callq 0x2274e
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x8c48
callq 0x63b0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x8c5c
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, %r13
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x8c8a
callq 0x63b0
addq $-0x20, %r12
addq $0x20, %r13
jne 0x8c7b
movb $0x1, %al
jmp 0x8cad
jmp 0x8c9e
jmp 0x8c9e
jmp 0x8c9e
movq %rax, %rbx
xorl %eax, %eax
jmp 0x8cad
movq %rax, %rbx
xorl %eax, %eax
movq %r15, %r14
cmpq %r14, %r15
sete %cl
orb %al, %cl
jne 0x8d1e
addq $-0x10, %r14
leaq 0x70(%rsp), %r15
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x8cce
callq 0x63b0
leaq -0x20(%r14), %rax
addq $-0x10, %r14
cmpq %r15, %r14
movq %rax, %r14
jne 0x8cc0
jmp 0x8d1e
jmp 0x8cf0
jmp 0x8cf0
jmp 0x8cf0
movq %rax, %rbx
jmp 0x8d2b
movq %rax, %rbx
jmp 0x8d3f
movq %rax, %rbx
jmp 0x8d1e
movq %rax, %rbx
jmp 0x8d14
movq %rax, %rbx
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x8d14
callq 0x63b0
leaq 0x58(%rsp), %rdi
callq 0x9e60
leaq 0x128(%rsp), %rdi
callq 0x2274e
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x8d3f
callq 0x63b0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x8d53
callq 0x63b0
movq %rbx, %rdi
callq 0x6430
nop