how does OpenSSH use bcrypt to set IV's? I generated an encrypted OpenSSH private key for test purposes:

-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jYmMAAAAGYmNyeXB0AAAAGAAAABCX18gzzE
urqzviTpYwDuLjAAAAEAAAAAEAAAAzAAAAC3NzaC1lZDI1NTE5AAAAIL3fL8j3ilzDkr/O
7rBBCIYaH/pE1VvU3r2IEy7M2vBaAAAAoAHqj8gYr4dNtxmQyoC+md10ZwY+GOuWIYmOxl
vDYQkGZWYAU4zeiu+GnWhJr935cR1IrJUdsPWkjtdYRh4HksY5DjFngSHxEYr5/HyfJN52
tCN4zoxVe9bHyWVAs/XdnfHAMSUL7f+tXXhSIOitwggn1/bUDqX3bYMk8qtEYbDweE0lS4
Q5TcIJEn3A255WyCJ+WKXTglTaKpDNXCucV9E=
-----END OPENSSH PRIVATE KEY-----


(key type is ed25519; password is "key")

PROTOCOL.key describes the format of the key. In decoding it they're using bcrypt with 160 rounds.

Quoting PROTOCOL.key,


  The KDF is used to derive a key, IV (and other values required by the cipher) from the passphrase. These values are then used to encrypt the unencrypted list of private keys.


That's kinda vague. How do the IV / key get generated? Are they the same?
If I am reading the code right, it does indeed use the key as the IV, here are the relevant functions:

sshkey_parse_private2 from sshkey.c is the function that performs the KDF and decrypts the private key blob. The KDF takes the 
The first decryption function called within sshkey_parse_private2 is cipher_init, as follows:

r = cipher_init(&amp;ciphercontext, cipher, key, keylen, key + keylen, ivlen, 0)) != 0)


The format of that function from cipher.c:

cipher_init(struct sshcipher_ctx **ccp, const struct sshcipher *cipher, const u_char *key, u_int keylen, const u_char *iv, u_int ivlen, int do_encrypt)


That means the IV passed to cipher_init is simply key + keylen

Additionally, the round count for bcrypt is 16