// File: /workspace/github_cpp_makefile_star2_O3/UBOdin[P]jitd-cpp/src/driver.cpp
// Function: buffer_cmd(std::istream&)
RecordBuffer buffer_cmd(istream &toks)
{
  string fill;
  toks >> fill;

  if(string("random") == fill) {
    int len, max;
    toks >> len >> max;
    return build_buffer(len,max);        

  } else if(string("explicit") == fill) {
    return load_buffer(toks);
  
  } else if(string("file") == fill) {
    ifstream f;
    string filename;
    toks >> filename;
    f.open(filename);
    return load_buffer(f);        
    
  } else {
    cerr << "Invalid Fill Mode: " << fill << endl;
    exit(-1);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x4300
leaq -0x260(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x12c9(%rip), %rsi      # 0x11026
leaq 0x12c8(%rip), %rdx      # 0x1102c
leaq -0x270(%rbp), %rdi
callq 0x78c0
movq -0x268(%rbp), %rdx
cmpq -0x40(%rbp), %rdx
jne 0xfd9d
movq -0x270(%rbp), %r15
testq %rdx, %rdx
je 0xfda9
movq -0x48(%rbp), %rsi
movq %r15, %rdi
callq 0x42a0
testl %eax, %eax
sete %r12b
jmp 0xfdac
movq -0x270(%rbp), %r15
xorl %r12d, %r12d
jmp 0xfdac
movb $0x1, %r12b
cmpq %r13, %r15
je 0xfdc3
movq -0x260(%rbp), %rsi
incq %rsi
movq %r15, %rdi
callq 0x4280
testb %r12b, %r12b
je 0xfdf9
leaq -0x270(%rbp), %rsi
movq %r14, %rdi
callq 0x4150
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x4150
movl -0x270(%rbp), %esi
movl -0x68(%rbp), %edx
movq %rbx, %rdi
callq 0x4adc
jmp 0xff68
leaq -0x270(%rbp), %rdi
movq %r13, (%rdi)
leaq 0x1223(%rip), %rsi      # 0x1102d
leaq 0x1224(%rip), %rdx      # 0x11035
callq 0x78c0
movq -0x268(%rbp), %rdx
cmpq -0x40(%rbp), %rdx
jne 0xfe43
movq -0x270(%rbp), %r15
testq %rdx, %rdx
je 0xfe4f
movq -0x48(%rbp), %rsi
movq %r15, %rdi
callq 0x42a0
testl %eax, %eax
sete %r12b
jmp 0xfe52
movq -0x270(%rbp), %r15
xorl %r12d, %r12d
jmp 0xfe52
movb $0x1, %r12b
cmpq %r13, %r15
je 0xfe69
movq -0x260(%rbp), %rsi
incq %rsi
movq %r15, %rdi
callq 0x4280
testb %r12b, %r12b
je 0xfe7e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4b7f
jmp 0xff68
leaq -0x270(%rbp), %rdi
movq %r13, (%rdi)
leaq 0x2061(%rip), %rsi      # 0x11ef0
leaq 0x205e(%rip), %rdx      # 0x11ef4
callq 0x78c0
movq -0x268(%rbp), %rdx
cmpq -0x40(%rbp), %rdx
jne 0xfec8
movq -0x270(%rbp), %r15
testq %rdx, %rdx
je 0xfed4
movq -0x48(%rbp), %rsi
movq %r15, %rdi
callq 0x42a0
testl %eax, %eax
sete %r12b
jmp 0xfed7
movq -0x270(%rbp), %r15
xorl %r12d, %r12d
jmp 0xfed7
movb $0x1, %r12b
cmpq %r13, %r15
je 0xfeee
movq -0x260(%rbp), %rsi
incq %rsi
movq %r15, %rdi
callq 0x4280
testb %r12b, %r12b
je 0xff96
leaq -0x270(%rbp), %rdi
callq 0x42c0
leaq -0x58(%rbp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq -0x68(%rbp), %rsi
movq %r14, %rdi
callq 0x4300
leaq -0x270(%rbp), %rdi
leaq -0x68(%rbp), %rsi
movl $0x8, %edx
callq 0x41f0
leaq -0x270(%rbp), %rsi
movq %rbx, %rdi
callq 0x4b7f
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0xff5c
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x4280
leaq -0x270(%rbp), %rdi
callq 0x4060
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xff81
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x4280
movq %rbx, %rax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8053(%rip), %rdi      # 0x17ff0
leaq 0x1f51(%rip), %rsi      # 0x11ef5
movl $0x13, %edx
callq 0x42d0
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x8033(%rip), %rdi      # 0x17ff0
callq 0x42d0
movq %rax, %rdi
callq 0x4120
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x42f0
jmp 0x10004
jmp 0x10004
jmp 0x10004
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0xfff2
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x4280
leaq -0x270(%rbp), %rdi
callq 0x4060
jmp 0x10007
jmp 0x10004
jmp 0x10004
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x10020
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x4280
movq %rbx, %rdi
callq 0x4400