[Question]
  [
A [variable-length quantity](https://en.wikipedia.org/wiki/Variable-length_quantity) (also referred to as **[VLQ](https://en.wikipedia.org/wiki/Variable-length_quantity)** or `uintvar`) is a way to encode up to a 28 bit integer value using only as many bytes as necessary. This was used in [MIDI file format](https://www.csie.ntu.edu.tw/%7Er92092/ref/midi/#vlq) as a way to minimize the size of certain event data.
The way it works is fairly simple. As a big-endian series of bytes, the most significant bit (MSB) of each byte is a `1` to indicate that another VLQ byte follows. The remaining 7 bits of each byte make up the decoded value.
**Example (from Wikipedia):**
`[ 0x86, 0xc3, 0x17 ] => 106903`
[![enter image description here](https://i.stack.imgur.com/WbC4p.png)](https://i.stack.imgur.com/WbC4p.png)
Additional references: [Wikipedia](https://en.wikipedia.org/wiki/Variable-length_quantity).
**Challenge:**
Given a variable-length quantity, convert it to it's integer value.
**Input:**
A list of one to four bytes or a 32-bit value type representing a valid VLQ of an integer.
**Output:**
The integer value of the VLQ input.
**Rules and scoring:**
* This is code-golf, so shortest answer in bytes for *each language* wins.
* [Standard rules](https://codegolf.meta.stackexchange.com/questions/2419/default-for-code-golf-program-function-or-snippet/2422#2422) and [default I/O rules](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods/) apply.
* [Loopholes forbidden](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) (of course).
* Please provide link with a test for your code ([TIO.run](https://tio.run/), etc).
* A clear explanation for your answer is highly recommended.
* Built-ins that handle this conversion are not banned, however *not* using them is a lot more interesting.
**Test cases:**
```
Input (VLQ)                   Output (int)
[                   0x00 ] => 0
[                   0x07 ] => 7
[                   0x7f ] => 127
[             0x81, 0x00 ] => 128
[             0xC0, 0x00 ] => 8192
[             0xff, 0x7f ] => 16383
[       0x81, 0x80, 0x00 ] => 16384
[       0x86, 0xc3, 0x17 ] => 106903
[       0xbd, 0x84, 0x40 ] => 1000000
[       0xff, 0xff, 0x7f ] => 2097151 
[ 0xC0, 0x80, 0x80, 0x00 ] => 134217728  
[ 0xFF, 0xFF, 0xFF, 0x7F ] => 268435455  
```
Note: you are not required to use hex literals to represent a byte as your input or output. You may use decimal literal (`[ 129, 128, 0 ]`), integer (`0x80818000`) or any other reasonable byte/octet representation if better suited to your platform. Format is flexible as long as it represents 1-4 byte/octets.
Golf away!
  
[Answer]
# [APL (dzaima/APL)](https://github.com/dzaima/APL), 8 bytes
```
128(⊣⊥|)
```
[Try it online!](https://tio.run/##SyzI0U2pSszMTfz/P@1R2wRDIwuNR12LH3UtrdEEihxaoXNohYaBpoa5poahEZiwVAByDS2NQJSRqakCXBioFSxlbKJgaGmqYGQMZFsAhY2NFMxMIGoR6oH6QeqhemByMPl/@QUlmfl5xf91iwE "APL (dzaima/APL) – Try It Online")
### How:
```
128(⊣⊥|) ⍝ Anonymous function
128   |  ⍝ Input modulo 128
    ⊣⊥   ⍝ Decoded from base 128
```
[Answer]
# [Pari/GP](http://pari.math.u-bordeaux.fr/), 24 bytes
```
a->fromdigits(a%128,128)
```
[Try it online!](https://tio.run/##K0gsytRNL/ifpmCr8D9R1y6tKD83JTM9s6RYI1HV0MhCB4g1/ycWFORUaiQq6NopFBRl5pUAmUogjpJCmkaipqZOdLRBhYFBrI4CiDaH0OZpENrCUEcBIetsgMxLSwPxUFVaoKiwMAPxko1BpCHU5KQUsDoTEGmCYhKqeRC7LAwwTXVzA/GQSXO32FjN/wA "Pari/GP – Try It Online")
[Answer]
# [J](http://jsoftware.com/), 10 bytes
```
128#.128|]
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/DY0slPWARE3sf00urtTkjHyFNDU9OwUDa3NrQyMQtgSyDS2NgKSRqakCTAyoBSRubKJgaGmqYGRsbWgBFDQ2UjAzAauDqwXqBKmFqIfJQGW5/gMA "J – Try It Online")
Taking inspiration from J Salle's APL answer.
* `128|]` Remainder of the input numbers divided by 128
* `128#.` Interpreted as the digits of a base 128 number
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 25 bytes
```
Fold[128#+#2&,#~Mod~128]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE7876Zg@98tPycl2tDIQllb2UhNR7nONz@lDsiNVfsfUJSZVxLtmVeSmp5aFFwC5KVHK@soGJrpKBjFKujaKbhFK8fGKqgp6DtwVVcb1OooVJuDCEMjKGWpowAWNbQ0grKMTE2BBiDJA22CKTI2AXItgfJGxmC@BUjaGKjTzASuFUU/yFSwfoQhCEVwlbX/AQ "Wolfram Language (Mathematica) – Try It Online")
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 25 bytes
```
#~Mod~128~FromDigits~128&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE7876Zg@1@5zjc/pc7QyKLOrSg/1yUzPbOkGMRV@x9QlJlXEu2ZV5KanloUXALkpUcr6ygYmukoGMUq6NopuEUrx8YqqCnoO3BVVxvU6ihUm4MIQyMoZamjABY1tDSCsoxMTYEGIMkDLYIpMjYBci2B8kbGYL4FSNoYqNPMBK4VRT/IVLB@hCEIRXCVtf8B "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 6 bytes
```
%Ø⁷ḅØ⁷
```
[Try it online!](https://tio.run/##y0rNyan8/1/18IxHjdsf7mgF0/8Ptz9qWuP@/390tEGFgUGsDpcCiGEOZZinQRkWhjoKSAqcDVC4aWkgLppiC1Q1FmYgbrIxiDSEmZ@UAlZpAiJNUE1DMxNio4UBFpPd3EBcZNLcLTYWAA "Jelly – Try It Online")
Equivalent to [alephalpha's Pari/GP answer](https://codegolf.stackexchange.com/a/189476/59487).
Method: Given \$n\$, output \$n \mod 128\$, converted from base \$128\$ to decimal.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 6 bytes
```
žy%žyβ
```
[Try it online!](https://tio.run/##yy9OTMpM/X9u6/@j@ypVgfjcpv@1h3b/j442qDAwiNVRANHmENo8DUJbGOooIGSdDZB5aWkgHqpKCxQVFmYgXrIxiDSEmpyUAlZnAiJNUExCNQ9il4UBpqlubiAeMmnuFhsLAA "05AB1E – Try It Online")
ಠ\_ಠ Why do both Jelly and 05AB1E have 2-byte constants for `128`? Well... It's \$2^7\$. But surely those bytes could be used for something better, right?
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 8 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
å→♂á╣>nt
```
[Run and debug it](https://staxlang.xyz/#p=861a0ba0b93e6e74&i=[0]%0A[7]%0A[127]%0A[129,+0]%0A[192,+0]%0A[255,+127]%0A[129,+128,+0]%0A[134,+195,+23]%0A[189,+132,+64]%0A[255,+255,+127]%0A[192,+128,+128,+0]%0A[255,+255,+255,+127]&a=1&m=2)
Algorithm:
* Convert each byte to fixed-width 7 bit array.
* Flatten bit arrays into one.
* Convert bit array back to number.
[Answer]
# [Python 3](https://docs.python.org/3/), 58 49 bytes
*-9 bytes thanks to @Chas and @ar4093*
```
lambda x:int("".join(bin(a|128)[3:]for a in x),2)
```
[Try it online!](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUaHCKjOvRENJSS8rPzNPIwmIE2sMjSw0o42tYtPyixQSFTLzFCo0dYw0/xcUgZSmaUQbVBgYxGpqciELmKMJmKehCVgY6mDR52yATTQtTQeXCRZYNViYAUWTjYGEIbpDklJAukyAhAlWa7DbBXaXhQFOC93cdJAJczeg/H8A "Python 3 – Try It Online")
or
```
lambda x:int("".join(f"{a%128:07b}"for a in x),2)
```
[Try it online!](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUaHCKjOvRENJSS8rPzNPI02pOlHV0MjCysA8qVYpLb9IIVEhM0@hQlPHSPN/QRFIaZpGtEGFgUGspiYXsoA5moB5GpqAhaEOFn3OBthE09J0cJlggVWDhRlQNNkYSBiiOyQpBaTLBEiYYLUGu11gd1kY4LTQzU0HmTB3A8r/BwA "Python 3 – Try It Online")
Input via list of integers.
Python's `bin` function adds "0b" to the beginning of the string, so those have to be taken off before they can be concatenated. It also doesn't keep leading zeros, so if there aren't any (aka the last byte) those have to be added back in. And if there is a leading one (aka all but the last byte) that must be removed as well. Thanks to @Chas for figuring out that by always setting the first bit, I can just remove the first three characters and be done.
Apparently (according to @ar4093) the `format` function allows not only not having the '0b' prefix, but also removing the first bit and padding to 7 characters all at the same time.
[Answer]
# JavaScript (ES6), 29 bytes
*-2 bytes thanks to @Shaggy*
Takes input as an array of bytes.
```
a=>a.map(p=c=>p=p<<7|c&127)|p
```
[Try it online!](https://tio.run/##jZDBDoIwEETvfgUnAwniblvYklgvJvyE8VCrNRqVRo3h4L@jaNCAou5hTvMys7PRZ300h7U7Dfb5YllaVWo11tFOO98po8ZOudGILqaPjIKLK02@P@bbZbTNV771p977QQHgzYLAGw496P3lp9pPf/nJ1v5bqa8EFBLDRiNk8gcxgSYhMWU/EGvDZq2ES97B1JVkK6ZiRDeTVG7DK8XnXAhJCt1B88U9SFQqXkFwv07q8Uz7JQYpYYxvVL2XhI9PccGQ6MPmUGRZ2FLKnmmJFDwWcVxeAQ "JavaScript (Node.js) – Try It Online")
[Answer]
# APL+WIN, 22 bytes
Prompts for a vector of integers:
```
2⊥¯32↑,0 1↓⍉(8⍴2)⊤¯4↑⎕
```
[Try it online! Courtesy of Dyalog Classic](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob6qvz6O2CcZcjzra0/4bPepaemi9sdGjtok6BgqGj9omP@rt1LB41LvFSPNR15JD602AMkA9/4Gq/6dxGXClcRkamQNJI1NTBQjL0MJSwdDYSMHMBCoMw0BpAA "APL (Dyalog Classic) – Try It Online")
Explanation:
```
¯4↑⎕ Pad the vector to 4 integers from the right.
⍉(8⍴2)⊤ Convert to a matrix of 8 bit values.
,0 1↓ drop the MSBs and flatten to a vector.
2⊥¯32↑ pad bit vector to 32 bits starting at LSB and convert back to integer.
```
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 12 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
ü╫ôà¡k2Wù}a☺
```
[Run and debug it at staxlang.xyz!](https://staxlang.xyz/#p=81d79385ad6b3257977d6101&i=[0]%0A[7]%0A[127]%0A[129,+0]%0A[192,+0]%0A[255,+127]%0A[129,+128,+0]%0A[134,+195,+23]%0A[189,+132,+64]%0A[255,+255,+127]%0A[192,+128,+128,+0]%0A[255,+255,+255,+127]&a=1&m=2)
### Unpacked (14 bytes) and explanation:
```
rk128%128i^#*+
r                 Reverse 'cuz big-endian
 k                Fold from the left using block:
  128%              Modulize by 128
      128i^#        Push 128 to the power of (one plus the iteration index)
            *       Multiply
             +      Add to the total
                  Implicit print
```
Stax has builtin base conversion, but it only works on strings. It *almost* works on lists of integers, though; the problem is in Stax's handling of `0`.
A string is a list of integers. When you're using such a list as a string, any zeroes are automatically converted to 32 as a nice shorthand for spaces. Since the builtin `|b` for base conversion treats its operand as a string rather than as a raw list of integers, any case with a zero will fail.
### 10 bytes, fails on zeroes
```
Ç┘_A♥∙QZ►╣
{128%m128|b    Unpacked
{128%m         Modulize each by 128
      128|b    Convert from base 128
```
[Run and debug it at staxlang.xyz!](https://staxlang.xyz/#p=80d95f4103f9515a10b9&i=[0]%0A[7]%0A[127]%0A[129,+0]%0A[192,+0]%0A[255,+127]%0A[129,+128,+0]%0A[134,+195,+23]%0A[189,+132,+64]%0A[255,+255,+127]%0A[192,+128,+128,+0]%0A[255,+255,+255,+127]&a=1&m=2)
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 48 bytes
Takes an integer in big-endian order as input, which is the same order as a byte array.
```
f(i,j){for(j=0;j|=i&127,i&128;j<<=7,i>>=8);i=j;}
```
[Try it online!](https://tio.run/##fZPfT8IwEMff91dcNJh2Vul@QEtGeVDDE/HNxAR5mINKFxwGppLg/nVnO1jcHLNZLu3dp9@77nLR1UsU5blEisR4L9cbFAsaxF9CXTguI8byIB4Ohd6PRoLjQIk4yPJzlUSr9/kChtt0rtbXy5H16wo3b2FXJYvUuC2VpPAaqgR9rNUcw97qdqfQXHRHKcxAjIC2E@xAsFaCyQOhi28wdMcdUsmjn3aCuaVVhjsD9wQkJakm63vcq1BlIl6TMpRfp/omHnnGOsenObQ/oHWx53kh5hvrl2K0WDXuUFS9NJcOmNNzoADLx3F6ojrPdx3GXA4lOx6TP5aNj6J97ns9v9fTLEC0DDdgb6czsbdMIcg4pjO8N@IZafhY08fGTV/Zq2ak7FAzUpbZpsZbbx5acXtsRTN@c1ftQVvm9vynfvz/Kn@07h8mE73JCNh2qk0U6JMZLVsRiANLn8z0pmIbgJ0GkF5emlkzV5VAGrSxccdCIlvhggd42@iARGc70aH8kYBEO1xsAXXe8VNyRmCZrpOVuaKz6A@btJmV5d@RXIUv2/zq8wc "C (gcc) – Try It Online")
## [C (gcc)](https://gcc.gnu.org/), 53 bytes
If a byte array is needed:
```
f(c,j)char*c;{for(j=0;j|=*c&127,*c++&128;j<<=7);c=j;}
```
[Try it online!](https://tio.run/##fZPfb9sgEMff/VecOnUCQhf8I4GI0Id1ylO1t0mTsjx4pDRYmVMl7hYp878@D5xYs@t4yDrB3YfvHT7Qd89aV5VBmmZYb9I90fJkdnuUKSaz34ro92HEKdGjkZsImc3nimOpVSbL6p3N9fZ1/QTzQ7G2uw@b@@CfK92/pGObPxXeHdi8gB@pzdHPnV1jOAXj8RL6gx0ZgxWoe2DDBD8TfJDg5ky4ynsMO4qQtvK4Q11hHlibEeEsugIZQ9vJprGIW1STSHSkPJV0qamP69jb8HK0kE1nrCv2fV2LJd4mjRirR4c7F9UtLWIzHk5CqMHmcIJdqS5OopDzSEDDLhb0jeWLi@hUJPEkmUwcC@CvDpDDcqVOgS8EecdyhU9evKQ9H@/7@KLva3rVjzQd6keaMofUxODOcyseLq3oxz9@avdgKPNw/ms//v8qb7Q@f3l8dJOSAiGFM1q6lX9axFLIZOBW/u0W6iCBFBKK0ci/Nb/VKuRAgr07UwaRAtc8wMveBQy6OapbJr5SMOiI6ymg21f8Lb@hsCl2@RYRi10W92GftgzK6o822/T5UN39@gs "C (gcc) – Try It Online")
[Answer]
# [MathGolf](https://github.com/maxbergmark/mathgolf/blob/master/math_golf.txt), ~~14~~ 13 [bytes](https://github.com/maxbergmark/mathgolf/blob/master/code_page.py)
```
♣%hrx♣▬^mÅε*Σ
```
Input as a list of integers.
[Try it online.](https://tio.run/##y00syUjPz0n7///RzMWqGUUVQOrRtDVxuYdbz23VOrf4//9og1iuaHMgNjSCkJY6IBFDSyMwbWRqqoOQMTSygMgam@gYWprqGBmDOBZACWMjHTMTqHokPUBTQHpg@mCyMBUA)
I have the feeling this can be shorter.. It's a bit annoying that MathGolf has a 1-byte builtin for the constant `128`, but no base-conversion (except for binary/hexadecimal).
**Explanation:**
```
♣%            # Take modulo-128 on each value in the (implicit) input-list
  h           # Push the length of the list (without popping the list itself)
   r          # Pop and push a list in the range [0, length)
    x         # Reverse the list to (length, 0]
     ♣▬       # Take 128 to the power of each value in this list
       ^      # Zip the two lists together to create pairs
        mÅ    # Map each pair to (using the following two commands):
          ε*  #  Reduce by multiplication (so basically the product of the pair)
            Σ # After multiplying each pair, take the total sum
              # (after which the entire stack joined together is output implicitly)
```
[Answer]
# [PHP](https://php.net/), 42 bytes
```
foreach($argv as$a)$r=$r<<7|$a&127;echo$r;
```
[Try it online!](https://tio.run/##K8go@G9jXwAk0/KLUhOTMzRUEovSyxQSi1USNVWKbFWKbGzMa1QS1QyNzK1TkzPyVYqs////b2hs8t/Q0vS/kTEA "PHP – Try It Online") and [verify all test cases](https://tio.run/##XVJbb4IwFH6WX3Fimk0TEstFwaDbwzKzhyXz3RlToQwWKaQU57Ltt7tTqFPHwwn5bucrtMqq4@y@yirLIorXqoY5rKzeCuiBwtqGXq83GgHtkOCMBAZJz5DjGjB07Gu744Yd80DBRsZQyITO1O2oNLVPecY08ULvMjCkbSxtFUbgg1FMNBd7ejrBn4JOptRkbJM2w9fTP2fQ9rmscFUEJS6dBs7YOR3g3OSyj47yfNcJAjcE02mxsP/NYGG07iT0vbE/HqN2HVlWWkrO4mwA5h@wGt9gCF8WAMprrqCpgIt9LktRcKEAHaAtoA1anyv4KJtdAlsOshGQyrKAuCwKJhLY5YIDk2815vE4K@G9LsWGi7hM@AAJyT43BasGtwmy/HBrt9uHNvRf1fwO@hH6OlUj6ixPlW5qA8HI/YquYRi1NfOi2THFDb42vdHbAniziIqOp7N2GKsJGxI5J3I2C74Ju8FbFOmKREZHU3b5tNw8vjzrErieqwGRuFBvlFyvuPgulvVz/AU).
Input via command line args, output to `STDOUT`.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~10~~ 8 bytes
Takes input as an array of integers.
```
muIÑ ìIÑ
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&header=rqRuRw&code=bXVJ0SDsSdE&input=WyIweDg2IiwiMHhjMyIsIjB4MTciXQ) or [run all test cases](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&header=rqRuRw&code=bXVJ0SDsSdE&input=WwpbIjB4MDAiXQpbIjB4MDciXQpbIjB4N2YiXQpbIjB4ODEiLCIweDAwIl0KWyIweEMwIiwiMHgwMCJdClsiMHhmZiIsIjB4N2YiXQpbIjB4ODEiLCIweDgwIiwiMHgwMCJdClsiMHg4NiIsIjB4YzMiLCIweDE3Il0KWyIweGJkIiwiMHg4NCIsIjB4NDAiXQpbIjB4ZmYiLCIweGZmIiwiMHg3ZiJdClsiMHhDMCIsIjB4ODAiLCIweDgwIiwiMHgwMCJdClsiMHhGRiIsIjB4RkYiLCIweEZGIiwiMHg3RiJdCl0tbVI) (header in both converts from input format used in challenge)
Saved 2 bytes by taking inspiration from [alephalpha's solution](https://codegolf.stackexchange.com/a/189476/58974).
```
muIÑ ìIÑ     :Implicit input of integer array
m            :Map
 u           :  Modulo
  I          :    64
   Ñ         :    Multiply by 2
     ì       :Convert to decimal
      IÑ     :  From base 64*2
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 11 bytes
```
Ｉ↨﹪θ¹²⁸¦¹²⁸
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMM5sbhEwymxOFXDNz@lNCdfo1BHwdDIQhNCampa//8fHa1gUOFsoAMkLZBIAwOF2Nj/umU5AA "Charcoal – Try It Online") Link is to verbose version of code. Takes input as an array. Explanation:
```
   θ        Input array
  ﹪ ¹²⁸    Elementwise modulo 128
 ↨      ¹²⁸ Convert from base 128
Ｉ          Cast to string for implicit print
```
[Answer]
# [Python 2](https://docs.python.org/2/), 42 bytes
```
f=lambda a:a>[]and a[-1]%128+f(a[:-1])*128
```
[Try it online!](https://tio.run/##dZLPboMwDMbP4yl8mQJbNiXhTwISXCrxEhmHdBANiVJUItQ9PQulVLSsPliyvp8@27K7X/NzbNk46rRRh32pQCUqk4VqS1DygxavlIl37SqZ2MJ7s9Voqt7sVF/1kII8qM6tBtVg89l3TW1clGbI80AfT2CgbgEh5EjYBjkTAgWkGZBnOp91/kTnetYpeyTIWVC86mCn3hA7siYEjdkG0Rqv20S@8G/M0kLc2UxMsGaiSf32p0yv61ASxWRttC8vRsGUg8WIXGJFzcPcj8RIzGlIwWLLQoL8M5UfMMo5EzCTeY4fMs@vhpEI/DAIQ3u15Z5fLfIkTYrCcaajKjxMZ709QeK8dKe6NVaAAYN9FW/8Aw "Python 2 – Try It Online")
[Answer]
## Windows Batch, 76 bytes
```
:a
@set/ax="%1&127",y=y*128+x
@if %2. neq . @shift&goto:a
@echo %y%
```
Pass parameters prefixed with "0x" and space between (e.g. 0xC0 0x80 0x80 0x00).
[Answer]
# ARM Thumb-2 machine code, 16 bytes
```
00 02 c0 01 04 c9 52 06 00 eb 52 60 f9 d2 70 47
```
Assembler source with pseudo-C:
```
    .syntax unified
    .arch armv7-a
    .globl vlq
    .thumb
    .thumb_func
    // Input: r1: array of **uint32_t** containing VLQ bytes
    // Output: r0
vlq:
    // initial accumulator
    movs    r0, #0                       @ acc = 0;
.Lloop:                                  @ do {
    // Shift accumulator for next value
    lsls    r0, r0, #7                   @    acc = acc << 7;
    // Load next vlq byte, advance ptr
    ldmia   r1!, {r2}                    @    tmp = *ptr++;
    // Shift left so the continuation
    // bit is in the carry
    lsls    r2, r2, #32 - 7              @    carry = tmp & 0x80;
                                         @    tmp = tmp << (32 - 7);
    // Insert it into the accumulator,
    // not affecting the flags (wide)
    add.w   r0, r0, r2, lsr #32 - 7      @    acc = acc + (tmp >> (32 - 7));
    // If there is no carry, loop again
    bcs     .Lloop                       @ } while (carry);
    // Return
    bx      lr                           @ return acc;
```
This function can be called from C with a dummy parameter to place `data` in `r1`.
```
uint32_t vlq(uint32_t dummy, const uint32_t *data);
// Note: uint32_t, not uint8_t
const uint32_t vlqs[] = { 0x86, 0xC3, 0x17 };
printf("%u\n", vlq(314159 /* dummy */, vlqs));
```
[Answer]
# [Ruby](https://www.ruby-lang.org/), 40 bytes
```
->a{a.map{("%08b"%_1)[1..]}.join.to_i 2}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72kqDSpcsEiN9ulpSVpuhY3NXTtEqsT9XITC6o1lFQNLJKUVOMNNaMN9fRia_Wy8jPz9Ery4zMVjGoh6vcWKLhFRxtUOBvoKBhUWCCRBgaxsRA1CxZAaAA)
[Answer]
# [J-uby](https://github.com/cyoce/J-uby), 40 bytes
Port of [my Ruby answer](https://codegolf.stackexchange.com/a/253522/11261), just for fun.
```
:*&(:%&"%08b"|~:[]&(1..))|:join|~:to_i&2
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m700K740qXLBIjfbpaUlaboWNzWstNQ0rFTVlFQNLJKUauqsomPVNAz19DQ1a6yy8jPzgCIl-fGZakYQ9XsLFNyiow0qnA10FAwqLJBIA4PYWIiaBQsgNAA)
## Explanation
```
:* & (           # Map with…
  :% & "%08b" |  #   Format (%) as binary padded to 8 digits, then
  ~:[] & (1..)   #   take range of characters 1..end
) |              # then
:join |          # join, then
~:to_i & 2       # convert to int as base 2
```
[Answer]
# [Nibbles](http://golfscript.com/nibbles/index.html), 5 bytes (10 nibbles)
```
`@;128.@%
```
```
`@;128.@%$@  # = program with implicit arguments added
`@           # convert from base
   128       # 128
  ;          # (and save that value)
       @     # the input values
      .      # each
        %$   # modulo 
          @  # the saved value of 128
```
[![enter image description here](https://i.stack.imgur.com/V5qrm.png)](https://i.stack.imgur.com/V5qrm.png)
]