[Question]
  [
At the opening scene of the *Dark Knight rises*, there is a rather [awkward dialogue](http://knowyourmeme.com/memes/baneposting) between a CIA agent and the villain Bane.
> 
> **CIA agent:** “If I pull that [mask] off, will you die?”
> 
> 
> **Bane:** “It would be extremely painful…”
> 
> 
> **CIA agent:** “You’re a big guy.”
> 
> 
> **Bane:** “…for you.”
> 
> 
> 
It’s unsure if Bane intends to say “painful for you” or “big guy for you”. Let’s settle this problem once for all through code golfing!
## Challenge
Your task is write a program that reorders the above dialogue depending on an integer given as input.
CIA agent dialogue words are:
`If` `I` `pull` `that` `off` `will` `you` `die?` `You're` `a` `big` `guy.`
Bane’s dialogue words are:
`It` `would` `be` `extremely` `painful...` `for` `you!`
Please note that `die?`, `You’re`, `painful...` and `you!` are considered as single words.
1. Given an integer n as input, convert it to binary
2. Reading the binary digits from left to right, output the next word from CIA agent dialogue if the digit is `1`, and the next word from Bane dialogue if the digit is `0`. The words should be separated by a space.
When the speaker changes, add a line feed. Also, prefix each dialogue line with the speaker name (`BANE:`  or `CIA:` ).
You can assume that the input always starts with a 1 in binary form, and has 12 ones and 7 zeroes.
## Example
`522300`
1. Converted to binary: `1111111100000111100`
2. The number starts with 8 ones, so we output the 8 first words from CIA’s agent dialogue, and prefix them with CIA:
`CIA: If I pull that off will you die?`
3. Then we got 5 zeroes, so we get the 5 first words from Bane’s dialogue:
`BANE: It would be extremely painful...`
4. Then there are 4 ones, so we output the 4 next CIA words:
`CIA: You’re a big guy.`
5. Then 2 zeroes:
`BANE: for you!`
**Final result:**
```
CIA: If I pull that off will you die?
BANE: It would be extremely painful...
CIA: You’re a big guy.
BANE: for you!
```
## More test cases:
**494542**
```
CIA: If I pull that
BANE: It would be
CIA: off
BANE: extremely
CIA: will you die? You're
BANE: painful... for
CIA: a big guy.
BANE: you!
```
**326711**
```
CIA: If
BANE: It would
CIA: I pull that off will you
BANE: be extremely painful... for
CIA: die? You're
BANE: you!
CIA: a big guy.
```
  
[Answer]
# Pyth - 138 bytes
I should look into compressing the movie script.
```
K_cc"guy big a You're die? you will off that pull I If you! for painful... extremely be would That"d12jmj;++@c"BANECIA"4ed\:m.)@Kedhdr8jQ2
```
[Test Suite](http://pyth.herokuapp.com/?code=K_cc%22guy+big+a+You%27re+die%3F+you+will+off+that+pull+I+If+you%21+for+painful...+extremely+be+would+That%22d12jmj%3B%2B%2B%40c%22BANECIA%224ed%5C%3Am.%29%40Kedhdr8jQ2&test_suite=1&test_suite_input=522300%0A494542%0A326711&debug=0).
[Answer]
## JavaScript (ES6), ~~203~~ 201 bytes
*Edit: saved 2 bytes by shamelessly borrowing the `trim()` idea from [ETHproductions answer](https://codegolf.stackexchange.com/a/109036/58563)*
```
n=>"If I pull that off will you die? You're a big guy. It would be extremely painful... for you!".split` `.map((_,i,a)=>[`
BANE: `,`
CIA: `,' '][j^(j=n>>18-i&1)?j:2]+a[k[j]++],k=[j=12,0]).join``.trim()
```
### Test cases
```
let f =
n=>"If I pull that off will you die? You're a big guy. It would be extremely painful... for you!".split` `.map((_,i,a)=>[`
BANE: `,`
CIA: `,' '][j^(j=n>>18-i&1)?j:2]+a[k[j]++],k=[j=12,0]).join``.trim()
console.log(f(522300))
console.log(f(494542))
console.log(f(326711))
```
[Answer]
## JavaScript (ES6), ~~209~~ ~~202~~ 201 bytes
```
(n,a="It would be extremely painful... for you! If I pull that off will you die? You're a big guy.".split` `,b=[6,18])=>(F=(s,p=n%2)=>n?F((p^(n>>=1)%2?p?`
CIA: `:`
BANE: `:` `)+a[b[p]--]+s):s.trim())``
```
Old approach:
```
(n,a="If I pull that off will you die? You're a big guy. It would be extremely painful... for you!".split` `,b=[12,0])=>(F=p=>p^n%2?F(n%2)+(p?`
CIA:`:`
BANE:`):n?F(p,n>>=1)+" "+a[b[p]++]:``)(n%2).trim()
```
### Test snippet
```
f=(n,a="It would be extremely painful... for you! If I pull that off will you die? You're a big guy.".split` `,b=[6,18])=>(F=(s,p=n%2)=>n?F((p^(n>>=1)%2?p?`
CIA: `:`
BANE: `:` `)+a[b[p]--]+s):s.trim())``
console.log(f(522300))
console.log(f(494542))
console.log(f(326711))
```
[Answer]
## C++11 (GCC), ~~298~~ 293 bytes
```
#include<sstream>
[](int i){std::stringstream b("It would be extremely painful... for you!"),c("If I pull that off will you die? You're a big guy.");std::string s,w;int n=0,t=i,p;while(t/=2)n++;for(;n>=0;p=t)((t=i>>n&1)?c:b)>>w,s+=p^t?t?"CIA: ":"BANE: ":" ",s+=t^(i>>--n)&1?w+"\n":w;return s;}
```
A lambda function that takes an integer and returns the dialogue as a `std::string`. You can see it in action [here](http://ideone.com/b6uunu).
Ungolfed version (with some explanation):
```
#include<sstream>
[](int i) {
    std::stringstream bane("It would be extremely painful... for you!"),
                      cia("If I pull that off will you die? You're a big guy.");
    std::string s, w;
    int n = 0, t = i, p;
    // Find the position of the most significant bit (n)
    while (t/=2) n++;
    for (; n>=0; p=t) {
        t = i>>n&1; // Current bit
        // Append the speaker name if the previous bit was different
        if (t != p) s += (t ? "CIA: " : "BANE: ");
        else s += " ";
        // Read the next word from one of the streams
        if (t) cia >> w;
        else bane >> w;
        s += w;
        if (t != ((i>>--n)&1)) // Append a newline if the next bit is different
            s += "\n";
    }
    return s;
}
```
[Answer]
# JavaScript (ES6), ~~252 227~~ 226 bytes
```
n=>[...n.toString(2,b="If I pull that off will you die? You're a big guy.".split` `,c="It would be extremely painful... for you!".split` `)].map((a,i,j)=>(a!=j[i-1]?+a?i?`
CIA: `:`CIA: `:`
BANE: `:``)+(+a?b:c).shift()).join` `
```
# Usage
```
f=n=>[...n.toString(2,b="If I pull that off will you die? You're a big guy.".split` `,c="It would be extremely painful... for you!".split` `)].map((a,i,j)=>(a!=j[i-1]?+a?i?`
CIA: `:`CIA: `:`
BANE: `:``)+(+a?b:c).shift()).join` `
f(522300)
```
# Notes
This is golfing-in-progress, I think I can still shave off some bytes, but feel free to leave suggestions in the comments.
[Answer]
# Python 3.6, 232 bytes
```
from itertools import*
c="you! for painful... extremely be would It".split(),"guy. big a You're die? you will off that pull I If".split()
for n,r in groupby(f'{int(input()):b}',int):
 print("BCAINAE::"[n::2],*[c[n].pop()for _ in r])
```
**Edit**, equivalently:
```
from itertools import*
c="It would be extremely painful... for you!".split(),"_ If I pull that off will you die? You're a big guy.".split()
for n,r in groupby(map(int,f'{int(input()):b}')):
 print("BCAINAE::"[n::2],*map(c[n].pop,r))
```
[Answer]
# Japt, 121 bytes
```
A=[`It Ùd ¼ extÚ+ pafª... f y!`¸`If I pªl È     f Øi y ¹e? Y' a big guy.`¸]¢®^T?["
BANE:""
CIA:"]gT=Z :P +S+AgZ vÃx
```
Contains many unprintables, so you'd just be better off [testing it online](http://ethproductions.github.io/japt/?v=1.4.4&code=QT1bYEl0INkCZCC8IGV4dJzaKyBwYYhmqi4uLiBmjiB5jCFguGBJZiBJIHCqbCDICSCPZiDYaSB5jCC5ZT8gWYwnnCBhIGJpZyBndXkuYLhdoq5eVD9bIgpCQU5FOiIiCkNJQToiXWdUPVogOlAgK1MrQWdaIHbDeA==&input=NTIyMzAw).
[Answer]
# [Perl 6](http://perl6.org/), 211 bytes
```
{.put for map |*,zip map {.[0]X .[1].rotor: .[2..*]},zip <CIA: BANE:>,(<If I pull that off will you die? You're a big guy.>,<It would be extremely painful... for you!>),|(.base(2)~~m:g/(.)$0*/)».chars.rotor(2)}
```
[Answer]
# C#, ~~398~~ ~~390~~ ~~385~~ ~~396~~ 389 bytes
```
class P{static void Main(string[] a){string s="2"+System.Convert.ToString(int.Parse(a[0]),2),e="CIA: ",r="BANE: ",o="";int k=0,l=0,i=1;string[] c="If I pull that off will you die? You're a big guy.".Split(' '),b="It would be extremely painful... for you!".Split(' ');for(;i<s.Length;i++)o+=(s[i-1]==s[i]?" ":(i<2?"":"\n")+(s[i]>'0'?e:r))+(s[i]>'0'?c[k++]:b[l++]);System.Console.Write(o);}}
```
Launch with input number as parameter.
Ungolfed:
```
class P
{
    static void Main(string[] a)
    {
        string s = "2" + System.Convert.ToString(int.Parse(a[0]), 2), e = "CIA: ", r = "BANE: ", o = "";
        int k = 0, l = 0, i = 1;
        string[] c = "If I pull that off will you die? You're a big guy.".Split(' '), b = "It would be extremely painful... for you!".Split(' ');
        for (; i < s.Length; i++)
            o += (s[i - 1] == s[i] ? " " : (i<2?"":"\n") + (s[i] > '0' ? e : r))
                + (s[i] > '0' ? c[k++] : b[l++]);
        System.Console.Write(o); 
    }
}
```
Back to 396 bytes because I didn't notice "no newline at the begining" rule.
[Answer]
# Ruby, 204+1 = 205 bytes
Requires the `-n` flag.
```
d=[%w"It would be extremely painful... for you!",%w"If I pull that off will you die? You're a big guy."]
n=%w"BANE CIA"
("%b"%$_).scan(/((.)\2*)/).map{|i,b|puts n[k=b.to_i]+': '+d[k].slice!(0,i.size)*' '}
```
[Answer]
# PHP, 198 bytes
```
while($i++<19)echo($t-$s=1&$argv[1]>>19-$i)?"
"[$i<2].($s?CIA:BANE).": ":" ",explode(0,"It0would0be0extremely0painful...0for0you!0If0I0pull0that0off0will0you0die?0You're0a0big0guy.")[$$s+++7*$t=$s];
```
[Answer]
# Perl, 205 bytes
```
@t=([qw/It would be extremely painful... for you!/],[qw/If I pull that off will you die? You're a big guy./]);$_=sprintf'%b',$0;print$n?'BANE':'CIA',": @{[splice$t[$n=1-$n],0,length$&]}"while s/(.)\1*//;
```
Put that into a file named 494542 and run like this:
```
perl -lX 494542
```
Tested on perl v5.22
[Answer]
## Clojure, 401 bytes
```
(require '[clojure.string :as s])(defn f[n](let[c(map #(-(int %) 48)(Integer/toString n 2))p[(s/split"It would be extremely painful... for you!"#" ")(s/split"If I pull that off will you die? You're a big guy."#" ")]a["BANE" "CIA"]](loop[i[0 0] g"" d c q 2](if(<(count d)1)g(let[b(first d)j(i b)](recur(assoc i b (inc j))(str g(if(= b q)" "(str(when(not= 2 q)"\n")(a b)": "))((p b) j))(rest d) b))))))
```
Invocation:
```
(f 522300)
```
# Ungolfed
```
(require '[clojure.string :as s])
(defn dialogue[num]
    (let [dacode (map #(- (int %) 48) (Integer/toString num 2))
          phrases [(s/split"It would be extremely painful... for you!"#" ")(s/split"If I pull that off will you die? You're a big guy."#" ")]
      actors ["BANE" "CIA"]]
      (loop [idxs [0 0] finaldial "" code dacode prevbit 2]
        (if (< (count code) 1) finaldial
            (let [bit (first code) idx (idxs bit)]
              (recur (assoc idxs bit (inc idx)) (str finaldial (if (= bit prevbit) " " (str (when (not= 2 prevbit) "\n") (actors bit) ": ")) ((phrases bit) idx)) (rest code) bit))))))
```
]