int main() {
  int fib_total;
  fib_total = 20;
  int i, j, fib;
  i = 0;
  j = 1;
  printf("Fibonacci Sequence");
  while (fib < fib_total) {
    fib = i + j;
    j = i;
    i = fib;
    printf(fib);
  }
  int a, b, c, d;
  a = 6;
  b = 6;
  printf("Greatest Commond Divisisor");
  do {
    c = a % b;
    a = b;
    b = c;
  } while (b > 0);
  printf("The GCD is: ");
  printf(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1173 <main+0x63>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
movslq -0x14(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1142 <main+0x32>
movl   $0x6,-0x18(%rbp)
movl   $0x6,-0x1c(%rbp)
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    %edx,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jg     118f <main+0x7f>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x6,%edi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Fibonacci Sequence\00"
@.str.1 = [27 x i8] c"Greatest Commond Divisisor\00"
@.str.2 = [13 x i8] c"The GCD is: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store i32 20, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %15, %0
%12 = load i32, i32* %5
%13 = load i32, i32* %2
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %25
15: ; preds = %11
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = add nsw i32 %16, %17
store i32 %18, i32* %5
%19 = load i32, i32* %3
store i32 %19, i32* %4
%20 = load i32, i32* %5
store i32 %20, i32* %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to i8*
%24 = call i32 (i8*, ...) @printf(i8* %23)
br label %11
25: ; preds = %11
store i32 6, i32* %6
store i32 6, i32* %7
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %27
27: ; preds = %33, %25
%28 = load i32, i32* %6
%29 = load i32, i32* %7
%30 = srem i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %7
store i32 %31, i32* %6
%32 = load i32, i32* %8
store i32 %32, i32* %7
br label %33
33: ; preds = %27
%34 = load i32, i32* %7
%35 = icmp sgt i32 %34, 0
br i1 %35, label %27, label %36
36: ; preds = %33
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%38 = load i32, i32* %6
%39 = sext i32 %38 to i64
%40 = inttoptr i64 %39 to i8*
%41 = call i32 (i8*, ...) @printf(i8* %40)
%42 = load i32, i32* %1
ret i32 %42
}

LLVM IR (-O2):
@.str = [19 x i8] c"Fibonacci Sequence\00"
@.str.1 = [27 x i8] c"Greatest Commond Divisisor\00"
@.str.2 = [13 x i8] c"The GCD is: \00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 6 to i8*))
ret i32 0
}