Use LLVM assembly to complete the missing functions for all of the following programs. See the LLVM Language Reference Manual for information about any of the supported instructions.

lab05.zip contains all of the starter template code. Additionally, it contains something called a Makefile. Makefiles are useful for a number of reasons, namely ease of use, simplicity, and determinism. Essentially, Makefiles specify targets and their dependencies. If a target is older than any dependency (or if the target doesn’t exist), then the specified command is run. See here for some quick examples.

FizzBuzz

Using the provided template-code, write the Fizz Buzz program. That is, print the integers 1 through 20 with the following conditions: if the number is divisible by 3, output “Fizz” instead of the number, “Buzz” if it’s divisible by 5, and “FizzBuzz” if it is divisible by both 3 and 5. This will require completing the fizzbuzz() function in fizz.ll.

Compute student average for n assignments

Using the provided template, ask for the number of grades and compute their average. Notice that the code has an array of 10 doubles already defined so make sure you enter a value less than or equal to 10. This will require completing the calc_avg() function in average.ll. You may need to consult the GetElementPtr page.

Adding fractions

Using the provided template, ask for two fractions, i.e., two pairs of positive integers, and find their sum. For the third problem from Lab 04 you found the greatest common denominator. Use that code to help you find the least common multiple in order to correctly add the values. This will require completing both the gcd() and lcm() in frac.ll.