#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;
float smach(char *cmach) {
  float sfmin, small, rmach;
  extern int lsame_(char *, char *);
  if (lsame_(cmach, "E")) {
    rmach = FLT_EPSILON * 0.5;
  } else if (lsame_(cmach, "S")) {
    sfmin = FLT_MIN;
    small = 1. / FLT_MAX;
    if (small >= sfmin) {
      sfmin = small * (FLT_EPSILON * 0.5 + 1.);
    }
    rmach = sfmin;
  } else if (lsame_(cmach, "B")) {
    rmach = FLT_RADIX;
  } else if (lsame_(cmach, "P")) {
    rmach = FLT_EPSILON * 0.5 * FLT_RADIX;
  } else if (lsame_(cmach, "N")) {
    rmach = FLT_MANT_DIG;
  } else if (lsame_(cmach, "R")) {
    rmach = FLT_ROUNDS;
  } else if (lsame_(cmach, "M")) {
    rmach = FLT_MIN_EXP;
  } else if (lsame_(cmach, "U")) {
    rmach = FLT_MIN;
  } else if (lsame_(cmach, "L")) {
    rmach = FLT_MAX_EXP;
  } else if (lsame_(cmach, "O")) {
    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
call   1030 <lsame_@plt>
cmp    $0x0,%eax
je     1156 <smach+0x46>
movsd  0xec3(%rip),%xmm0
mov    0x2e6c(%rip),%rax
mulsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    13a9 <smach+0x299>
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <lsame_@plt>
cmp    $0x0,%eax
je     11f6 <smach+0xe6>
mov    0x2e62(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    0x2e3a(%rip),%rax
cvtsi2sdl (%rax),%xmm1
movsd  0xe76(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     11e7 <smach+0xd7>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    0x2df2(%rip),%rax
movsd  (%rax),%xmm1
movsd  0xe36(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe32(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    13a4 <smach+0x294>
mov    -0x8(%rbp),%rdi
lea    0xe13(%rip),%rsi
call   1030 <lsame_@plt>
cmp    $0x0,%eax
je     1228 <smach+0x118>
mov    0x2dd2(%rip),%rax
movsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    139f <smach+0x28f>
mov    -0x8(%rbp),%rdi
lea    0xde3(%rip),%rsi
call   1030 <lsame_@plt>
cmp    $0x0,%eax
je     126d <smach+0x15d>
movsd  0xdb7(%rip),%xmm0
mov    0x2d60(%rip),%rax
mulsd  (%rax),%xmm0
mov    0x2d8d(%rip),%rax
mulsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    139a <smach+0x28a>
mov    -0x8(%rbp),%rdi
lea    0xda0(%rip),%rsi
call   1030 <lsame_@plt>
cmp    $0x0,%eax
je     129b <smach+0x18b>
mov    0x2d1b(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1395 <smach+0x285>
mov    -0x8(%rbp),%rdi
lea    0xd74(%rip),%rsi
call   1030 <lsame_@plt>
cmp    $0x0,%eax
je     12c9 <smach+0x1b9>
mov    0x2d25(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1390 <smach+0x280>
mov    -0x8(%rbp),%rdi
lea    0xd48(%rip),%rsi
call   1030 <lsame_@plt>
cmp    $0x0,%eax
je     12f7 <smach+0x1e7>
mov    0x2cdf(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    138b <smach+0x27b>
mov    -0x8(%rbp),%rdi
lea    0xd1c(%rip),%rsi
call   1030 <lsame_@plt>
cmp    $0x0,%eax
je     1325 <smach+0x215>
mov    0x2cc1(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1386 <smach+0x276>
mov    -0x8(%rbp),%rdi
lea    0xcf0(%rip),%rsi
call   1030 <lsame_@plt>
cmp    $0x0,%eax
je     1353 <smach+0x243>
mov    0x2c8b(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1381 <smach+0x271>
mov    -0x8(%rbp),%rdi
lea    0xcc4(%rip),%rsi
call   1030 <lsame_@plt>
cmp    $0x0,%eax
je     137c <smach+0x26c>
mov    0x2c4d(%rip),%rax
cvtsi2ssl (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1381 <smach+0x271>
jmp    1386 <smach+0x276>
jmp    138b <smach+0x27b>
jmp    1390 <smach+0x280>
jmp    1395 <smach+0x285>
jmp    139a <smach+0x28a>
jmp    139f <smach+0x28f>
jmp    13a4 <smach+0x294>
jmp    13a9 <smach+0x299>
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smach>:
push   %rbx
mov    %rdi,%rbx
lea    0xef5(%rip),%rsi
call   1030 <lsame_@plt>
test   %eax,%eax
je     113d <smach+0x2d>
mov    0x2e85(%rip),%rax
movsd  (%rax),%xmm0
mulsd  0xec9(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbx
ret
lea    0xece(%rip),%rsi
mov    %rbx,%rdi
call   1030 <lsame_@plt>
test   %eax,%eax
je     1180 <smach+0x70>
mov    0x2e81(%rip),%rax
movss  (%rax),%xmm0
mov    0x2e5e(%rip),%rax
cvtsi2sdl (%rax),%xmm1
movsd  0xe9a(%rip),%xmm2
divsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
ucomiss %xmm0,%xmm1
jae    11a0 <smach+0x90>
pop    %rbx
ret
lea    0xe8d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <lsame_@plt>
test   %eax,%eax
je     11c8 <smach+0xb8>
mov    0x2e4e(%rip),%rax
movsd  (%rax),%xmm0
jmp    1137 <smach+0x27>
mov    0x2e09(%rip),%rax
movsd  (%rax),%xmm0
mulsd  0xe4d(%rip),%xmm0
addsd  0xe4d(%rip),%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
jmp    1137 <smach+0x27>
lea    0xe47(%rip),%rsi
mov    %rbx,%rdi
call   1030 <lsame_@plt>
test   %eax,%eax
je     11fe <smach+0xee>
mov    0x2dce(%rip),%rax
movsd  (%rax),%xmm0
mulsd  0xe12(%rip),%xmm0
mov    0x2df3(%rip),%rax
mulsd  (%rax),%xmm0
jmp    1137 <smach+0x27>
lea    0xe13(%rip),%rsi
mov    %rbx,%rdi
call   1030 <lsame_@plt>
test   %eax,%eax
je     121a <smach+0x10a>
mov    0x2d90(%rip),%rax
jmp    1288 <smach+0x178>
lea    0xdf9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <lsame_@plt>
test   %eax,%eax
je     1236 <smach+0x126>
mov    0x2dac(%rip),%rax
jmp    1288 <smach+0x178>
lea    0xddf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <lsame_@plt>
test   %eax,%eax
je     1252 <smach+0x142>
mov    0x2d78(%rip),%rax
jmp    1288 <smach+0x178>
lea    0xdc5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <lsame_@plt>
test   %eax,%eax
je     126e <smach+0x15e>
mov    0x2d6c(%rip),%rax
jmp    1288 <smach+0x178>
lea    0xdab(%rip),%rsi
mov    %rbx,%rdi
call   1030 <lsame_@plt>
test   %eax,%eax
je     128e <smach+0x17e>
mov    0x2d48(%rip),%rax
movss  (%rax),%xmm0
pop    %rbx
ret
lea    0xd8d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <lsame_@plt>
test   %eax,%eax
je     12ae <smach+0x19e>
mov    0x2d18(%rip),%rax
cvtsi2ssl (%rax),%xmm0
pop    %rbx
ret
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 i32 @lsame_(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32 %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 i32 @lsame_(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp ne i32 %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 i32 @lsame_(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%38 = icmp ne i32 %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 i32 @lsame_(i8* %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%45 = icmp ne i32 %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 i32 @lsame_(i8* %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%55 = icmp ne i32 %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 i32 @lsame_(i8* %59, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%61 = icmp ne i32 %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 i32 @lsame_(i8* %65, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%67 = icmp ne i32 %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 i32 @lsame_(i8* %71, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%73 = icmp ne i32 %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 i32 @lsame_(i8* %77, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%79 = icmp ne i32 %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 i32 @lsame_(i8* %83, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%85 = icmp ne i32 %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 i32 @lsame_(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
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 i32 @lsame_(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %24, label %11
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 i32 @lsame_(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp eq i32 %25, 0
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = load double, double* @FLT_RADIX
%29 = fptrunc double %28 to float
br label %70
30: ; preds = %24
%31 = tail call i32 @lsame_(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%32 = icmp eq i32 %31, 0
br i1 %32, label %39, label %33
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 i32 @lsame_(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%41 = icmp eq i32 %40, 0
br i1 %41, label %44, label %42
42: ; preds = %39
%43 = load float, float* @FLT_MANT_DIG
br label %70
44: ; preds = %39
%45 = tail call i32 @lsame_(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%46 = icmp eq i32 %45, 0
br i1 %46, label %49, label %47
47: ; preds = %44
%48 = load float, float* @FLT_ROUNDS
br label %70
49: ; preds = %44
%50 = tail call i32 @lsame_(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%51 = icmp eq i32 %50, 0
br i1 %51, label %54, label %52
52: ; preds = %49
%53 = load float, float* @FLT_MIN_EXP
br label %70
54: ; preds = %49
%55 = tail call i32 @lsame_(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%56 = icmp eq i32 %55, 0
br i1 %56, label %59, label %57
57: ; preds = %54
%58 = load float, float* @FLT_MIN
br label %70
59: ; preds = %54
%60 = tail call i32 @lsame_(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%61 = icmp eq i32 %60, 0
br i1 %61, label %64, label %62
62: ; preds = %59
%63 = load float, float* @FLT_MAX_EXP
br label %70
64: ; preds = %59
%65 = tail call i32 @lsame_(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%66 = icmp eq i32 %65, 0
br i1 %66, label %70, label %67
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
}