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


x86 assembly (clang, -O0):
<fraction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
sub    $0xa,%eax
je     11b3 <fraction+0x73>
jmp    1162 <fraction+0x22>
mov    -0x4(%rbp),%eax
sub    $0x2b,%eax
je     119b <fraction+0x5b>
jmp    1173 <fraction+0x33>
mov    -0x4(%rbp),%eax
add    $0xffffffd3,%eax
sub    $0x2,%eax
jb     119b <fraction+0x5b>
jmp    1187 <fraction+0x47>
mov    -0x4(%rbp),%eax
add    $0xffffffd0,%eax
sub    $0xa,%eax
jb     11a7 <fraction+0x67>
jmp    11bf <fraction+0x7f>
mov    $0x0,%al
call   1060 <error@plt>
jmp    11bf <fraction+0x7f>
mov    $0x0,%al
call   1050 <real@plt>
jmp    11bf <fraction+0x7f>
lea    0xe46(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fraction>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
lea    -0x30(%rax),%ecx
cmp    $0xa,%ecx
jae    1158 <fraction+0x18>
xor    %eax,%eax
pop    %rcx
jmp    1050 <real@plt>
lea    -0x2d(%rax),%ecx
cmp    $0x2,%ecx
jb     116a <fraction+0x2a>
cmp    $0xa,%eax
je     1172 <fraction+0x32>
cmp    $0x2b,%eax
jne    117f <fraction+0x3f>
xor    %eax,%eax
pop    %rcx
jmp    1060 <error@plt>
lea    0xe87(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
pop    %rax
ret

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

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