#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*/ *strstr(char *, char *);
int requestlookslikehttp(char *req) {
  if ((req[0] == 'G') && (req[1] == 'E') && (req[2] == 'T') &&
      (req[3] == ' ') && (req[4] == '/')) {
    if (strstr(req, " HTTP/") != NULL)
      return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<requestlookslikehttp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x47,%eax
jne    119b <requestlookslikehttp+0x8b>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x45,%eax
jne    119b <requestlookslikehttp+0x8b>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x54,%eax
jne    119b <requestlookslikehttp+0x8b>
mov    -0x10(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x20,%eax
jne    119b <requestlookslikehttp+0x8b>
mov    -0x10(%rbp),%rax
movsbl 0x4(%rax),%eax
cmp    $0x2f,%eax
jne    119b <requestlookslikehttp+0x8b>
mov    -0x10(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1196 <requestlookslikehttp+0x86>
movl   $0x1,-0x4(%rbp)
jmp    11a2 <requestlookslikehttp+0x92>
jmp    119b <requestlookslikehttp+0x8b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<requestlookslikehttp>:
push   %rax
cmpb   $0x47,(%rdi)
jne    1147 <requestlookslikehttp+0x37>
cmpb   $0x45,0x1(%rdi)
jne    1147 <requestlookslikehttp+0x37>
cmpb   $0x54,0x2(%rdi)
jne    1147 <requestlookslikehttp+0x37>
cmpb   $0x20,0x3(%rdi)
jne    1147 <requestlookslikehttp+0x37>
cmpb   $0x2f,0x4(%rdi)
jne    1147 <requestlookslikehttp+0x37>
lea    0xecb(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1149 <requestlookslikehttp+0x39>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c" HTTP/\00"
define i32 @requestlookslikehttp(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 71
br i1 %8, label %9, label %39
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 69
br i1 %14, label %15, label %39
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 84
br i1 %20, label %21, label %39
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 3
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 32
br i1 %26, label %27, label %39
27: ; preds = %21
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 4
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 47
br i1 %32, label %33, label %39
33: ; preds = %27
%34 = load i8*, i8** %3
%35 = call i32* @strstr(i8* %34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%36 = icmp ne i32* %35, null
br i1 %36, label %37, label %38
37: ; preds = %33
store i32 1, i32* %2
br label %40
38: ; preds = %33
br label %39
39: ; preds = %38, %27, %21, %15, %9, %1
store i32 0, i32* %2
br label %40
40: ; preds = %39, %37
%41 = load i32, i32* %2
ret i32 %41
}

LLVM IR (-O2):
@.str = [7 x i8] c" HTTP/\00"
define i32 @requestlookslikehttp(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 71
br i1 %3, label %4, label %23
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 69
br i1 %7, label %8, label %23
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 84
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 32
br i1 %15, label %16, label %23
16: ; preds = %12
%17 = getelementptr inbounds i8, i8* %0, i64 4
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 47
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = tail call i32* @strstr(i8* %0, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %24
23: ; preds = %20, %16, %12, %8, %4, %1
br label %24
24: ; preds = %20, %23
%25 = phi i32 [ 0, %23 ], [ 1, %20 ]
ret i32 %25
}