#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 FLT_EPSILON;
float FLT_MANT_DIG;
int FLT_MAX;
float FLT_MAX_EXP;
float FLT_MIN;
float FLT_MIN_EXP;
double FLT_RADIX;
float FLT_ROUNDS;
scalar_t__ strncmp(char *, char *, int);
float smach(char *cmach) {
  float sfmin, small, rmach;
  if (strncmp(cmach, "E", 1) == 0) {
    rmach = FLT_EPSILON * 0.5;
  } else if (strncmp(cmach, "S", 1) == 0) {
    sfmin = FLT_MIN;
    small = 1. / FLT_MAX;
    if (small >= sfmin) {
      sfmin = small * (FLT_EPSILON * 0.5 + 1.);
    }
    rmach = sfmin;
  } else if (strncmp(cmach, "B", 1) == 0) {
    rmach = FLT_RADIX;
  } else if (strncmp(cmach, "P", 1) == 0) {
    rmach = FLT_EPSILON * 0.5 * FLT_RADIX;
  } else if (strncmp(cmach, "N", 1) == 0) {
    rmach = FLT_MANT_DIG;
  } else if (strncmp(cmach, "R", 1) == 0) {
    rmach = FLT_ROUNDS;
  } else if (strncmp(cmach, "M", 1) == 0) {
    rmach = FLT_MIN_EXP;
  } else if (strncmp(cmach, "U", 1) == 0) {
    rmach = FLT_MIN;
  } else if (strncmp(cmach, "L", 1) == 0) {
    rmach = FLT_MAX_EXP;
  } else if (strncmp(cmach, "O", 1) == 0) {
    rmach = FLT_MAX;
  }
  return rmach;
}


