// File: mh0fm4[P]SCDC/src/components/compcoup/compcoup_transport.cc
// Function: scdc_compcoup_transport::dataset_input_incoming_consume(scdc_transport_connection_t*, _scdc_dataset_inout_t*, bool*)
bool scdc_compcoup_transport::dataset_input_incoming_consume(scdc_transport_connection_t *conn, scdc_dataset_input_t *input, bool *next)
{
  scdc_dataset_input_t input_null;

  /* use null input for consuming all input */
  if (!input)
  {
    scdc_dataset_input_unset(&input_null);
    input = &input_null;
  }

  *next = true;

  while (*next)
  {
    SCDC_TRACE("dataset_input_incoming_consume: incoming receive");
    if (!dataset_input_incoming_recv(conn, input, next))
    {
      SCDC_FAIL("dataset_input_incoming_consume: receive failed");
      return false;
    }

    if (input == &input_null) continue; 

    if (!input->next) break;

    SCDC_TRACE("dataset_input_incoming_consume: next");
    if (!input->next(input, 0))
    {
      SCDC_FAIL("dataset_input_incoming_consume: next failed");
      return false;
    }
  }

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xa284f
leaq -0x78(%rbp), %rdi
callq 0x433d0
leaq -0x78(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
movb $0x1, (%rax)
movq -0x20(%rbp), %rax
testb $0x1, (%rax)
je 0xa29d7
jmp 0xa2865
jmp 0xa2867
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xa1e40
testb $0x1, %al
jne 0xa290b
jmp 0xa2882
leaq 0x31e1f(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x257e0
cmpq $0x0, %rax
je 0xa2900
leaq 0x31e0a(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x25800
leaq 0x31dfb(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x257e0
movq %rax, %rdi
leaq 0x38f1(%rip), %rsi      # 0xa61b0
callq 0xc670
movq %rax, %rdi
leaq 0x7579(%rip), %rsi      # 0xa9e47
callq 0xc670
movq %rax, %rdi
leaq 0x79df(%rip), %rsi      # 0xaa2bc
callq 0xc670
movq %rax, %rdi
movq 0x316d4(%rip), %rsi     # 0xd3fc0
callq 0xc6d0
leaq 0x31db0(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x25820
jmp 0xa2902
movb $0x0, -0x1(%rbp)
jmp 0xa29db
leaq -0x78(%rbp), %rax
cmpq %rax, -0x18(%rbp)
jne 0xa291a
jmp 0xa2856
movq -0x18(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0xa292a
jmp 0xa29d7
jmp 0xa292c
jmp 0xa292e
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x18(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %esi
callq *%rax
cmpq $0x0, %rax
jne 0xa29d2
jmp 0xa294c
leaq 0x31d55(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x257e0
cmpq $0x0, %rax
je 0xa29ca
leaq 0x31d40(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x25800
leaq 0x31d31(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x257e0
movq %rax, %rdi
leaq 0x3827(%rip), %rsi      # 0xa61b0
callq 0xc670
movq %rax, %rdi
leaq 0x74af(%rip), %rsi      # 0xa9e47
callq 0xc670
movq %rax, %rdi
leaq 0x7944(%rip), %rsi      # 0xaa2eb
callq 0xc670
movq %rax, %rdi
movq 0x3160a(%rip), %rsi     # 0xd3fc0
callq 0xc6d0
leaq 0x31ce6(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x25820
jmp 0xa29cc
movb $0x0, -0x1(%rbp)
jmp 0xa29db
jmp 0xa2856
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)