#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 */
typedef int /*<<< orphan*/ cValue;

/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
size_t strcspn(char *, char *);
int /*<<< orphan*/ strncpyz(char *, char *, size_t);
int /*<<< orphan*/ strtrim(char *, int);
int _jsonIsNull(char *pcSrc, char **ppcNext) {
  char cValue[16];
  size_t iValLen;
  iValLen = strcspn(pcSrc, ",");
  if (iValLen < sizeof(cValue)) {
    strncpyz(cValue, pcSrc, iValLen);
    strtrim(cValue, 3);
    if (!strcmp(cValue, "null")) {
      *ppcNext = pcSrc + iValLen;
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<_jsonIsNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1040 <strcspn@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x10,-0x38(%rbp)
jae    11c7 <_jsonIsNull+0x87>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x38(%rbp),%rdx
call   1030 <strncpyz@plt>
lea    -0x30(%rbp),%rdi
mov    $0x3,%esi
call   1060 <strtrim@plt>
lea    -0x30(%rbp),%rdi
lea    0xe69(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11c2 <_jsonIsNull+0x82>
mov    -0x10(%rbp),%rcx
add    -0x38(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    11ce <_jsonIsNull+0x8e>
jmp    11c7 <_jsonIsNull+0x87>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_jsonIsNull>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeb7(%rip),%rsi
call   1040 <strcspn@plt>
xor    %r15d,%r15d
cmp    $0xf,%rax
ja     1195 <_jsonIsNull+0x65>
mov    %rax,%rbp
mov    %rsp,%r12
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <strncpyz@plt>
mov    %r12,%rdi
mov    $0x3,%esi
call   1050 <strtrim@plt>
mov    $0x6c6c756e,%eax
xor    (%rsp),%eax
movzbl 0x4(%rsp),%ecx
or     %eax,%ecx
jne    1195 <_jsonIsNull+0x65>
add    %rbp,%rbx
mov    %rbx,(%r14)
mov    $0x1,%r15d
mov    %r15d,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c",\00"
@.str.1 = [5 x i8] c"null\00"
define i32 @_jsonIsNull(i8* %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca [16 x i8]
%7 = alloca i64
store i8* %0, i8** %4
store i8** %1, i8*** %5
%8 = load i8*, i8** %4
%9 = call i64 @strcspn(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i64 %9, i64* %7
%10 = load i64, i64* %7
%11 = icmp ult i64 %10, 16
br i1 %11, label %12, label %28
12: ; preds = %2
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%14 = load i8*, i8** %4
%15 = load i64, i64* %7
%16 = call i32 @strncpyz(i8* %13, i8* %14, i64 %15)
%17 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%18 = call i32 @strtrim(i8* %17, i32 3)
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%20 = call i32 @strcmp(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp ne i32 %20, 0
br i1 %21, label %27, label %22
22: ; preds = %12
%23 = load i8*, i8** %4
%24 = load i64, i64* %7
%25 = getelementptr inbounds i8, i8* %23, i64 %24
%26 = load i8**, i8*** %5
store i8* %25, i8** %26
store i32 1, i32* %3
br label %29
27: ; preds = %12
br label %28
28: ; preds = %27, %2
store i32 0, i32* %3
br label %29
29: ; preds = %28, %22
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@.str = [2 x i8] c",\00"
@.str.1 = [5 x i8] c"null\00"
define i32 @_jsonIsNull(i8* %0, i8** nocapture writeonly %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = tail call i64 @strcspn(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp ult i64 %5, 16
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = call i32 @strncpyz(i8* %4, i8* %0, i64 %5)
%9 = call i32 @strtrim(i8* %4, i32 3)
%10 = call i32 @bcmp(i8* dereferenceable(5) %4, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 5)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %0, i64 %5
store i8* %13, i8** %1
br label %14
14: ; preds = %2, %7, %12
%15 = phi i32 [ 1, %12 ], [ 0, %7 ], [ 0, %2 ]
ret i32 %15
}