// File: /workspace/github_c_makefile_star2_O0/0xADE1A1DE[P]MeasureSuite/lib/src/evaluator.c
// Function: run_batch
static void run_batch(struct measuresuite *ms, struct function_tuple *fct,
                      uint64_t *count) {

  uint64_t *out = fct->arithmetic_results;
  // we always call the function with three in-arguments. It itself will then
  // take which ever it needs. However, the positon of the in-args is dependent
  // on the num out args, thus the switch
  //
  size_t batch_size = ms->batch_size; // working copy
  size_t width = ms->arg_width;

  // this is the initial config for the case that we have one out-variable and
  // at most 5 in vars
  uint64_t *arg0 = out;
  uint64_t *arg1 = ms->random_data;
  uint64_t *arg2 = ms->random_data + width;
  uint64_t *arg3 = ms->random_data + (size_t)2 * width;
  uint64_t *arg4 = ms->random_data + (size_t)3 * width;
  uint64_t *arg5 = ms->random_data + (size_t)4 * width;

  if (ms->num_arg_out == 1) {
    // do nothing, stay with default
  } else if (ms->num_arg_out == 2) {
    // shift them all one
    arg5 = arg4;
    arg4 = arg3;
    arg3 = arg2;
    arg2 = arg1;
    // and add the new out
    arg1 = out + width;
  } else if (ms->num_arg_out == 3) {
    arg5 = arg3;
    arg4 = arg2;
    arg3 = arg1;
    arg2 = out + (size_t)2 * width;
    arg1 = out + width;
  } else if (ms->num_arg_out == 4) {
    arg5 = arg2;
    arg4 = arg1;
    arg3 = out + (size_t)3 * width;
    arg2 = out + (size_t)2 * width;
    arg1 = out + width;
  } else {
    arg5 = arg1;
    arg4 = out + (size_t)4 * width;
    arg3 = out + (size_t)3 * width;
    arg2 = out + (size_t)2 * width;
    arg1 = out + width;
  }

  int (*func)(uint64_t * out, ...) = fct->code;
  assert(func != NULL);
  DEBUG("Function to evaluate is not NULL (%p). Running with a batch size of "
        "%lu",
        func, batch_size);

  uint64_t start_time = 0;
  start_timer(ms, &start_time);

  while (batch_size > 0) {
    func(arg0, arg1, arg2, arg3, arg4, arg5);
    batch_size--;
  }

  *count = stop_timer(ms, start_time);
  DEBUG("Done. Ran for %lu cycles.\n", *count);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x30(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x30(%rbp), %rcx
shlq %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
imulq $0x3, -0x30(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x30(%rbp), %rcx
shlq $0x2, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x1, 0x10(%rax)
jne 0x444f
jmp 0x459f
movq -0x8(%rbp), %rax
cmpq $0x2, 0x10(%rax)
jne 0x4492
movq -0x58(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
jmp 0x459d
movq -0x8(%rbp), %rax
cmpq $0x3, 0x10(%rax)
jne 0x44e3
movq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
shlq %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
jmp 0x459b
movq -0x8(%rbp), %rax
cmpq $0x4, 0x10(%rax)
jne 0x453d
movq -0x48(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
imulq $0x3, -0x30(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
shlq %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
jmp 0x4599
movq -0x40(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
shlq $0x2, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
imulq $0x3, -0x30(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
shlq %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
jmp 0x459b
jmp 0x459d
jmp 0x459f
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0x45b4
jmp 0x45d3
leaq 0x3993(%rip), %rdi      # 0x7f4e
leaq 0x3999(%rip), %rsi      # 0x7f5b
movl $0x52, %edx
leaq 0x399d(%rip), %rcx      # 0x7f6b
callq 0x2100
movq $0x0, -0x70(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x4000
cmpq $0x0, -0x28(%rbp)
jbe 0x461e
movq -0x68(%rbp), %r10
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x50(%rbp), %rcx
movq -0x58(%rbp), %r8
movq -0x60(%rbp), %r9
movb $0x0, %al
callq *%r10
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x45e8
movq -0x8(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x4060
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)