#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
double get_fmass() {
  int fget;
  double ftemp = 0;
  printf("\nFractional Mass Threshold? \n");
  printf("\nin the form of: cut-off values below 10 to the -n");
  printf("\nwhere n is what you enter now\n\n");
  scanf("%d", &fget);
  switch (fget) {
  case 1:
    ftemp = 10E-1;
    break;
  case 2:
    ftemp = 10E-2;
    break;
  case 3:
    ftemp = 10E-3;
    break;
  case 4:
    ftemp = 10E-4;
    break;
  case 5:
    ftemp = 10E-5;
    break;
  case 6:
    ftemp = 10E-6;
    break;
  case 7:
    ftemp = 10E-7;
    break;
  case 8:
    ftemp = 10E-8;
    break;
  case 9:
    ftemp = 10E-9;
    break;
  case 10:
    ftemp = 10E-10;
    break;
  }
  return (ftemp);
}


x86 assembly (clang, -O0):
<get_fmass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x10(%rbp)
lea    0xf41(%rip),%rdi
call   1030 <printf@plt>
lea    0xf53(%rip),%rdi
call   1030 <printf@plt>
lea    0xf7a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf8f(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x9,%eax
ja     123c <get_fmass+0x11c>
mov    -0x18(%rbp),%rax
lea    0xecc(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsd  0xeb3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    123c <get_fmass+0x11c>
movsd  0xe99(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    123c <get_fmass+0x11c>
movsd  0xe7f(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    123c <get_fmass+0x11c>
movsd  0xe65(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    123c <get_fmass+0x11c>
movsd  0xe4b(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    123c <get_fmass+0x11c>
movsd  0xe31(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    123c <get_fmass+0x11c>
movsd  0xe17(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    123c <get_fmass+0x11c>
movsd  0xdfd(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    123c <get_fmass+0x11c>
movsd  0xde3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    123c <get_fmass+0x11c>
movsd  0xdc9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fmass>:
push   %rax
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cmp    $0x9,%eax
ja     1183 <get_fmass+0x53>
cltq
lea    0xefa(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [30 x i8] c"\0AFractional Mass Threshold? \0A\00"
@.str.1 = [51 x i8] c"\0Ain the form of: cut-off values below 10 to the -n\00"
@.str.2 = [33 x i8] c"\0Awhere n is what you enter now\0A\0A\00"
@.str.3 = [3 x i8] c"%d\00"
define double @get_fmass() {
%1 = alloca i32
%2 = alloca double
store double 0.000000e+00, double* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
switch i32 %7, label %18 [
i32 1, label %8
i32 2, label %9
i32 3, label %10
i32 4, label %11
i32 5, label %12
i32 6, label %13
i32 7, label %14
i32 8, label %15
i32 9, label %16
i32 10, label %17
]
8: ; preds = %0
store double 1.000000e+00, double* %2
br label %18
9: ; preds = %0
store double 1.000000e-01, double* %2
br label %18
10: ; preds = %0
store double 1.000000e-02, double* %2
br label %18
11: ; preds = %0
store double 1.000000e-03, double* %2
br label %18
12: ; preds = %0
store double 1.000000e-04, double* %2
br label %18
13: ; preds = %0
store double 1.000000e-05, double* %2
br label %18
14: ; preds = %0
store double 0x3EB0C6F7A0B5ED8D, double* %2
br label %18
15: ; preds = %0
store double 0x3E7AD7F29ABCAF48, double* %2
br label %18
16: ; preds = %0
store double 1.000000e-08, double* %2
br label %18
17: ; preds = %0
store double 1.000000e-09, double* %2
br label %18
18: ; preds = %0, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8
%19 = load double, double* %2
ret double %19
}

LLVM IR (-O2):
@.str.1 = [51 x i8] c"\0Ain the form of: cut-off values below 10 to the -n\00"
@.str.3 = [3 x i8] c"%d\00"
@str = [29 x i8] c"\0AFractional Mass Threshold? \00"
@str.4 = [32 x i8] c"\0Awhere n is what you enter now\0A\00"
@switch.table.get_fmass = [10 x double] [double 1.000000e+00, double 1.000000e-01, double 1.000000e-02, double 1.000000e-03, double 1.000000e-04, double 1.000000e-05, double 0x3EB0C6F7A0B5ED8D, double 0x3E7AD7F29ABCAF48, double 1.000000e-08, double 1.000000e-09]
define double @get_fmass() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.4, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = add i32 %7, -1
%9 = icmp ult i32 %8, 10
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = sext i32 %8 to i64
%12 = getelementptr inbounds [10 x double], [10 x double]* @switch.table.get_fmass, i64 0, i64 %11
%13 = load double, double* %12
br label %14
14: ; preds = %10, %0
%15 = phi double [ 0.000000e+00, %0 ], [ %13, %10 ]
ret double %15
}