#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*/ abort();
int /*<<< orphan*/ memset(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int main() {
  char buf[5];
  memset(buf, 5, 0);
  read(0, buf, 5);
  if (buf[0] == 'c')
    if (buf[1] == 'r')
      if (buf[2] == 'a')
        if (buf[3] == 's')
          if (buf[4] == 'h')
            abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x9(%rbp),%rdi
mov    $0x5,%esi
xor    %edx,%edx
call   1040 <memset@plt>
lea    -0x9(%rbp),%rsi
xor    %edi,%edi
mov    $0x5,%edx
call   1050 <read@plt>
movsbl -0x9(%rbp),%eax
cmp    $0x63,%eax
jne    11bb <main+0x8b>
movsbl -0x8(%rbp),%eax
cmp    $0x72,%eax
jne    11b6 <main+0x86>
movsbl -0x7(%rbp),%eax
cmp    $0x61,%eax
jne    11b1 <main+0x81>
movsbl -0x6(%rbp),%eax
cmp    $0x73,%eax
jne    11ac <main+0x7c>
movsbl -0x5(%rbp),%eax
cmp    $0x68,%eax
jne    11a7 <main+0x77>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11ac <main+0x7c>
jmp    11b1 <main+0x81>
jmp    11b6 <main+0x86>
jmp    11bb <main+0x8b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %edx,%edx
call   1040 <memset@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1050 <read@plt>
movd   0x8(%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x73617263,%eax
jne    1170 <main+0x40>
cmpb   $0x68,0xc(%rsp)
je     1178 <main+0x48>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 5, i32 0)
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%6 = call i32 @read(i32 0, i8* %5, i32 5)
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 99
br i1 %10, label %11, label %37
11: ; preds = %0
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 1
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 114
br i1 %15, label %16, label %36
16: ; preds = %11
%17 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 97
br i1 %20, label %21, label %35
21: ; preds = %16
%22 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 3
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 115
br i1 %25, label %26, label %34
26: ; preds = %21
%27 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 4
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 104
br i1 %30, label %31, label %33
31: ; preds = %26
%32 = call i32 (...) @abort()
unreachable
33: ; preds = %26
br label %34
34: ; preds = %33, %21
br label %35
35: ; preds = %34, %16
br label %36
36: ; preds = %35, %11
br label %37
37: ; preds = %36, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 5, i32 0)
%4 = call i32 @read(i32 0, i8* %2, i32 5)
%5 = bitcast [5 x i8]* %1 to <4 x i8>*
%6 = load <4 x i8>, <4 x i8>* %5
%7 = freeze <4 x i8> %6
%8 = bitcast <4 x i8> %7 to i32
%9 = icmp eq i32 %8, 1935766115
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 4
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 104
%13 = select i1 %9, i1 %12, i1 false
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %0
ret i32 0
}