LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: nicoeps[P]NicoGB/src/mbc.cpp
// Function: MBC5::read(unsigned short)
uint8_t MBC5::read(uint16_t address) {
    if (address <= 0x3FFF) {
        return rom[address];
    } else if (address <= 0x7FFF) {
        romBank = ((bank2 << 8) | bank1);
        return rom[((romBank << 14) | (address & 0x3FFF)) % romSize];
    } else if (address >= 0xA000 && address <= 0xBFFF) {
        if (ramg) {
            return ram[((ramBank << 13) | (address & 0x1FFF)) % ramSize];
        } else {
            return 0xFF;
        }
    } else {
        return 0xFF;
    }
}

// Assembly:
subq $0x28, %rsp
movw %si, %ax
movq %rdi, 0x18(%rsp)
movw %ax, 0x16(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movzwl 0x16(%rsp), %eax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jg 0xe187
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movzwl 0x16(%rsp), %eax
movl %eax, %esi
callq 0x40f0
movb (%rax), %al
movb %al, 0x27(%rsp)
jmp 0xe235
movzwl 0x16(%rsp), %eax
cmpl $0x7fff, %eax           # imm = 0x7FFF
jg 0xe1d5
movq 0x8(%rsp), %rcx
movzbl 0x22(%rcx), %eax
shll $0x8, %eax
movzbl 0x21(%rcx), %edx
orl %edx, %eax
movw %ax, 0x24(%rcx)
movq 0x8(%rcx), %rdi
movzwl 0x24(%rcx), %eax
shll $0xe, %eax
movzwl 0x16(%rsp), %edx
andl $0x3fff, %edx           # imm = 0x3FFF
orl %edx, %eax
cltd
idivl 0x18(%rcx)
movslq %edx, %rsi
callq 0x40f0
movb (%rax), %al
movb %al, 0x27(%rsp)
jmp 0xe235
movzwl 0x16(%rsp), %eax
cmpl $0xa000, %eax           # imm = 0xA000
jl 0xe230
movzwl 0x16(%rsp), %eax
cmpl $0xbfff, %eax           # imm = 0xBFFF
jg 0xe230
movq 0x8(%rsp), %rax
testb $0x1, 0x20(%rax)
je 0xe229
movq 0x8(%rsp), %rcx
movq 0x10(%rcx), %rdi
movzbl 0x26(%rcx), %eax
shll $0xd, %eax
movzwl 0x16(%rsp), %edx
andl $0x1fff, %edx           # imm = 0x1FFF
orl %edx, %eax
cltd
idivl 0x1c(%rcx)
movslq %edx, %rsi
callq 0x40f0
movb (%rax), %al
movb %al, 0x27(%rsp)
jmp 0xe235
movb $-0x1, 0x27(%rsp)
jmp 0xe235
movb $-0x1, 0x27(%rsp)
movb 0x27(%rsp), %al
addq $0x28, %rsp
retq
nop
// File: nicoeps[P]NicoGB/src/mbc.cpp
// Function: MBC5::write(unsigned short, unsigned char)
void MBC5::write(uint16_t address, uint8_t n) {
    if (address <= 0x1FFF) {
        ramg = (n == 0x0A);
    } else if (address <= 0x2FFF) {
        bank1 = n;
    } else if (address <= 0x3FFF) {
        bank2 = n & 0x1;
    } else if (address <= 0x5FFF) {
        ramBank = n & 0xF;
    } else if (address >= 0xA000 && address <= 0xBFFF) {
        if (ramg) {
            ram[((ramBank << 13) | (address & 0x1FFF)) % ramSize] = n;
        }
    }
}

// Assembly:
subq $0x28, %rsp
movb %dl, %al
movw %si, %cx
movq %rdi, 0x20(%rsp)
movw %cx, 0x1e(%rsp)
movb %al, 0x1d(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movzwl 0x1e(%rsp), %eax
cmpl $0x1fff, %eax           # imm = 0x1FFF
jg 0xe288
movq 0x10(%rsp), %rax
movzbl 0x1d(%rsp), %ecx
cmpl $0xa, %ecx
sete %cl
andb $0x1, %cl
movb %cl, 0x20(%rax)
jmp 0xe345
movzwl 0x1e(%rsp), %eax
cmpl $0x2fff, %eax           # imm = 0x2FFF
jg 0xe2a5
movq 0x10(%rsp), %rax
movb 0x1d(%rsp), %cl
movb %cl, 0x21(%rax)
jmp 0xe343
movzwl 0x1e(%rsp), %eax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jg 0xe2c3
movq 0x10(%rsp), %rax
movzbl 0x1d(%rsp), %ecx
andl $0x1, %ecx
movb %cl, 0x22(%rax)
jmp 0xe341
movzwl 0x1e(%rsp), %eax
cmpl $0x5fff, %eax           # imm = 0x5FFF
jg 0xe2e1
movq 0x10(%rsp), %rax
movzbl 0x1d(%rsp), %ecx
andl $0xf, %ecx
movb %cl, 0x26(%rax)
jmp 0xe33f
movzwl 0x1e(%rsp), %eax
cmpl $0xa000, %eax           # imm = 0xA000
jl 0xe33d
movzwl 0x1e(%rsp), %eax
cmpl $0xbfff, %eax           # imm = 0xBFFF
jg 0xe33d
movq 0x10(%rsp), %rax
testb $0x1, 0x20(%rax)
je 0xe33b
movq 0x10(%rsp), %rcx
movb 0x1d(%rsp), %al
movb %al, 0xf(%rsp)
movq 0x10(%rcx), %rdi
movzbl 0x26(%rcx), %eax
shll $0xd, %eax
movzwl 0x1e(%rsp), %edx
andl $0x1fff, %edx           # imm = 0x1FFF
orl %edx, %eax
cltd
idivl 0x1c(%rcx)
movslq %edx, %rsi
callq 0x40f0
movb 0xf(%rsp), %cl
movb %cl, (%rax)
jmp 0xe33d
jmp 0xe33f
jmp 0xe341
jmp 0xe343
jmp 0xe345
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: nicoeps[P]NicoGB/src/memory.cpp
// Function: Memory::init()
void Memory::init() {
    bootEnabled = false;
    std::fill_n(vram.begin(), 0x2000, 0);
    std::fill_n(wram.begin(), 0x2000, 0);
    std::fill_n(oam.begin(), 0xA0, 0);
    std::fill_n(io.begin(), 0x100, 0xFF);
    std::fill_n(hram.begin(), 0x7F, 0);
    lcd.lcdc = 0;
    lcd.stat = 0;
    lcd.scy = 0;
    lcd.scx = 0;
    lcd.ly = 0;
    lcd.lyc = 0;
    lcd.bgp = 0xFC;
    lcd.obp0 = 0xFF;
    lcd.obp1 = 0xFF;
    lcd.wy = 0;
    lcd.wx = 0;
    dmaAddress = 0;
    dmaCycle = 0xFF;
    write(0xFF01, 0x00); // SB
    write(0xFF02, 0x7E); // SC
    write(0xFF0F, 0x00); // IF
    write(0xFFFF, 0x00); // IE
    bootEnabled = true;
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq 0x80(%rsp), %rdi
movq %rdi, (%rsp)
movb $0x0, 0x23(%rdi)
addq $0x28, %rdi
callq 0x4170
movq %rax, 0x78(%rsp)
movl $0x0, 0x74(%rsp)
movq 0x78(%rsp), %rdi
movl $0x2000, %esi           # imm = 0x2000
leaq 0x74(%rsp), %rdx
callq 0x4110
movq (%rsp), %rdi
movq %rax, 0x68(%rsp)
addq $0x40, %rdi
callq 0x4170
movq %rax, 0x60(%rsp)
movl $0x0, 0x5c(%rsp)
movq 0x60(%rsp), %rdi
movl $0x2000, %esi           # imm = 0x2000
leaq 0x5c(%rsp), %rdx
callq 0x4110
movq (%rsp), %rdi
movq %rax, 0x50(%rsp)
addq $0x58, %rdi
callq 0x4170
movq %rax, 0x48(%rsp)
movl $0x0, 0x44(%rsp)
movq 0x48(%rsp), %rdi
movl $0xa0, %esi
leaq 0x44(%rsp), %rdx
callq 0x4110
movq (%rsp), %rdi
movq %rax, 0x38(%rsp)
addq $0x70, %rdi
callq 0x4170
movq %rax, 0x30(%rsp)
movl $0xff, 0x2c(%rsp)
movq 0x30(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
leaq 0x2c(%rsp), %rdx
callq 0x4110
movq (%rsp), %rdi
movq %rax, 0x20(%rsp)
addq $0x88, %rdi
callq 0x4170
movq %rax, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movq 0x18(%rsp), %rdi
movl $0x7f, %esi
leaq 0x14(%rsp), %rdx
callq 0x4110
movq (%rsp), %rdi
movq %rax, 0x8(%rsp)
movb $0x0, 0x18(%rdi)
movb $0x0, 0x19(%rdi)
movb $0x0, 0x1a(%rdi)
movb $0x0, 0x1b(%rdi)
movb $0x0, 0x1c(%rdi)
movb $0x0, 0x1d(%rdi)
movb $-0x4, 0x1e(%rdi)
movb $-0x1, 0x1f(%rdi)
movb $-0x1, 0x20(%rdi)
movb $0x0, 0x21(%rdi)
movb $0x0, 0x22(%rdi)
movw $0x0, 0x24(%rdi)
movb $-0x1, 0x26(%rdi)
movl $0xff01, %esi           # imm = 0xFF01
xorl %edx, %edx
callq 0xe840
movq (%rsp), %rdi
movl $0xff02, %esi           # imm = 0xFF02
movl $0x7e, %edx
callq 0xe840
movq (%rsp), %rdi
movl $0xff0f, %esi           # imm = 0xFF0F
xorl %edx, %edx
callq 0xe840
movq (%rsp), %rdi
movl $0xffff, %esi           # imm = 0xFFFF
xorl %edx, %edx
callq 0xe840
movq (%rsp), %rax
movb $0x1, 0x23(%rax)
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)
// File: nicoeps[P]NicoGB/src/nicogb.cpp
// Function: NicoGB::NicoGB()
NicoGB::NicoGB() :
    memory(cartridge, joypad, timer),
    ppu(memory),
    cpu(memory, ppu),
    loaded(cartridge.loaded),
    title(cartridge.title),
    framebuffer(ppu.framebuffer) {
        timer = Timer();
        joypad = Joypad();
        cartridge = Cartridge();
        speed = 0;
        epoch = std::chrono::high_resolution_clock::from_time_t(0);
        last = millis();
}

// Assembly:
subq $0xd8, %rsp
movq %rdi, 0xd0(%rsp)
movq 0xd0(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x15df0
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
movq %rdi, 0x28(%rsp)
callq 0x3560
movq 0x30(%rsp), %rdi
subq $-0x80, %rdi
callq 0xc4d0
jmp 0xfda4
movq 0x30(%rsp), %rcx
movq %rcx, %rdi
addq $0x88, %rdi
movq %rdi, 0x20(%rsp)
movq %rcx, %rsi
addq $0x8, %rsi
movq %rcx, %rdx
subq $-0x80, %rdx
callq 0xe490
jmp 0xfdcd
movq 0x30(%rsp), %rsi
movq %rsi, %rdi
addq $0x140, %rdi            # imm = 0x140
movq %rdi, 0x18(%rsp)
addq $0x88, %rsi
callq 0x10550
jmp 0xfdef
movq 0x30(%rsp), %rdx
movq %rdx, %rdi
addq $0x200, %rdi            # imm = 0x200
movq %rdx, %rsi
addq $0x88, %rsi
addq $0x140, %rdx            # imm = 0x140
callq 0x5db0
jmp 0xfe16
movq 0x30(%rsp), %rdi
addq $0x298, %rdi            # imm = 0x298
callq 0x10330
jmp 0xfe29
movq 0x30(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rax, %rdx
addq $0x28, %rdx
movq %rdx, 0x2b0(%rax)
movq %rcx, 0x2b8(%rax)
movq %rax, %rcx
addq $0x148, %rcx            # imm = 0x148
movq %rcx, 0x2c0(%rax)
leaq 0xbc(%rsp), %rdi
callq 0x15df0
jmp 0xfe6a
movq 0x30(%rsp), %rax
movl 0xbc(%rsp), %ecx
movl 0xbf(%rsp), %edx
movl %edx, 0x3(%rax)
movl %ecx, (%rax)
leaq 0xb8(%rsp), %rdi
callq 0xc4d0
jmp 0xfe91
movq 0x30(%rsp), %rax
movl 0xb8(%rsp), %ecx
movl %ecx, 0x80(%rax)
leaq 0x40(%rsp), %rdi
callq 0x3560
jmp 0xfeaf
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
leaq 0x40(%rsp), %rsi
movq %rsi, 0x8(%rsp)
callq 0x10360
movq 0x8(%rsp), %rdi
callq 0xd400
movq 0x30(%rsp), %rax
movb $0x0, 0x2a8(%rax)
xorl %eax, %eax
movl %eax, %edi
callq 0xce70
movq 0x30(%rsp), %rdi
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x298(%rdi)
callq 0xff90
movq %rax, 0x10(%rsp)
jmp 0xff08
movq 0x30(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, 0x2a0(%rax)
addq $0xd8, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
jmp 0xff75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
jmp 0xff6b
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
callq 0xd340
movq 0x20(%rsp), %rdi
callq 0xd390
movq 0x28(%rsp), %rdi
callq 0xd400
movq 0xc8(%rsp), %rdi
callq 0x33d0
nopl (%rax)
// File: nicoeps[P]NicoGB/src/nicogb.cpp
// Function: NicoGB::init()
void NicoGB::init() {
    cpu.init();
    timer.init();
    joypad.reset();
    memory.init();
    ppu.init();
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, 0x8(%rsp)
addq $0x200, %rdi            # imm = 0x200
callq 0x5ea0
movq 0x8(%rsp), %rdi
callq 0x15e00
movq 0x8(%rsp), %rdi
addq $0x80, %rdi
callq 0xc4e0
movq 0x8(%rsp), %rdi
addq $0x88, %rdi
callq 0xe690
movq 0x8(%rsp), %rdi
addq $0x140, %rdi            # imm = 0x140
callq 0x10830
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: nicoeps[P]NicoGB/src/nicogb.cpp
// Function: NicoGB::tick()
void NicoGB::tick() {
    if (speed) {
        cpu.totalCycles = 0;
    }

    if (cartridge.loaded && cpu.totalCycles < 70224) {
        cpu.cycle();
    }

    if (millis() - last >= 1000/60) {
        last = millis();
        if (cartridge.loaded && !speed) {
            cpu.totalCycles -= 70224;
        }
    }
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
testb $0x1, 0x2a8(%rax)
je 0x1013c
movq 0x8(%rsp), %rax
movq $0x0, 0x210(%rax)
movq 0x8(%rsp), %rax
testb $0x1, 0x28(%rax)
je 0x1016a
movq 0x8(%rsp), %rax
cmpq $0x11250, 0x210(%rax) # imm = 0x11250
jge 0x1016a
movq 0x8(%rsp), %rdi
addq $0x200, %rdi            # imm = 0x200
callq 0x7250
movq 0x8(%rsp), %rdi
callq 0xff90
movq 0x8(%rsp), %rcx
subq 0x2a0(%rcx), %rax
cmpq $0x10, %rax
jl 0x101cf
movq 0x8(%rsp), %rdi
callq 0xff90
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x2a0(%rax)
testb $0x1, 0x28(%rax)
je 0x101cd
movq 0x8(%rsp), %rax
testb $0x1, 0x2a8(%rax)
jne 0x101cd
movq 0x8(%rsp), %rax
movq 0x210(%rax), %rcx
subq $0x11250, %rcx          # imm = 0x11250
movq %rcx, 0x210(%rax)
jmp 0x101cf
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: nicoeps[P]NicoGB/src/ppu.cpp
// Function: PPU::init()
void PPU::init() {
    std::fill_n(framebuffer.begin(), 160*144, 0);
    std::fill_n(writebuffer.begin(), 160*144, 0);
    std::fill_n(line.begin(), 160, 0);
    mode = 4;
    totalCycles = 0;
    interrupt = false;
    windowCounter = 0;
    clear = true;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, (%rsp)
addq $0x8, %rdi
callq 0x13440
movq %rax, 0x48(%rsp)
movl $0x0, 0x44(%rsp)
movq 0x48(%rsp), %rdi
movl $0x5a00, %esi           # imm = 0x5A00
leaq 0x44(%rsp), %rdx
callq 0x133e0
movq (%rsp), %rdi
movq %rax, 0x38(%rsp)
addq $0x88, %rdi
callq 0x13440
movq %rax, 0x30(%rsp)
movl $0x0, 0x2c(%rsp)
movq 0x30(%rsp), %rdi
movl $0x5a00, %esi           # imm = 0x5A00
leaq 0x2c(%rsp), %rdx
callq 0x133e0
movq (%rsp), %rdi
movq %rax, 0x20(%rsp)
addq $0xa0, %rdi
callq 0x4170
movq %rax, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movq 0x18(%rsp), %rdi
movl $0xa0, %esi
leaq 0x14(%rsp), %rdx
callq 0x4110
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x8(%rsp)
movb $0x4, 0x80(%rax)
movl $0x0, 0x20(%rax)
movb $0x0, 0x24(%rax)
movl $0x0, 0x84(%rax)
movb $0x1, 0xb8(%rax)
addq $0x58, %rsp
retq
nopl (%rax)
// File: nicoeps[P]NicoGB/src/timer.cpp
// Function: Timer::init()
void Timer::init() {
    counter = 0;
    divider = 0;
    tima = 0;
    tma = 0;
    tac = 0;
    reload = 0;
    oldEdge = 0;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movw $0x0, (%rax)
movb $0x0, 0x1(%rax)
movb $0x0, 0x2(%rax)
movb $0x0, 0x3(%rax)
movb $0x0, 0x4(%rax)
movb $0x0, 0x5(%rax)
movb $0x0, 0x6(%rax)
retq
nopl (%rax,%rax)
// File: sharmaeklavya2[P]ddos-on-anycast/src/lib/segtree.cpp
// Function: SegTree::_init(int, int, int, double const*)
void SegTree::_init(int root, int first, int last, const value_type* a) {
    if(first == last) {
        v[root] = a[first];
    }
    else {
        int mid = (first + last) / 2;
        int left = 2 * root + 1;
        _init(left, first, mid, a);
        _init(left+1, mid+1, last, a);
        v[root] = segtree_join(v[left], v[left+1]);
    }
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movl %edx, 0x38(%rsp)
movl %ecx, 0x34(%rsp)
movq %r8, 0x28(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x38(%rsp), %eax
cmpl 0x34(%rsp), %eax
jne 0x12f5
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rax
movslq 0x38(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x10(%rsp)
addq $0x8, %rdi
movslq 0x3c(%rsp), %rsi
callq 0x18c0
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x13b7
movq 0x18(%rsp), %rdi
movl 0x38(%rsp), %eax
addl 0x34(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x24(%rsp)
movl 0x3c(%rsp), %eax
shll %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
movl 0x20(%rsp), %esi
movl 0x38(%rsp), %edx
movl 0x24(%rsp), %ecx
movq 0x28(%rsp), %r8
callq 0x1290
movq 0x18(%rsp), %rdi
movl 0x20(%rsp), %esi
addl $0x1, %esi
movl 0x24(%rsp), %edx
addl $0x1, %edx
movl 0x34(%rsp), %ecx
movq 0x28(%rsp), %r8
callq 0x1290
movq 0x18(%rsp), %rdi
addq $0x8, %rdi
movslq 0x20(%rsp), %rsi
callq 0x18c0
movq 0x18(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
addq $0x8, %rdi
movl 0x20(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x18c0
movsd (%rsp), %xmm0
movsd (%rax), %xmm1
callq 0x13c0
movq 0x18(%rsp), %rdi
movsd %xmm0, 0x8(%rsp)
addq $0x8, %rdi
movslq 0x3c(%rsp), %rsi
callq 0x18c0
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
addq $0x48, %rsp
retq
nopl (%rax)
// File: sharmaeklavya2[P]ddos-on-anycast/src/lib/segtree.cpp
// Function: SegTree::_print(_IO_FILE*, int, int, int, int) const
void SegTree::_print(FILE* fp, int root, int first, int last, int indent) const {
    for(int i=0; i<indent; ++i) {
        fprintf(fp, "  ");
    }
    fprintf(fp, "%d(%d-%d): %lf\n", root, first, last, v[root]);
    if(first != last) {
        int mid = (first + last) / 2;
        int left = 2 * root + 1;
        _print(fp, left, first, mid, indent+1);
        _print(fp, left+1, mid+1, last, indent+1);
    }
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movl %edx, 0x44(%rsp)
movl %ecx, 0x40(%rsp)
movl %r8d, 0x3c(%rsp)
movl %r9d, 0x38(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x38(%rsp), %eax
jge 0x143c
movq 0x48(%rsp), %rdi
leaq 0x1bdc(%rip), %rsi      # 0x3004
movb $0x0, %al
callq 0x10e0
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x1412
movq 0x20(%rsp), %rdi
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0x14(%rsp)
movl 0x40(%rsp), %eax
movl %eax, 0x18(%rsp)
movl 0x3c(%rsp), %eax
movl %eax, 0x1c(%rsp)
addq $0x8, %rdi
movslq 0x44(%rsp), %rsi
callq 0x18e0
movq 0x8(%rsp), %rdi
movl 0x14(%rsp), %edx
movl 0x18(%rsp), %ecx
movl 0x1c(%rsp), %r8d
movsd (%rax), %xmm0
leaq 0x1b79(%rip), %rsi      # 0x3007
movb $0x1, %al
callq 0x10e0
movl 0x40(%rsp), %eax
cmpl 0x3c(%rsp), %eax
je 0x1510
movq 0x20(%rsp), %rdi
movl 0x40(%rsp), %eax
addl 0x3c(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x30(%rsp)
movl 0x44(%rsp), %eax
shll %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
movq 0x48(%rsp), %rsi
movl 0x2c(%rsp), %edx
movl 0x40(%rsp), %ecx
movl 0x30(%rsp), %r8d
movl 0x38(%rsp), %r9d
addl $0x1, %r9d
callq 0x13e0
movq 0x20(%rsp), %rdi
movq 0x48(%rsp), %rsi
movl 0x2c(%rsp), %edx
addl $0x1, %edx
movl 0x30(%rsp), %ecx
addl $0x1, %ecx
movl 0x3c(%rsp), %r8d
movl 0x38(%rsp), %r9d
addl $0x1, %r9d
callq 0x13e0
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: sharmaeklavya2[P]ddos-on-anycast/src/lib/segtree.cpp
// Function: SegTree::_query(int, int, int, int) const
typename SegTree::value_type SegTree::_query(int root, int first, int last, int index) const {
    if(index < first || index > last) {
        return segtree_zero;
    }
    else if(first == last) {
        return v[root];
    }
    else {
        int mid = (first+last) / 2;
        int left = 2 * root + 1;
        return _query(left, first, mid, index) + _query(left+1, mid+1, last, index);
    }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movl %edx, 0x20(%rsp)
movl %ecx, 0x1c(%rsp)
movl %r8d, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x20(%rsp), %eax
jl 0x1558
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jle 0x156b
movsd 0x3b50(%rip), %xmm0     # 0x50b0
movsd %xmm0, 0x30(%rsp)
jmp 0x1608
movl 0x20(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jne 0x1594
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
movslq 0x24(%rsp), %rsi
callq 0x18e0
movsd (%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
jmp 0x1608
movq 0x8(%rsp), %rdi
movl 0x20(%rsp), %eax
addl 0x1c(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x14(%rsp)
movl 0x24(%rsp), %eax
shll %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
movl 0x10(%rsp), %esi
movl 0x20(%rsp), %edx
movl 0x14(%rsp), %ecx
movl 0x18(%rsp), %r8d
callq 0x1520
movq 0x8(%rsp), %rdi
movsd %xmm0, (%rsp)
movl 0x10(%rsp), %esi
addl $0x1, %esi
movl 0x14(%rsp), %edx
addl $0x1, %edx
movl 0x1c(%rsp), %ecx
movl 0x18(%rsp), %r8d
callq 0x1520
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x30(%rsp), %xmm0
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: sharmaeklavya2[P]ddos-on-anycast/src/lib/segtree.cpp
// Function: SegTree::_update(int, int, int, int, double)
void SegTree::_update(int root, int first, int last, int index, value_type x) {
    if(index < first || index > last) {
        return;
    }
    else if(first == last) {
        v[root] = x;
    }
    else {
        int mid = (first + last) / 2;
        int left = 2 * root + 1;
        _update(left, first, mid, index, x);
        _update(left+1, mid+1, last, index, x);
        v[root] = segtree_join(v[left], v[left+1]);
    }
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movl %edx, 0x38(%rsp)
movl %ecx, 0x34(%rsp)
movl %r8d, 0x30(%rsp)
movsd %xmm0, 0x28(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x30(%rsp), %eax
cmpl 0x38(%rsp), %eax
jl 0x165e
movl 0x30(%rsp), %eax
cmpl 0x34(%rsp), %eax
jle 0x1663
jmp 0x176b
movl 0x38(%rsp), %eax
cmpl 0x34(%rsp), %eax
jne 0x169b
movq 0x18(%rsp), %rdi
movsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
addq $0x8, %rdi
movslq 0x3c(%rsp), %rsi
callq 0x18c0
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x1769
movq 0x18(%rsp), %rdi
movl 0x38(%rsp), %eax
addl 0x34(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x24(%rsp)
movl 0x3c(%rsp), %eax
shll %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
movl 0x20(%rsp), %esi
movl 0x38(%rsp), %edx
movl 0x24(%rsp), %ecx
movl 0x30(%rsp), %r8d
movsd 0x28(%rsp), %xmm0
callq 0x1620
movq 0x18(%rsp), %rdi
movl 0x20(%rsp), %esi
addl $0x1, %esi
movl 0x24(%rsp), %edx
addl $0x1, %edx
movl 0x34(%rsp), %ecx
movl 0x30(%rsp), %r8d
movsd 0x28(%rsp), %xmm0
callq 0x1620
movq 0x18(%rsp), %rdi
addq $0x8, %rdi
movslq 0x20(%rsp), %rsi
callq 0x18c0
movq 0x18(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
addq $0x8, %rdi
movl 0x20(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x18c0
movsd (%rsp), %xmm0
movsd (%rax), %xmm1
callq 0x13c0
movq 0x18(%rsp), %rdi
movsd %xmm0, 0x8(%rsp)
addq $0x8, %rdi
movslq 0x3c(%rsp), %rsi
callq 0x18c0
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x176b
addq $0x48, %rsp
retq
// File: sharmaeklavya2[P]ddos-on-anycast/src/lib/segtree.cpp
// Function: SegTree::_cumsum_search(int, int, int, double) const
int SegTree::_cumsum_search(int root, int first, int last, value_type x) const {
    if(x > v[root]) {
        return -1;
    }
    else if(first == last) {
        return first;
    }
    int left = 2 * root + 1;
    int mid = (first + last) / 2;
    if(x <= v[left]) {
        return _cumsum_search(left, first, mid, x);
    }
    else {
        return _cumsum_search(left+1, mid+1, last, x-v[left]);
    }
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movl %esi, 0x54(%rsp)
movl %edx, 0x50(%rsp)
movl %ecx, 0x4c(%rsp)
movsd %xmm0, 0x40(%rsp)
movq 0x58(%rsp), %rdi
movq %rdi, 0x28(%rsp)
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
addq $0x8, %rdi
movslq 0x54(%rsp), %rsi
callq 0x18e0
movsd 0x30(%rsp), %xmm0
ucomisd (%rax), %xmm0
jbe 0x17c8
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
jmp 0x18b4
movl 0x50(%rsp), %eax
cmpl 0x4c(%rsp), %eax
jne 0x17df
movl 0x50(%rsp), %eax
movl %eax, 0x64(%rsp)
jmp 0x18b4
jmp 0x17e1
movq 0x28(%rsp), %rdi
movl 0x54(%rsp), %eax
shll %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
movl 0x50(%rsp), %eax
addl 0x4c(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x38(%rsp)
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
addq $0x8, %rdi
movslq 0x3c(%rsp), %rsi
callq 0x18e0
movsd 0x20(%rsp), %xmm1
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0x1853
movq 0x28(%rsp), %rdi
movl 0x3c(%rsp), %esi
movl 0x50(%rsp), %edx
movl 0x38(%rsp), %ecx
movsd 0x40(%rsp), %xmm0
callq 0x1770
movl %eax, 0x64(%rsp)
jmp 0x18b4
movq 0x28(%rsp), %rdi
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
movl 0x4c(%rsp), %eax
movl %eax, 0x1c(%rsp)
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
addq $0x8, %rdi
movslq 0x3c(%rsp), %rsi
callq 0x18e0
movsd 0x8(%rsp), %xmm0
movq 0x28(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x18(%rsp), %edx
movl 0x1c(%rsp), %ecx
subsd (%rax), %xmm0
callq 0x1770
movl %eax, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopl (%rax)
// File: zeeev[P]DASVC/bamtools/src/api/BamAlignment.cpp
// Function: BamTools::BamAlignment::FindTag(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char*&, unsigned int const&, unsigned int&) const
bool BamAlignment::FindTag(const std::string& tag,
                           char*& pTagData,
                           const unsigned int& tagDataLength,
                           unsigned int& numBytesParsed) const
{

    while ( numBytesParsed < tagDataLength ) {

        const char* pTagType        = pTagData;
        const char* pTagStorageType = pTagData + 2;
        pTagData       += 3;
        numBytesParsed += 3;

        // check the current tag, return true on match
        if ( strncmp(pTagType, tag.c_str(), 2) == 0 )
            return true;

        // get the storage class and find the next tag
        if ( *pTagStorageType == '\0' ) return false;
        if ( !SkipToNextTag(*pTagStorageType, pTagData, numBytesParsed) ) return false;
        if ( *pTagData == '\0' ) return false;
    }

    // checked all tags, none match
    return false;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movq %r8, 0x28(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movl (%rax), %eax
movq 0x30(%rsp), %rcx
cmpl (%rcx), %eax
jae 0x8772f
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x38(%rsp), %rax
movq (%rax), %rax
addq $0x2, %rax
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rax
movq (%rax), %rcx
addq $0x3, %rcx
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movl (%rax), %ecx
addl $0x3, %ecx
movl %ecx, (%rax)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rdi
callq 0x73020
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movl $0x2, %edx
callq 0x735f0
cmpl $0x0, %eax
jne 0x876d6
movb $0x1, 0x57(%rsp)
jmp 0x87734
movq 0x18(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x876ea
movb $0x0, 0x57(%rsp)
jmp 0x87734
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
movb (%rax), %al
movq 0x38(%rsp), %rdx
movq 0x28(%rsp), %rcx
movsbl %al, %esi
callq 0x741e0
testb $0x1, %al
jne 0x87713
movb $0x0, 0x57(%rsp)
jmp 0x87734
movq 0x38(%rsp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x8772a
movb $0x0, 0x57(%rsp)
jmp 0x87734
jmp 0x87657
movb $0x0, 0x57(%rsp)
movb 0x57(%rsp), %al
andb $0x1, %al
addq $0x58, %rsp
retq
nop
// File: zeeev[P]DASVC/bamtools/src/api/BamAlignment.cpp
// Function: BamTools::BamAlignment::GetEndPosition(bool, bool) const
int BamAlignment::GetEndPosition(bool usePadded, bool closedInterval) const {

    // initialize alignment end to starting position
    int alignEnd = Position;

    // iterate over cigar operations
    vector<CigarOp>::const_iterator cigarIter = CigarData.begin();
    vector<CigarOp>::const_iterator cigarEnd  = CigarData.end();
    for ( ; cigarIter != cigarEnd; ++cigarIter) {
        const CigarOp& op = (*cigarIter);

        switch ( op.Type ) {

            // increase end position on CIGAR chars [DMXN=]
            case Constants::BAM_CIGAR_DEL_CHAR      :
            case Constants::BAM_CIGAR_MATCH_CHAR    :
            case Constants::BAM_CIGAR_MISMATCH_CHAR :
            case Constants::BAM_CIGAR_REFSKIP_CHAR  :
            case Constants::BAM_CIGAR_SEQMATCH_CHAR :
                alignEnd += op.Length;
                break;

            // increase end position on insertion, only if @usePadded is true
            case Constants::BAM_CIGAR_INS_CHAR :
                if ( usePadded )
                    alignEnd += op.Length;
                break;

            // all other CIGAR chars do not affect end position
            default :
                break;
        }
    }

    // adjust for closedInterval, if requested
    if ( closedInterval )
        alignEnd -= 1;

    // return result
    return alignEnd;
}

// Assembly:
subq $0x38, %rsp
movb %dl, %al
movb %sil, %cl
movq %rdi, 0x30(%rsp)
andb $0x1, %cl
movb %cl, 0x2f(%rsp)
andb $0x1, %al
movb %al, 0x2e(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movl 0xac(%rdi), %eax
movl %eax, 0x28(%rsp)
addq $0xb8, %rdi
callq 0x75e20
movq 0x8(%rsp), %rdi
movq %rax, 0x20(%rsp)
addq $0xb8, %rdi
callq 0x76450
movq %rax, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x75bf0
testb $0x1, %al
jne 0x87e9e
jmp 0x87f2d
leaq 0x20(%rsp), %rdi
callq 0x765d0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movsbl (%rax), %eax
movl %eax, 0x4(%rsp)
subl $0x3d, %eax
je 0x87eef
jmp 0x87ec0
movl 0x4(%rsp), %eax
subl $0x44, %eax
je 0x87eef
jmp 0x87ecb
movl 0x4(%rsp), %eax
subl $0x49, %eax
je 0x87f01
jmp 0x87ed6
movl 0x4(%rsp), %eax
addl $-0x4d, %eax
subl $0x2, %eax
jb 0x87eef
jmp 0x87ee4
movl 0x4(%rsp), %eax
subl $0x58, %eax
jne 0x87f1a
jmp 0x87eef
movq 0x10(%rsp), %rax
movl 0x4(%rax), %eax
addl 0x28(%rsp), %eax
movl %eax, 0x28(%rsp)
jmp 0x87f1c
testb $0x1, 0x2f(%rsp)
je 0x87f18
movq 0x10(%rsp), %rax
movl 0x4(%rax), %eax
addl 0x28(%rsp), %eax
movl %eax, 0x28(%rsp)
jmp 0x87f1c
jmp 0x87f1c
jmp 0x87f1e
leaq 0x20(%rsp), %rdi
callq 0x72bc0
jmp 0x87e86
testb $0x1, 0x2e(%rsp)
je 0x87f3f
movl 0x28(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x28(%rsp)
movl 0x28(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/BamAlignment.cpp
// Function: BamTools::BamAlignment::HasTag(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
bool BamAlignment::HasTag(const std::string& tag) const {

    // return false if no tag data present
    if ( SupportData.HasCoreOnly || TagData.empty() )
        return false;

    // localize the tag data for lookup
    char* pTagData = (char*)TagData.data();
    const unsigned int tagDataLength = TagData.size();
    unsigned int numBytesParsed = 0;

    // if result of tag lookup
    return FindTag(tag, pTagData, tagDataLength, numBytesParsed);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
testb $0x1, 0x130(%rax)
jne 0x886e8
movq 0x8(%rsp), %rdi
addq $0x88, %rdi
callq 0x7aba0
testb $0x1, %al
jne 0x886e8
jmp 0x886ef
movb $0x0, 0x37(%rsp)
jmp 0x88746
movq 0x8(%rsp), %rdi
addq $0x88, %rdi
callq 0x785e0
movq 0x8(%rsp), %rdi
movq %rax, 0x18(%rsp)
addq $0x88, %rdi
callq 0x74cd0
movq 0x8(%rsp), %rdi
movl %eax, 0x14(%rsp)
movl $0x0, 0x10(%rsp)
movq 0x20(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
callq 0x77c80
andb $0x1, %al
movb %al, 0x37(%rsp)
movb 0x37(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/BamAux.h
// Function: BamTools::SwapEndian_32(unsigned int&)
API_EXPORT inline void SwapEndian_32(uint32_t& x) {
    x = ( (x >> 24) | 
         ((x << 8) & 0x00FF0000) | 
         ((x >> 8) & 0x0000FF00) | 
          (x << 24)
        );
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movl (%rax), %ecx
shrl $0x18, %ecx
movq -0x8(%rsp), %rax
movl (%rax), %eax
shll $0x8, %eax
andl $0xff0000, %eax         # imm = 0xFF0000
orl %eax, %ecx
movq -0x8(%rsp), %rax
movl (%rax), %eax
shrl $0x8, %eax
andl $0xff00, %eax           # imm = 0xFF00
orl %eax, %ecx
movq -0x8(%rsp), %rax
movl (%rax), %eax
shll $0x18, %eax
orl %eax, %ecx
movq -0x8(%rsp), %rax
movl %ecx, (%rax)
retq
nopw %cs:(%rax,%rax)
nop
// File: zeeev[P]DASVC/bamtools/src/api/internal/bam/BamMultiMerger_p.h
// Function: BamTools::Internal::MultiMerger<BamTools::Algorithms::Sort::Unsorted>::Remove(BamTools::BamReader*)
inline
void MultiMerger<Algorithms::Sort::Unsorted>::Remove(BamReader* reader) {

    if ( reader == 0 ) return;
    const std::string filenameToRemove = reader->GetFilename();

    // iterate over readers in cache
    DataIterator dataIter = m_data.begin();
    DataIterator dataEnd  = m_data.end();
    for ( ; dataIter != dataEnd; ++dataIter ) {
        const MergeItem& item = (*dataIter);
        const BamReader* itemReader = item.Reader;
        if ( itemReader == 0 ) continue;

        // remove iterator on match
        if ( itemReader->GetFilename() == filenameToRemove ) {
            m_data.erase(dataIter);
            return;
        }
    }
}

// Assembly:
subq $0x128, %rsp            # imm = 0x128
movq %rdi, 0x120(%rsp)
movq %rsi, 0x118(%rsp)
movq 0x120(%rsp), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x118(%rsp)
jne 0x8bee4
jmp 0x8c081
movq 0x118(%rsp), %rsi
leaq 0xf8(%rsp), %rdi
callq 0x741b0
movq 0x28(%rsp), %rsi
addq $0x8, %rsi
leaq 0xd8(%rsp), %rdi
callq 0x77e20
jmp 0x8bf11
movq 0x28(%rsp), %rsi
addq $0x8, %rsi
leaq 0xa8(%rsp), %rdi
callq 0x74ba0
jmp 0x8bf29
jmp 0x8bf2b
leaq 0xd8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x719c0
movb %al, 0x27(%rsp)
jmp 0x8bf46
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x8bf53
jmp 0x8c06c
leaq 0xd8(%rsp), %rdi
callq 0x7bec0
movq %rax, 0x18(%rsp)
jmp 0x8bf67
movq 0x18(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x98(%rsp)
cmpq $0x0, 0x98(%rsp)
jne 0x8bfb0
jmp 0x8c058
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
jmp 0x8c089
movq 0x98(%rsp), %rsi
leaq 0x78(%rsp), %rdi
callq 0x741b0
jmp 0x8bfc4
leaq 0x78(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x74120
movb %al, 0x17(%rsp)
jmp 0x8bfdc
leaq 0x78(%rsp), %rdi
callq 0x7cce8
jmp 0x8bfe8
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x8bff2
jmp 0x8c056
movq 0x28(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x8(%rsp)
leaq 0x58(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x7a6a0
jmp 0x8c014
movq 0x8(%rsp), %rsi
leaq 0x38(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x7b950
jmp 0x8c02a
movl $0x1, 0x34(%rsp)
jmp 0x8c074
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x7cce8
jmp 0x8c054
jmp 0x8c089
jmp 0x8c058
leaq 0xd8(%rsp), %rdi
callq 0x74c70
jmp 0x8c067
jmp 0x8bf2b
movl $0x0, 0x34(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x7cce8
addq $0x128, %rsp            # imm = 0x128
retq
leaq 0xf8(%rsp), %rdi
callq 0x7cce8
jmp 0x8c098
jmp 0x8c09a
movq 0xd0(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nop
// File: zeeev[P]DASVC/bamtools/src/api/SamHeader.cpp
// Function: BamTools::SamHeader::SetHeaderText(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void SamHeader::SetHeaderText(const std::string& headerText) {

    // clear prior data
    Clear();

    try {
        SamFormatParser parser(*this);
        parser.Parse(headerText);
    } catch ( BamException& e ) {

        // clear anything parsed so far
        // no telling what's valid and what's partially parsed
        Clear();

        // set error string
        m_errorString = e.what();
    }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x7c7f0
movq (%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x74bb0
jmp 0x8f74c
movq 0x28(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x75100
jmp 0x8f75d
leaq 0x20(%rsp), %rdi
callq 0x75110
jmp 0x8f769
jmp 0x8f7e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
jmp 0x8f797
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x75110
jmp 0x8f795
jmp 0x8f797
movl 0x14(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x8f802
movq 0x18(%rsp), %rdi
callq 0x72fc0
movq (%rsp), %rdi
movq %rax, 0x8(%rsp)
callq 0x7c7f0
jmp 0x8f7be
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq (%rsp), %rdi
movq %rax, %rsi
addq $0x138, %rdi            # imm = 0x138
callq 0x78d10
jmp 0x8f7e1
callq 0x7a790
addq $0x38, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
callq 0x7a790
jmp 0x8f800
jmp 0x8f802
movq 0x18(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nopw %cs:(%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/SamHeader.cpp
// Function: BamTools::SamHeader::Clear()
void SamHeader::Clear(void) {

    // clear SAM header components
    Version.clear();
    SortOrder.clear();
    GroupOrder.clear();
    CustomTags.clear();
    Sequences.Clear();
    ReadGroups.Clear();
    Programs.Clear();
    Comments.clear();

    // clear error string
    m_errorString.clear();
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x78800
movq 0x8(%rsp), %rdi
addq $0x20, %rdi
callq 0x78800
movq 0x8(%rsp), %rdi
addq $0x40, %rdi
callq 0x78800
movq 0x8(%rsp), %rdi
addq $0x60, %rdi
callq 0x73dc0
movq 0x8(%rsp), %rdi
addq $0x78, %rdi
callq 0x72550
movq 0x8(%rsp), %rdi
addq $0xc0, %rdi
callq 0x76790
movq 0x8(%rsp), %rdi
addq $0x108, %rdi            # imm = 0x108
callq 0x76a00
movq 0x8(%rsp), %rdi
addq $0x120, %rdi            # imm = 0x120
callq 0x76660
movq 0x8(%rsp), %rdi
addq $0x138, %rdi            # imm = 0x138
callq 0x78800
addq $0x18, %rsp
retq
nopl (%rax)
// File: zeeev[P]DASVC/bamtools/src/api/SamHeader.cpp
// Function: BamTools::SamHeader::IsValid(bool) const
bool SamHeader::IsValid(bool verbose) const {

    SamHeaderValidator validator(*this);

    // if SAM header is valid, return success
    if ( validator.Validate() )
        return true;

    // otherwiser
    else {

        // print messages to stderr
        if ( verbose )
            validator.PrintMessages(std::cerr);

        // or catch in local error string
        else {
            stringstream errorStream("");
            validator.PrintMessages(errorStream);
            m_errorString = errorStream.str();
        }
        return false;
    }
}

// Assembly:
subq $0x258, %rsp            # imm = 0x258
movb %sil, %al
movq %rdi, 0x248(%rsp)
andb $0x1, %al
movb %al, 0x247(%rsp)
movq 0x248(%rsp), %rsi
movq %rsi, 0x10(%rsp)
leaq 0x208(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x71810
movq 0x18(%rsp), %rdi
callq 0x76430
movb %al, 0x27(%rsp)
jmp 0x8fe4a
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x8fe54
jmp 0x8fe85
movb $0x1, 0x257(%rsp)
movl $0x1, 0x1f8(%rsp)
jmp 0x9000b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x90029
testb $0x1, 0x247(%rsp)
je 0x8feaa
movq 0x82152(%rip), %rsi     # 0x111fe8
leaq 0x208(%rsp), %rdi
callq 0x7a040
jmp 0x8fea5
jmp 0x8fff8
leaq 0x4f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x7b5f0
movq 0x8(%rsp), %rdx
leaq 0x5b217(%rip), %rsi     # 0xeb0dc
leaq 0x50(%rsp), %rdi
callq 0x78e70
jmp 0x8fed1
movl $0x10, %edi
movl $0x8, %esi
callq 0x7b8d0
movl %eax, 0x4(%rsp)
jmp 0x8fee6
movl 0x4(%rsp), %edx
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x7a4b0
jmp 0x8fefb
leaq 0x50(%rsp), %rdi
callq 0x7cce8
jmp 0x8ff07
leaq 0x4f(%rsp), %rdi
callq 0x76f80
leaq 0x80(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x7a040
jmp 0x8ff28
leaq 0x28(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x76880
jmp 0x8ff39
movq 0x10(%rsp), %rdi
addq $0x138, %rdi            # imm = 0x138
leaq 0x28(%rsp), %rsi
callq 0x71240
jmp 0x8ff51
leaq 0x28(%rsp), %rdi
callq 0x7cce8
jmp 0x8ff5d
leaq 0x70(%rsp), %rdi
callq 0x74f60
jmp 0x8ff69
jmp 0x8fff8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x8ffa6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x7cce8
jmp 0x8ffa4
jmp 0x8ffa6
leaq 0x4f(%rsp), %rdi
callq 0x76f80
jmp 0x90029
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x8ffea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x7cce8
jmp 0x8ffe8
jmp 0x8ffea
leaq 0x70(%rsp), %rdi
callq 0x74f60
jmp 0x8fff6
jmp 0x90029
movb $0x0, 0x257(%rsp)
movl $0x1, 0x1f8(%rsp)
leaq 0x208(%rsp), %rdi
callq 0x71dd0
movb 0x257(%rsp), %al
andb $0x1, %al
addq $0x258, %rsp            # imm = 0x258
retq
leaq 0x208(%rsp), %rdi
callq 0x71dd0
jmp 0x90038
jmp 0x9003a
movq 0x200(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nop
// File: zeeev[P]DASVC/bamtools/src/api/SamProgram.cpp
// Function: BamTools::SamProgram::Clear()
void SamProgram::Clear(void) {
    CommandLine.clear();
    ID.clear();
    Name.clear();
    PreviousProgramID.clear();
    Version.clear();
    NextProgramID.clear();
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x78800
movq 0x8(%rsp), %rdi
addq $0x20, %rdi
callq 0x78800
movq 0x8(%rsp), %rdi
addq $0x40, %rdi
callq 0x78800
movq 0x8(%rsp), %rdi
addq $0x60, %rdi
callq 0x78800
movq 0x8(%rsp), %rdi
addq $0x80, %rdi
callq 0x78800
movq 0x8(%rsp), %rdi
addq $0xb8, %rdi
callq 0x78800
addq $0x18, %rsp
retq
nopl (%rax)
// File: zeeev[P]DASVC/bamtools/src/api/SamProgramChain.cpp
// Function: BamTools::SamProgramChain::Add(BamTools::SamProgram&)
void SamProgramChain::Add(SamProgram& program) {

    // ignore duplicated records
    if ( Contains(program) )
        return;

    // if other programs already in chain, try to find the "next" record
    // tries to match another record's PPID with @program's ID
    if ( !IsEmpty() )
        program.NextProgramID = NextIdFor(program.ID);

    // store program record
    m_data.push_back(program);
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movq 0x48(%rsp), %rsi
callq 0x74330
testb $0x1, %al
jne 0x91c08
jmp 0x91c0a
jmp 0x91c84
movq 0x10(%rsp), %rdi
callq 0x7b6d0
testb $0x1, %al
jne 0x91c75
movq 0x10(%rsp), %rsi
movq 0x48(%rsp), %rdx
addq $0x20, %rdx
leaq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x73c20
movq 0x8(%rsp), %rsi
movq 0x48(%rsp), %rdi
addq $0xb8, %rdi
callq 0x71240
jmp 0x91c4d
leaq 0x28(%rsp), %rdi
callq 0x7cce8
jmp 0x91c75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x7cce8
jmp 0x91c73
jmp 0x91c89
movq 0x10(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x7aac0
addq $0x58, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nopl (%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/SamProgramChain.cpp
// Function: BamTools::SamProgramChain::NextIdFor(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
const std::string SamProgramChain::NextIdFor(const std::string& programId) const {

    // find first record in container whose PreviousProgramID matches @programId
    SamProgramConstIterator iter = ConstBegin();
    SamProgramConstIterator end  = ConstEnd();
    for ( ; iter != end; ++iter ) {
        const SamProgram& current = (*iter);
        if ( !current.HasPreviousProgramID() &&
              current.PreviousProgramID == programId
           )
        {
            return current.ID;
        }
    }

    // none found
    return string();
}

// Assembly:
subq $0x48, %rsp
movq %rdi, (%rsp)
movq %rdi, %rax
movq %rax, 0x8(%rsp)
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq 0x38(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x738b0
movq 0x10(%rsp), %rdi
movq %rax, 0x28(%rsp)
callq 0x7c8a0
movq %rax, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x71760
testb $0x1, %al
jne 0x91d47
jmp 0x91d9f
leaq 0x28(%rsp), %rdi
callq 0x7b140
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x794e0
testb $0x1, %al
jne 0x91d91
movq 0x18(%rsp), %rdi
addq $0x60, %rdi
movq 0x30(%rsp), %rsi
callq 0x74120
testb $0x1, %al
jne 0x91d7d
jmp 0x91d91
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
addq $0x20, %rsi
callq 0x73370
jmp 0x91da8
jmp 0x91d93
leaq 0x28(%rsp), %rdi
callq 0x78180
jmp 0x91d32
movq (%rsp), %rdi
callq 0x79100
movq 0x8(%rsp), %rax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/SamProgramChain.cpp
// Function: BamTools::SamProgramChain::Add(std::vector<BamTools::SamProgram, std::allocator<BamTools::SamProgram>>&)
void SamProgramChain::Add(std::vector<SamProgram>& programs) {
    vector<SamProgram>::iterator pgIter = programs.begin();
    vector<SamProgram>::iterator pgEnd  = programs.end();
    for ( ; pgIter != pgEnd; ++pgIter )
        Add(*pgIter);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rdi
callq 0x77130
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
callq 0x79390
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x73fc0
testb $0x1, %al
jne 0x91e0a
jmp 0x91e2c
leaq 0x10(%rsp), %rdi
callq 0x78610
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x76700
leaq 0x10(%rsp), %rdi
callq 0x74cb0
jmp 0x91df5
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: zeeev[P]DASVC/bamtools/src/api/SamProgramChain.cpp
// Function: BamTools::SamProgramChain::IndexOf(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
int SamProgramChain::IndexOf(const std::string& programId) const {
    SamProgramConstIterator begin = ConstBegin();
    SamProgramConstIterator iter  = begin;
    SamProgramConstIterator end   = ConstEnd();
    for ( ; iter != end; ++iter ) {
        const SamProgram& current = (*iter);
        if ( current.ID == programId )
            break;
    }
    return distance( begin, iter );
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x738b0
movq (%rsp), %rdi
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x28(%rsp)
callq 0x7c8a0
movq %rax, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x71760
testb $0x1, %al
jne 0x91fae
jmp 0x91fe6
leaq 0x28(%rsp), %rdi
callq 0x7b140
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
addq $0x20, %rdi
movq 0x38(%rsp), %rsi
callq 0x74120
testb $0x1, %al
jne 0x91fd6
jmp 0x91fd8
jmp 0x91fe6
jmp 0x91fda
leaq 0x28(%rsp), %rdi
callq 0x78180
jmp 0x91f99
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x788a0
addq $0x48, %rsp
retq
nop
// File: zeeev[P]DASVC/bamtools/src/api/SamProgramChain.cpp
// Function: BamTools::SamProgramChain::First()
SamProgram& SamProgramChain::First(void) {

    // find first record in container that has no PreviousProgramID entry
    SamProgramIterator iter = Begin();
    SamProgramIterator end  = End();
    for ( ; iter != end; ++iter ) {
        SamProgram& current = (*iter);
        if ( !current.HasPreviousProgramID() )
            return current;
    }

    // otherwise error
    cerr << "SamProgramChain::First: could not find any record without a PP tag" << endl;
    exit(1);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x71960
movq (%rsp), %rdi
movq %rax, 0x18(%rsp)
callq 0x7cad0
movq %rax, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x73fc0
testb $0x1, %al
jne 0x920af
jmp 0x920e4
leaq 0x18(%rsp), %rdi
callq 0x78610
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
callq 0x794e0
testb $0x1, %al
jne 0x920d6
movq 0x8(%rsp), %rax
addq $0x28, %rsp
retq
jmp 0x920d8
leaq 0x18(%rsp), %rdi
callq 0x74cb0
jmp 0x9209a
movq 0x7fefd(%rip), %rdi     # 0x111fe8
leaq 0x58382(%rip), %rsi     # 0xea474
callq 0x768e0
movq %rax, %rdi
movq 0x7fe17(%rip), %rsi     # 0x111f18
callq 0x76cc0
movl $0x1, %edi
callq 0x77ea0
// File: zeeev[P]DASVC/bamtools/src/api/SamProgramChain.cpp
// Function: BamTools::SamProgramChain::First() const
const SamProgram& SamProgramChain::First(void) const {

    // find first record in container that has no PreviousProgramID entry
    SamProgramConstIterator iter = ConstBegin();
    SamProgramConstIterator end  = ConstEnd();
    for ( ; iter != end; ++iter ) {
        const SamProgram& current = (*iter);
        if ( !current.HasPreviousProgramID() )
            return current;
    }

    // otherwise error
    cerr << "SamProgramChain::First: could not find any record without a PP tag" << endl;
    exit(1);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x738b0
movq (%rsp), %rdi
movq %rax, 0x18(%rsp)
callq 0x7c8a0
movq %rax, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x71760
testb $0x1, %al
jne 0x9214f
jmp 0x92184
leaq 0x18(%rsp), %rdi
callq 0x7b140
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
callq 0x794e0
testb $0x1, %al
jne 0x92176
movq 0x8(%rsp), %rax
addq $0x28, %rsp
retq
jmp 0x92178
leaq 0x18(%rsp), %rdi
callq 0x78180
jmp 0x9213a
movq 0x7fe5d(%rip), %rdi     # 0x111fe8
leaq 0x582e2(%rip), %rsi     # 0xea474
callq 0x768e0
movq %rax, %rdi
movq 0x7fd77(%rip), %rsi     # 0x111f18
callq 0x76cc0
movl $0x1, %edi
callq 0x77ea0
// File: zeeev[P]DASVC/bamtools/src/api/SamProgramChain.cpp
// Function: BamTools::SamProgramChain::Last()
SamProgram& SamProgramChain::Last(void) {
    // find first record in container that has no NextProgramID entry
    SamProgramIterator iter = Begin();
    SamProgramIterator end  = End();
    for ( ; iter != end; ++iter ) {
        SamProgram& current = (*iter);
        if ( !current.HasNextProgramID() )
            return current;
    }

    // otherwise error
    cerr << "SamProgramChain::Last: could not determine last record" << endl;
    exit(1);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x71960
movq (%rsp), %rdi
movq %rax, 0x18(%rsp)
callq 0x7cad0
movq %rax, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x73fc0
testb $0x1, %al
jne 0x921ef
jmp 0x92224
leaq 0x18(%rsp), %rdi
callq 0x78610
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
callq 0x77ed0
testb $0x1, %al
jne 0x92216
movq 0x8(%rsp), %rax
addq $0x28, %rsp
retq
jmp 0x92218
leaq 0x18(%rsp), %rdi
callq 0x74cb0
jmp 0x921da
movq 0x7fdbd(%rip), %rdi     # 0x111fe8
leaq 0x58285(%rip), %rsi     # 0xea4b7
callq 0x768e0
movq %rax, %rdi
movq 0x7fcd7(%rip), %rsi     # 0x111f18
callq 0x76cc0
movl $0x1, %edi
callq 0x77ea0