Created
July 17, 2017 21:17
-
-
Save alexcrichton/b16c54c93f5135abf4bbf23c4ab98184 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io::*; | |
fn main() { | |
let mut s = String::new(); | |
stdin().read_to_string(&mut s).unwrap(); | |
let mut lines = s.lines().enumerate(); | |
let start = loop { | |
let (i, l) = lines.next().unwrap(); | |
if l.starts_with("define void") && l.contains("@foo") { | |
break i | |
} | |
}; | |
while let Some((j, l)) = lines.next() { | |
if l.ends_with(":") { | |
continue | |
} | |
if l.contains(" alloca ") { | |
continue | |
} | |
println!("{} allocas", j - start); | |
break | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment