#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 */
scalar_t__ strcmp(char *, char *);
int is_post_request(const char *text) {
  char first4[] = {text[0], text[1], text[2], text[3]};
  if (strcmp(first4, "POST") == 0) {
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<is_post_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x13(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0x12(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0x11(%rbp)
lea    -0x14(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1169 <is_post_request+0x59>
movl   $0x0,-0x4(%rbp)
jmp    1170 <is_post_request+0x60>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_post_request>:
push   %rax
mov    (%rdi),%al
mov    %al,0x4(%rsp)
mov    0x1(%rdi),%al
mov    %al,0x5(%rsp)
mov    0x2(%rdi),%al
mov    %al,0x6(%rsp)
mov    0x3(%rdi),%al
mov    %al,0x7(%rsp)
lea    0xecd(%rip),%rsi
lea    0x4(%rsp),%rdi
call   1030 <strcmp@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"POST\00"
define i32 @is_post_request(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [4 x i8]
store i8* %0, i8** %3
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
store i8 %8, i8* %5
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
store i8 %12, i8* %9
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
store i8 %16, i8* %13
%17 = getelementptr inbounds i8, i8* %13, i64 1
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 3
%20 = load i8, i8* %19
store i8 %20, i8* %17
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %1
store i32 0, i32* %2
br label %26
25: ; preds = %1
store i32 -1, i32* %2
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
@.str = [5 x i8] c"POST\00"
define i32 @is_post_request(i8* nocapture %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = load i8, i8* %0
store i8 %4, i8* %3
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
store i8 %10, i8* %8
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
%12 = getelementptr inbounds i8, i8* %0, i64 3
%13 = load i8, i8* %12
store i8 %13, i8* %11
%14 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%15 = icmp ne i64 %14, 0
%16 = sext i1 %15 to i32
ret i32 %16
}