// File: jliesch[P]ofxget/ofxhome.cc
// Function: ofxget::OfxDumpStringToInstitutions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
vector<Institution> OfxDumpStringToInstitutions(const string& dump) {
  pugi::xml_document doc;
  pugi::xml_parse_result result = doc.load_string(dump.c_str());
  if (!result) {
    throw string("Could not parse institutions");
  }

  vector<Institution> insts;
  for (pugi::xml_node inst = doc.child("institution"); inst; inst = inst.next_sibling("institution")) {
    Institution i;
    i.ofxhome_id = inst.attribute("id").as_int();
    i.name = inst.child("name").child_value();
    i.url = inst.child("url").child_value();
    i.fid = inst.child("fid").child_value();
    i.org = inst.child("org").child_value();
    i.brokerid = inst.child("brokerid").child_value();
    i.bankid = inst.child("bankid").child_value();
    i.ofxfail = inst.child("ofxfail").text().as_int();
    i.sslfail = inst.child("sslfail").text().as_int();
    i.lastofxvalidation = inst.child("lastofxvalidation").child_value();
    i.lastsslvalidation = inst.child("lastsslvalidation").child_value();
    auto profile = inst.child("profile");
    for (pugi::xml_attribute_iterator ait = profile.attributes_begin(); ait != profile.attributes_end(); ++ait)
    {
      i.profile[ait->name()] = ait->value();
    }
    insts.push_back(i);
  }

  return insts;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x490, %rsp            # imm = 0x490
movq %rdi, -0x328(%rbp)
movq %rdi, %rax
movq %rax, -0x320(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x476b0
movq -0x10(%rbp), %rdi
callq 0x7100
movq -0x318(%rbp), %rsi
movq %rax, %rdx
leaq -0xf8(%rbp), %rdi
movl $0x74, %ecx
callq 0x48310
jmp 0xf36d
leaq -0xf8(%rbp), %rdi
callq 0x47550
movb %al, -0x329(%rbp)
jmp 0xf381
movb -0x329(%rbp), %al
testb $0x1, %al
jne 0xf456
jmp 0xf391
movb $0x1, -0x106(%rbp)
movl $0x20, %edi
callq 0x7380
movq %rax, -0x340(%rbp)
movq %rax, -0x348(%rbp)
leaq -0x105(%rbp), %rdi
movq %rdi, -0x338(%rbp)
callq 0x78f0
movq -0x340(%rbp), %rdi
movq -0x338(%rbp), %rdx
leaq 0x5a1a8(%rip), %rsi     # 0x69580
callq 0x77b0
jmp 0xf3df
movq -0x348(%rbp), %rdi
movb $0x0, -0x106(%rbp)
leaq 0x8518c(%rip), %rsi     # 0x94580
movq 0x85ba5(%rip), %rdx     # 0x94fa0
callq 0x75e0
jmp 0xfb76
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0xfb5e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x105(%rbp), %rdi
callq 0x7b70
testb $0x1, -0x106(%rbp)
jne 0xf445
jmp 0xf451
movq -0x348(%rbp), %rdi
callq 0x7840
jmp 0xfb5e
movq -0x328(%rbp), %rdi
movb $0x0, -0x107(%rbp)
callq 0x108b0
leaq 0x59c47(%rip), %rsi     # 0x690b7
leaq -0xe0(%rbp), %rdi
callq 0x41ed0
movq %rax, -0x350(%rbp)
jmp 0xf485
movq -0x350(%rbp), %rax
movq %rax, -0x110(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x41c30
movq %rax, -0x358(%rbp)
jmp 0xf4a8
movq -0x358(%rbp), %rax
cmpq $0x0, %rax
je 0xfb1a
leaq -0x250(%rbp), %rdi
callq 0x108d0
leaq 0x59c18(%rip), %rsi     # 0x690e4
leaq -0x110(%rbp), %rdi
callq 0x42260
movq %rax, -0x360(%rbp)
jmp 0xf4e1
movq -0x360(%rbp), %rax
movq %rax, -0x258(%rbp)
leaq -0x258(%rbp), %rdi
xorl %esi, %esi
callq 0x40c10
movl %eax, -0x364(%rbp)
jmp 0xf505
movl -0x364(%rbp), %eax
movl %eax, -0x250(%rbp)
leaq 0x5e06e(%rip), %rsi     # 0x6d586
leaq -0x110(%rbp), %rdi
callq 0x41ed0
movq %rax, -0x370(%rbp)
jmp 0xf52d
movq -0x370(%rbp), %rax
movq %rax, -0x260(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x42830
movq %rax, -0x378(%rbp)
jmp 0xf550
movq -0x378(%rbp), %rsi
leaq -0x248(%rbp), %rdi
callq 0x73b0
jmp 0xf565
leaq 0x59c01(%rip), %rsi     # 0x6916d
leaq -0x110(%rbp), %rdi
callq 0x41ed0
movq %rax, -0x380(%rbp)
jmp 0xf581
movq -0x380(%rbp), %rax
movq %rax, -0x268(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x42830
movq %rax, -0x388(%rbp)
jmp 0xf5a4
movq -0x388(%rbp), %rsi
leaq -0x1e8(%rbp), %rdi
callq 0x73b0
jmp 0xf5b9
leaq 0x59b23(%rip), %rsi     # 0x690e3
leaq -0x110(%rbp), %rdi
callq 0x41ed0
movq %rax, -0x390(%rbp)
jmp 0xf5d5
movq -0x390(%rbp), %rax
movq %rax, -0x270(%rbp)
leaq -0x270(%rbp), %rdi
callq 0x42830
movq %rax, -0x398(%rbp)
jmp 0xf5f8
movq -0x398(%rbp), %rsi
leaq -0x228(%rbp), %rdi
callq 0x73b0
jmp 0xf60d
leaq 0x59acb(%rip), %rsi     # 0x690df
leaq -0x110(%rbp), %rdi
callq 0x41ed0
movq %rax, -0x3a0(%rbp)
jmp 0xf629
movq -0x3a0(%rbp), %rax
movq %rax, -0x278(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x42830
movq %rax, -0x3a8(%rbp)
jmp 0xf64c
movq -0x3a8(%rbp), %rsi
leaq -0x208(%rbp), %rdi
callq 0x73b0
jmp 0xf661
leaq 0x59a7f(%rip), %rsi     # 0x690e7
leaq -0x110(%rbp), %rdi
callq 0x41ed0
movq %rax, -0x3b0(%rbp)
jmp 0xf67d
movq -0x3b0(%rbp), %rax
movq %rax, -0x280(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x42830
movq %rax, -0x3b8(%rbp)
jmp 0xf6a0
movq -0x3b8(%rbp), %rsi
leaq -0x180(%rbp), %rdi
callq 0x73b0
jmp 0xf6b5
leaq 0x59a34(%rip), %rsi     # 0x690f0
leaq -0x110(%rbp), %rdi
callq 0x41ed0
movq %rax, -0x3c0(%rbp)
jmp 0xf6d1
movq -0x3c0(%rbp), %rax
movq %rax, -0x288(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x42830
movq %rax, -0x3c8(%rbp)
jmp 0xf6f4
movq -0x3c8(%rbp), %rsi
leaq -0x160(%rbp), %rdi
callq 0x73b0
jmp 0xf709
leaq 0x59e8d(%rip), %rsi     # 0x6959d
leaq -0x110(%rbp), %rdi
callq 0x41ed0
movq %rax, -0x3d0(%rbp)
jmp 0xf725
movq -0x3d0(%rbp), %rax
movq %rax, -0x298(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x42800
movq %rax, -0x3d8(%rbp)
jmp 0xf748
movq -0x3d8(%rbp), %rax
movq %rax, -0x290(%rbp)
leaq -0x290(%rbp), %rdi
xorl %esi, %esi
callq 0x462e0
movl %eax, -0x3dc(%rbp)
jmp 0xf76c
movl -0x3dc(%rbp), %eax
movl %eax, -0x1c8(%rbp)
leaq 0x59e26(%rip), %rsi     # 0x695a5
leaq -0x110(%rbp), %rdi
callq 0x41ed0
movq %rax, -0x3e8(%rbp)
jmp 0xf794
movq -0x3e8(%rbp), %rax
movq %rax, -0x2a8(%rbp)
leaq -0x2a8(%rbp), %rdi
callq 0x42800
movq %rax, -0x3f0(%rbp)
jmp 0xf7b7
movq -0x3f0(%rbp), %rax
movq %rax, -0x2a0(%rbp)
leaq -0x2a0(%rbp), %rdi
xorl %esi, %esi
callq 0x462e0
movl %eax, -0x3f4(%rbp)
jmp 0xf7db
movl -0x3f4(%rbp), %eax
movl %eax, -0x1c4(%rbp)
leaq 0x59dbf(%rip), %rsi     # 0x695ad
leaq -0x110(%rbp), %rdi
callq 0x41ed0
movq %rax, -0x400(%rbp)
jmp 0xf803
movq -0x400(%rbp), %rax
movq %rax, -0x2b0(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0x42830
movq %rax, -0x408(%rbp)
jmp 0xf826
movq -0x408(%rbp), %rsi
leaq -0x1c0(%rbp), %rdi
callq 0x73b0
jmp 0xf83b
leaq 0x59d7d(%rip), %rsi     # 0x695bf
leaq -0x110(%rbp), %rdi
callq 0x41ed0
movq %rax, -0x410(%rbp)
jmp 0xf857
movq -0x410(%rbp), %rax
movq %rax, -0x2b8(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0x42830
movq %rax, -0x418(%rbp)
jmp 0xf87a
movq -0x418(%rbp), %rsi
leaq -0x1a0(%rbp), %rdi
callq 0x73b0
jmp 0xf88f
leaq 0x59d3b(%rip), %rsi     # 0x695d1
leaq -0x110(%rbp), %rdi
callq 0x41ed0
movq %rax, -0x420(%rbp)
jmp 0xf8ab
movq -0x420(%rbp), %rax
movq %rax, -0x2c0(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0x41d20
movq %rdx, -0x430(%rbp)
movq %rax, -0x428(%rbp)
jmp 0xf8d5
movq -0x430(%rbp), %rax
movq -0x428(%rbp), %rcx
movq %rcx, -0x2d0(%rbp)
movq %rax, -0x2c8(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0x41d80
movq %rdx, -0x440(%rbp)
movq %rax, -0x438(%rbp)
jmp 0xf90d
movq -0x440(%rbp), %rax
movq -0x438(%rbp), %rcx
movq %rcx, -0x2e0(%rbp)
movq %rax, -0x2d8(%rbp)
leaq -0x2d0(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x46f70
movb %al, -0x441(%rbp)
jmp 0xf944
movb -0x441(%rbp), %al
testb $0x1, %al
jne 0xf953
jmp 0xfaae
leaq -0x2d0(%rbp), %rdi
callq 0x47010
movq %rax, -0x450(%rbp)
jmp 0xf968
movq -0x450(%rbp), %rdi
callq 0x41070
movq %rax, -0x458(%rbp)
jmp 0xf97d
leaq -0x140(%rbp), %rax
movq %rax, -0x468(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0x47010
movq %rax, -0x460(%rbp)
jmp 0xf9a0
movq -0x460(%rbp), %rdi
callq 0x41020
movq %rax, -0x470(%rbp)
jmp 0xf9b5
leaq -0x301(%rbp), %rdi
movq %rdi, -0x478(%rbp)
callq 0x78f0
movq -0x470(%rbp), %rsi
movq -0x478(%rbp), %rdx
leaq -0x300(%rbp), %rdi
callq 0x77b0
jmp 0xf9e4
movq -0x468(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0xae10
movq %rax, -0x480(%rbp)
jmp 0xfa00
movq -0x458(%rbp), %rsi
movq -0x480(%rbp), %rdi
callq 0x73b0
jmp 0xfa15
leaq -0x300(%rbp), %rdi
callq 0x7b88
leaq -0x301(%rbp), %rdi
callq 0x7b70
leaq -0x2d0(%rbp), %rdi
callq 0x47060
jmp 0xfa3b
jmp 0xf8f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0xfb52
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0xfb0c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0xfaa0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x7b88
leaq -0x301(%rbp), %rdi
callq 0x7b70
jmp 0xfb0c
movq -0x328(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x10970
jmp 0xfac3
leaq -0x250(%rbp), %rdi
callq 0x109e0
leaq 0x595e1(%rip), %rsi     # 0x690b7
leaq -0x110(%rbp), %rdi
callq 0x42300
movq %rax, -0x488(%rbp)
jmp 0xfaeb
movq -0x488(%rbp), %rax
movq %rax, -0x310(%rbp)
movq -0x310(%rbp), %rax
movq %rax, -0x110(%rbp)
jmp 0xf493
leaq -0x250(%rbp), %rdi
callq 0x109e0
jmp 0xfb52
movb $0x1, -0x107(%rbp)
testb $0x1, -0x107(%rbp)
jne 0xfb36
movq -0x328(%rbp), %rdi
callq 0x10a80
leaq -0xe0(%rbp), %rdi
callq 0x47810
movq -0x320(%rbp), %rax
addq $0x490, %rsp            # imm = 0x490
popq %rbp
retq
movq -0x328(%rbp), %rdi
callq 0x10a80
leaq -0xe0(%rbp), %rdi
callq 0x47810
movq -0x100(%rbp), %rdi
callq 0x7600
nopw %cs:(%rax,%rax)