#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 */
scalar_t__ isspace(char);
int /*<<< orphan*/ strtod(char *, char **);
int _jsonIsNumber(char *pcSrc, char **ppcNext) {
  char *pcEOD = pcSrc;
  strtod(pcSrc, &pcEOD);
  if (isspace(*pcEOD) || !*pcEOD || *pcEOD == ',') {
    *ppcNext = pcEOD;
    return 1;
  }
  *ppcNext = pcEOD;
  return 0;
}


x86 assembly (clang, -O0):
<_jsonIsNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <strtod@plt>
mov    -0x20(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
jne    1178 <_jsonIsNumber+0x58>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1178 <_jsonIsNumber+0x58>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    118f <_jsonIsNumber+0x6f>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    11a1 <_jsonIsNumber+0x81>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_jsonIsNumber>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,(%rsp)
mov    %rsp,%rsi
call   1030 <strtod@plt>
mov    (%rsp),%rbx
movsbl (%rbx),%edi
call   1040 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    115d <_jsonIsNumber+0x3d>
mov    (%rbx),%al
test   %al,%al
sete   %cl
cmp    $0x2c,%al
sete   %al
or     %cl,%al
movzbl %al,%eax
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @_jsonIsNumber(i8* %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8*
store i8* %0, i8** %4
store i8** %1, i8*** %5
%7 = load i8*, i8** %4
store i8* %7, i8** %6
%8 = load i8*, i8** %4
%9 = call i32 @strtod(i8* %8, i8** %6)
%10 = load i8*, i8** %6
%11 = load i8, i8* %10
%12 = call i64 @isspace(i8 signext %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %23, label %14
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = load i8, i8* %15
%17 = icmp ne i8 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i8*, i8** %6
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 44
br i1 %22, label %23, label %26
23: ; preds = %18, %14, %2
%24 = load i8*, i8** %6
%25 = load i8**, i8*** %5
store i8* %24, i8** %25
store i32 1, i32* %3
br label %29
26: ; preds = %18
%27 = load i8*, i8** %6
%28 = load i8**, i8*** %5
store i8* %27, i8** %28
store i32 0, i32* %3
br label %29
29: ; preds = %26, %23
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @_jsonIsNumber(i8* %0, i8** nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* %0, i8** %3
%5 = call i32 @strtod(i8* %0, i8** %3)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = tail call i64 @isspace(i8 signext %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8, i8* %6
%12 = icmp eq i8 %11, 0
%13 = icmp eq i8 %11, 44
%14 = or i1 %12, %13
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %2, %10
%17 = phi i32 [ %15, %10 ], [ 1, %2 ]
store i8* %6, i8** %1
ret i32 %17
}