#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 */
double DBL_EPSILON;
double DBL_MANT_DIG;
int DBL_MAX;
double DBL_MAX_EXP;
double DBL_MIN;
double DBL_MIN_EXP;
double FLT_RADIX;
double FLT_ROUNDS;
scalar_t__ strncmp(char *, char *, int);
double dmach(char *cmach) {
  double sfmin, small, rmach;
  if (strncmp(cmach, "E", 1) == 0) {
    rmach = DBL_EPSILON * 0.5;
  } else if (strncmp(cmach, "S", 1) == 0) {
    sfmin = DBL_MIN;
    small = 1. / DBL_MAX;
    if (small >= sfmin) {
      sfmin = small * (DBL_EPSILON * 0.5 + 1.);
    }
    rmach = sfmin;
  } else if (strncmp(cmach, "B", 1) == 0) {
    rmach = FLT_RADIX;
  } else if (strncmp(cmach, "P", 1) == 0) {
    rmach = DBL_EPSILON * 0.5 * FLT_RADIX;
  } else if (strncmp(cmach, "N", 1) == 0) {
    rmach = DBL_MANT_DIG;
  } else if (strncmp(cmach, "R", 1) == 0) {
    rmach = FLT_ROUNDS;
  } else if (strncmp(cmach, "M", 1) == 0) {
    rmach = DBL_MIN_EXP;
  } else if (strncmp(cmach, "U", 1) == 0) {
    rmach = DBL_MIN;
  } else if (strncmp(cmach, "L", 1) == 0) {
    rmach = DBL_MAX_EXP;
  } else if (strncmp(cmach, "O", 1) == 0) {
    rmach = DBL_MAX;
  }
  return rmach;
}


