#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__ isdigit(char const);
int islower(char const);
int isupper(char const);
int camel_split(const char c0, const char c1, const char c2) {
  const int upper1 = isupper(c1);
  const int lower2 = islower(c2);
  if (upper1 && lower2)
    return 1;
  const int b0 = islower(c0) || isdigit(c0);
  if (b0 && upper1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<camel_split>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x5(%rbp)
mov    %cl,-0x6(%rbp)
mov    %al,-0x7(%rbp)
movsbl -0x6(%rbp),%edi
call   1050 <isupper@plt>
mov    %eax,-0xc(%rbp)
movsbl -0x7(%rbp),%edi
call   1040 <islower@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1181 <camel_split+0x51>
cmpl   $0x0,-0x10(%rbp)
je     1181 <camel_split+0x51>
movl   $0x1,-0x4(%rbp)
jmp    11df <camel_split+0xaf>
movsbl -0x5(%rbp),%edi
call   1040 <islower@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
jne    11ad <camel_split+0x7d>
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11d8 <camel_split+0xa8>
cmpl   $0x0,-0xc(%rbp)
je     11d8 <camel_split+0xa8>
movl   $0x1,-0x4(%rbp)
jmp    11df <camel_split+0xaf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<camel_split>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %edi,%r14d
mov    %esi,%edi
call   1050 <isupper@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1040 <islower@plt>
test   %ebx,%ebx
setne  %r15b
je     115f <camel_split+0x2f>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jne    1188 <camel_split+0x58>
movsbl %r14b,%ebp
mov    %ebp,%edi
call   1040 <islower@plt>
test   %eax,%eax
jne    1184 <camel_split+0x54>
test   %ebx,%ebx
setne  %bl
mov    %ebp,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %r15b
and    %bl,%r15b
movzbl %r15b,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @camel_split(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
%11 = load i8, i8* %6
%12 = call i32 @isupper(i8 signext %11)
store i32 %12, i32* %8
%13 = load i8, i8* %7
%14 = call i32 @islower(i8 signext %13)
store i32 %14, i32* %9
%15 = load i32, i32* %8
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %3
%18 = load i32, i32* %9
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 1, i32* %4
br label %39
21: ; preds = %17, %3
%22 = load i8, i8* %5
%23 = call i32 @islower(i8 signext %22)
%24 = icmp ne i32 %23, 0
br i1 %24, label %29, label %25
25: ; preds = %21
%26 = load i8, i8* %5
%27 = call i64 @isdigit(i8 signext %26)
%28 = icmp ne i64 %27, 0
br label %29
29: ; preds = %25, %21
%30 = phi i1 [ true, %21 ], [ %28, %25 ]
%31 = zext i1 %30 to i32
store i32 %31, i32* %10
%32 = load i32, i32* %10
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %29
%35 = load i32, i32* %8
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %34
store i32 1, i32* %4
br label %39
38: ; preds = %34, %29
store i32 0, i32* %4
br label %39
39: ; preds = %38, %37, %20
%40 = load i32, i32* %4
ret i32 %40
}

LLVM IR (-O2):
define i32 @camel_split(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @isupper(i8 signext %1)
%5 = tail call i32 @islower(i8 signext %2)
%6 = icmp ne i32 %4, 0
%7 = icmp ne i32 %5, 0
%8 = select i1 %6, i1 %7, i1 false
br i1 %8, label %19, label %9
9: ; preds = %3
%10 = tail call i32 @islower(i8 signext %0)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = tail call i64 @isdigit(i8 signext %0)
%14 = icmp ne i64 %13, 0
%15 = select i1 %14, i1 %6, i1 false
br label %16
16: ; preds = %12, %9
%17 = phi i1 [ %6, %9 ], [ %15, %12 ]
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %3, %16
%20 = phi i32 [ %18, %16 ], [ 1, %3 ]
ret i32 %20
}