Code advice with minimum clock cycles
As @sharptooth mentions - the compiler really does have the final say. It also depends heavily on the architecture you're compiling for - what instructions it has available.

For instance, compiling your first snippet for MIPS results in:

sra v1,v0,0x4
andi    v1,v1,0x6
andi    v0,v0,0x1
or  v0,v1,v0


And your second results in:

andi    v1,v0,0x1
beqz    v1,func+0x20
andi    v1,v0,0x20
lbu v1,-32760(gp)
addiu   v1,v1,1
sb  v1,-32760(gp)
andi    v1,v0,0x20
beqz    v1,func+0x34
andi    v0,v0,0x40
lbu v1,-32760(gp)
addiu   v1,v1,2
sb  v1,-32760(gp)
beqz    v0,func+0x44
lbu v0,-32760(gp)
addiu   v0,v0,4
sb  v0,-32760(gp)


So undoubtedly in this situation your first snippet is the more code efficient. The same may not always be true though for a different architecture or a different compiler.

There's also some other caveats to note with your second snippet. Chiefly, what is "data" at the start?  You have to remember to always zero "data" out before doing your calculations, or you'll end up accumulating successive values.  The same is not true for the first snippet.