human
I wrote the below code

    if (intp is None):
        intp = count.type
    if (start is None):
        start = intp(0)
    stop = count
    bbcond = builder.append_basic_block('for.cond')
    bbbody = builder.append_basic_block('for.body')
    bbend = builder.append_basic_block('for.end')
    def do_break():
        builder.branch(bbend)
    bbstart = builder.basic_block
    builder.branch(bbcond)
    with builder.goto_block(bbcond):
        index = builder.phi(intp, name='loop.index')
        pred = builder.icmp_signed('<', index, stop)
        builder.cbranch(pred, bbbody, bbend)
    with builder.goto_block(bbbody):
        (yield Loop(index, do_break))
        bbbody = builder.basic_block
        incr = increment_index(builder, index)
        terminate(builder, bbcond)
    index.add_incoming(start, bbstart)
    index.add_incoming(incr, bbbody)
    builder.position_at_end(bbend)

What's a good function header?
assistant
#Here's a good function header.

@contextmanager
def for_range(builder, count, start=None, intp=None):