#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*/ fraction();
int getchar();
int /*<<< orphan*/ integer();
int /*<<< orphan*/ printf(char *);
void sign(void) {
  switch (getchar()) {
  case '+':
  case '-':
    sign();
    return;
  case '.':
    fraction();
    return;
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
    integer();
    return;
  case '\n':
    printf("Rejected by method 1\n");
    return;
  }
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1060 <getchar@plt>
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x8(%rbp)
sub    $0x2f,%eax
ja     11b3 <sign+0x63>
mov    -0x8(%rbp),%rax
lea    0xe84(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
call   1070 <sign@plt>
jmp    11b3 <sign+0x63>
mov    $0x0,%al
call   1050 <fraction@plt>
jmp    11b3 <sign+0x63>
mov    $0x0,%al
call   1030 <integer@plt>
jmp    11b3 <sign+0x63>
lea    0xf12(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
push   %rbx
lea    0xeb8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <getchar@plt>
add    $0xfffffff6,%eax
cmp    $0x2f,%eax
ja     117d <sign+0x3d>
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
xor    %eax,%eax
pop    %rbx
jmp    1040 <integer@plt>
lea    0xf49(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
jmp    1050 <fraction@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Rejected by method 1\0A\00"
define void @sign() {
%1 = call i32 (...) @getchar()
switch i32 %1, label %9 [
i32 43, label %2
i32 45, label %2
i32 46, label %3
i32 48, label %5
i32 49, label %5
i32 50, label %5
i32 51, label %5
i32 52, label %5
i32 53, label %5
i32 54, label %5
i32 55, label %5
i32 56, label %5
i32 57, label %5
i32 10, label %7
]
2: ; preds = %0, %0
br label %9
3: ; preds = %0
%4 = call i32 (...) @fraction()
br label %9
5: ; preds = %0, %0, %0, %0, %0, %0, %0, %0, %0, %0
%6 = call i32 (...) @integer()
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %2, %3, %5, %7, %0
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Rejected by method 1\00"
define void @sign() {
br label %1
1: ; preds = %3, %0
%2 = tail call i32 (...) @getchar()
switch i32 %2, label %10 [
i32 43, label %3
i32 45, label %3
i32 46, label %4
i32 48, label %6
i32 49, label %6
i32 50, label %6
i32 51, label %6
i32 52, label %6
i32 53, label %6
i32 54, label %6
i32 55, label %6
i32 56, label %6
i32 57, label %6
i32 10, label %8
]
3: ; preds = %1, %1
br label %1
4: ; preds = %1
%5 = tail call i32 (...) @fraction()
br label %10
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
%7 = tail call i32 (...) @integer()
br label %10
8: ; preds = %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %1, %4, %6, %8
ret void
}