// File: /workspace/github_c_makefile_star2_O1/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 0x6ede(%rip), %eax      # 0x10358
cmpl 0x6da8(%rip), %eax      # 0x10228
jbe 0x94a3
movb $0x1, %al
cmpb $0x0, 0x6e0a(%rip)      # 0x10295
jne 0x97a8
movl 0x6ec5(%rip), %ecx      # 0x1035c
cmpl 0x6d8f(%rip), %ecx      # 0x1022c
ja 0x97a8
movsbq %bl, %rax
leaq 0x68f2(%rip), %rcx      # 0xfda0
movq -0x8(%rcx,%rax,8), %rax
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x8(%rax)
je 0x97a2
movzbl %bl, %ebp
cmpb $0x2, %bl
leaq 0x3df7(%rip), %rax      # 0xd2c6
leaq 0x3def(%rip), %rcx      # 0xd2c5
cmoveq %rax, %rcx
cmpb $0x1, %bl
leaq 0x3ddc(%rip), %r15      # 0xd2c0
cmovneq %rcx, %r15
movq $0x0, 0x8(%rsp)
movl %ebx, 0x14(%rsp)
movq 0x20(%rsp), %rax
cmpl %ebp, 0x4(%rax)
jle 0x9784
xorl %r12d, %r12d
movl $0x2, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x7a97
cmpb $0x4, %bl
je 0x955d
cmpl $0x2, %ebp
je 0x9544
movl $0x0, %r13d
cmpl $0x1, %ebp
jne 0x9580
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rsp), %rcx
movsbl (%rax,%rcx,4), %r13d
movl $0x65, %edi
jmp 0x9573
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rsp), %rcx
movswl (%rax,%rcx,4), %r13d
movl $0x66, %edi
jmp 0x9573
movq 0x18(%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 0x7a97
callq 0x7ddc
movq %rax, %r14
movq %rax, %rdi
callq 0xa57e
testb %al, %al
je 0x95e8
leaq 0x3d04(%rip), %r14      # 0xd29f
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2030
movq 0x6cb3(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x95cd
movq %r14, %rsi
movl %r12d, %edx
movl %r13d, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x22d0
cmpb $0x0, 0x6cbe(%rip)      # 0x10292
movl $0x1, %r13d
movl $0x8, %eax
cmovnel %eax, %r13d
jmp 0x9768
movl 0x6d6a(%rip), %eax      # 0x10358
cmpl 0x6c34(%rip), %eax      # 0x10228
jbe 0x9601
incl 0x6cf4(%rip)            # 0x102f0
jmp 0x969b
movq %r14, %rdi
movl $0x1, %esi
callq 0x8b23
testb %al, %al
je 0x969b
leaq 0x3cae(%rip), %rbx      # 0xd2cb
movq %rbx, %rdi
movl %r12d, %esi
movl %r13d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2030
movq 0x6c31(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x964f
movq %rbx, %rsi
movl %r12d, %edx
movl %r13d, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x22d0
movl 0x6d03(%rip), %eax      # 0x10358
incl %eax
movl %eax, 0x6cfb(%rip)      # 0x10358
movl 0x6bc5(%rip), %esi      # 0x10228
xorl %ebx, %ebx
cmpl %esi, %eax
jbe 0x969d
leaq 0x3c8e(%rip), %rdi      # 0xd2fe
xorl %eax, %eax
callq 0x2030
movq 0x6bea(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x969d
movl 0x6b9f(%rip), %edx      # 0x10228
xorl %ebx, %ebx
leaq 0x3c6c(%rip), %rsi      # 0xd2fe
xorl %eax, %eax
callq 0x22d0
jmp 0x969d
movb $0x1, %bl
movl 0x6cb9(%rip), %eax      # 0x1035c
cmpl 0x6b83(%rip), %eax      # 0x1022c
jbe 0x96b6
incl 0x6c47(%rip)            # 0x102f8
jmp 0x9750
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl $0x1, %ecx
callq 0x8dfc
testb %al, %al
je 0x9750
leaq 0x3bf4(%rip), %rdi      # 0xd2cb
movl %r12d, %esi
movl %r13d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2030
movq 0x6b7a(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x970a
leaq 0x3bd1(%rip), %rsi      # 0xd2cb
movl %r12d, %edx
movl %r13d, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x22d0
movl 0x6c4c(%rip), %eax      # 0x1035c
incl %eax
movl %eax, 0x6c44(%rip)      # 0x1035c
movl 0x6b0e(%rip), %esi      # 0x1022c
cmpl %esi, %eax
jbe 0x9750
leaq 0x3c1d(%rip), %rdi      # 0xd346
xorl %eax, %eax
callq 0x2030
movq 0x6b31(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x9750
movl 0x6aea(%rip), %edx      # 0x1022c
leaq 0x3bfd(%rip), %rsi      # 0xd346
xorl %eax, %eax
callq 0x22d0
xorl %r13d, %r13d
testb %bl, %bl
je 0x9764
movq %r14, %rdi
movl $0x1, %esi
callq 0x89b5
movl 0x14(%rsp), %ebx
testb $0x7, %r13b
jne 0x97a6
incl %r12d
movq 0x20(%rsp), %rax
movl 0x4(%rax), %eax
subl %ebp, %eax
cmpl %eax, %r12d
jl 0x9506
movq 0x8(%rsp), %rdx
incq %rdx
movq 0x18(%rsp), %rax
movl 0x8(%rax), %eax
movq %rdx, 0x8(%rsp)
cmpq %rax, %rdx
jb 0x94f5
xorl %eax, %eax
jmp 0x97a8
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq