// File: /workspace/github_c_makefile_star2_O3/mabdi[P]bunney/bunny-main.c
// Function: valset_walk
static _u8 valset_walk(struct bunny_traceitem* t, _u8 size) {
  struct naive_list_int* l = 0;
  _u32 val;
  _s32 pos;

  if (reg_execs > cycle_branch_limit && (zero_range || reg_params > cycle_value_limit)) return 1;

  switch (size) {
    case 1: l = &byte_val_list; break;
    case 2: l = &word_val_list; break;
    case 4: l = &dword_val_list; break;
  }

  for (val=0;val < l->c; val++) 
    for (pos=0;pos < (_s32)t->fuzzable - size ;pos++) {
      struct bunny_traceitem* n;
      _s32 rval = 0;
      _u8 rne = 0;

      flow_command(FLOW_RESET,0,0,0);

      switch (size) {
        case 1: flow_command(FLOW_SETBYTE , pos, (rval = (_s8)l->v[val]) , 0); break;
        case 2: flow_command(FLOW_SETWORD , pos, (rval = (_s16)l->v[val]), 0); break;
        case 4: flow_command(FLOW_SETDWORD, pos, (rval = (_s32)l->v[val]), 0); break;
      }

      n = run_program();

      if (check_crash(n)) {
        outf("setting offset #%u to %d (%s).\n\n",pos, rval,
             (size == 1) ? "byte" : (size == 2) ? "word" : "dword" );
        if (keep_fault) continue;
        return 1;
      }

      if (reg_execs > cycle_branch_limit) epath_ign++;
        else if ((rne=register_new_exec(n,1))) {
        outf("      Triggered by setting offset #%u to %d (%s).\n",pos, rval,
             (size == 1) ? "byte" : (size == 2) ? "word" : "dword" );
        reg_execs++;
        if (reg_execs > cycle_branch_limit) 
          outf("      >>> Per-cycle call path limit of %u exceeded (use -N to adjust).\n",cycle_branch_limit);
      }

      if (reg_params > cycle_value_limit) ppath_ign++;
        else if (register_new_param(n,pos,size,1,rne)) {
          outf("      Triggered by setting offset #%u to %d (%s).\n",pos, rval,
               (size == 1) ? "byte" : (size == 2) ? "word" : "dword" );
          reg_params++;
          if (reg_params > cycle_value_limit) 
            outf("      >>> Per-cycle function parameter limit of %u exceeded (use -P to adjust).\n",cycle_value_limit);
        }
    
      /* Context not saved */
      if (!rne) discard_context(n,1);
    
    }

  return 0;
  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebx
movq %rdi, 0x20(%rsp)
movl 0x6e6f(%rip), %eax      # 0x10358
cmpl 0x6d39(%rip), %eax      # 0x10228
jbe 0x9512
movb $0x1, %al
cmpb $0x0, 0x6d9b(%rip)      # 0x10295
jne 0x980c
movl 0x6e56(%rip), %ecx      # 0x1035c
cmpl 0x6d20(%rip), %ecx      # 0x1022c
ja 0x980c
movsbq %bl, %rax
leaq 0x6883(%rip), %rcx      # 0xfda0
movq -0x8(%rcx,%rax,8), %rax
movq %rax, 0x10(%rsp)
movl 0x8(%rax), %eax
testl %eax, %eax
je 0x9806
movzbl %bl, %ebp
cmpb $0x2, %bl
leaq 0x3d87(%rip), %rcx      # 0xd2c6
leaq 0x3d7f(%rip), %rdx      # 0xd2c5
cmoveq %rcx, %rdx
cmpb $0x1, %bl
leaq 0x3d6c(%rip), %r15      # 0xd2c0
cmovneq %rdx, %r15
movq 0x20(%rsp), %rcx
movl 0x4(%rcx), %ecx
movq $0x0, 0x8(%rsp)
movl %ebx, 0x1c(%rsp)
cmpl %ebp, %ecx
jle 0x97ee
xorl %r12d, %r12d
movl $0x2, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x7b27
cmpb $0x4, %bl
je 0x95cf
cmpl $0x2, %ebp
je 0x95b6
movl $0x0, %r13d
cmpl $0x1, %ebp
jne 0x95f2
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rsp), %rcx
movsbl (%rax,%rcx,4), %r13d
movl $0x65, %edi
jmp 0x95e5
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rsp), %rcx
movswl (%rax,%rcx,4), %r13d
movl $0x66, %edi
jmp 0x95e5
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rsp), %rcx
movl (%rax,%rcx,4), %r13d
movl $0x67, %edi
movl %r12d, %esi
movl %r13d, %edx
xorl %ecx, %ecx
callq 0x7b27
callq 0x7e6c
movq %rax, %r14
movq %rax, %rdi
callq 0xa5aa
testb %al, %al
je 0x9651
leaq 0x3c92(%rip), %r14      # 0xd29f
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2030
movq 0x6c41(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x963f
movq %r14, %rsi
movl %r12d, %edx
movl %r13d, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x22d0
cmpb $0x0, 0x6c4c(%rip)      # 0x10292
jne 0x97ce
jmp 0x980a
movl 0x6d01(%rip), %eax      # 0x10358
cmpl 0x6bcb(%rip), %eax      # 0x10228
jbe 0x966a
incl 0x6c8b(%rip)            # 0x102f0
jmp 0x9704
movq %r14, %rdi
movl $0x1, %esi
callq 0x8b9a
testb %al, %al
je 0x9704
leaq 0x3c45(%rip), %rbx      # 0xd2cb
movq %rbx, %rdi
movl %r12d, %esi
movl %r13d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2030
movq 0x6bc8(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x96b8
movq %rbx, %rsi
movl %r12d, %edx
movl %r13d, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x22d0
movl 0x6c9a(%rip), %eax      # 0x10358
incl %eax
movl %eax, 0x6c92(%rip)      # 0x10358
movl 0x6b5c(%rip), %esi      # 0x10228
xorl %ebx, %ebx
cmpl %esi, %eax
jbe 0x9706
leaq 0x3c25(%rip), %rdi      # 0xd2fe
xorl %eax, %eax
callq 0x2030
movq 0x6b81(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x9706
movl 0x6b36(%rip), %edx      # 0x10228
xorl %ebx, %ebx
leaq 0x3c03(%rip), %rsi      # 0xd2fe
xorl %eax, %eax
callq 0x22d0
jmp 0x9706
movb $0x1, %bl
movl 0x6c50(%rip), %eax      # 0x1035c
cmpl 0x6b1a(%rip), %eax      # 0x1022c
jbe 0x971f
incl 0x6bde(%rip)            # 0x102f8
jmp 0x97b9
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl $0x1, %ecx
callq 0x8e74
testb %al, %al
je 0x97b9
leaq 0x3b8b(%rip), %rdi      # 0xd2cb
movl %r12d, %esi
movl %r13d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2030
movq 0x6b11(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x9773
leaq 0x3b68(%rip), %rsi      # 0xd2cb
movl %r12d, %edx
movl %r13d, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x22d0
movl 0x6be3(%rip), %eax      # 0x1035c
incl %eax
movl %eax, 0x6bdb(%rip)      # 0x1035c
movl 0x6aa5(%rip), %esi      # 0x1022c
cmpl %esi, %eax
jbe 0x97b9
leaq 0x3bb4(%rip), %rdi      # 0xd346
xorl %eax, %eax
callq 0x2030
movq 0x6ac8(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x97b9
movl 0x6a81(%rip), %edx      # 0x1022c
leaq 0x3b94(%rip), %rsi      # 0xd346
xorl %eax, %eax
callq 0x22d0
testb %bl, %bl
movl 0x1c(%rsp), %ebx
je 0x97ce
movq %r14, %rdi
movl $0x1, %esi
callq 0x8a2c
incl %r12d
movq 0x20(%rsp), %rax
movl 0x4(%rax), %ecx
movl %ecx, %eax
subl %ebp, %eax
cmpl %eax, %r12d
jl 0x9578
movq 0x10(%rsp), %rax
movl 0x8(%rax), %eax
movq 0x8(%rsp), %rdi
incq %rdi
movl %eax, %edx
movq %rdi, 0x8(%rsp)
cmpq %rdx, %rdi
jb 0x956d
xorl %eax, %eax
jmp 0x980c
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq