#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*/ GetStringBit(char *, char *, int /*<<< orphan*/, int);
scalar_t__ IsEqual(char *, char *);
int GETorPOST(char *data) {
  char strBit[10];
  GetStringBit(data, strBit, 0, 4);
  if (IsEqual(strBit, "GET "))
    return 1;
  if (IsEqual(strBit, "POST"))
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<GETorPOST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1a(%rbp),%rsi
xor    %edx,%edx
mov    $0x4,%ecx
call   1040 <GetStringBit@plt>
lea    -0x1a(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <IsEqual@plt>
cmp    $0x0,%rax
je     1166 <GETorPOST+0x46>
movl   $0x1,-0x4(%rbp)
jmp    1193 <GETorPOST+0x73>
lea    -0x1a(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1030 <IsEqual@plt>
cmp    $0x0,%rax
je     118c <GETorPOST+0x6c>
movl   $0x2,-0x4(%rbp)
jmp    1193 <GETorPOST+0x73>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GETorPOST>:
push   %rbx
sub    $0x10,%rsp
lea    0x6(%rsp),%rbx
mov    %rbx,%rsi
xor    %edx,%edx
mov    $0x4,%ecx
call   1040 <GetStringBit@plt>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <IsEqual@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1173 <GETorPOST+0x53>
lea    0xea9(%rip),%rsi
lea    0x6(%rsp),%rdi
call   1030 <IsEqual@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"GET \00"
@.str.1 = [5 x i8] c"POST\00"
define i32 @GETorPOST(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [10 x i8]
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%7 = call i32 @GetStringBit(i8* %5, i8* %6, i32 0, i32 4)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%9 = call i64 @IsEqual(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %2
br label %18
12: ; preds = %1
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%14 = call i64 @IsEqual(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 2, i32* %2
br label %18
17: ; preds = %12
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %11
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@.str = [5 x i8] c"GET \00"
@.str.1 = [5 x i8] c"POST\00"
define i32 @GETorPOST(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @GetStringBit(i8* %0, i8* %3, i32 0, i32 4)
%5 = call i64 @IsEqual(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i64 @IsEqual(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i32 0, i32 2
br label %11
11: ; preds = %7, %1
%12 = phi i32 [ 1, %1 ], [ %10, %7 ]
ret i32 %12
}