'Given a node and details of a successor, makes a list of CFGJobs
and if it is a call or exit marks it appropriately so in the CFG
:param int target:          Destination of the resultant job
:param str jumpkind:        The jumpkind of the edge going to this node
:param int current_function_addr: Address of the current function
:param pyvex.IRSB irsb:     IRSB of the predecessor node
:param int addr:            The predecessor address
:param CFGNode cfg_node:    The CFGNode of the predecessor node
:param int ins_addr:        Address of the source instruction.
:param int stmt_idx:        ID of the source statement.
:return:                    a list of CFGJobs
:rtype:                     list'

def _create_jobs(self, target, jumpkind, current_function_addr, irsb, addr, cfg_node, ins_addr, stmt_idx, fast_indirect_jump_resolution=True):

    if (type(target) is pyvex.IRExpr.Const):
        target_addr = target.con.value
    elif (type(target) in (pyvex.IRConst.U32, pyvex.IRConst.U64)):
        target_addr = target.value
    elif (type(target) in (int, long)):
        target_addr = target
    else:
        target_addr = None
    jobs = []
    if ((target_addr is None) and ((jumpkind in ('Ijk_Boring', 'Ijk_Call')) or jumpkind.startswith('Ijk_Sys')) and fast_indirect_jump_resolution):
        (resolved, resolved_targets) = self._resolve_indirect_jump_timelessly(addr, irsb, current_function_addr, jumpkind)
        if resolved:
            for t in resolved_targets:
                ent = self._create_jobs(t, jumpkind, current_function_addr, irsb, addr, cfg_node, ins_addr, stmt_idx, fast_indirect_jump_resolution=False)
                jobs.extend(ent)
            return jobs
    if (jumpkind == 'Ijk_Boring'):
        if (target_addr is not None):
            if (not self._addrs_belong_to_same_section(addr, target_addr)):
                target_func_addr = target_addr
                to_outside = True
            else:
                target_func_addr = None
                if (target_addr in self._traced_addresses):
                    node = self.get_any_node(target_addr)
                    if (node is not None):
                        target_func_addr = node.function_address
                if (target_func_addr is None):
                    target_func_addr = current_function_addr
                to_outside = (not (target_func_addr == current_function_addr))
            r = self._function_add_transition_edge(target_addr, cfg_node, current_function_addr, ins_addr=ins_addr, stmt_idx=stmt_idx, to_outside=to_outside)
            if (not r):
                if (cfg_node is not None):
                    l.debug('An    angr    exception    occurred    when    adding    a    transition    from    %#x    to    %#x.    Ignore    this    successor.', cfg_node.addr, target_addr)
                else:
                    l.debug('SimTranslationError    occurred    when    creating    a    new    entry    to    %#x.    Ignore    this    successor.', target_addr)
                return []
            ce = CFGJob(target_addr, target_func_addr, jumpkind, last_addr=addr, src_node=cfg_node, src_ins_addr=ins_addr, src_stmt_idx=stmt_idx)
            jobs.append(ce)
        else:
            l.debug('(%s)    Indirect    jump    at    %#x.', jumpkind, addr)
            if (addr not in self.indirect_jumps):
                tmp_statements = (irsb.statements if (stmt_idx == 'default') else irsb.statements[:stmt_idx])
                ins_addr = next(iter((stmt.addr for stmt in reversed(tmp_statements) if isinstance(stmt, pyvex.IRStmt.IMark))), None)
                ij = IndirectJump(addr, ins_addr, current_function_addr, jumpkind, stmt_idx, resolved_targets=[])
                self.indirect_jumps[addr] = ij
            else:
                ij = self.indirect_jumps[addr]
            if ij.resolved_targets:
                for resolved_target in ij.resolved_targets:
                    ce = CFGJob(resolved_target, resolved_target, jumpkind, last_addr=resolved_target, src_node=cfg_node, src_stmt_idx=stmt_idx, src_ins_addr=ins_addr)
                    jobs.append(ce)
                    self._function_add_call_edge(resolved_target, None, None, resolved_target, stmt_idx=stmt_idx, ins_addr=ins_addr)
            else:
                resolved_as_plt = False
                if irsb:
                    resolved_as_plt = self._resolve_plt(addr, irsb, ij)
                    if resolved_as_plt:
                        jump_target = next(iter(ij.resolved_targets))
                        target_func_addr = jump_target
                        r = self._function_add_transition_edge(jump_target, cfg_node, current_function_addr, ins_addr=ins_addr, stmt_idx=stmt_idx, to_outside=True)
                        if r:
                            ce = CFGJob(jump_target, target_func_addr, jumpkind, last_addr=jump_target, src_node=cfg_node, src_stmt_idx=stmt_idx, src_ins_addr=ins_addr)
                            jobs.append(ce)
                            self._function_add_call_edge(jump_target, None, None, target_func_addr, stmt_idx=stmt_idx, ins_addr=ins_addr)
                            resolved_as_plt = True
                if resolved_as_plt:
                    if (ij.addr in self._indirect_jumps_to_resolve):
                        self._indirect_jumps_to_resolve.remove(ij.addr)
                        self._deregister_analysis_job(current_function_addr, ij)
                else:
                    self._indirect_jumps_to_resolve.add(ij)
                    self._register_analysis_job(current_function_addr, ij)
    elif ((jumpkind == 'Ijk_Call') or jumpkind.startswith('Ijk_Sys')):
        is_syscall = jumpkind.startswith('Ijk_Sys')
        if (target_addr is not None):
            jobs += self._create_job_call(addr, irsb, cfg_node, stmt_idx, ins_addr, current_function_addr, target_addr, jumpkind, is_syscall=is_syscall)
        else:
            l.debug('(%s)    Indirect    jump    at    %#x.', jumpkind, addr)
            if (addr not in self.indirect_jumps):
                tmp_statements = (irsb.statements if (stmt_idx == 'default') else irsb.statements[:stmt_idx])
                if self.project.arch.branch_delay_slot:
                    ins_addr = next(itertools.islice(iter((stmt.addr for stmt in reversed(tmp_statements) if isinstance(stmt, pyvex.IRStmt.IMark))), 1, None), None)
                else:
                    ins_addr = next(iter((stmt.addr for stmt in reversed(tmp_statements) if isinstance(stmt, pyvex.IRStmt.IMark))), None)
                ij = IndirectJump(addr, ins_addr, current_function_addr, jumpkind, stmt_idx, resolved_targets=[])
                self.indirect_jumps[addr] = ij
            else:
                ij = self.indirect_jumps[addr]
            self._indirect_jumps_to_resolve.add(ij)
            self._register_analysis_job(current_function_addr, ij)
            self._create_job_call(addr, irsb, cfg_node, stmt_idx, ins_addr, current_function_addr, None, jumpkind, is_syscall=is_syscall)
    elif (jumpkind == 'Ijk_Ret'):
        if (current_function_addr != (-1)):
            self._function_exits[current_function_addr].add(addr)
            self._function_add_return_site(addr, current_function_addr)
        cfg_node.has_return = True
    else:
        l.debug('Unsupported    jumpkind    %s', jumpkind)
    return jobs
