#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ To_Celsius(float *);
int /*<<< orphan*/ To_Fahr(float *);
int /*<<< orphan*/ get_input(char *);
int /*<<< orphan*/ get_num(float *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char deg_in, deg_out;
  float deg_num = 0.0;
  float kelvin_loop = 0.0;
  float celsius_loop = 0.0;
  int i;
  printf("\nWould you like to convert from (F)ahrenheit, (C)elsius, (K)elvin, "
         "or see a (L)ist of conversions?\n");
  get_input(&deg_in);
  if (deg_in != 'L') {
    printf("Convert to (F)ahrenheit, (C)elsius, or (K)elvin?\n");
    get_input(&deg_out);
  }
  switch (deg_in) {
  case 'F':
    if (deg_out == 'C') {
      printf("Enter Temperature to convert:\n");
      get_num(&deg_num);
      To_Celsius(&deg_num);
      printf("%06.3f Degrees Celsius\n", deg_num);
    } else if (deg_out == 'K') {
      printf("Enter Temperature to convert:\n");
      get_num(&deg_num);
      To_Celsius(&deg_num);
      deg_num += 273.15;
      printf("%06.3f Kelvin\n", deg_num);
    } else if (deg_out == 'F') {
      printf("Enter Temperature to convert:\n");
      get_num(&deg_num);
      printf("%06.3f Degrees Fahrenheit, Duh\n", deg_num);
    }
    break;
  case 'C':
    if (deg_out == 'F') {
      printf("Enter Temperature to convert:\n");
      get_num(&deg_num);
      To_Fahr(&deg_num);
      printf("%06.3f Degrees Fahrenheit\n", deg_num);
    } else if (deg_out == 'K') {
      printf("Enter Temperature to convert:\n");
      get_num(&deg_num);
      deg_num += 273.15;
      printf("%06.3f Kelvin\n", deg_num);
    } else if (deg_out == 'C') {
      printf("Enter Temperature to convert:\n");
      get_num(&deg_num);
      printf("%06.3f Degrees Celsius, Duh\n", deg_num);
    }
    break;
  case 'K':
    if (deg_out == 'F') {
      printf("Enter Temperature to convert:\n");
      get_num(&deg_num);
      deg_num -= 273.15;
      To_Fahr(&deg_num);
      printf("%06.3f Degrees Fehrenheit\n", deg_num);
    } else if (deg_out == 'C') {
      printf("Enter Temperature to convert:\n");
      get_num(&deg_num);
      deg_num -= 273.15;
      printf("%06.3f Celsius\n", deg_num);
    } else if (deg_out == 'K') {
      printf("Enter Temperature to convert:\n");
      get_num(&deg_num);
      printf("%06.3f Kelvin, Duh\n", deg_num);
    }
    break;
  case 'L':
    printf("Fahrenheit\tCelcius\tKelvin\n\n");
    for (i = -40; i <= 200; i += 20) {
      celsius_loop = i;
      kelvin_loop = i;
      To_Celsius(&celsius_loop);
      To_Celsius(&kelvin_loop);
      kelvin_loop += 273.15;
      printf("\n\t%3d\t%06.3f\t%06.3f\n", i, celsius_loop, kelvin_loop);
    }
    break;
  default:
    printf("Something went wrong.\n");
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x5(%rbp),%rdi
call   1070 <get_input@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x4c,%eax
je     11b2 <main+0x62>
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x6(%rbp),%rdi
call   1070 <get_input@plt>
movsbl -0x5(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x9,%eax
ja     1572 <main+0x422>
mov    -0x20(%rbp),%rax
lea    0xe35(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsbl -0x6(%rbp),%eax
cmp    $0x43,%eax
jne    1225 <main+0xd5>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xc(%rbp),%rdi
call   1040 <get_num@plt>
lea    -0xc(%rbp),%rdi
call   1060 <To_Celsius@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xecc(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    12d1 <main+0x181>
movsbl -0x6(%rbp),%eax
cmp    $0x4b,%eax
jne    128c <main+0x13c>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xc(%rbp),%rdi
call   1040 <get_num@plt>
lea    -0xc(%rbp),%rdi
call   1060 <To_Celsius@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd9d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7d(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    12cc <main+0x17c>
movsbl -0x6(%rbp),%eax
cmp    $0x46,%eax
jne    12c7 <main+0x177>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xc(%rbp),%rdi
call   1040 <get_num@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe4c(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    12cc <main+0x17c>
jmp    12d1 <main+0x181>
jmp    1580 <main+0x430>
movsbl -0x6(%rbp),%eax
cmp    $0x46,%eax
jne    131f <main+0x1cf>
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xc(%rbp),%rdi
call   1040 <get_num@plt>
lea    -0xc(%rbp),%rdi
call   1030 <To_Fahr@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe19(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    13c2 <main+0x272>
movsbl -0x6(%rbp),%eax
cmp    $0x4b,%eax
jne    137d <main+0x22d>
lea    0xd93(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xc(%rbp),%rdi
call   1040 <get_num@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcac(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd8c(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    13bd <main+0x26d>
movsbl -0x6(%rbp),%eax
cmp    $0x43,%eax
jne    13b8 <main+0x268>
lea    0xd35(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xc(%rbp),%rdi
call   1040 <get_num@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd96(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    13bd <main+0x26d>
jmp    13c2 <main+0x272>
jmp    1580 <main+0x430>
movsbl -0x6(%rbp),%eax
cmp    $0x46,%eax
jne    142e <main+0x2de>
lea    0xceb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xc(%rbp),%rdi
call   1040 <get_num@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc04(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <To_Fahr@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd42(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    14d1 <main+0x381>
movsbl -0x6(%rbp),%eax
cmp    $0x43,%eax
jne    148c <main+0x33c>
lea    0xc84(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xc(%rbp),%rdi
call   1040 <get_num@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xb9d(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcff(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    14cc <main+0x37c>
movsbl -0x6(%rbp),%eax
cmp    $0x4b,%eax
jne    14c7 <main+0x377>
lea    0xc26(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xc(%rbp),%rdi
call   1040 <get_num@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xccf(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    14cc <main+0x37c>
jmp    14d1 <main+0x381>
jmp    1580 <main+0x430>
lea    0xcc6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffd8,-0x18(%rbp)
cmpl   $0xc8,-0x18(%rbp)
jg     156d <main+0x41d>
cvtsi2ssl -0x18(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
cvtsi2ssl -0x18(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1060 <To_Celsius@plt>
lea    -0x10(%rbp),%rdi
call   1060 <To_Celsius@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xad1(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x18(%rbp),%esi
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xc67(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x18(%rbp)
jmp    14eb <main+0x39b>
jmp    1580 <main+0x430>
lea    0xc5b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0x8(%rsp)
lea    0xf91(%rip),%rdi
call   1050 <puts@plt>
lea    0xf(%rsp),%rdi
call   1080 <get_input@plt>
cmpb   $0x4c,0xf(%rsp)
jne    122c <main+0xcc>
lea    0xfd3(%rip),%rdi
call   1050 <puts@plt>
mov    $0xffffffc4,%ebx
lea    0x14(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0xf40(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
add    $0x14,%ebx
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
movss  %xmm0,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
mov    %r14,%rdi
call   1070 <To_Celsius@plt>
mov    %r15,%rdi
call   1070 <To_Celsius@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xe10(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movss  %xmm1,0x10(%rsp)
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
mov    %r12,%rdi
mov    %ebx,%esi
mov    $0x2,%al
call   1060 <printf@plt>
cmp    $0xb5,%ebx
jl     11c0 <main+0x60>
jmp    14b0 <main+0x350>
lea    0xf8a(%rip),%rdi
call   1050 <puts@plt>
lea    0xe(%rsp),%rdi
call   1080 <get_input@plt>
movsbl 0xf(%rsp),%eax
add    $0xffffffbd,%eax
cmp    $0x9,%eax
ja     1378 <main+0x218>
lea    0xdb6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0xe(%rsp),%al
cmp    $0x43,%al
je     1389 <main+0x229>
cmp    $0x4b,%al
je     13b5 <main+0x255>
cmp    $0x46,%al
jne    14b0 <main+0x350>
lea    0xf03(%rip),%rdi
call   1050 <puts@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <get_num@plt>
mov    %rbx,%rdi
call   1030 <To_Fahr@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdce(%rip),%rdi
jmp    14a9 <main+0x349>
mov    0xe(%rsp),%al
cmp    $0x4b,%al
je     13cd <main+0x26d>
cmp    $0x46,%al
je     141a <main+0x2ba>
cmp    $0x43,%al
jne    14b0 <main+0x350>
lea    0xeb0(%rip),%rdi
call   1050 <puts@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <get_num@plt>
mov    %rbx,%rdi
call   1070 <To_Celsius@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd34(%rip),%rdi
jmp    14a9 <main+0x349>
mov    0xe(%rsp),%al
cmp    $0x43,%al
je     1443 <main+0x2e3>
cmp    $0x4b,%al
je     1482 <main+0x322>
cmp    $0x46,%al
jne    14b0 <main+0x350>
lea    0xe5d(%rip),%rdi
call   1050 <puts@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <get_num@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xcb0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <To_Fahr@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd44(%rip),%rdi
jmp    14a9 <main+0x349>
lea    0xe28(%rip),%rdi
call   1050 <puts@plt>
jmp    14b0 <main+0x350>
lea    0xdf9(%rip),%rdi
call   1050 <puts@plt>
lea    0x8(%rsp),%rdi
call   1040 <get_num@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcea(%rip),%rdi
jmp    14a9 <main+0x349>
lea    0xdcd(%rip),%rdi
call   1050 <puts@plt>
lea    0x8(%rsp),%rdi
call   1040 <get_num@plt>
jmp    13ee <main+0x28e>
lea    0xdb5(%rip),%rdi
call   1050 <puts@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <get_num@plt>
mov    %rbx,%rdi
call   1070 <To_Celsius@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xc08(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xc3b(%rip),%rdi
jmp    14a9 <main+0x349>
lea    0xd68(%rip),%rdi
call   1050 <puts@plt>
lea    0x8(%rsp),%rdi
call   1040 <get_num@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc1e(%rip),%rdi
jmp    14a9 <main+0x349>
lea    0xd3f(%rip),%rdi
call   1050 <puts@plt>
lea    0x8(%rsp),%rdi
call   1040 <get_num@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xb95(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xc52(%rip),%rdi
jmp    14a9 <main+0x349>
lea    0xd00(%rip),%rdi
call   1050 <puts@plt>
lea    0x8(%rsp),%rdi
call   1040 <get_num@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc39(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [100 x i8] c"\0AWould you like to convert from (F)ahrenheit, (C)elsius, (K)elvin, or see a (L)ist of conversions?\0A\00"
@.str.1 = [50 x i8] c"Convert to (F)ahrenheit, (C)elsius, or (K)elvin?\0A\00"
@.str.2 = [31 x i8] c"Enter Temperature to convert:\0A\00"
@.str.3 = [24 x i8] c"%06.3f Degrees Celsius\0A\00"
@.str.4 = [15 x i8] c"%06.3f Kelvin\0A\00"
@.str.5 = [32 x i8] c"%06.3f Degrees Fahrenheit, Duh\0A\00"
@.str.6 = [27 x i8] c"%06.3f Degrees Fahrenheit\0A\00"
@.str.7 = [29 x i8] c"%06.3f Degrees Celsius, Duh\0A\00"
@.str.8 = [27 x i8] c"%06.3f Degrees Fehrenheit\0A\00"
@.str.9 = [16 x i8] c"%06.3f Celsius\0A\00"
@.str.10 = [20 x i8] c"%06.3f Kelvin, Duh\0A\00"
@.str.11 = [28 x i8] c"Fahrenheit\09Celcius\09Kelvin\0A\0A\00"
@.str.12 = [21 x i8] c"\0A\09%3d\09%06.3f\09%06.3f\0A\00"
@.str.13 = [23 x i8] c"Something went wrong.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca i32
store i32 0, i32* %1
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @get_input(i8* %2)
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 76
br i1 %12, label %13, label %16
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @get_input(i8* %3)
br label %16
16: ; preds = %13, %0
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
switch i32 %18, label %164 [
i32 70, label %19
i32 67, label %58
i32 75, label %96
i32 76, label %138
]
19: ; preds = %16
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 67
br i1 %22, label %23, label %30
23: ; preds = %19
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%25 = call i32 @get_num(float* %4)
%26 = call i32 @To_Celsius(float* %4)
%27 = load float, float* %4
%28 = fpext float %27 to double
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), double %28)
br label %57
30: ; preds = %19
%31 = load i8, i8* %3
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 75
br i1 %33, label %34, label %45
34: ; preds = %30
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%36 = call i32 @get_num(float* %4)
%37 = call i32 @To_Celsius(float* %4)
%38 = load float, float* %4
%39 = fpext float %38 to double
%40 = fadd double %39, 2.731500e+02
%41 = fptrunc double %40 to float
store float %41, float* %4
%42 = load float, float* %4
%43 = fpext float %42 to double
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %43)
br label %56
45: ; preds = %30
%46 = load i8, i8* %3
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 70
br i1 %48, label %49, label %55
49: ; preds = %45
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%51 = call i32 @get_num(float* %4)
%52 = load float, float* %4
%53 = fpext float %52 to double
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), double %53)
br label %55
55: ; preds = %49, %45
br label %56
56: ; preds = %55, %34
br label %57
57: ; preds = %56, %23
br label %166
58: ; preds = %16
%59 = load i8, i8* %3
%60 = sext i8 %59 to i32
%61 = icmp eq i32 %60, 70
br i1 %61, label %62, label %69
62: ; preds = %58
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%64 = call i32 @get_num(float* %4)
%65 = call i32 @To_Fahr(float* %4)
%66 = load float, float* %4
%67 = fpext float %66 to double
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), double %67)
br label %95
69: ; preds = %58
%70 = load i8, i8* %3
%71 = sext i8 %70 to i32
%72 = icmp eq i32 %71, 75
br i1 %72, label %73, label %83
73: ; preds = %69
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%75 = call i32 @get_num(float* %4)
%76 = load float, float* %4
%77 = fpext float %76 to double
%78 = fadd double %77, 2.731500e+02
%79 = fptrunc double %78 to float
store float %79, float* %4
%80 = load float, float* %4
%81 = fpext float %80 to double
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %81)
br label %94
83: ; preds = %69
%84 = load i8, i8* %3
%85 = sext i8 %84 to i32
%86 = icmp eq i32 %85, 67
br i1 %86, label %87, label %93
87: ; preds = %83
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%89 = call i32 @get_num(float* %4)
%90 = load float, float* %4
%91 = fpext float %90 to double
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), double %91)
br label %93
93: ; preds = %87, %83
br label %94
94: ; preds = %93, %73
br label %95
95: ; preds = %94, %62
br label %166
96: ; preds = %16
%97 = load i8, i8* %3
%98 = sext i8 %97 to i32
%99 = icmp eq i32 %98, 70
br i1 %99, label %100, label %111
100: ; preds = %96
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%102 = call i32 @get_num(float* %4)
%103 = load float, float* %4
%104 = fpext float %103 to double
%105 = fsub double %104, 2.731500e+02
%106 = fptrunc double %105 to float
store float %106, float* %4
%107 = call i32 @To_Fahr(float* %4)
%108 = load float, float* %4
%109 = fpext float %108 to double
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), double %109)
br label %137
111: ; preds = %96
%112 = load i8, i8* %3
%113 = sext i8 %112 to i32
%114 = icmp eq i32 %113, 67
br i1 %114, label %115, label %125
115: ; preds = %111
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%117 = call i32 @get_num(float* %4)
%118 = load float, float* %4
%119 = fpext float %118 to double
%120 = fsub double %119, 2.731500e+02
%121 = fptrunc double %120 to float
store float %121, float* %4
%122 = load float, float* %4
%123 = fpext float %122 to double
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), double %123)
br label %136
125: ; preds = %111
%126 = load i8, i8* %3
%127 = sext i8 %126 to i32
%128 = icmp eq i32 %127, 75
br i1 %128, label %129, label %135
129: ; preds = %125
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%131 = call i32 @get_num(float* %4)
%132 = load float, float* %4
%133 = fpext float %132 to double
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), double %133)
br label %135
135: ; preds = %129, %125
br label %136
136: ; preds = %135, %115
br label %137
137: ; preds = %136, %100
br label %166
138: ; preds = %16
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0))
store i32 -40, i32* %7
br label %140
140: ; preds = %160, %138
%141 = load i32, i32* %7
%142 = icmp sle i32 %141, 200
br i1 %142, label %143, label %163
143: ; preds = %140
%144 = load i32, i32* %7
%145 = sitofp i32 %144 to float
store float %145, float* %6
%146 = load i32, i32* %7
%147 = sitofp i32 %146 to float
store float %147, float* %5
%148 = call i32 @To_Celsius(float* %6)
%149 = call i32 @To_Celsius(float* %5)
%150 = load float, float* %5
%151 = fpext float %150 to double
%152 = fadd double %151, 2.731500e+02
%153 = fptrunc double %152 to float
store float %153, float* %5
%154 = load i32, i32* %7
%155 = load float, float* %6
%156 = fpext float %155 to double
%157 = load float, float* %5
%158 = fpext float %157 to double
%159 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i32 %154, double %156, double %158)
br label %160
160: ; preds = %143
%161 = load i32, i32* %7
%162 = add nsw i32 %161, 20
store i32 %162, i32* %7
br label %140
163: ; preds = %140
br label %166
164: ; preds = %16
%165 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0))
br label %166
166: ; preds = %164, %163, %137, %95, %57
%167 = load i32, i32* %1
ret i32 %167
}

LLVM IR (-O2):
@.str.3 = [24 x i8] c"%06.3f Degrees Celsius\0A\00"
@.str.4 = [15 x i8] c"%06.3f Kelvin\0A\00"
@.str.5 = [32 x i8] c"%06.3f Degrees Fahrenheit, Duh\0A\00"
@.str.6 = [27 x i8] c"%06.3f Degrees Fahrenheit\0A\00"
@.str.7 = [29 x i8] c"%06.3f Degrees Celsius, Duh\0A\00"
@.str.8 = [27 x i8] c"%06.3f Degrees Fehrenheit\0A\00"
@.str.9 = [16 x i8] c"%06.3f Celsius\0A\00"
@.str.10 = [20 x i8] c"%06.3f Kelvin, Duh\0A\00"
@.str.12 = [21 x i8] c"\0A\09%3d\09%06.3f\09%06.3f\0A\00"
@str = [99 x i8] c"\0AWould you like to convert from (F)ahrenheit, (C)elsius, (K)elvin, or see a (L)ist of conversions?\00"
@str.14 = [27 x i8] c"Fahrenheit\09Celcius\09Kelvin\0A\00"
@str.23 = [30 x i8] c"Enter Temperature to convert:\00"
@str.24 = [22 x i8] c"Something went wrong.\00"
@str.25 = [49 x i8] c"Convert to (F)ahrenheit, (C)elsius, or (K)elvin?\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = bitcast float* %3 to i8*
store float 0.000000e+00, float* %3
%7 = bitcast float* %4 to i8*
%8 = bitcast float* %5 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([99 x i8], [99 x i8]* @str, i64 0, i64 0))
%10 = call i32 @get_input(i8* %1)
%11 = load i8, i8* %1
%12 = icmp eq i8 %11, 76
br i1 %12, label %95, label %13
13: ; preds = %0
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.25, i64 0, i64 0))
%15 = call i32 @get_input(i8* %2)
%16 = load i8, i8* %1
%17 = sext i8 %16 to i32
switch i32 %17, label %112 [
i32 70, label %18
i32 67, label %43
i32 75, label %67
i32 76, label %95
]
18: ; preds = %13
%19 = load i8, i8* %2
switch i8 %19, label %114 [
i8 67, label %20
i8 75, label %27
i8 70, label %37
]
20: ; preds = %18
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.23, i64 0, i64 0))
%22 = call i32 @get_num(float* %3)
%23 = call i32 @To_Celsius(float* %3)
%24 = load float, float* %3
%25 = fpext float %24 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), double %25)
br label %114
27: ; preds = %18
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.23, i64 0, i64 0))
%29 = call i32 @get_num(float* %3)
%30 = call i32 @To_Celsius(float* %3)
%31 = load float, float* %3
%32 = fpext float %31 to double
%33 = fadd double %32, 2.731500e+02
%34 = fptrunc double %33 to float
store float %34, float* %3
%35 = fpext float %34 to double
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %35)
br label %114
37: ; preds = %18
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.23, i64 0, i64 0))
%39 = call i32 @get_num(float* %3)
%40 = load float, float* %3
%41 = fpext float %40 to double
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), double %41)
br label %114
43: ; preds = %13
%44 = load i8, i8* %2
switch i8 %44, label %114 [
i8 70, label %45
i8 75, label %52
i8 67, label %61
]
45: ; preds = %43
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.23, i64 0, i64 0))
%47 = call i32 @get_num(float* %3)
%48 = call i32 @To_Fahr(float* %3)
%49 = load float, float* %3
%50 = fpext float %49 to double
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), double %50)
br label %114
52: ; preds = %43
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.23, i64 0, i64 0))
%54 = call i32 @get_num(float* %3)
%55 = load float, float* %3
%56 = fpext float %55 to double
%57 = fadd double %56, 2.731500e+02
%58 = fptrunc double %57 to float
store float %58, float* %3
%59 = fpext float %58 to double
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %59)
br label %114
61: ; preds = %43
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.23, i64 0, i64 0))
%63 = call i32 @get_num(float* %3)
%64 = load float, float* %3
%65 = fpext float %64 to double
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), double %65)
br label %114
67: ; preds = %13
%68 = load i8, i8* %2
switch i8 %68, label %114 [
i8 70, label %69
i8 67, label %80
i8 75, label %89
]
69: ; preds = %67
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.23, i64 0, i64 0))
%71 = call i32 @get_num(float* %3)
%72 = load float, float* %3
%73 = fpext float %72 to double
%74 = fadd double %73, -2.731500e+02
%75 = fptrunc double %74 to float
store float %75, float* %3
%76 = call i32 @To_Fahr(float* %3)
%77 = load float, float* %3
%78 = fpext float %77 to double
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), double %78)
br label %114
80: ; preds = %67
%81 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.23, i64 0, i64 0))
%82 = call i32 @get_num(float* %3)
%83 = load float, float* %3
%84 = fpext float %83 to double
%85 = fadd double %84, -2.731500e+02
%86 = fptrunc double %85 to float
store float %86, float* %3
%87 = fpext float %86 to double
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), double %87)
br label %114
89: ; preds = %67
%90 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.23, i64 0, i64 0))
%91 = call i32 @get_num(float* %3)
%92 = load float, float* %3
%93 = fpext float %92 to double
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), double %93)
br label %114
95: ; preds = %0, %13
%96 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.14, i64 0, i64 0))
br label %97
97: ; preds = %95, %97
%98 = phi i32 [ -40, %95 ], [ %110, %97 ]
%99 = sitofp i32 %98 to float
store float %99, float* %5
store float %99, float* %4
%100 = call i32 @To_Celsius(float* %5)
%101 = call i32 @To_Celsius(float* %4)
%102 = load float, float* %4
%103 = fpext float %102 to double
%104 = fadd double %103, 2.731500e+02
%105 = fptrunc double %104 to float
store float %105, float* %4
%106 = load float, float* %5
%107 = fpext float %106 to double
%108 = fpext float %105 to double
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i32 %98, double %107, double %108)
%110 = add nsw i32 %98, 20
%111 = icmp slt i32 %98, 181
br i1 %111, label %97, label %114
112: ; preds = %13
%113 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.24, i64 0, i64 0))
br label %114
114: ; preds = %97, %67, %43, %18, %69, %89, %80, %45, %61, %52, %20, %37, %27, %112
ret i32 0
}