int main(int argc, char **argv) {
  char types[3][10] = {"celsius", "fahrenheit", "kelvin"};
  int option, start, i, from, to;
  if (argc < 2) {
    printf("\e[31m"
           "Error: Not enough arguments given\n"
           "\e[39;0m");
    printhelp();
    return 0;
  }
  start = getFrom(argc, argv, types);
  from = getType(start, argv, types);
  printf("%d\t%d\n", start, from);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xea3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xea0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe9d(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe9b(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xe95(%rip),%ax
mov    %ax,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11b6 <main+0x76>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <printhelp@plt>
movl   $0x0,-0x4(%rbp)
jmp    11fb <main+0xbb>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
mov    $0x0,%al
call   1040 <getFrom@plt>
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
mov    $0x0,%al
call   1050 <getType@plt>
mov    %eax,-0x40(%rbp)
mov    -0x38(%rbp),%esi
mov    -0x40(%rbp),%edx
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
movups 0xebf(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,(%rsp)
cmp    $0x1,%edi
jg     117b <main+0x3b>
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1060 <printhelp@plt>
jmp    11ae <main+0x6e>
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <getFrom@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <getType@plt>
lea    0xeaa(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.types = [3 x [10 x i8]] [[10 x i8] c"celsius\00\00\00", [10 x i8] c"fahrenheit", [10 x i8] c"kelvin\00\00\00\00"]
@.str = [47 x i8] c"\1B[31mError: Not enough arguments given\0A\1B[39;0m\00"
@.str.1 = [7 x i8] c"%d\09%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x [10 x i8]]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = bitcast [3 x [10 x i8]]* %6 to i8*
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 2
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%17 = call i32 (...) @printhelp()
store i32 0, i32* %3
br label %30
18: ; preds = %2
%19 = load i32, i32* %4
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %6, i64 0, i64 0
%22 = call i32 (i32, i8**, [10 x i8]*, ...) bitcast (i32 (...)* @getFrom to i32 (i32, i8**, [10 x i8]*, ...)*)(i32 %19, i8** %20, [10 x i8]* %21)
store i32 %22, i32* %8
%23 = load i32, i32* %8
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %6, i64 0, i64 0
%26 = call i32 (i32, i8**, [10 x i8]*, ...) bitcast (i32 (...)* @getType to i32 (i32, i8**, [10 x i8]*, ...)*)(i32 %23, i8** %24, [10 x i8]* %25)
store i32 %26, i32* %10
%27 = load i32, i32* %8
%28 = load i32, i32* %10
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %27, i32 %28)
store i32 0, i32* %3
br label %30
30: ; preds = %18, %15
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
@__const.main.types = [3 x [10 x i8]] [[10 x i8] c"celsius\00\00\00", [10 x i8] c"fahrenheit", [10 x i8] c"kelvin\00\00\00\00"]
@.str = [47 x i8] c"\1B[31mError: Not enough arguments given\0A\1B[39;0m\00"
@.str.1 = [7 x i8] c"%d\09%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [3 x [10 x i8]]
%4 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %3, i64 0, i64 0, i64 0
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @printhelp()
br label %14
9: ; preds = %2
%10 = getelementptr inbounds [3 x [10 x i8]], [3 x [10 x i8]]* %3, i64 0, i64 0
%11 = call i32 (i32, i8**, [10 x i8]*, ...) bitcast (i32 (...)* @getFrom to i32 (i32, i8**, [10 x i8]*, ...)*)(i32 %0, i8** %1, [10 x i8]* %10)
%12 = call i32 (i32, i8**, [10 x i8]*, ...) bitcast (i32 (...)* @getType to i32 (i32, i8**, [10 x i8]*, ...)*)(i32 %11, i8** %1, [10 x i8]* %10)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12)
br label %14
14: ; preds = %9, %6
ret i32 0
}