x86 assembly (clang, -O0):
<dmach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xee9(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1158 <dmach+0x48>
movsd  0xebd(%rip),%xmm0
mov    0x2e76(%rip),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    13ce <dmach+0x2be>
mov    -0x8(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11f3 <dmach+0xe3>
mov    0x2e32(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0x2e1a(%rip),%rax
cvtsi2sdl (%rax),%xmm1
movsd  0xe6e(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11e4 <dmach+0xd4>
movsd  -0x18(%rbp),%xmm0
mov    0x2e01(%rip),%rax
movsd  (%rax),%xmm1
movsd  0xe35(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe31(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    13c9 <dmach+0x2b9>
mov    -0x8(%rbp),%rdi
lea    0xe16(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1227 <dmach+0x117>
mov    0x2dcf(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    13c4 <dmach+0x2b4>
mov    -0x8(%rbp),%rdi
lea    0xde4(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    126e <dmach+0x15e>
movsd  0xdb2(%rip),%xmm0
mov    0x2d6b(%rip),%rax
mulsd  (%rax),%xmm0
mov    0x2d88(%rip),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    13bf <dmach+0x2af>
mov    -0x8(%rbp),%rdi
lea    0xd9f(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    12a2 <dmach+0x192>
mov    0x2d34(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    13ba <dmach+0x2aa>
mov    -0x8(%rbp),%rdi
lea    0xd6d(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    12d6 <dmach+0x1c6>
mov    0x2d18(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    13b5 <dmach+0x2a5>
mov    -0x8(%rbp),%rdi
lea    0xd3b(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    130a <dmach+0x1fa>
mov    0x2cdc(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    13b0 <dmach+0x2a0>
mov    -0x8(%rbp),%rdi
lea    0xd09(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    133e <dmach+0x22e>
mov    0x2c80(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    13ab <dmach+0x29b>
mov    -0x8(%rbp),%rdi
lea    0xcd7(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1372 <dmach+0x262>
mov    0x2c6c(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    13a6 <dmach+0x296>
mov    -0x8(%rbp),%rdi
lea    0xca5(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    13a1 <dmach+0x291>
mov    0x2c10(%rip),%rax
cvtsi2sdl (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    13a6 <dmach+0x296>
jmp    13ab <dmach+0x29b>
jmp    13b0 <dmach+0x2a0>
jmp    13b5 <dmach+0x2a5>
jmp    13ba <dmach+0x2aa>
jmp    13bf <dmach+0x2af>
jmp    13c4 <dmach+0x2b4>
jmp    13c9 <dmach+0x2b9>
jmp    13ce <dmach+0x2be>
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmach>:
push   %rbx
mov    %rdi,%rbx
lea    0xef5(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     123f <dmach+0x12f>
lea    0xedd(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1254 <dmach+0x144>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12ac <dmach+0x19c>
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12b5 <dmach+0x1a5>
lea    0xe8c(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12d5 <dmach+0x1c5>
lea    0xe71(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12de <dmach+0x1ce>
lea    0xe56(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12e7 <dmach+0x1d7>
lea    0xe3b(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12f0 <dmach+0x1e0>
lea    0xe20(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12f9 <dmach+0x1e9>
lea    0xe05(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    123d <dmach+0x12d>
mov    0x2d7a(%rip),%rax
xorps  %xmm0,%xmm0
cvtsi2sdl (%rax),%xmm0
pop    %rbx
ret
mov    0x2d7a(%rip),%rax
movsd  (%rax),%xmm0
mulsd  0xdae(%rip),%xmm0
pop    %rbx
ret
mov    0x2d4d(%rip),%rax
movsd  (%rax),%xmm1
mov    0x2d4a(%rip),%rax
cvtsi2sdl (%rax),%xmm0
mov    0x2d4f(%rip),%rax
movsd  (%rax),%xmm2
mulsd  0xd83(%rip),%xmm2
movsd  0xd83(%rip),%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm0,%xmm3
mulsd  %xmm3,%xmm2
movapd %xmm1,%xmm0
cmpnlesd %xmm3,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
pop    %rbx
ret
mov    0x2d35(%rip),%rax
jmp    1300 <dmach+0x1f0>
mov    0x2d04(%rip),%rax
movsd  (%rax),%xmm0
mulsd  0xd38(%rip),%xmm0
mov    0x2d19(%rip),%rax
mulsd  (%rax),%xmm0
pop    %rbx
ret
mov    0x2cec(%rip),%rax
jmp    1300 <dmach+0x1f0>
mov    0x2cfb(%rip),%rax
jmp    1300 <dmach+0x1f0>
mov    0x2cea(%rip),%rax
jmp    1300 <dmach+0x1f0>
mov    0x2cb1(%rip),%rax
jmp    1300 <dmach+0x1f0>
mov    0x2cd0(%rip),%rax
movsd  (%rax),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"E\00"
@DBL_EPSILON = global double 0.000000e+00
@.str.1 = [2 x i8] c"S\00"
@DBL_MIN = global double 0.000000e+00
@DBL_MAX = global i32 0
@.str.2 = [2 x i8] c"B\00"
@FLT_RADIX = global double 0.000000e+00
@.str.3 = [2 x i8] c"P\00"
@.str.4 = [2 x i8] c"N\00"
@DBL_MANT_DIG = global double 0.000000e+00
@.str.5 = [2 x i8] c"R\00"
@FLT_ROUNDS = global double 0.000000e+00
@.str.6 = [2 x i8] c"M\00"
@DBL_MIN_EXP = global double 0.000000e+00
@.str.7 = [2 x i8] c"U\00"
@.str.8 = [2 x i8] c"L\00"
@DBL_MAX_EXP = global double 0.000000e+00
@.str.9 = [2 x i8] c"O\00"
define double @dmach(i8* %0) {
%2 = alloca i8*
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i64 @strncmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load double, double* @DBL_EPSILON
%11 = fmul double %10, 5.000000e-01
store double %11, double* %5
br label %92
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %31
16: ; preds = %12
%17 = load double, double* @DBL_MIN
store double %17, double* %3
%18 = load i32, i32* @DBL_MAX
%19 = sitofp i32 %18 to double
%20 = fdiv double 1.000000e+00, %19
store double %20, double* %4
%21 = load double, double* %4
%22 = load double, double* %3
%23 = fcmp oge double %21, %22
br i1 %23, label %24, label %29
24: ; preds = %16
%25 = load double, double* %4
%26 = load double, double* @DBL_EPSILON
%27 = call double @llvm.fmuladd.f64(double %26, double 5.000000e-01, double 1.000000e+00)
%28 = fmul double %25, %27
store double %28, double* %3
br label %29
29: ; preds = %24, %16
%30 = load double, double* %3
store double %30, double* %5
br label %91
31: ; preds = %12
%32 = load i8*, i8** %2
%33 = call i64 @strncmp(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1)
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = load double, double* @FLT_RADIX
store double %36, double* %5
br label %90
37: ; preds = %31
%38 = load i8*, i8** %2
%39 = call i64 @strncmp(i8* %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %46
41: ; preds = %37
%42 = load double, double* @DBL_EPSILON
%43 = fmul double %42, 5.000000e-01
%44 = load double, double* @FLT_RADIX
%45 = fmul double %43, %44
store double %45, double* %5
br label %89
46: ; preds = %37
%47 = load i8*, i8** %2
%48 = call i64 @strncmp(i8* %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i32 1)
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %46
%51 = load double, double* @DBL_MANT_DIG
store double %51, double* %5
br label %88
52: ; preds = %46
%53 = load i8*, i8** %2
%54 = call i64 @strncmp(i8* %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i32 1)
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %52
%57 = load double, double* @FLT_ROUNDS
store double %57, double* %5
br label %87
58: ; preds = %52
%59 = load i8*, i8** %2
%60 = call i64 @strncmp(i8* %59, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 1)
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %58
%63 = load double, double* @DBL_MIN_EXP
store double %63, double* %5
br label %86
64: ; preds = %58
%65 = load i8*, i8** %2
%66 = call i64 @strncmp(i8* %65, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i32 1)
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %64
%69 = load double, double* @DBL_MIN
store double %69, double* %5
br label %85
70: ; preds = %64
%71 = load i8*, i8** %2
%72 = call i64 @strncmp(i8* %71, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i32 1)
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %76
74: ; preds = %70
%75 = load double, double* @DBL_MAX_EXP
store double %75, double* %5
br label %84
76: ; preds = %70
%77 = load i8*, i8** %2
%78 = call i64 @strncmp(i8* %77, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i32 1)
%79 = icmp eq i64 %78, 0
br i1 %79, label %80, label %83
80: ; preds = %76
%81 = load i32, i32* @DBL_MAX
%82 = sitofp i32 %81 to double
store double %82, double* %5
br label %83
83: ; preds = %80, %76
br label %84
84: ; preds = %83, %74
br label %85
85: ; preds = %84, %68
br label %86
86: ; preds = %85, %62
br label %87
87: ; preds = %86, %56
br label %88
88: ; preds = %87, %50
br label %89
89: ; preds = %88, %41
br label %90
90: ; preds = %89, %35
br label %91
91: ; preds = %90, %29
br label %92
92: ; preds = %91, %9
%93 = load double, double* %5
ret double %93
}

LLVM IR (-O2):
@.str = [2 x i8] c"E\00"
@DBL_EPSILON = global double 0.000000e+00
@.str.1 = [2 x i8] c"S\00"
@DBL_MIN = global double 0.000000e+00
@DBL_MAX = global i32 0
@.str.2 = [2 x i8] c"B\00"
@FLT_RADIX = global double 0.000000e+00
@.str.3 = [2 x i8] c"P\00"
@.str.4 = [2 x i8] c"N\00"
@DBL_MANT_DIG = global double 0.000000e+00
@.str.5 = [2 x i8] c"R\00"
@FLT_ROUNDS = global double 0.000000e+00
@.str.6 = [2 x i8] c"M\00"
@DBL_MIN_EXP = global double 0.000000e+00
@.str.7 = [2 x i8] c"U\00"
@.str.8 = [2 x i8] c"L\00"
@DBL_MAX_EXP = global double 0.000000e+00
@.str.9 = [2 x i8] c"O\00"
define double @dmach(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load double, double* @DBL_EPSILON
%6 = fmul double %5, 5.000000e-01
br label %64
7: ; preds = %1
%8 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load double, double* @DBL_MIN
%12 = load i32, i32* @DBL_MAX
%13 = sitofp i32 %12 to double
%14 = fdiv double 1.000000e+00, %13
%15 = fcmp ult double %14, %11
%16 = load double, double* @DBL_EPSILON
%17 = tail call double @llvm.fmuladd.f64(double %16, double 5.000000e-01, double 1.000000e+00)
%18 = fmul double %14, %17
%19 = select i1 %15, double %11, double %18
br label %64
20: ; preds = %7
%21 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = load double, double* @FLT_RADIX
br label %64
25: ; preds = %20
%26 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %33
28: ; preds = %25
%29 = load double, double* @DBL_EPSILON
%30 = fmul double %29, 5.000000e-01
%31 = load double, double* @FLT_RADIX
%32 = fmul double %30, %31
br label %64
33: ; preds = %25
%34 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i32 1)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = load double, double* @DBL_MANT_DIG
br label %64
38: ; preds = %33
%39 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i32 1)
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = load double, double* @FLT_ROUNDS
br label %64
43: ; preds = %38
%44 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 1)
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = load double, double* @DBL_MIN_EXP
br label %64
48: ; preds = %43
%49 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i32 1)
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = load double, double* @DBL_MIN
br label %64
53: ; preds = %48
%54 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i32 1)
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = load double, double* @DBL_MAX_EXP
br label %64
58: ; preds = %53
%59 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i32 1)
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %64
61: ; preds = %58
%62 = load i32, i32* @DBL_MAX
%63 = sitofp i32 %62 to double
br label %64
64: ; preds = %10, %28, %41, %51, %58, %61, %56, %46, %36, %23, %4
%65 = phi double [ %6, %4 ], [ %19, %10 ], [ %24, %23 ], [ %32, %28 ], [ %37, %36 ], [ %42, %41 ], [ %47, %46 ], [ %52, %51 ], [ %57, %56 ], [ %63, %61 ], [ undef, %58 ]
ret double %65
}