#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*/ matchDigitPlus(char const **);
int matchNumber(const char **strptr) {
  const char *str = *strptr;
  if ((*str == '-') || (*str == '+'))
    str++;
  if (!matchDigitPlus(&str))
    return 0;
  if (*str == '.') {
    str++;
    if (!matchDigitPlus(&str))
      return 0;
  }
  *strptr = str;
  return 1;
}


x86 assembly (clang, -O0):
<matchNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1147 <matchNumber+0x37>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    1153 <matchNumber+0x43>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <matchDigitPlus@plt>
cmp    $0x0,%eax
jne    1171 <matchNumber+0x61>
movl   $0x0,-0x4(%rbp)
jmp    11c2 <matchNumber+0xb2>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    11b0 <matchNumber+0xa0>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <matchDigitPlus@plt>
cmp    $0x0,%eax
jne    11ab <matchNumber+0x9b>
movl   $0x0,-0x4(%rbp)
jmp    11c2 <matchNumber+0xb2>
jmp    11b0 <matchNumber+0xa0>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matchNumber>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    %rax,(%rsp)
mov    (%rax),%cl
cmp    $0x2d,%cl
je     1129 <matchNumber+0x19>
cmp    $0x2b,%cl
jne    1131 <matchNumber+0x21>
add    $0x1,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <matchDigitPlus@plt>
xor    %ebp,%ebp
test   %eax,%eax
je     1168 <matchNumber+0x58>
mov    (%rsp),%rax
cmpb   $0x2e,(%rax)
jne    1160 <matchNumber+0x50>
add    $0x1,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <matchDigitPlus@plt>
test   %eax,%eax
je     1168 <matchNumber+0x58>
mov    (%rsp),%rax
mov    %rax,(%rbx)
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @matchNumber(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 45
br i1 %10, label %16, label %11
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 43
br i1 %15, label %16, label %19
16: ; preds = %11, %1
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %4
br label %19
19: ; preds = %16, %11
%20 = call i32 @matchDigitPlus(i8** %4)
%21 = icmp ne i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %19
store i32 0, i32* %2
br label %38
23: ; preds = %19
%24 = load i8*, i8** %4
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 46
br i1 %27, label %28, label %35
28: ; preds = %23
%29 = load i8*, i8** %4
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %4
%31 = call i32 @matchDigitPlus(i8** %4)
%32 = icmp ne i32 %31, 0
br i1 %32, label %34, label %33
33: ; preds = %28
store i32 0, i32* %2
br label %38
34: ; preds = %28
br label %35
35: ; preds = %34, %23
%36 = load i8*, i8** %4
%37 = load i8**, i8*** %3
store i8* %36, i8** %37
store i32 1, i32* %2
br label %38
38: ; preds = %35, %33, %22
%39 = load i32, i32* %2
ret i32 %39
}

LLVM IR (-O2):
define i32 @matchNumber(i8** nocapture %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = load i8*, i8** %0
store i8* %4, i8** %2
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 45, label %6
i8 43, label %6
]
6: ; preds = %1, %1
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %2
br label %8
8: ; preds = %1, %6
%9 = call i32 @matchDigitPlus(i8** %2)
%10 = icmp eq i32 %9, 0
br i1 %10, label %23, label %11
11: ; preds = %8
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 46
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %16, i8** %2
%17 = call i32 @matchDigitPlus(i8** %2)
%18 = icmp eq i32 %17, 0
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i8*, i8** %2
br label %21
21: ; preds = %19, %11
%22 = phi i8* [ %20, %19 ], [ %12, %11 ]
store i8* %22, i8** %0
br label %23
23: ; preds = %15, %8, %21
%24 = phi i32 [ 1, %21 ], [ 0, %8 ], [ 0, %15 ]
ret i32 %24
}