x86 assembly (clang, -O0):
<smach>:
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    115c <smach+0x4c>
movsd  0xebd(%rip),%xmm0
mov    0x2e66(%rip),%rax
mulsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    13e5 <smach+0x2d5>
mov    -0x8(%rbp),%rdi
lea    0xeab(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1202 <smach+0xf2>
mov    0x2e56(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    0x2e2e(%rip),%rax
cvtsi2sdl (%rax),%xmm1
movsd  0xe6a(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     11f3 <smach+0xe3>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    0x2de6(%rip),%rax
movsd  (%rax),%xmm1
movsd  0xe2a(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe26(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    13e0 <smach+0x2d0>
mov    -0x8(%rbp),%rdi
lea    0xe07(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    123a <smach+0x12a>
mov    0x2dc0(%rip),%rax
movsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    13db <smach+0x2cb>
mov    -0x8(%rbp),%rdi
lea    0xdd1(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1285 <smach+0x175>
movsd  0xd9f(%rip),%xmm0
mov    0x2d48(%rip),%rax
mulsd  (%rax),%xmm0
mov    0x2d75(%rip),%rax
mulsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    13d6 <smach+0x2c6>
mov    -0x8(%rbp),%rdi
lea    0xd88(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    12b9 <smach+0x1a9>
mov    0x2cfd(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    13d1 <smach+0x2c1>
mov    -0x8(%rbp),%rdi
lea    0xd56(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    12ed <smach+0x1dd>
mov    0x2d01(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    13cc <smach+0x2bc>
mov    -0x8(%rbp),%rdi
lea    0xd24(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1321 <smach+0x211>
mov    0x2cb5(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    13c7 <smach+0x2b7>
mov    -0x8(%rbp),%rdi
lea    0xcf2(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1355 <smach+0x245>
mov    0x2c91(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    13c2 <smach+0x2b2>
mov    -0x8(%rbp),%rdi
lea    0xcc0(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1389 <smach+0x279>
mov    0x2c55(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    13bd <smach+0x2ad>
mov    -0x8(%rbp),%rdi
lea    0xc8e(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    13b8 <smach+0x2a8>
mov    0x2c11(%rip),%rax
cvtsi2ssl (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    13bd <smach+0x2ad>
jmp    13c2 <smach+0x2b2>
jmp    13c7 <smach+0x2b7>
jmp    13cc <smach+0x2bc>
jmp    13d1 <smach+0x2c1>
jmp    13d6 <smach+0x2c6>
jmp    13db <smach+0x2cb>
jmp    13e0 <smach+0x2d0>
jmp    13e5 <smach+0x2d5>
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smach>:
push   %rbx
mov    %rdi,%rbx
lea    0xef5(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     123f <smach+0x12f>
lea    0xedd(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1257 <smach+0x147>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1287 <smach+0x177>
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12b9 <smach+0x1a9>
lea    0xe8c(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12dd <smach+0x1cd>
lea    0xe71(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12e6 <smach+0x1d6>
lea    0xe56(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12ef <smach+0x1df>
lea    0xe3b(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12f8 <smach+0x1e8>
lea    0xe20(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1301 <smach+0x1f1>
lea    0xe05(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1285 <smach+0x175>
mov    0x2d8a(%rip),%rax
xorps  %xmm0,%xmm0
cvtsi2ssl (%rax),%xmm0
jmp    1285 <smach+0x175>
mov    0x2d6a(%rip),%rax
movsd  (%rax),%xmm0
mulsd  0xdae(%rip),%xmm0
jmp    12d7 <smach+0x1c7>
mov    0x2d7a(%rip),%rax
movss  (%rax),%xmm0
mov    0x2d57(%rip),%rax
cvtsi2sdl (%rax),%xmm1
movsd  0xd93(%rip),%xmm2
divsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
ucomiss %xmm0,%xmm1
jae    1294 <smach+0x184>
pop    %rbx
ret
mov    0x2d5a(%rip),%rax
movsd  (%rax),%xmm0
jmp    12d7 <smach+0x1c7>
mov    0x2d15(%rip),%rax
movsd  (%rax),%xmm0
mulsd  0xd59(%rip),%xmm0
addsd  0xd59(%rip),%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
jmp    12d7 <smach+0x1c7>
mov    0x2cf0(%rip),%rax
movsd  (%rax),%xmm0
mulsd  0xd34(%rip),%xmm0
mov    0x2d15(%rip),%rax
mulsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbx
ret
mov    0x2cc4(%rip),%rax
jmp    1308 <smach+0x1f8>
mov    0x2cf3(%rip),%rax
jmp    1308 <smach+0x1f8>
mov    0x2cd2(%rip),%rax
jmp    1308 <smach+0x1f8>
mov    0x2cd9(%rip),%rax
jmp    1308 <smach+0x1f8>
mov    0x2cc8(%rip),%rax
movss  (%rax),%xmm0
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"E\00"
@FLT_EPSILON = global double 0.000000e+00
@.str.1 = [2 x i8] c"S\00"
@FLT_MIN = global float 0.000000e+00
@FLT_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"
@FLT_MANT_DIG = global float 0.000000e+00
@.str.5 = [2 x i8] c"R\00"
@FLT_ROUNDS = global float 0.000000e+00
@.str.6 = [2 x i8] c"M\00"
@FLT_MIN_EXP = global float 0.000000e+00
@.str.7 = [2 x i8] c"U\00"
@.str.8 = [2 x i8] c"L\00"
@FLT_MAX_EXP = global float 0.000000e+00
@.str.9 = [2 x i8] c"O\00"
define float @smach(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 %8
4: ; preds = %1
%5 = load double, double* @FLT_EPSILON
%6 = fmul double %5, 5.000000e-01
%7 = fptrunc double %6 to float
br label %70
8: ; preds = %1
%9 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %8
%12 = load float, float* @FLT_MIN
%13 = load i32, i32* @FLT_MAX
%14 = sitofp i32 %13 to double
%15 = fdiv double 1.000000e+00, %14
%16 = fptrunc double %15 to float
%17 = fcmp ugt float %12, %16
br i1 %17, label %70, label %18
18: ; preds = %11
%19 = fpext float %16 to double
%20 = load double, double* @FLT_EPSILON
%21 = tail call double @llvm.fmuladd.f64(double %20, double 5.000000e-01, double 1.000000e+00)
%22 = fmul double %21, %19
%23 = fptrunc double %22 to float
br label %70
24: ; preds = %8
%25 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load double, double* @FLT_RADIX
%29 = fptrunc double %28 to float
br label %70
30: ; preds = %24
%31 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %39
33: ; preds = %30
%34 = load double, double* @FLT_EPSILON
%35 = fmul double %34, 5.000000e-01
%36 = load double, double* @FLT_RADIX
%37 = fmul double %35, %36
%38 = fptrunc double %37 to float
br label %70
39: ; preds = %30
%40 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i32 1)
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %39
%43 = load float, float* @FLT_MANT_DIG
br label %70
44: ; preds = %39
%45 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i32 1)
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %44
%48 = load float, float* @FLT_ROUNDS
br label %70
49: ; preds = %44
%50 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i32 1)
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %49
%53 = load float, float* @FLT_MIN_EXP
br label %70
54: ; preds = %49
%55 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i32 1)
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = load float, float* @FLT_MIN
br label %70
59: ; preds = %54
%60 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i32 1)
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %59
%63 = load float, float* @FLT_MAX_EXP
br label %70
64: ; preds = %59
%65 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i32 1)
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %70
67: ; preds = %64
%68 = load i32, i32* @FLT_MAX
%69 = sitofp i32 %68 to float
br label %70
70: ; preds = %11, %18, %33, %47, %57, %64, %67, %62, %52, %42, %27, %4
%71 = phi float [ %7, %4 ], [ %29, %27 ], [ %38, %33 ], [ %43, %42 ], [ %48, %47 ], [ %53, %52 ], [ %58, %57 ], [ %63, %62 ], [ %69, %67 ], [ undef, %64 ], [ %23, %18 ], [ %12, %11 ]
ret float %71
}