#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 str32_strsearch(char *, unsigned long, char *, int);
unsigned char compare_signed(char *target_str, unsigned long int length,
                             unsigned long int status_nzcv) {
  if (str32_strsearch(target_str, length, "== \0", 3) != -1) {
    if (status_nzcv & 0x40000000)
      return ((unsigned char)0);
  } else if (str32_strsearch(target_str, length, "!= \0", 3) != -1) {
    if (!(status_nzcv & 0x40000000))
      return ((unsigned char)0);
  } else if (str32_strsearch(target_str, length, ">= \0", 3) != -1) {
    if ((status_nzcv & 0x80000000) == (status_nzcv & 0x10000000))
      return ((unsigned char)0);
  } else if (str32_strsearch(target_str, length, "<= \0", 3) != -1) {
    if (((status_nzcv & 0x80000000) != (status_nzcv & 0x10000000) ||
         (status_nzcv & 0x40000000)))
      return ((unsigned char)0);
  } else if (str32_strsearch(target_str, length, "> \0", 2) != -1) {
    if (((status_nzcv & 0x80000000) == (status_nzcv & 0x10000000) &&
         (!(status_nzcv & 0x40000000))))
      return ((unsigned char)0);
  } else if (str32_strsearch(target_str, length, "< \0", 2) != -1) {
    if ((status_nzcv & 0x80000000) != (status_nzcv & 0x10000000))
      return ((unsigned char)0);
  }
  return ((unsigned char)1);
}


x86 assembly (clang, -O0):
<compare_signed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xecd(%rip),%rdx
mov    $0x3,%ecx
call   1030 <str32_strsearch@plt>
cmp    $0xffffffff,%eax
je     1168 <compare_signed+0x58>
mov    -0x20(%rbp),%rax
and    $0x40000000,%rax
cmp    $0x0,%rax
je     1163 <compare_signed+0x53>
movb   $0x0,-0x1(%rbp)
jmp    1339 <compare_signed+0x229>
jmp    1335 <compare_signed+0x225>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xe8e(%rip),%rdx
mov    $0x3,%ecx
call   1030 <str32_strsearch@plt>
cmp    $0xffffffff,%eax
je     11ac <compare_signed+0x9c>
mov    -0x20(%rbp),%rax
and    $0x40000000,%rax
cmp    $0x0,%rax
jne    11a7 <compare_signed+0x97>
movb   $0x0,-0x1(%rbp)
jmp    1339 <compare_signed+0x229>
jmp    1330 <compare_signed+0x220>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xe4f(%rip),%rdx
mov    $0x3,%ecx
call   1030 <str32_strsearch@plt>
cmp    $0xffffffff,%eax
je     11fe <compare_signed+0xee>
movabs $0x80000000,%rax
and    -0x20(%rbp),%rax
mov    -0x20(%rbp),%rcx
and    $0x10000000,%rcx
cmp    %rcx,%rax
jne    11f9 <compare_signed+0xe9>
movb   $0x0,-0x1(%rbp)
jmp    1339 <compare_signed+0x229>
jmp    132b <compare_signed+0x21b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xe02(%rip),%rdx
mov    $0x3,%ecx
call   1030 <str32_strsearch@plt>
cmp    $0xffffffff,%eax
je     1264 <compare_signed+0x154>
movabs $0x80000000,%rax
and    -0x20(%rbp),%rax
mov    -0x20(%rbp),%rcx
and    $0x10000000,%rcx
cmp    %rcx,%rax
jne    1256 <compare_signed+0x146>
mov    -0x20(%rbp),%rax
and    $0x40000000,%rax
cmp    $0x0,%rax
je     125f <compare_signed+0x14f>
movb   $0x0,-0x1(%rbp)
jmp    1339 <compare_signed+0x229>
jmp    1326 <compare_signed+0x216>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xda1(%rip),%rdx
mov    $0x2,%ecx
call   1030 <str32_strsearch@plt>
cmp    $0xffffffff,%eax
je     12ca <compare_signed+0x1ba>
movabs $0x80000000,%rax
and    -0x20(%rbp),%rax
mov    -0x20(%rbp),%rcx
and    $0x10000000,%rcx
cmp    %rcx,%rax
jne    12c5 <compare_signed+0x1b5>
mov    -0x20(%rbp),%rax
and    $0x40000000,%rax
cmp    $0x0,%rax
jne    12c5 <compare_signed+0x1b5>
movb   $0x0,-0x1(%rbp)
jmp    1339 <compare_signed+0x229>
jmp    1321 <compare_signed+0x211>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xd3f(%rip),%rdx
mov    $0x2,%ecx
call   1030 <str32_strsearch@plt>
cmp    $0xffffffff,%eax
je     131c <compare_signed+0x20c>
movabs $0x80000000,%rax
and    -0x20(%rbp),%rax
mov    -0x20(%rbp),%rcx
and    $0x10000000,%rcx
cmp    %rcx,%rax
je     1317 <compare_signed+0x207>
movb   $0x0,-0x1(%rbp)
jmp    1339 <compare_signed+0x229>
jmp    131c <compare_signed+0x20c>
jmp    1321 <compare_signed+0x211>
jmp    1326 <compare_signed+0x216>
jmp    132b <compare_signed+0x21b>
jmp    1330 <compare_signed+0x220>
jmp    1335 <compare_signed+0x225>
movb   $0x1,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_signed>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xedb(%rip),%rdx
mov    $0x3,%ecx
call   1030 <str32_strsearch@plt>
cmp    $0xffffffff,%eax
je     113f <compare_signed+0x2f>
test   $0x40000000,%r14d
je     118b <compare_signed+0x7b>
jmp    11b4 <compare_signed+0xa4>
lea    0xebf(%rip),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x3,%ecx
call   1030 <str32_strsearch@plt>
cmp    $0xffffffff,%eax
je     1166 <compare_signed+0x56>
test   $0x40000000,%r14d
je     11b4 <compare_signed+0xa4>
jmp    118b <compare_signed+0x7b>
lea    0xe9d(%rip),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x3,%ecx
call   1030 <str32_strsearch@plt>
cmp    $0xffffffff,%eax
je     118f <compare_signed+0x7f>
test   $0x90000000,%r14d
je     11b4 <compare_signed+0xa4>
mov    $0x1,%al
jmp    11b6 <compare_signed+0xa6>
lea    0xe79(%rip),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x3,%ecx
call   1030 <str32_strsearch@plt>
cmp    $0xffffffff,%eax
je     11bc <compare_signed+0xac>
test   $0xd0000000,%r14d
je     118b <compare_signed+0x7b>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe51(%rip),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x2,%ecx
call   1030 <str32_strsearch@plt>
cmp    $0xffffffff,%eax
je     11e3 <compare_signed+0xd3>
test   $0xd0000000,%r14d
jne    118b <compare_signed+0x7b>
jmp    11b4 <compare_signed+0xa4>
lea    0xe2e(%rip),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x2,%ecx
call   1030 <str32_strsearch@plt>
test   $0x90000000,%r14d
je     118b <compare_signed+0x7b>
cmp    $0xffffffff,%eax
jne    11b4 <compare_signed+0xa4>
jmp    118b <compare_signed+0x7b>

LLVM IR (-O0):
@.str = [5 x i8] c"== \00\00"
@.str.1 = [5 x i8] c"!= \00\00"
@.str.2 = [5 x i8] c">= \00\00"
@.str.3 = [5 x i8] c"<= \00\00"
@.str.4 = [4 x i8] c"> \00\00"
@.str.5 = [4 x i8] c"< \00\00"
define zeroext i8 @compare_signed(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @str32_strsearch(i8* %8, i64 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 3)
%11 = icmp ne i32 %10, -1
br i1 %11, label %12, label %18
12: ; preds = %3
%13 = load i64, i64* %7
%14 = and i64 %13, 1073741824
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
store i8 0, i8* %4
br label %95
17: ; preds = %12
br label %94
18: ; preds = %3
%19 = load i8*, i8** %5
%20 = load i64, i64* %6
%21 = call i32 @str32_strsearch(i8* %19, i64 %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 3)
%22 = icmp ne i32 %21, -1
br i1 %22, label %23, label %29
23: ; preds = %18
%24 = load i64, i64* %7
%25 = and i64 %24, 1073741824
%26 = icmp ne i64 %25, 0
br i1 %26, label %28, label %27
27: ; preds = %23
store i8 0, i8* %4
br label %95
28: ; preds = %23
br label %93
29: ; preds = %18
%30 = load i8*, i8** %5
%31 = load i64, i64* %6
%32 = call i32 @str32_strsearch(i8* %30, i64 %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 3)
%33 = icmp ne i32 %32, -1
br i1 %33, label %34, label %42
34: ; preds = %29
%35 = load i64, i64* %7
%36 = and i64 %35, 2147483648
%37 = load i64, i64* %7
%38 = and i64 %37, 268435456
%39 = icmp eq i64 %36, %38
br i1 %39, label %40, label %41
40: ; preds = %34
store i8 0, i8* %4
br label %95
41: ; preds = %34
br label %92
42: ; preds = %29
%43 = load i8*, i8** %5
%44 = load i64, i64* %6
%45 = call i32 @str32_strsearch(i8* %43, i64 %44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 3)
%46 = icmp ne i32 %45, -1
br i1 %46, label %47, label %59
47: ; preds = %42
%48 = load i64, i64* %7
%49 = and i64 %48, 2147483648
%50 = load i64, i64* %7
%51 = and i64 %50, 268435456
%52 = icmp ne i64 %49, %51
br i1 %52, label %57, label %53
53: ; preds = %47
%54 = load i64, i64* %7
%55 = and i64 %54, 1073741824
%56 = icmp ne i64 %55, 0
br i1 %56, label %57, label %58
57: ; preds = %53, %47
store i8 0, i8* %4
br label %95
58: ; preds = %53
br label %91
59: ; preds = %42
%60 = load i8*, i8** %5
%61 = load i64, i64* %6
%62 = call i32 @str32_strsearch(i8* %60, i64 %61, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 2)
%63 = icmp ne i32 %62, -1
br i1 %63, label %64, label %76
64: ; preds = %59
%65 = load i64, i64* %7
%66 = and i64 %65, 2147483648
%67 = load i64, i64* %7
%68 = and i64 %67, 268435456
%69 = icmp eq i64 %66, %68
br i1 %69, label %70, label %75
70: ; preds = %64
%71 = load i64, i64* %7
%72 = and i64 %71, 1073741824
%73 = icmp ne i64 %72, 0
br i1 %73, label %75, label %74
74: ; preds = %70
store i8 0, i8* %4
br label %95
75: ; preds = %70, %64
br label %90
76: ; preds = %59
%77 = load i8*, i8** %5
%78 = load i64, i64* %6
%79 = call i32 @str32_strsearch(i8* %77, i64 %78, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 2)
%80 = icmp ne i32 %79, -1
br i1 %80, label %81, label %89
81: ; preds = %76
%82 = load i64, i64* %7
%83 = and i64 %82, 2147483648
%84 = load i64, i64* %7
%85 = and i64 %84, 268435456
%86 = icmp ne i64 %83, %85
br i1 %86, label %87, label %88
87: ; preds = %81
store i8 0, i8* %4
br label %95
88: ; preds = %81
br label %89
89: ; preds = %88, %76
br label %90
90: ; preds = %89, %75
br label %91
91: ; preds = %90, %58
br label %92
92: ; preds = %91, %41
br label %93
93: ; preds = %92, %28
br label %94
94: ; preds = %93, %17
store i8 1, i8* %4
br label %95
95: ; preds = %94, %87, %74, %57, %40, %27, %16
%96 = load i8, i8* %4
ret i8 %96
}

LLVM IR (-O2):
@.str = [5 x i8] c"== \00\00"
@.str.1 = [5 x i8] c"!= \00\00"
@.str.2 = [5 x i8] c">= \00\00"
@.str.3 = [5 x i8] c"<= \00\00"
@.str.4 = [4 x i8] c"> \00\00"
@.str.5 = [4 x i8] c"< \00\00"
define zeroext i8 @compare_signed(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 @str32_strsearch(i8* %0, i64 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = and i64 %2, 1073741824
%8 = icmp eq i64 %7, 0
br i1 %8, label %39, label %40
9: ; preds = %3
%10 = tail call i32 @str32_strsearch(i8* %0, i64 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 3)
%11 = icmp eq i32 %10, -1
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = and i64 %2, 1073741824
%14 = icmp eq i64 %13, 0
br i1 %14, label %40, label %39
15: ; preds = %9
%16 = tail call i32 @str32_strsearch(i8* %0, i64 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 3)
%17 = icmp eq i32 %16, -1
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = and i64 %2, 2415919104
%20 = icmp eq i64 %19, 0
br i1 %20, label %40, label %39
21: ; preds = %15
%22 = tail call i32 @str32_strsearch(i8* %0, i64 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 3)
%23 = icmp eq i32 %22, -1
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = and i64 %2, 3489660928
%26 = icmp eq i64 %25, 0
br i1 %26, label %39, label %40
27: ; preds = %21
%28 = tail call i32 @str32_strsearch(i8* %0, i64 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 2)
%29 = icmp eq i32 %28, -1
br i1 %29, label %33, label %30
30: ; preds = %27
%31 = and i64 %2, 3489660928
%32 = icmp eq i64 %31, 0
br i1 %32, label %40, label %39
33: ; preds = %27
%34 = tail call i32 @str32_strsearch(i8* %0, i64 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 2)
%35 = icmp eq i32 %34, -1
%36 = and i64 %2, 2415919104
%37 = icmp eq i64 %36, 0
%38 = or i1 %37, %35
br i1 %38, label %39, label %40
39: ; preds = %24, %12, %33, %30, %18, %6
br label %40
40: ; preds = %33, %30, %24, %18, %12, %6, %39
%41 = phi i8 [ 1, %39 ], [ 0, %6 ], [ 0, %12 ], [ 0, %18 ], [ 0, %24 ], [ 0, %30 ], [ 0, %33 ]
ret i8 %41
}