#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*/ printf(char *, ...);
int floatEcho(char c, int hasDot, int signPossible) {
  if (c == 127 || c == 8) {
    printf("\b \b");
  } else {
    if (!signPossible && (c == '+' || c == '-')) {
      return 0;
    }
    if (hasDot && c == '.') {
      return 0;
    }
    if (c == '.' || c == '+' || c == '-' || (c >= '0' && c <= '9')) {
      printf("%c", c);
    } else {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<floatEcho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x7f,%eax
je     113e <floatEcho+0x2e>
movsbl -0x5(%rbp),%eax
cmp    $0x8,%eax
jne    1151 <floatEcho+0x41>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120d <floatEcho+0xfd>
cmpl   $0x0,-0x10(%rbp)
jne    1181 <floatEcho+0x71>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     1175 <floatEcho+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
jne    1181 <floatEcho+0x71>
movl   $0x0,-0x4(%rbp)
jmp    1214 <floatEcho+0x104>
cmpl   $0x0,-0xc(%rbp)
je     11a4 <floatEcho+0x94>
movsbl -0x5(%rbp),%eax
cmp    $0x2e,%eax
jne    11a4 <floatEcho+0x94>
movl   $0x0,-0x4(%rbp)
jmp    1214 <floatEcho+0x104>
movsbl -0x5(%rbp),%eax
cmp    $0x2e,%eax
je     11e5 <floatEcho+0xd5>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     11e5 <floatEcho+0xd5>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     11e5 <floatEcho+0xd5>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     11fc <floatEcho+0xec>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     11fc <floatEcho+0xec>
movsbl -0x5(%rbp),%esi
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1208 <floatEcho+0xf8>
movl   $0x0,-0x4(%rbp)
jmp    1214 <floatEcho+0x104>
jmp    120d <floatEcho+0xfd>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatEcho>:
push   %rax
cmp    $0x7f,%dil
je     112d <floatEcho+0xd>
cmp    $0x8,%dil
jne    1142 <floatEcho+0x22>
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret
test   %edx,%edx
je     1173 <floatEcho+0x53>
xor    %eax,%eax
cmp    $0x2e,%dil
jne    1152 <floatEcho+0x32>
test   %esi,%esi
jne    1140 <floatEcho+0x20>
cmp    $0x2e,%dil
ja     1183 <floatEcho+0x63>
movzbl %dil,%ecx
movabs $0x680000000000,%rdx
bt     %rcx,%rdx
jae    1183 <floatEcho+0x63>
call   1030 <putchar@plt>
jmp    113b <floatEcho+0x1b>
xor    %eax,%eax
cmp    $0x2b,%dil
je     1140 <floatEcho+0x20>
cmp    $0x2d,%dil
je     1140 <floatEcho+0x20>
jmp    1146 <floatEcho+0x26>
lea    -0x30(%rdi),%ecx
cmp    $0x9,%cl
ja     1140 <floatEcho+0x20>
jmp    116c <floatEcho+0x4c>

LLVM IR (-O0):
@.str = [4 x i8] c"\08 \08\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @floatEcho(i8 signext %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i8, i8* %5
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 127
br i1 %10, label %15, label %11
11: ; preds = %3
%12 = load i8, i8* %5
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 8
br i1 %14, label %15, label %17
15: ; preds = %11, %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %63
17: ; preds = %11
%18 = load i32, i32* %7
%19 = icmp ne i32 %18, 0
br i1 %19, label %29, label %20
20: ; preds = %17
%21 = load i8, i8* %5
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 43
br i1 %23, label %28, label %24
24: ; preds = %20
%25 = load i8, i8* %5
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 45
br i1 %27, label %28, label %29
28: ; preds = %24, %20
store i32 0, i32* %4
br label %64
29: ; preds = %24, %17
%30 = load i32, i32* %6
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %37
32: ; preds = %29
%33 = load i8, i8* %5
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 46
br i1 %35, label %36, label %37
36: ; preds = %32
store i32 0, i32* %4
br label %64
37: ; preds = %32, %29
%38 = load i8, i8* %5
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 46
br i1 %40, label %57, label %41
41: ; preds = %37
%42 = load i8, i8* %5
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 43
br i1 %44, label %57, label %45
45: ; preds = %41
%46 = load i8, i8* %5
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 45
br i1 %48, label %57, label %49
49: ; preds = %45
%50 = load i8, i8* %5
%51 = sext i8 %50 to i32
%52 = icmp sge i32 %51, 48
br i1 %52, label %53, label %61
53: ; preds = %49
%54 = load i8, i8* %5
%55 = sext i8 %54 to i32
%56 = icmp sle i32 %55, 57
br i1 %56, label %57, label %61
57: ; preds = %53, %45, %41, %37
%58 = load i8, i8* %5
%59 = sext i8 %58 to i32
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %59)
br label %62
61: ; preds = %53, %49
store i32 0, i32* %4
br label %64
62: ; preds = %57
br label %63
63: ; preds = %62, %15
store i32 1, i32* %4
br label %64
64: ; preds = %63, %61, %36, %28
%65 = load i32, i32* %4
ret i32 %65
}

LLVM IR (-O2):
@.str = [4 x i8] c"\08 \08\00"
define i32 @floatEcho(i8 signext %0, i32 %1, i32 %2) {
%4 = sext i8 %0 to i32
switch i8 %0, label %7 [
i8 127, label %5
i8 8, label %5
]
5: ; preds = %3, %3
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %20
7: ; preds = %3
%8 = icmp eq i32 %2, 0
br i1 %8, label %9, label %10
9: ; preds = %7
switch i8 %0, label %10 [
i8 45, label %20
i8 43, label %20
]
10: ; preds = %9, %7
%11 = icmp ne i32 %1, 0
%12 = icmp eq i8 %0, 46
%13 = and i1 %12, %11
br i1 %13, label %20, label %14
14: ; preds = %10
switch i8 %0, label %15 [
i8 46, label %18
i8 45, label %18
i8 43, label %18
]
15: ; preds = %14
%16 = add i8 %0, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %18, label %20
18: ; preds = %14, %14, %14, %15
%19 = tail call i32 @putchar(i32 %4)
br label %20
20: ; preds = %5, %18, %15, %10, %9, %9
%21 = phi i32 [ 0, %9 ], [ 0, %9 ], [ 0, %10 ], [ 0, %15 ], [ 1, %18 ], [ 1, %5 ]
ret i32 %21
}