// File: dm4[P]huffman-homework/decode.cc
// Function: main
int main(int argc, const char *argv[]) {
    if (argc != 4) {
        fprintf(stderr, "Usage:\n");
        fprintf(stderr, "    %s huff_table_name compressed.txt decoded_symbol.txt\n", argv[0]);
        exit(1);
    }

    // read symbol-codeword table to construct symbol vector
    printf("Read symbol-codeword table from file: %s\n", argv[1]);
    FILE *fp = fopen(argv[1], "r");
    if (fp == NULL) {
        fprintf(stderr, "Invalid file: %s\n", argv[1]);
        exit(1);
    }
    Symbol tmp;
    while (fscanf(fp, "%s\n%s\n", tmp.symbol, tmp.codeword) != EOF) {
        Symbol *ptr = (Symbol *)malloc(sizeof(Symbol));
        strcpy(ptr->symbol, tmp.symbol);
        strcpy(ptr->codeword, tmp.codeword);
        ptr->cl = strlen(tmp.codeword);
        symbols.push_back(ptr);
    }
    fclose(fp);

    // sort
    printf("Sort by codewords\n");
    sort(symbols.begin(), symbols.end(), cmpSymbol);

    // LUT
    printf("Construct LUT\n");
    map<int, int> buildLUT;
    int height = 0;
    int previousBuildLUT = -1;
    for (int i = 0; i < symbols.size(); i++) {
        Symbol *p = symbols[i];
        if (p->cl > height) {
            height += 4;
        }

        // build new lookup
        int nowBuildLUT = bin2dec(0, height - 4, p->codeword);
        if (nowBuildLUT != previousBuildLUT) {
            Lookup *ptr = (Lookup *)malloc(sizeof(Lookup));
            LUT.push_back(ptr);
            buildLUT[nowBuildLUT] = LUT.size() - 1;
            previousBuildLUT = nowBuildLUT;

            // set link
            if (height >= 8) {
                int previousLUT = buildLUT[bin2dec(0, height - 8, p->codeword)];
                Lookup *previous = LUT[previousLUT];
                int index = bin2dec(height - 8, height - 4, p->codeword);
                previous->isSymbol[index] = false;
                previous->next[index] = LUT.size() - 1;
            }
        }

        // set lookup entries
        int depth = height - p->cl;
        int subNum  = 1 << depth;
        // 1111 1111 10, base is 8
        int base = calcBase(height, p->codeword);
        for (int j = 0; j < subNum; j++) {
            LUT[LUT.size() - 1]->isSymbol[base + j] = true;
            LUT[LUT.size() - 1]->next[base + j] = i;
        }
    }

    // print LUT
    if (1) {
        for (int i = 0; i < LUT.size(); i++) {
            printf("LUT[%d]\n", i);
            for (int j = 0; j < 16; j++) {
                Lookup *ptr = LUT[i];
                if (ptr->isSymbol[j]) {
                    printf("[%2d] %s %s\n", j, symbols[ptr->next[j]]->symbol, symbols[ptr->next[j]]->codeword);
                }
                else {
                    printf("[%2d] LUT[%d]\n", j, ptr->next[j]);
                }
            }
        }
    }

    // read from compressed text file
    printf("Read compressed text from file: %s\n", argv[2]);
    FILE *cfp = fopen(argv[2], "r");
    if (cfp == NULL) {
        fprintf(stderr, "Invalid file: %s\n", argv[2]);
        exit(1);
    }
    FILE *fout = fopen(argv[3], "w");
    if (fout == NULL) {
        fprintf(stderr, "Couldn't open file: %s\n", argv[3]);
        exit(1);
    }
    char buf[5] = {0};
    int  nowLUT = 0;
    int  nowCL  = 0;
    while(!feof(cfp)) {
        // align buffer to left
        alignBuf(buf);

        // read from compressed text
        bool isEOF = false;
        for (int i = 0; i < 4; i++) {
            if (buf[i] == 0) {
                int c;
                while (c = fgetc(cfp)) {
                    if (c == '0' || c == '1' || c == EOF)
                        break;
                }
                if (c == EOF) {
                    isEOF = true;
                    break;
                }
                buf[i] = c;
            }
        }
        if (isEOF && strlen(buf) == 0)
            break;

        //
        int index = bin2dec(0, 4, buf);
        printf("Bufffer %s\n", buf);
        Lookup *table = LUT[nowLUT];
        if (table->isSymbol[index]) {
            Symbol *s = symbols[table->next[index]];
            printf("Symbol  %s\n", s->symbol);
            fprintf(fout, "%s\n", s->symbol);
            int shift = s->cl - nowCL;
            for (int i = 0; i < shift; i++) {
                buf[i] = 0;
            }
            nowCL  = 0;
            nowLUT = 0;
        }
        else {
            printf("Jump to LUT[%d]\n", table->next[index]);
            nowLUT = table->next[index];
            nowCL += 4;
            for (int i = 0; i < 4; i++) {
                buf[i] = 0;
            }
        }
    }
    fclose(cfp);
    fclose(fout);

    // deconstruct symbol vector
    for (int i = 0; i < symbols.size(); i++) {
        free(symbols[i]);
    }

    // deconstruct LUT
    for (int i = 0; i < LUT.size(); i++) {
        free(LUT[i]);
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x4, -0x8(%rbp)
je 0x1620
movq 0x99fa(%rip), %rax      # 0xafe0
movq (%rax), %rdi
leaq 0x5a14(%rip), %rsi      # 0x7004
movb $0x0, %al
callq 0x1190
movq 0x99e2(%rip), %rax      # 0xafe0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0x59fd(%rip), %rsi      # 0x700c
movb $0x0, %al
callq 0x1190
movl $0x1, %edi
callq 0x1150
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x5a17(%rip), %rdi      # 0x7046
movb $0x0, %al
callq 0x1030
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x5a2b(%rip), %rsi      # 0x7070
callq 0x1130
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x167f
movq 0x9984(%rip), %rax      # 0xafe0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x5a04(%rip), %rsi      # 0x7072
movb $0x0, %al
callq 0x1190
movl $0x1, %edi
callq 0x1150
jmp 0x1681
movq -0x18(%rbp), %rdi
leaq -0x34(%rbp), %rdx
leaq -0x34(%rbp), %rcx
addq $0x4, %rcx
leaq 0x59ec(%rip), %rsi      # 0x7084
movb $0x0, %al
callq 0x1200
cmpl $-0x1, %eax
je 0x16fc
movl $0x1c, %edi
callq 0x1160
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x10e0
movq -0x40(%rbp), %rdi
addq $0x4, %rdi
leaq -0x34(%rbp), %rsi
addq $0x4, %rsi
callq 0x10e0
leaq -0x34(%rbp), %rdi
addq $0x4, %rdi
callq 0x1080
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x18(%rax)
leaq 0x9a37(%rip), %rdi      # 0xb128
leaq -0x40(%rbp), %rsi
callq 0x21a0
jmp 0x1681
movq -0x18(%rbp), %rdi
callq 0x10f0
leaq 0x597f(%rip), %rdi      # 0x708b
movb $0x0, %al
callq 0x1030
leaq 0x9a0e(%rip), %rdi      # 0xb128
callq 0x2260
movq %rax, -0x48(%rbp)
leaq 0x99fe(%rip), %rdi      # 0xb128
callq 0x2290
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rsi
leaq -0x3c2(%rip), %rdx      # 0x1380
callq 0x2210
leaq 0x5950(%rip), %rdi      # 0x709e
movb $0x0, %al
callq 0x1030
leaq -0x80(%rbp), %rdi
callq 0x22c0
movl $0x0, -0x84(%rbp)
movl $0xffffffff, -0x88(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x8c(%rbp)
movslq -0x8c(%rbp), %rax
movq %rax, -0x150(%rbp)
leaq 0x9997(%rip), %rdi      # 0xb128
callq 0x22e0
movq %rax, %rcx
movq -0x150(%rbp), %rax
cmpq %rcx, %rax
jae 0x1a84
movslq -0x8c(%rbp), %rsi
leaq 0x9971(%rip), %rdi      # 0xb128
callq 0x2300
movq (%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movl 0x18(%rax), %eax
cmpl -0x84(%rbp), %eax
jle 0x17e7
movl -0x84(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %esi
subl $0x4, %esi
movq -0x98(%rbp), %rdx
addq $0x4, %rdx
xorl %edi, %edi
callq 0x1460
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0x88(%rbp), %eax
je 0x197d
movl $0x50, %edi
callq 0x1160
movq %rax, -0xa8(%rbp)
leaq 0x990e(%rip), %rdi      # 0xb140
leaq -0xa8(%rbp), %rsi
callq 0x2320
jmp 0x1840
leaq 0x98f9(%rip), %rdi      # 0xb140
callq 0x2390
decl %eax
movl %eax, -0x15c(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x9c(%rbp), %rsi
callq 0x23b0
movq %rax, -0x158(%rbp)
jmp 0x186d
movq -0x158(%rbp), %rax
movl -0x15c(%rbp), %ecx
movl %ecx, (%rax)
movl -0x9c(%rbp), %eax
movl %eax, -0x88(%rbp)
cmpl $0x8, -0x84(%rbp)
jl 0x197b
movl -0x84(%rbp), %esi
addl $-0x8, %esi
movq -0x98(%rbp), %rdx
addq $0x4, %rdx
xorl %edi, %edi
callq 0x1460
movl %eax, -0xbc(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0xbc(%rbp), %rsi
callq 0x2490
movq %rax, -0x168(%rbp)
jmp 0x18cf
movq -0x168(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xb8(%rbp)
movslq -0xb8(%rbp), %rsi
leaq 0x9854(%rip), %rdi      # 0xb140
callq 0x2570
movq (%rax), %rax
movq %rax, -0xc8(%rbp)
movl -0x84(%rbp), %edi
subl $0x8, %edi
movl -0x84(%rbp), %esi
subl $0x4, %esi
movq -0x98(%rbp), %rdx
addq $0x4, %rdx
callq 0x1460
movl %eax, -0xcc(%rbp)
movq -0xc8(%rbp), %rax
movslq -0xcc(%rbp), %rcx
movb $0x0, 0x40(%rax,%rcx)
leaq 0x9803(%rip), %rdi      # 0xb140
callq 0x2390
subq $0x1, %rax
movl %eax, %edx
movq -0xc8(%rbp), %rax
movslq -0xcc(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x197b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x2590
jmp 0x2091
jmp 0x197d
movl -0x84(%rbp), %eax
movq -0x98(%rbp), %rcx
subl 0x18(%rcx), %eax
movl %eax, -0xd0(%rbp)
movl -0xd0(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0xd4(%rbp)
movl -0x84(%rbp), %edi
movq -0x98(%rbp), %rsi
addq $0x4, %rsi
callq 0x13f0
movl %eax, -0xd8(%rbp)
movl $0x0, -0xdc(%rbp)
movl -0xdc(%rbp), %eax
cmpl -0xd4(%rbp), %eax
jge 0x1a6e
leaq 0x975b(%rip), %rdi      # 0xb140
callq 0x2390
movq %rax, %rsi
subq $0x1, %rsi
leaq 0x9748(%rip), %rdi      # 0xb140
callq 0x2570
movq (%rax), %rax
movl -0xd8(%rbp), %ecx
addl -0xdc(%rbp), %ecx
movslq %ecx, %rcx
movb $0x1, 0x40(%rax,%rcx)
movl -0x8c(%rbp), %eax
movl %eax, -0x16c(%rbp)
leaq 0x9719(%rip), %rdi      # 0xb140
callq 0x2390
movq %rax, %rsi
subq $0x1, %rsi
leaq 0x9706(%rip), %rdi      # 0xb140
callq 0x2570
movl -0x16c(%rbp), %edx
movq (%rax), %rax
movl -0xd8(%rbp), %ecx
addl -0xdc(%rbp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0xdc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xdc(%rbp)
jmp 0x19cc
jmp 0x1a70
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x177c
movl $0x0, -0xe0(%rbp)
movslq -0xe0(%rbp), %rax
movq %rax, -0x178(%rbp)
leaq 0x969d(%rip), %rdi      # 0xb140
callq 0x2390
movq %rax, %rcx
movq -0x178(%rbp), %rax
cmpq %rcx, %rax
jae 0x1be6
movl -0xe0(%rbp), %esi
leaq 0x55f8(%rip), %rdi      # 0x70c0
xorl %eax, %eax
callq 0x1030
jmp 0x1ad1
movl $0x0, -0xe4(%rbp)
cmpl $0x10, -0xe4(%rbp)
jge 0x1bd0
movslq -0xe0(%rbp), %rsi
leaq 0x964a(%rip), %rdi      # 0xb140
callq 0x2570
movq (%rax), %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movslq -0xe4(%rbp), %rcx
testb $0x1, 0x40(%rax,%rcx)
je 0x1b95
movslq -0xe4(%rbp), %rcx
movl %ecx, %eax
movl %eax, -0x184(%rbp)
movq -0xf0(%rbp), %rax
movslq (%rax,%rcx,4), %rsi
leaq 0x95ed(%rip), %rdi      # 0xb128
movq %rdi, -0x190(%rbp)
callq 0x2300
movq -0x190(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x180(%rbp)
movq -0xf0(%rbp), %rax
movslq -0xe4(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
callq 0x2300
movl -0x184(%rbp), %esi
movq -0x180(%rbp), %rdx
movq (%rax), %rcx
addq $0x4, %rcx
leaq 0x5523(%rip), %rdi      # 0x70ad
xorl %eax, %eax
callq 0x1030
jmp 0x1b93
jmp 0x1bba
movslq -0xe4(%rbp), %rcx
movl %ecx, %esi
movq -0xf0(%rbp), %rax
movl (%rax,%rcx,4), %edx
leaq 0x550b(%rip), %rdi      # 0x70ba
xorl %eax, %eax
callq 0x1030
jmp 0x1bb8
jmp 0x1bba
jmp 0x1bbc
movl -0xe4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe4(%rbp)
jmp 0x1adb
jmp 0x1bd2
movl -0xe0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe0(%rbp)
jmp 0x1a8e
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x54d4(%rip), %rdi      # 0x70c9
xorl %eax, %eax
callq 0x1030
jmp 0x1bfe
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x5463(%rip), %rsi      # 0x7070
callq 0x1130
movq %rax, -0x198(%rbp)
jmp 0x1c1b
movq -0x198(%rbp), %rax
movq %rax, -0xf8(%rbp)
cmpq $0x0, -0xf8(%rbp)
jne 0x1c5d
movq 0x93a6(%rip), %rax      # 0xafe0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0x5426(%rip), %rsi      # 0x7072
movb $0x0, %al
callq 0x1190
movl $0x1, %edi
callq 0x1150
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x5481(%rip), %rsi      # 0x70ed
callq 0x1130
movq %rax, -0x1a0(%rbp)
jmp 0x1c7a
movq -0x1a0(%rbp), %rax
movq %rax, -0x100(%rbp)
cmpq $0x0, -0x100(%rbp)
jne 0x1cbc
movq 0x9347(%rip), %rax      # 0xafe0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdx
leaq 0x5444(%rip), %rsi      # 0x70ef
movb $0x0, %al
callq 0x1190
movl $0x1, %edi
callq 0x1150
leaq -0x105(%rbp), %rdi
xorl %esi, %esi
movl $0x5, %edx
callq 0x10a0
movl $0x0, -0x10c(%rbp)
movl $0x0, -0x110(%rbp)
movq -0xf8(%rbp), %rdi
callq 0x11b0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1d00
jmp 0x1f9b
leaq -0x105(%rbp), %rdi
callq 0x1530
movb $0x0, -0x111(%rbp)
movl $0x0, -0x118(%rbp)
cmpl $0x4, -0x118(%rbp)
jge 0x1dc2
movslq -0x118(%rbp), %rax
movsbl -0x105(%rbp,%rax), %eax
cmpl $0x0, %eax
jne 0x1dac
jmp 0x1d40
movq -0xf8(%rbp), %rdi
callq 0x11c0
movl %eax, -0x1a4(%rbp)
jmp 0x1d54
movl -0x1a4(%rbp), %eax
movl %eax, -0x11c(%rbp)
cmpl $0x0, %eax
je 0x1d84
cmpl $0x30, -0x11c(%rbp)
je 0x1d80
cmpl $0x31, -0x11c(%rbp)
je 0x1d80
cmpl $-0x1, -0x11c(%rbp)
jne 0x1d82
jmp 0x1d84
jmp 0x1d40
cmpl $-0x1, -0x11c(%rbp)
jne 0x1d96
movb $0x1, -0x111(%rbp)
jmp 0x1dc2
movl -0x11c(%rbp), %eax
movb %al, %cl
movslq -0x118(%rbp), %rax
movb %cl, -0x105(%rbp,%rax)
jmp 0x1dae
movl -0x118(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x118(%rbp)
jmp 0x1d1d
testb $0x1, -0x111(%rbp)
je 0x1de2
leaq -0x105(%rbp), %rdi
callq 0x1080
cmpq $0x0, %rax
jne 0x1de2
jmp 0x1f9b
xorl %edi, %edi
movl %edi, -0x1a8(%rbp)
movl $0x4, %esi
leaq -0x105(%rbp), %rdx
movq %rdx, -0x1b0(%rbp)
callq 0x1460
movq -0x1b0(%rbp), %rsi
movl %eax, %ecx
movl -0x1a8(%rbp), %eax
movl %ecx, -0x120(%rbp)
leaq 0x52e9(%rip), %rdi      # 0x7107
callq 0x1030
jmp 0x1e25
movslq -0x10c(%rbp), %rsi
leaq 0x930d(%rip), %rdi      # 0xb140
callq 0x2570
movq (%rax), %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movslq -0x120(%rbp), %rcx
testb $0x1, 0x40(%rax,%rcx)
je 0x1f1a
movq -0x128(%rbp), %rax
movslq -0x120(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
leaq 0x92b4(%rip), %rdi      # 0xb128
callq 0x2300
movq (%rax), %rax
movq %rax, -0x130(%rbp)
movq -0x130(%rbp), %rsi
leaq 0x5282(%rip), %rdi      # 0x7113
xorl %eax, %eax
callq 0x1030
jmp 0x1e9a
movq -0x100(%rbp), %rdi
movq -0x130(%rbp), %rdx
leaq 0x51d8(%rip), %rsi      # 0x7087
movb $0x0, %al
callq 0x1190
movq -0x130(%rbp), %rax
movl 0x18(%rax), %eax
subl -0x110(%rbp), %eax
movl %eax, -0x134(%rbp)
movl $0x0, -0x138(%rbp)
movl -0x138(%rbp), %eax
cmpl -0x134(%rbp), %eax
jge 0x1f04
movslq -0x138(%rbp), %rax
movb $0x0, -0x105(%rbp,%rax)
movl -0x138(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x138(%rbp)
jmp 0x1ed6
movl $0x0, -0x110(%rbp)
movl $0x0, -0x10c(%rbp)
jmp 0x1f96
movq -0x128(%rbp), %rax
movslq -0x120(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq 0x51ed(%rip), %rdi      # 0x711f
xorl %eax, %eax
callq 0x1030
jmp 0x1f3b
movq -0x128(%rbp), %rax
movslq -0x120(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x10c(%rbp)
movl -0x110(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x110(%rbp)
movl $0x0, -0x13c(%rbp)
cmpl $0x4, -0x13c(%rbp)
jge 0x1f94
movslq -0x13c(%rbp), %rax
movb $0x0, -0x105(%rbp,%rax)
movl -0x13c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x13c(%rbp)
jmp 0x1f6b
jmp 0x1f96
jmp 0x1ce3
movq -0xf8(%rbp), %rdi
callq 0x10f0
jmp 0x1fa9
movq -0x100(%rbp), %rdi
callq 0x10f0
jmp 0x1fb7
movl $0x0, -0x140(%rbp)
movslq -0x140(%rbp), %rax
movq %rax, -0x1b8(%rbp)
leaq 0x9152(%rip), %rdi      # 0xb128
callq 0x22e0
movq %rax, %rcx
movq -0x1b8(%rbp), %rax
cmpq %rcx, %rax
jae 0x2016
movslq -0x140(%rbp), %rsi
leaq 0x9130(%rip), %rdi      # 0xb128
callq 0x2300
movq (%rax), %rdi
callq 0x1140
movl -0x140(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x140(%rbp)
jmp 0x1fc1
movl $0x0, -0x144(%rbp)
movslq -0x144(%rbp), %rax
movq %rax, -0x1c0(%rbp)
leaq 0x910b(%rip), %rdi      # 0xb140
callq 0x2390
movq %rax, %rcx
movq -0x1c0(%rbp), %rax
cmpq %rcx, %rax
jae 0x2075
movslq -0x144(%rbp), %rsi
leaq 0x90e9(%rip), %rdi      # 0xb140
callq 0x2570
movq (%rax), %rdi
callq 0x1140
movl -0x144(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x144(%rbp)
jmp 0x2020
movl $0x0, -0x4(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x2590
movl -0x4(%rbp), %eax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
movq -0xb0(%rbp), %rdi
callq 0x11f0
nopl (%rax)