#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 isDigit(char const *, int *);
int isInitial(char const *, char *);
int isSpecialSubsequent(char const *, char *);
int isSubsequent(const char *c, char *value) {
  char initial = '\0';
  const int INITIAL_RETURN = isInitial(c, &initial);
  int digit = 0;
  const int DIGIT_RETURN = isDigit(c, &digit);
  char special = '\0';
  const int SPECIAL_RETURN = isSpecialSubsequent(c, &special);
  if (c == NULL)
    return 0;
  if (INITIAL_RETURN > 0) {
    if (value != NULL)
      *value = initial;
    return 1;
  } else if (DIGIT_RETURN > 0) {
    if (value != NULL)
      *value = (char)(digit + 48);
    return 1;
  } else if (SPECIAL_RETURN > 0) {
    if (value != NULL)
      *value = special;
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<isSubsequent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movb   $0x0,-0x19(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x19(%rbp),%rsi
call   1040 <isInitial@plt>
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1050 <isDigit@plt>
mov    %eax,-0x28(%rbp)
movb   $0x0,-0x29(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x29(%rbp),%rsi
call   1030 <isSpecialSubsequent@plt>
mov    %eax,-0x30(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1196 <isSubsequent+0x66>
movl   $0x0,-0x4(%rbp)
jmp    1220 <isSubsequent+0xf0>
cmpl   $0x0,-0x20(%rbp)
jle    11c0 <isSubsequent+0x90>
cmpq   $0x0,-0x18(%rbp)
je     11b4 <isSubsequent+0x84>
mov    -0x19(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1220 <isSubsequent+0xf0>
cmpl   $0x0,-0x28(%rbp)
jle    11ef <isSubsequent+0xbf>
cmpq   $0x0,-0x18(%rbp)
je     11e3 <isSubsequent+0xb3>
mov    -0x24(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1220 <isSubsequent+0xf0>
cmpl   $0x0,-0x30(%rbp)
jle    1219 <isSubsequent+0xe9>
cmpq   $0x0,-0x18(%rbp)
je     120d <isSubsequent+0xdd>
mov    -0x29(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1220 <isSubsequent+0xf0>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSubsequent>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movb   $0x0,0x3(%rsp)
lea    0x3(%rsp),%rsi
call   1040 <isInitial@plt>
mov    %eax,%ebp
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <isDigit@plt>
mov    %eax,%r15d
movb   $0x0,0x2(%rsp)
lea    0x2(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <isSpecialSubsequent@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %rbx,%rbx
je     11b7 <isSubsequent+0x87>
test   %ebp,%ebp
jle    1190 <isSubsequent+0x60>
test   %r14,%r14
je     11b2 <isSubsequent+0x82>
mov    0x3(%rsp),%al
jmp    11af <isSubsequent+0x7f>
test   %r15d,%r15d
jle    11a2 <isSubsequent+0x72>
test   %r14,%r14
je     11b2 <isSubsequent+0x82>
mov    0x4(%rsp),%al
add    $0x30,%al
jmp    11af <isSubsequent+0x7f>
test   %ecx,%ecx
jle    11b7 <isSubsequent+0x87>
test   %r14,%r14
je     11b2 <isSubsequent+0x82>
mov    0x2(%rsp),%al
mov    %al,(%r14)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isSubsequent(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
%11 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 0, i8* %6
%12 = load i8*, i8** %4
%13 = call i32 @isInitial(i8* %12, i8* %6)
store i32 %13, i32* %7
store i32 0, i32* %8
%14 = load i8*, i8** %4
%15 = call i32 @isDigit(i8* %14, i32* %8)
store i32 %15, i32* %9
store i8 0, i8* %10
%16 = load i8*, i8** %4
%17 = call i32 @isSpecialSubsequent(i8* %16, i8* %10)
store i32 %17, i32* %11
%18 = load i8*, i8** %4
%19 = icmp eq i8* %18, null
br i1 %19, label %20, label %21
20: ; preds = %2
store i32 0, i32* %3
br label %54
21: ; preds = %2
%22 = load i32, i32* %7
%23 = icmp sgt i32 %22, 0
br i1 %23, label %24, label %31
24: ; preds = %21
%25 = load i8*, i8** %5
%26 = icmp ne i8* %25, null
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i8, i8* %6
%29 = load i8*, i8** %5
store i8 %28, i8* %29
br label %30
30: ; preds = %27, %24
store i32 1, i32* %3
br label %54
31: ; preds = %21
%32 = load i32, i32* %9
%33 = icmp sgt i32 %32, 0
br i1 %33, label %34, label %43
34: ; preds = %31
%35 = load i8*, i8** %5
%36 = icmp ne i8* %35, null
br i1 %36, label %37, label %42
37: ; preds = %34
%38 = load i32, i32* %8
%39 = add nsw i32 %38, 48
%40 = trunc i32 %39 to i8
%41 = load i8*, i8** %5
store i8 %40, i8* %41
br label %42
42: ; preds = %37, %34
store i32 1, i32* %3
br label %54
43: ; preds = %31
%44 = load i32, i32* %11
%45 = icmp sgt i32 %44, 0
br i1 %45, label %46, label %53
46: ; preds = %43
%47 = load i8*, i8** %5
%48 = icmp ne i8* %47, null
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = load i8, i8* %10
%51 = load i8*, i8** %5
store i8 %50, i8* %51
br label %52
52: ; preds = %49, %46
store i32 1, i32* %3
br label %54
53: ; preds = %43
store i32 0, i32* %3
br label %54
54: ; preds = %53, %52, %42, %30, %20
%55 = load i32, i32* %3
ret i32 %55
}

LLVM IR (-O2):
define i32 @isSubsequent(i8* %0, i8* writeonly %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i8
store i8 0, i8* %3
%6 = call i32 @isInitial(i8* %0, i8* %3)
%7 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%8 = call i32 @isDigit(i8* %0, i32* %4)
store i8 0, i8* %5
%9 = call i32 @isSpecialSubsequent(i8* %0, i8* %5)
%10 = icmp eq i8* %0, null
br i1 %10, label %33, label %11
11: ; preds = %2
%12 = icmp sgt i32 %6, 0
br i1 %12, label %13, label %17
13: ; preds = %11
%14 = icmp eq i8* %1, null
br i1 %14, label %33, label %15
15: ; preds = %13
%16 = load i8, i8* %3
br label %31
17: ; preds = %11
%18 = icmp sgt i32 %8, 0
br i1 %18, label %19, label %25
19: ; preds = %17
%20 = icmp eq i8* %1, null
br i1 %20, label %33, label %21
21: ; preds = %19
%22 = load i32, i32* %4
%23 = trunc i32 %22 to i8
%24 = add i8 %23, 48
br label %31
25: ; preds = %17
%26 = icmp sgt i32 %9, 0
br i1 %26, label %27, label %33
27: ; preds = %25
%28 = icmp eq i8* %1, null
br i1 %28, label %33, label %29
29: ; preds = %27
%30 = load i8, i8* %5
br label %31
31: ; preds = %15, %21, %29
%32 = phi i8 [ %30, %29 ], [ %24, %21 ], [ %16, %15 ]
store i8 %32, i8* %1
br label %33
33: ; preds = %31, %25, %27, %19, %13, %2
%34 = phi i32 [ 0, %2 ], [ 1, %13 ], [ 1, %19 ], [ 1, %27 ], [ 0, %25 ], [ 1, %31 ]
ret i32 %34
}