// File: /workspace/github_cpp_makefile_star2_O1/mh0fm4[P]SCDC/src/components/dataprov/dataprov_bench.cc
// Function: scdc_dataset_bench::do_cmd_put(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, _scdc_dataset_inout_t*, _scdc_dataset_inout_t*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool do_cmd_put(const string &params, scdc_dataset_input_t *input, scdc_dataset_output_t *output, scdc_result &result)
    {
      SCDC_TRACE("dataset_bench: do_cmd_put: '" << params << "'");

      string p = trim(params);

      scdcint_t total_size = (p.size() > 0)?atoll(p.c_str()):-1;

      FILE *file = 0;

      if (mode == "file") file = fopen("/dev/null", "w");

      bool ret = true;

      while (ret)
      {
        /* min of data left and current size */
        scdcint_t size = min(total_size, SCDC_DATASET_INOUT_BUF_CURRENT(input));

        SCDC_TRACE("do_cmd_put: put data of size = " << size);

        if (file) size = fwrite(SCDC_DATASET_INOUT_BUF_PTR(input), 1, size, file);

        total_size -= size;

        if (!input->next || total_size == 0) break;

        ret = input->next(input, 0);
      }

      if (file) fclose(file);

      return true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rdi, %r14
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x1d19a
leaq 0x304e7(%rip), %rsi     # 0x6b50b
movl $0x2, %ecx
movq %r15, %rdi
movq $-0x1, %rdx
callq 0xb920
cmpq $-0x1, %rax
je 0x3b05c
leaq 0x1(%rax), %rdx
movq 0x10(%rsp), %rcx
cmpq %rax, %rcx
jbe 0x3b1ac
movq %rdx, 0x10(%rsp)
addq 0x8(%rsp), %rdx
jmp 0x3b06a
movq $0x0, 0x10(%rsp)
movq 0x8(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x30497(%rip), %rsi     # 0x6b50b
leaq 0x8(%rsp), %r15
movl $0x2, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0xb980
movq %r15, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0xb0e0
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x1d19a
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x3b0cd
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
cmpq $0x0, 0x30(%rsp)
je 0x3b0e4
movq 0x28(%rsp), %rdi
callq 0xb3e0
movq %rax, %r15
jmp 0x3b0eb
movq $-0x1, %r15
addq $0x78, %r14
leaq 0x30568(%rip), %rsi     # 0x6b65e
movq %r14, %rdi
callq 0xb110
testl %eax, %eax
je 0x3b107
xorl %r14d, %r14d
jmp 0x3b11d
leaq 0x30355(%rip), %rdi     # 0x6b463
leaq 0x30580(%rip), %rsi     # 0x6b695
callq 0xb640
movq %rax, %r14
movb $0x1, %bpl
testb $0x1, %bpl
je 0x3b177
movq 0x20(%rbx), %rax
cmpq %r15, %rax
cmovgeq %r15, %rax
testq %r14, %r14
je 0x3b14a
movq 0x10(%rbx), %rdi
movl $0x1, %esi
movq %rax, %rdx
movq %r14, %rcx
callq 0xba90
movq 0x38(%rbx), %rcx
testq %rcx, %rcx
setne %dl
subq %rax, %r15
setne %r13b
andb %dl, %r13b
cmpb $0x1, %r13b
jne 0x3b172
movq %rbx, %rdi
xorl %esi, %esi
callq *%rcx
testq %rax, %rax
setne %bpl
testb %r13b, %r13b
jne 0x3b120
testq %r14, %r14
je 0x3b184
movq %r14, %rdi
callq 0xb4f0
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x3b19b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
movb $0x1, %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2f3e3(%rip), %rdi     # 0x6a596
leaq 0x2f3c8(%rip), %rsi     # 0x6a582
xorl %eax, %eax
callq 0xb820
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x3b1ef
movq 0x18(%rsp), %rsi
jmp 0x3b1e7
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x3b1ef
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rbx, %rdi
callq 0xb9c0
nop