// File: /workspace/github_c_makefile_star2_O3/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, %ebx
movq %rdi, 0x10(%rsp)
movl 0x6b22(%rip), %eax      # 0x10358
cmpl 0x69ec(%rip), %eax      # 0x10228
jbe 0x985f
movb $0x1, %al
cmpb $0x0, 0x6a4e(%rip)      # 0x10295
jne 0x9b30
movl 0x6b09(%rip), %ecx      # 0x1035c
cmpl 0x69d3(%rip), %ecx      # 0x1022c
ja 0x9b30
movl 0x69b7(%rip), %ecx      # 0x1021c
xorl %eax, %eax
testl %ecx, %ecx
je 0x9b30
movzbl %bl, %ebp
cmpb $0x2, %bpl
leaq 0x3a49(%rip), %rax      # 0xd2c6
leaq 0x3a41(%rip), %rdx      # 0xd2c5
cmoveq %rax, %rdx
cmpb $0x1, %bpl
leaq 0x3a2d(%rip), %r15      # 0xd2c0
cmovneq %rdx, %r15
movq 0x10(%rsp), %rax
movl 0x4(%rax), %eax
xorl %edx, %edx
movl %ebx, 0xc(%rsp)
cmpl %ebp, %eax
jle 0x9b20
movl %edx, 0x8(%rsp)
xorl %r12d, %r12d
movl $0x2, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x7b27
cmpb $0x4, %bl
je 0x98f9
cmpl $0x2, %ebp
je 0x98e9
movl $0x0, %r13d
cmpl $0x1, %ebp
jne 0x9922
callq 0x2110
movsbl %al, %r13d
movl $0x65, %edi
jmp 0x9915
callq 0x2110
movswl %ax, %r13d
movl $0x66, %edi
jmp 0x9915
callq 0x2110
movq %rax, %r14
shll $0x10, %r14d
callq 0x2110
movq %rax, %r13
xorl %r14d, %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 0x9981
leaq 0x3962(%rip), %r14      # 0xd29f
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2030
movq 0x6911(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x996f
movq %r14, %rsi
movl %r12d, %edx
movl %r13d, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x22d0
cmpb $0x0, 0x691c(%rip)      # 0x10292
jne 0x9afe
jmp 0x9b2e
movl 0x69d1(%rip), %eax      # 0x10358
cmpl 0x689b(%rip), %eax      # 0x10228
jbe 0x999a
incl 0x695b(%rip)            # 0x102f0
jmp 0x9a34
movq %r14, %rdi
movl $0x1, %esi
callq 0x8b9a
testb %al, %al
je 0x9a34
leaq 0x3915(%rip), %rbx      # 0xd2cb
movq %rbx, %rdi
movl %r12d, %esi
movl %r13d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2030
movq 0x6898(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x99e8
movq %rbx, %rsi
movl %r12d, %edx
movl %r13d, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x22d0
movl 0x696a(%rip), %eax      # 0x10358
incl %eax
movl %eax, 0x6962(%rip)      # 0x10358
movl 0x682c(%rip), %esi      # 0x10228
xorl %ebx, %ebx
cmpl %esi, %eax
jbe 0x9a36
leaq 0x38f5(%rip), %rdi      # 0xd2fe
xorl %eax, %eax
callq 0x2030
movq 0x6851(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x9a36
movl 0x6806(%rip), %edx      # 0x10228
xorl %ebx, %ebx
leaq 0x38d3(%rip), %rsi      # 0xd2fe
xorl %eax, %eax
callq 0x22d0
jmp 0x9a36
movb $0x1, %bl
movl 0x6920(%rip), %eax      # 0x1035c
cmpl 0x67ea(%rip), %eax      # 0x1022c
jbe 0x9a4f
incl 0x68ae(%rip)            # 0x102f8
jmp 0x9ae9
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl $0x1, %ecx
callq 0x8e74
testb %al, %al
je 0x9ae9
leaq 0x385b(%rip), %rdi      # 0xd2cb
movl %r12d, %esi
movl %r13d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2030
movq 0x67e1(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x9aa3
leaq 0x3838(%rip), %rsi      # 0xd2cb
movl %r12d, %edx
movl %r13d, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x22d0
movl 0x68b3(%rip), %eax      # 0x1035c
incl %eax
movl %eax, 0x68ab(%rip)      # 0x1035c
movl 0x6775(%rip), %esi      # 0x1022c
cmpl %esi, %eax
jbe 0x9ae9
leaq 0x3884(%rip), %rdi      # 0xd346
xorl %eax, %eax
callq 0x2030
movq 0x6798(%rip), %rdi      # 0x10268
testq %rdi, %rdi
je 0x9ae9
movl 0x6751(%rip), %edx      # 0x1022c
leaq 0x3864(%rip), %rsi      # 0xd346
xorl %eax, %eax
callq 0x22d0
testb %bl, %bl
movl 0xc(%rsp), %ebx
je 0x9afe
movq %r14, %rdi
movl $0x1, %esi
callq 0x8a2c
incl %r12d
movq 0x10(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %ecx
subl %ebp, %ecx
cmpl %ecx, %r12d
jl 0x98b4
movl 0x6700(%rip), %ecx      # 0x1021c
movl 0x8(%rsp), %edx
incl %edx
cmpl %ecx, %edx
jb 0x98a5
xorl %eax, %eax
jmp 0x9b30
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq