// File: /workspace/github_c_makefile_star2_O1/mabdi[P]bunney/bunny-main.c
// Function: valset_rand_walk
static _u8 valset_rand_walk(struct bunny_traceitem* t, _u8 size) {
  _u32 val;
  _s32 pos;

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

  for (val=0;val < rand_val_walks; 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)random()) , 0); break;
        case 2: flow_command(FLOW_SETWORD , pos, (rval = (_s16)random()), 0); break;
        case 4: flow_command(FLOW_SETDWORD, pos, (rval = R32()), 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 $0x18, %rsp
movl %esi, %r14d
movq %rdi, 0x10(%rsp)
movl 0x6b85(%rip), %eax      # 0x10358
cmpl 0x6a4f(%rip), %eax      # 0x10228
jbe 0x97fc
movb $0x1, %al
cmpb $0x0, 0x6ab1(%rip)      # 0x10295
jne 0x9ae4
movl 0x6b6c(%rip), %ecx      # 0x1035c
cmpl 0x6a36(%rip), %ecx      # 0x1022c
ja 0x9ae4
xorl %eax, %eax
cmpl $0x0, 0x6a17(%rip)      # 0x1021c
je 0x9ae4
movzbl %r14b, %ebp
cmpb $0x2, %bpl
leaq 0x3aac(%rip), %rax      # 0xd2c6
leaq 0x3aa4(%rip), %rcx      # 0xd2c5
cmoveq %rax, %rcx
cmpb $0x1, %bpl
leaq 0x3a90(%rip), %r15      # 0xd2c0
cmovneq %rcx, %r15
xorl %eax, %eax
movl %r14d, 0x8(%rsp)
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rax
cmpl %ebp, 0x4(%rax)
jle 0x9acc
xorl %r12d, %r12d
movl $0x2, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x7a97
cmpb $0x4, %r14b
je 0x9896
cmpl $0x2, %ebp
je 0x9886
movl $0x0, %r13d
cmpl $0x1, %ebp
jne 0x98be
callq 0x2110
movsbl %al, %r13d
movl $0x65, %edi
jmp 0x98b1
callq 0x2110
movswl %ax, %r13d
movl $0x66, %edi
jmp 0x98b1
callq 0x2110
movq %rax, %rbx
shll $0x10, %ebx
callq 0x2110
movq %rax, %r13
xorl %ebx, %r13d
movl $0x67, %edi
movl %r12d, %esi
movl %r13d, %edx
xorl %ecx, %ecx
callq 0x7a97
callq 0x7ddc
movq %rax, %rbx
movq %rax, %rdi
callq 0xa57e
testb %al, %al
je 0x9926
leaq 0x39c6(%rip), %rbx      # 0xd29f
movq %rbx, %rdi
movl %r12d, %esi
movl %r13d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2030
movq 0x6975(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x990b
movq %rbx, %rsi
movl %r12d, %edx
movl %r13d, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x22d0
cmpb $0x0, 0x6980(%rip)      # 0x10292
movl $0x1, %r13d
movl $0x7, %eax
cmovnel %eax, %r13d
jmp 0x9aab
movl 0x6a2c(%rip), %eax      # 0x10358
cmpl 0x68f6(%rip), %eax      # 0x10228
jbe 0x993f
incl 0x69b6(%rip)            # 0x102f0
jmp 0x99db
movq %rbx, %rdi
movl $0x1, %esi
callq 0x8b23
testb %al, %al
je 0x99db
leaq 0x3970(%rip), %r14      # 0xd2cb
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2030
movq 0x68f3(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x998d
movq %r14, %rsi
movl %r12d, %edx
movl %r13d, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x22d0
movl 0x69c5(%rip), %eax      # 0x10358
incl %eax
movl %eax, 0x69bd(%rip)      # 0x10358
movl 0x6887(%rip), %esi      # 0x10228
xorl %r14d, %r14d
cmpl %esi, %eax
jbe 0x99de
leaq 0x394f(%rip), %rdi      # 0xd2fe
xorl %eax, %eax
callq 0x2030
movq 0x68ab(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x99de
movl 0x6860(%rip), %edx      # 0x10228
xorl %r14d, %r14d
leaq 0x392c(%rip), %rsi      # 0xd2fe
xorl %eax, %eax
callq 0x22d0
jmp 0x99de
movb $0x1, %r14b
movl 0x6978(%rip), %eax      # 0x1035c
cmpl 0x6842(%rip), %eax      # 0x1022c
jbe 0x99f7
incl 0x6906(%rip)            # 0x102f8
jmp 0x9a91
movq %rbx, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl $0x1, %ecx
callq 0x8dfc
testb %al, %al
je 0x9a91
leaq 0x38b3(%rip), %rdi      # 0xd2cb
movl %r12d, %esi
movl %r13d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2030
movq 0x6839(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x9a4b
leaq 0x3890(%rip), %rsi      # 0xd2cb
movl %r12d, %edx
movl %r13d, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x22d0
movl 0x690b(%rip), %eax      # 0x1035c
incl %eax
movl %eax, 0x6903(%rip)      # 0x1035c
movl 0x67cd(%rip), %esi      # 0x1022c
cmpl %esi, %eax
jbe 0x9a91
leaq 0x38dc(%rip), %rdi      # 0xd346
xorl %eax, %eax
callq 0x2030
movq 0x67f0(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x9a91
movl 0x67a9(%rip), %edx      # 0x1022c
leaq 0x38bc(%rip), %rsi      # 0xd346
xorl %eax, %eax
callq 0x22d0
xorl %r13d, %r13d
testb %r14b, %r14b
je 0x9aa6
movq %rbx, %rdi
movl $0x1, %esi
callq 0x89b5
movl 0x8(%rsp), %r14d
cmpl $0x7, %r13d
je 0x9ab6
testl %r13d, %r13d
jne 0x9ae2
incl %r12d
movq 0x10(%rsp), %rax
movl 0x4(%rax), %eax
subl %ebp, %eax
cmpl %eax, %r12d
jl 0x9850
movl 0xc(%rsp), %eax
incl %eax
cmpl 0x6744(%rip), %eax      # 0x1021c
jb 0x983b
xorl %eax, %eax
jmp 0x9ae4
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq