#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 __mesh_convertd(char *);
double __mesh_convertf(char *);
int /*<<< orphan*/ mesh_error(int);
double __mesh_convert_format_float_1(int dtype, char *in) {
  switch (dtype) {
  case 6:
  case 7:
    return __mesh_convertf(in);
  case 8:
    return __mesh_convertd(in);
  default:
    mesh_error(4);
  }
  return -1;
}


x86 assembly (clang, -O0):
<__mesh_convert_format_float_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
add    $0xfffffffa,%eax
sub    $0x2,%eax
jb     1167 <__mesh_convert_format_float_1+0x37>
jmp    1156 <__mesh_convert_format_float_1+0x26>
mov    -0x1c(%rbp),%eax
sub    $0x8,%eax
je     117a <__mesh_convert_format_float_1+0x4a>
jmp    118d <__mesh_convert_format_float_1+0x5d>
mov    -0x18(%rbp),%rdi
call   1030 <__mesh_convertf@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11a4 <__mesh_convert_format_float_1+0x74>
mov    -0x18(%rbp),%rdi
call   1040 <__mesh_convertd@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11a4 <__mesh_convert_format_float_1+0x74>
mov    $0x4,%edi
call   1050 <mesh_error@plt>
movsd  0xe61(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mesh_convert_format_float_1>:
lea    -0x6(%rdi),%eax
cmp    $0x2,%eax
jae    1140 <__mesh_convert_format_float_1+0x10>
mov    %rsi,%rdi
jmp    1030 <__mesh_convertf@plt>
cmp    $0x8,%edi
jne    114d <__mesh_convert_format_float_1+0x1d>
mov    %rsi,%rdi
jmp    1040 <__mesh_convertd@plt>
push   %rax
mov    $0x4,%edi
call   1050 <mesh_error@plt>
movsd  0xea0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @__mesh_convert_format_float_1(i32 %0, i8* %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
switch i32 %6, label %13 [
i32 6, label %7
i32 7, label %7
i32 8, label %10
]
7: ; preds = %2, %2
%8 = load i8*, i8** %5
%9 = call double @__mesh_convertf(i8* %8)
store double %9, double* %3
br label %16
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = call double @__mesh_convertd(i8* %11)
store double %12, double* %3
br label %16
13: ; preds = %2
%14 = call i32 @mesh_error(i32 4)
br label %15
15: ; preds = %13
store double -1.000000e+00, double* %3
br label %16
16: ; preds = %15, %10, %7
%17 = load double, double* %3
ret double %17
}

LLVM IR (-O2):
define double @__mesh_convert_format_float_1(i32 %0, i8* %1) {
switch i32 %0, label %7 [
i32 6, label %3
i32 7, label %3
i32 8, label %5
]
3: ; preds = %2, %2
%4 = tail call double @__mesh_convertf(i8* %1)
br label %9
5: ; preds = %2
%6 = tail call double @__mesh_convertd(i8* %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @mesh_error(i32 4)
br label %9
9: ; preds = %7, %5, %3
%10 = phi double [ -1.000000e+00, %7 ], [ %6, %5 ], [ %4, %3 ]
ret double %10
}