#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 */
long double atof(char *);
char interpret_command(char *input, long double *output) {
  switch (input[0]) {
  case ('m'):
    *output = atof(input + 1);
    break;
  case ('d'):
    *output = atof(input + 1);
    break;
  case ('i'):
    *output = atof(input + 1);
    break;
  case ('t'):
    *output = atof(input + 1);
    break;
  case ('q'):
    *output = -1;
    break;
  default:
    *output = 0;
    break;
  }
  return input[0];
}


x86 assembly (clang, -O0):
<interpret_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffff9c,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x10,%eax
ja     11bc <interpret_command+0xac>
mov    -0x18(%rbp),%rax
lea    0xebc(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <atof@plt>
mov    -0x10(%rbp),%rax
fstpt  (%rax)
jmp    11c4 <interpret_command+0xb4>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <atof@plt>
mov    -0x10(%rbp),%rax
fstpt  (%rax)
jmp    11c4 <interpret_command+0xb4>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <atof@plt>
mov    -0x10(%rbp),%rax
fstpt  (%rax)
jmp    11c4 <interpret_command+0xb4>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <atof@plt>
mov    -0x10(%rbp),%rax
fstpt  (%rax)
jmp    11c4 <interpret_command+0xb4>
mov    -0x10(%rbp),%rax
fld1
fchs
fstpt  (%rax)
jmp    11c4 <interpret_command+0xb4>
mov    -0x10(%rbp),%rax
fldz
fstpt  (%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpret_command>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsbl (%rdi),%eax
fld1
fchs
add    $0xffffff9c,%eax
cmp    $0x10,%eax
ja     1146 <interpret_command+0x36>
lea    0xed0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
fstp   %st(0)
lea    0x1(%rbx),%rdi
call   1030 <atof@plt>
jmp    114a <interpret_command+0x3a>
fstp   %st(0)
fldz
fstpt  (%r14)
mov    (%rbx),%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define signext i8 @interpret_command(i8* %0, x86_fp80* %1) {
%3 = alloca i8*
%4 = alloca x86_fp80*
store i8* %0, i8** %3
store x86_fp80* %1, x86_fp80** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
switch i32 %8, label %31 [
i32 109, label %9
i32 100, label %14
i32 105, label %19
i32 116, label %24
i32 113, label %29
]
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = call x86_fp80 @atof(i8* %11)
%13 = load x86_fp80*, x86_fp80** %4
store x86_fp80 %12, x86_fp80* %13
br label %33
14: ; preds = %2
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = call x86_fp80 @atof(i8* %16)
%18 = load x86_fp80*, x86_fp80** %4
store x86_fp80 %17, x86_fp80* %18
br label %33
19: ; preds = %2
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = call x86_fp80 @atof(i8* %21)
%23 = load x86_fp80*, x86_fp80** %4
store x86_fp80 %22, x86_fp80* %23
br label %33
24: ; preds = %2
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 1
%27 = call x86_fp80 @atof(i8* %26)
%28 = load x86_fp80*, x86_fp80** %4
store x86_fp80 %27, x86_fp80* %28
br label %33
29: ; preds = %2
%30 = load x86_fp80*, x86_fp80** %4
store x86_fp80 0xKBFFF8000000000000000, x86_fp80* %30
br label %33
31: ; preds = %2
%32 = load x86_fp80*, x86_fp80** %4
store x86_fp80 0xK00000000000000000000, x86_fp80* %32
br label %33
33: ; preds = %31, %29, %24, %19, %14, %9
%34 = load i8*, i8** %3
%35 = getelementptr inbounds i8, i8* %34, i64 0
%36 = load i8, i8* %35
ret i8 %36
}

LLVM IR (-O2):
define signext i8 @interpret_command(i8* nocapture %0, x86_fp80* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
switch i32 %4, label %17 [
i32 109, label %5
i32 100, label %8
i32 105, label %11
i32 116, label %14
i32 113, label %18
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = tail call x86_fp80 @atof(i8* %6)
br label %18
8: ; preds = %2
%9 = getelementptr inbounds i8, i8* %0, i64 1
%10 = tail call x86_fp80 @atof(i8* %9)
br label %18
11: ; preds = %2
%12 = getelementptr inbounds i8, i8* %0, i64 1
%13 = tail call x86_fp80 @atof(i8* %12)
br label %18
14: ; preds = %2
%15 = getelementptr inbounds i8, i8* %0, i64 1
%16 = tail call x86_fp80 @atof(i8* %15)
br label %18
17: ; preds = %2
br label %18
18: ; preds = %2, %17, %14, %11, %8, %5
%19 = phi x86_fp80 [ 0xK00000000000000000000, %17 ], [ %16, %14 ], [ %13, %11 ], [ %10, %8 ], [ %7, %5 ], [ 0xKBFFF8000000000000000, %2 ]
store x86_fp80 %19, x86_fp80* %1
%20 = load i8, i8* %0
ret i8 %20
}