#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*/ printf(char *, ...);
int /*<<< orphan*/ s2e_disable_forking();
int /*<<< orphan*/ s2e_enable_forking();
int /*<<< orphan*/ s2e_get_example(char *, int);
int /*<<< orphan*/ s2e_make_symbolic(char *, int, char *);
int main(void) {
  char str[3];
  s2e_enable_forking();
  s2e_make_symbolic(str, 2, "str");
  if (str[0] == 0 || str[1] == 0) {
    printf("Not enough characters\n");
  } else {
    if (str[0] >= 'a' && str[0] <= 'z')
      printf("First char is lowercase\n");
    else
      printf("First char is not lowercase\n");
    if (str[0] >= '0' && str[0] <= '9')
      printf("First char is a digit\n");
    else
      printf("First char is not a digit\n");
    if (str[0] == str[1])
      printf("First and second chars are the same\n");
    else
      printf("First and second chars are not the same\n");
  }
  s2e_disable_forking();
  s2e_get_example(str, 2);
  printf("'%c%c' %02x %02x\n", str[0], str[1], (unsigned char)str[0],
         (unsigned char)str[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <s2e_enable_forking@plt>
lea    -0x7(%rbp),%rdi
mov    $0x2,%esi
lea    0xe8a(%rip),%rdx
call   1050 <s2e_make_symbolic@plt>
movsbl -0x7(%rbp),%eax
cmp    $0x0,%eax
je     1195 <main+0x45>
movsbl -0x6(%rbp),%eax
cmp    $0x0,%eax
jne    11a8 <main+0x58>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1254 <main+0x104>
movsbl -0x7(%rbp),%eax
cmp    $0x61,%eax
jl     11d5 <main+0x85>
movsbl -0x7(%rbp),%eax
cmp    $0x7a,%eax
jg     11d5 <main+0x85>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11e3 <main+0x93>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x7(%rbp),%eax
cmp    $0x30,%eax
jl     1210 <main+0xc0>
movsbl -0x7(%rbp),%eax
cmp    $0x39,%eax
jg     1210 <main+0xc0>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    121e <main+0xce>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x7(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jne    1241 <main+0xf1>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    124f <main+0xff>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1254 <main+0x104>
mov    $0x0,%al
call   1030 <s2e_disable_forking@plt>
lea    -0x7(%rbp),%rdi
mov    $0x2,%esi
call   1070 <s2e_get_example@plt>
movsbl -0x7(%rbp),%esi
movsbl -0x6(%rbp),%edx
movzbl -0x7(%rbp),%ecx
movzbl -0x6(%rbp),%r8d
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <s2e_enable_forking@plt>
lea    0xe91(%rip),%rdx
lea    0x5(%rsp),%rdi
mov    $0x2,%esi
call   1060 <s2e_make_symbolic@plt>
mov    0x5(%rsp),%al
lea    0xf3d(%rip),%rdi
test   %al,%al
je     11e8 <main+0x88>
cmpb   $0x0,0x6(%rsp)
je     11e8 <main+0x88>
add    $0x9f,%al
cmp    $0x1a,%al
lea    0xf0f(%rip),%rax
lea    0xe70(%rip),%rdi
cmovb  %rax,%rdi
call   1030 <puts@plt>
mov    0x5(%rsp),%al
add    $0xd0,%al
cmp    $0xa,%al
lea    0xeda(%rip),%rax
lea    0xe6d(%rip),%rdi
cmovb  %rax,%rdi
call   1030 <puts@plt>
mov    0x5(%rsp),%al
cmp    0x6(%rsp),%al
lea    0xe97(%rip),%rax
lea    0xe68(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <s2e_disable_forking@plt>
lea    0x5(%rsp),%rdi
mov    $0x2,%esi
call   1080 <s2e_get_example@plt>
movzbl 0x5(%rsp),%ecx
movsbl %cl,%esi
movzbl 0x6(%rsp),%r8d
movsbl %r8b,%edx
lea    0xde8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"str\00"
@.str.1 = [23 x i8] c"Not enough characters\0A\00"
@.str.2 = [25 x i8] c"First char is lowercase\0A\00"
@.str.3 = [29 x i8] c"First char is not lowercase\0A\00"
@.str.4 = [23 x i8] c"First char is a digit\0A\00"
@.str.5 = [27 x i8] c"First char is not a digit\0A\00"
@.str.6 = [37 x i8] c"First and second chars are the same\0A\00"
@.str.7 = [41 x i8] c"First and second chars are not the same\0A\00"
@.str.8 = [18 x i8] c"'%c%c' %02x %02x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
store i32 0, i32* %1
%3 = call i32 (...) @s2e_enable_forking()
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = call i32 @s2e_make_symbolic(i8* %4, i32 2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %0
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %10, %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %58
17: ; preds = %10
%18 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 97
br i1 %21, label %22, label %29
22: ; preds = %17
%23 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 122
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %31
29: ; preds = %22, %17
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
br label %31
31: ; preds = %29, %27
%32 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp sge i32 %34, 48
br i1 %35, label %36, label %43
36: ; preds = %31
%37 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp sle i32 %39, 57
br i1 %40, label %41, label %43
41: ; preds = %36
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
br label %45
43: ; preds = %36, %31
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %45
45: ; preds = %43, %41
%46 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %48, %51
br i1 %52, label %53, label %55
53: ; preds = %45
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0))
br label %57
55: ; preds = %45
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
br label %57
57: ; preds = %55, %53
br label %58
58: ; preds = %57, %15
%59 = call i32 (...) @s2e_disable_forking()
%60 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%61 = call i32 @s2e_get_example(i8* %60, i32 2)
%62 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%69 = load i8, i8* %68
%70 = zext i8 %69 to i32
%71 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
%72 = load i8, i8* %71
%73 = zext i8 %72 to i32
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %64, i32 %67, i32 %70, i32 %73)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"str\00"
@.str.8 = [18 x i8] c"'%c%c' %02x %02x\0A\00"
@str = [28 x i8] c"First char is not lowercase\00"
@str.9 = [26 x i8] c"First char is not a digit\00"
@str.10 = [40 x i8] c"First and second chars are not the same\00"
@str.11 = [36 x i8] c"First and second chars are the same\00"
@str.12 = [22 x i8] c"First char is a digit\00"
@str.13 = [24 x i8] c"First char is lowercase\00"
@str.14 = [22 x i8] c"Not enough characters\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @s2e_enable_forking()
%4 = call i32 @s2e_make_symbolic(i8* %2, i32 2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
%10 = select i1 %6, i1 true, i1 %9
br i1 %10, label %25, label %11
11: ; preds = %0
%12 = add i8 %5, -97
%13 = icmp ult i8 %12, 26
%14 = select i1 %13, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.13, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0)
%15 = call i32 @puts(i8* dereferenceable(1) %14)
%16 = load i8, i8* %2
%17 = add i8 %16, -48
%18 = icmp ult i8 %17, 10
%19 = select i1 %18, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str.12, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str.9, i64 0, i64 0)
%20 = call i32 @puts(i8* dereferenceable(1) %19)
%21 = load i8, i8* %2
%22 = load i8, i8* %7
%23 = icmp eq i8 %21, %22
%24 = select i1 %23, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @str.11, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @str.10, i64 0, i64 0)
br label %25
25: ; preds = %11, %0
%26 = phi i8* [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.14, i64 0, i64 0), %0 ], [ %24, %11 ]
%27 = call i32 @puts(i8* dereferenceable(1) %26)
%28 = call i32 (...) @s2e_disable_forking()
%29 = call i32 @s2e_get_example(i8* %2, i32 2)
%30 = load i8, i8* %2
%31 = sext i8 %30 to i32
%32 = load i8, i8* %7
%33 = sext i8 %32 to i32
%34 = zext i8 %30 to i32
%35 = zext i8 %32 to i32
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %31, i32 %33, i32 %34, i32 %35)
ret i32 0
}