#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*/ ffc2dd(char const *, double *, int *);
int /*<<< orphan*/ ffc2ii(char const *, long *, int *);
int /*<<< orphan*/ ffc2ll(char const *, int *, int *);
int /*<<< orphan*/ ffc2s(char const *, char *, int *);
int /*<<< orphan*/ ffdtyp(char const *, char *, int *);
int ffc2x(const char *cval, char *dtype, long *ival, int *lval, char *sval,
          double *dval, int *status) {
  ffdtyp(cval, dtype, status);
  if (*dtype == 'I')
    ffc2ii(cval, ival, status);
  else if (*dtype == 'F')
    ffc2dd(cval, dval, status);
  else if (*dtype == 'L')
    ffc2ll(cval, lval, status);
  else
    ffc2s(cval, sval, status);
  return (*status);
}


x86 assembly (clang, -O0):
<ffc2x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x10(%rbp),%rdx
call   1050 <ffdtyp@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x49,%eax
jne    11ab <ffc2x+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x10(%rbp),%rdx
call   1040 <ffc2ii@plt>
jmp    1212 <ffc2x+0xc2>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x46,%eax
jne    11d1 <ffc2x+0x81>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    0x10(%rbp),%rdx
call   1070 <ffc2dd@plt>
jmp    120d <ffc2x+0xbd>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x4c,%eax
jne    11f7 <ffc2x+0xa7>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x10(%rbp),%rdx
call   1060 <ffc2ll@plt>
jmp    1208 <ffc2x+0xb8>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    0x10(%rbp),%rdx
call   1030 <ffc2s@plt>
jmp    120d <ffc2x+0xbd>
jmp    1212 <ffc2x+0xc2>
mov    0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffc2x>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%rbp
mov    %r8,(%rsp)
mov    %rcx,%r13
mov    %rdx,%r12
mov    %rsi,%r15
mov    %rdi,%rbx
mov    0x40(%rsp),%r14
mov    %r14,%rdx
call   1050 <ffdtyp@plt>
mov    (%r15),%al
mov    %rbx,%rdi
cmp    $0x46,%al
je     119a <ffc2x+0x4a>
cmp    $0x4c,%al
je     11a7 <ffc2x+0x57>
cmp    $0x49,%al
jne    11b4 <ffc2x+0x64>
mov    %r12,%rsi
mov    %r14,%rdx
call   1040 <ffc2ii@plt>
jmp    11c0 <ffc2x+0x70>
mov    %rbp,%rsi
mov    %r14,%rdx
call   1070 <ffc2dd@plt>
jmp    11c0 <ffc2x+0x70>
mov    %r13,%rsi
mov    %r14,%rdx
call   1060 <ffc2ll@plt>
jmp    11c0 <ffc2x+0x70>
mov    (%rsp),%rsi
mov    %r14,%rdx
call   1030 <ffc2s@plt>
mov    (%r14),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ffc2x(i8* %0, i8* %1, i64* %2, i32* %3, i8* %4, double* %5, i32* %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64*
%11 = alloca i32*
%12 = alloca i8*
%13 = alloca double*
%14 = alloca i32*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i64* %2, i64** %10
store i32* %3, i32** %11
store i8* %4, i8** %12
store double* %5, double** %13
store i32* %6, i32** %14
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i32*, i32** %14
%18 = call i32 @ffdtyp(i8* %15, i8* %16, i32* %17)
%19 = load i8*, i8** %9
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 73
br i1 %22, label %23, label %28
23: ; preds = %7
%24 = load i8*, i8** %8
%25 = load i64*, i64** %10
%26 = load i32*, i32** %14
%27 = call i32 @ffc2ii(i8* %24, i64* %25, i32* %26)
br label %55
28: ; preds = %7
%29 = load i8*, i8** %9
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 70
br i1 %32, label %33, label %38
33: ; preds = %28
%34 = load i8*, i8** %8
%35 = load double*, double** %13
%36 = load i32*, i32** %14
%37 = call i32 @ffc2dd(i8* %34, double* %35, i32* %36)
br label %54
38: ; preds = %28
%39 = load i8*, i8** %9
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 76
br i1 %42, label %43, label %48
43: ; preds = %38
%44 = load i8*, i8** %8
%45 = load i32*, i32** %11
%46 = load i32*, i32** %14
%47 = call i32 @ffc2ll(i8* %44, i32* %45, i32* %46)
br label %53
48: ; preds = %38
%49 = load i8*, i8** %8
%50 = load i8*, i8** %12
%51 = load i32*, i32** %14
%52 = call i32 @ffc2s(i8* %49, i8* %50, i32* %51)
br label %53
53: ; preds = %48, %43
br label %54
54: ; preds = %53, %33
br label %55
55: ; preds = %54, %23
%56 = load i32*, i32** %14
%57 = load i32, i32* %56
ret i32 %57
}

LLVM IR (-O2):
define i32 @ffc2x(i8* %0, i8* %1, i64* %2, i32* %3, i8* %4, double* %5, i32* %6) {
%8 = tail call i32 @ffdtyp(i8* %0, i8* %1, i32* %6)
%9 = load i8, i8* %1
switch i8 %9, label %16 [
i8 73, label %10
i8 70, label %12
i8 76, label %14
]
10: ; preds = %7
%11 = tail call i32 @ffc2ii(i8* %0, i64* %2, i32* %6)
br label %18
12: ; preds = %7
%13 = tail call i32 @ffc2dd(i8* %0, double* %5, i32* %6)
br label %18
14: ; preds = %7
%15 = tail call i32 @ffc2ll(i8* %0, i32* %3, i32* %6)
br label %18
16: ; preds = %7
%17 = tail call i32 @ffc2s(i8* %0, i8* %4, i32* %6)
br label %18
18: ; preds = %12, %16, %14, %10
%19 = load i32, i32* %6
ret i32 %19
}