#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 */
typedef int /*<<< orphan*/ requestTarget;
typedef int /*<<< orphan*/ method;

/* Variables and functions */
int /*<<< orphan*/ error(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
char *strchr(char const *, char);
scalar_t__ strcmp(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char const *);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char const *, int);
bool parse(const char *line, char *abs_path, char *query) {
  const char *get = "GET";
  char *afterMethod = strchr(line, ' ');
  int lenMethod = strlen(line) - strlen(afterMethod);
  char method[lenMethod + 1];
  memset(method, 0, sizeof(method));
  strncpy(method, line, lenMethod);
  if (strcmp(method, get) != 0) {
    error(405);
    return false;
  }
  if (afterMethod[0] == ' ') {
    afterMethod++;
  }
  char *afterRequestTarget = strchr(afterMethod, ' ');
  int lenRequestTarget = strlen(afterMethod) - strlen(afterRequestTarget);
  char requestTarget[lenRequestTarget + 1];
  memset(requestTarget, 0, sizeof(requestTarget));
  strncpy(requestTarget, afterMethod, lenRequestTarget);
  if (strncmp(requestTarget, "/", 1) != 0) {
    error(501);
    return false;
  }
  for (int i = 0; i < strlen(requestTarget); i++) {
    if (strncmp(&requestTarget[i], "\"", 1) == 0) {
      error(400);
      return false;
    }
  }
  for (int i = 0; i < strlen(requestTarget); i++) {
    if (strncmp(&requestTarget[i], "?", 1) == 0) {
      memset(abs_path, 0, strlen(abs_path));
      strcpy(query, strchr(requestTarget, '?'));
      for (int j = 1; j < strlen(requestTarget) - 1; j++) {
        query[j - 1] = query[j];
      }
      strncpy(abs_path, requestTarget,
              strlen(requestTarget) - strlen(query) - 1);
      break;
    } else {
      strcpy(abs_path, requestTarget);
    }
  }
  if (afterRequestTarget[0] == ' ') {
    afterRequestTarget++;
  }
  if (strchr(afterRequestTarget, ' ')) {
    error(400);
    return false;
  }
  if (strncmp(afterRequestTarget, "HTTP/1.1", 8) != 0) {
    error(505);
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    0xe62(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1070 <strchr@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x84(%rbp)
mov    -0x30(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x84(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x80(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x48(%rbp)
mov    %eax,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x34(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x80(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     124f <parse+0xcf>
mov    $0x195,%edi
call   10a0 <error@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x4c(%rbp)
jmp    15aa <parse+0x42a>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    126b <parse+0xeb>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    $0x20,%esi
call   1070 <strchr@plt>
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x94(%rbp)
mov    -0x58(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x94(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x90(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x68(%rbp)
mov    %eax,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    -0x90(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x5c(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x90(%rbp),%rdi
lea    0xd13(%rip),%rsi
mov    $0x1,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     1322 <parse+0x1a2>
mov    $0x1f5,%edi
call   10a0 <error@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x4c(%rbp)
jmp    15aa <parse+0x42a>
movl   $0x0,-0x6c(%rbp)
mov    -0x90(%rbp),%rdi
mov    -0x6c(%rbp),%eax
mov    %eax,-0x98(%rbp)
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x98(%rbp),%eax
cmp    %ecx,%eax
jge    13a7 <parse+0x227>
mov    -0x90(%rbp),%rdi
movslq -0x6c(%rbp),%rax
add    %rax,%rdi
lea    0xca3(%rip),%rsi
mov    $0x1,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1394 <parse+0x214>
mov    $0x190,%edi
call   10a0 <error@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x4c(%rbp)
jmp    15aa <parse+0x42a>
jmp    1399 <parse+0x219>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1329 <parse+0x1a9>
movl   $0x0,-0x70(%rbp)
mov    -0x90(%rbp),%rdi
mov    -0x70(%rbp),%eax
mov    %eax,-0x9c(%rbp)
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x9c(%rbp),%eax
cmp    %ecx,%eax
jge    150f <parse+0x38f>
mov    -0x90(%rbp),%rdi
movslq -0x70(%rbp),%rax
add    %rax,%rdi
lea    0xc20(%rip),%rsi
mov    $0x1,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    14ec <parse+0x36c>
mov    -0x18(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0xb0(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    -0x90(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    $0x3f,%esi
call   1070 <strchr@plt>
mov    -0xa8(%rbp),%rdi
mov    %rax,%rsi
call   1050 <strcpy@plt>
movl   $0x1,-0x74(%rbp)
mov    -0x90(%rbp),%rdi
mov    -0x74(%rbp),%eax
mov    %eax,-0xb4(%rbp)
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0xb4(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    14a3 <parse+0x323>
mov    -0x20(%rbp),%rax
movslq -0x74(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x20(%rbp),%rax
mov    -0x74(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1452 <parse+0x2d2>
mov    -0x90(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %rax,-0xc0(%rbp)
call   1060 <strlen@plt>
mov    %eax,-0xc4(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0xc4(%rbp),%edx
mov    -0xc0(%rbp),%rdi
mov    -0x90(%rbp),%rsi
sub    %eax,%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
jmp    150f <parse+0x38f>
mov    -0x90(%rbp),%rsi
mov    -0x18(%rbp),%rdi
call   1050 <strcpy@plt>
jmp    1501 <parse+0x381>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    13ae <parse+0x22e>
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    152b <parse+0x3ab>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
mov    $0x20,%esi
call   1070 <strchr@plt>
cmp    $0x0,%rax
je     1560 <parse+0x3e0>
mov    $0x190,%edi
call   10a0 <error@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x4c(%rbp)
jmp    15aa <parse+0x42a>
mov    -0x58(%rbp),%rdi
lea    0xa9f(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     159c <parse+0x41c>
mov    $0x1f9,%edi
call   10a0 <error@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x4c(%rbp)
jmp    15aa <parse+0x42a>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x4c(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,-0x38(%rbp)
mov    %rsi,%r13
mov    %rdi,%r12
mov    $0x20,%esi
call   1070 <strchr@plt>
mov    %rax,%r14
mov    %r12,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1060 <strlen@plt>
sub    %eax,%ebx
lea    0x1(%rbx),%edx
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r15
sub    %rax,%r15
mov    %r15,%rsp
mov    %r15,%rdi
xor    %esi,%esi
call   1080 <memset@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   1030 <strncpy@plt>
lea    0xe12(%rip),%rsi
mov    %r15,%rdi
call   1090 <strcmp@plt>
mov    $0x195,%edi
test   %rax,%rax
jne    140a <parse+0x28a>
xor    %r12d,%r12d
cmpb   $0x20,(%r14)
sete   %r12b
add    %r14,%r12
mov    %r12,%rdi
mov    $0x20,%esi
call   1070 <strchr@plt>
mov    %rax,%rbx
mov    %r12,%rdi
call   1060 <strlen@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1060 <strlen@plt>
sub    %eax,%r14d
lea    0x1(%r14),%edx
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r15
sub    %rax,%r15
mov    %r15,%rsp
mov    %r15,%rdi
xor    %esi,%esi
call   1080 <memset@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14d,%edx
call   1030 <strncpy@plt>
lea    0xd98(%rip),%rsi
mov    %r15,%rdi
mov    $0x1,%edx
call   1040 <strncmp@plt>
mov    $0x1f5,%edi
test   %rax,%rax
jne    140a <parse+0x28a>
mov    %rbx,-0x30(%rbp)
mov    %r15,%rdi
call   1060 <strlen@plt>
test   %eax,%eax
jle    12c9 <parse+0x149>
xor    %ebx,%ebx
lea    0xd66(%rip),%r14
lea    (%r15,%rbx,1),%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1329 <parse+0x1a9>
add    $0x1,%rbx
mov    %r15,%rdi
call   1060 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     12a0 <parse+0x120>
mov    %r15,%rdi
call   1060 <strlen@plt>
test   %eax,%eax
jle    13c6 <parse+0x246>
xor    %ebx,%ebx
lea    0xd26(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%r15,%rbx,1),%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <strncmp@plt>
mov    %r13,%rdi
test   %rax,%rax
je     1333 <parse+0x1b3>
mov    %r15,%rsi
call   1050 <strcpy@plt>
add    $0x1,%rbx
mov    %r15,%rdi
call   1060 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     12f0 <parse+0x170>
jmp    13c6 <parse+0x246>
mov    $0x190,%edi
jmp    140a <parse+0x28a>
call   1060 <strlen@plt>
mov    %r13,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1080 <memset@plt>
mov    %r15,%rdi
mov    $0x3f,%esi
call   1070 <strchr@plt>
mov    -0x38(%rbp),%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <strcpy@plt>
mov    %r15,%rdi
call   1060 <strlen@plt>
cmp    $0x3,%eax
jl     13a0 <parse+0x220>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%eax
mov    %al,-0x1(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r15,%rdi
call   1060 <strlen@plt>
add    $0xffffffff,%eax
cltq
cmp    %rax,%rbx
jl     1380 <parse+0x200>
mov    %r15,%rdi
call   1060 <strlen@plt>
mov    %r14,%rdi
mov    %eax,%r14d
call   1060 <strlen@plt>
not    %eax
add    %eax,%r14d
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   1030 <strncpy@plt>
xor    %eax,%eax
mov    -0x30(%rbp),%rbx
cmpb   $0x20,(%rbx)
sete   %al
add    %rax,%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1070 <strchr@plt>
mov    $0x190,%edi
test   %rax,%rax
jne    140a <parse+0x28a>
lea    0xc17(%rip),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1040 <strncmp@plt>
mov    $0x1f9,%edi
test   %rax,%rax
je     1420 <parse+0x2a0>
call   10a0 <error@plt>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%eax
jmp    1411 <parse+0x291>

LLVM IR (-O0):
@.str = [4 x i8] c"GET\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [2 x i8] c"\22\00"
@.str.3 = [2 x i8] c"?\00"
@.str.4 = [9 x i8] c"HTTP/1.1\00"
define i32 @parse(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i64
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %8
%20 = load i8*, i8** %5
%21 = call i8* @strchr(i8* %20, i8 signext 32)
store i8* %21, i8** %9
%22 = load i8*, i8** %5
%23 = call i32 @strlen(i8* %22)
%24 = load i8*, i8** %9
%25 = call i32 @strlen(i8* %24)
%26 = sub nsw i32 %23, %25
store i32 %26, i32* %10
%27 = load i32, i32* %10
%28 = add nsw i32 %27, 1
%29 = zext i32 %28 to i64
%30 = call i8* @llvm.stacksave()
store i8* %30, i8** %11
%31 = alloca i8, i64 %29
store i64 %29, i64* %12
%32 = trunc i64 %29 to i32
%33 = call i32 @memset(i8* %31, i32 0, i32 %32)
%34 = load i8*, i8** %5
%35 = load i32, i32* %10
%36 = call i32 @strncpy(i8* %31, i8* %34, i32 %35)
%37 = load i8*, i8** %8
%38 = call i64 @strcmp(i8* %31, i8* %37)
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %3
%41 = call i32 @error(i32 405)
store i32 0, i32* %4
store i32 1, i32* %13
br label %164
42: ; preds = %3
%43 = load i8*, i8** %9
%44 = getelementptr inbounds i8, i8* %43, i64 0
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %46, 32
br i1 %47, label %48, label %51
48: ; preds = %42
%49 = load i8*, i8** %9
%50 = getelementptr inbounds i8, i8* %49, i32 1
store i8* %50, i8** %9
br label %51
51: ; preds = %48, %42
%52 = load i8*, i8** %9
%53 = call i8* @strchr(i8* %52, i8 signext 32)
store i8* %53, i8** %14
%54 = load i8*, i8** %9
%55 = call i32 @strlen(i8* %54)
%56 = load i8*, i8** %14
%57 = call i32 @strlen(i8* %56)
%58 = sub nsw i32 %55, %57
store i32 %58, i32* %15
%59 = load i32, i32* %15
%60 = add nsw i32 %59, 1
%61 = zext i32 %60 to i64
%62 = alloca i8, i64 %61
store i64 %61, i64* %16
%63 = trunc i64 %61 to i32
%64 = call i32 @memset(i8* %62, i32 0, i32 %63)
%65 = load i8*, i8** %9
%66 = load i32, i32* %15
%67 = call i32 @strncpy(i8* %62, i8* %65, i32 %66)
%68 = call i64 @strncmp(i8* %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%69 = icmp ne i64 %68, 0
br i1 %69, label %70, label %72
70: ; preds = %51
%71 = call i32 @error(i32 501)
store i32 0, i32* %4
store i32 1, i32* %13
br label %164
72: ; preds = %51
store i32 0, i32* %17
br label %73
73: ; preds = %86, %72
%74 = load i32, i32* %17
%75 = call i32 @strlen(i8* %62)
%76 = icmp slt i32 %74, %75
br i1 %76, label %77, label %89
77: ; preds = %73
%78 = load i32, i32* %17
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8, i8* %62, i64 %79
%81 = call i64 @strncmp(i8* %80, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1)
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %85
83: ; preds = %77
%84 = call i32 @error(i32 400)
store i32 0, i32* %4
store i32 1, i32* %13
br label %164
85: ; preds = %77
br label %86
86: ; preds = %85
%87 = load i32, i32* %17
%88 = add nsw i32 %87, 1
store i32 %88, i32* %17
br label %73
89: ; preds = %73
store i32 0, i32* %18
br label %90
90: ; preds = %139, %89
%91 = load i32, i32* %18
%92 = call i32 @strlen(i8* %62)
%93 = icmp slt i32 %91, %92
br i1 %93, label %94, label %142
94: ; preds = %90
%95 = load i32, i32* %18
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i8, i8* %62, i64 %96
%98 = call i64 @strncmp(i8* %97, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%99 = icmp eq i64 %98, 0
br i1 %99, label %100, label %135
100: ; preds = %94
%101 = load i8*, i8** %6
%102 = load i8*, i8** %6
%103 = call i32 @strlen(i8* %102)
%104 = call i32 @memset(i8* %101, i32 0, i32 %103)
%105 = load i8*, i8** %7
%106 = call i8* @strchr(i8* %62, i8 signext 63)
%107 = call i32 @strcpy(i8* %105, i8* %106)
store i32 1, i32* %19
br label %108
108: ; preds = %124, %100
%109 = load i32, i32* %19
%110 = call i32 @strlen(i8* %62)
%111 = sub nsw i32 %110, 1
%112 = icmp slt i32 %109, %111
br i1 %112, label %113, label %127
113: ; preds = %108
%114 = load i8*, i8** %7
%115 = load i32, i32* %19
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds i8, i8* %114, i64 %116
%118 = load i8, i8* %117
%119 = load i8*, i8** %7
%120 = load i32, i32* %19
%121 = sub nsw i32 %120, 1
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds i8, i8* %119, i64 %122
store i8 %118, i8* %123
br label %124
124: ; preds = %113
%125 = load i32, i32* %19
%126 = add nsw i32 %125, 1
store i32 %126, i32* %19
br label %108
127: ; preds = %108
%128 = load i8*, i8** %6
%129 = call i32 @strlen(i8* %62)
%130 = load i8*, i8** %7
%131 = call i32 @strlen(i8* %130)
%132 = sub nsw i32 %129, %131
%133 = sub nsw i32 %132, 1
%134 = call i32 @strncpy(i8* %128, i8* %62, i32 %133)
br label %142
135: ; preds = %94
%136 = load i8*, i8** %6
%137 = call i32 @strcpy(i8* %136, i8* %62)
br label %138
138: ; preds = %135
br label %139
139: ; preds = %138
%140 = load i32, i32* %18
%141 = add nsw i32 %140, 1
store i32 %141, i32* %18
br label %90
142: ; preds = %127, %90
%143 = load i8*, i8** %14
%144 = getelementptr inbounds i8, i8* %143, i64 0
%145 = load i8, i8* %144
%146 = sext i8 %145 to i32
%147 = icmp eq i32 %146, 32
br i1 %147, label %148, label %151
148: ; preds = %142
%149 = load i8*, i8** %14
%150 = getelementptr inbounds i8, i8* %149, i32 1
store i8* %150, i8** %14
br label %151
151: ; preds = %148, %142
%152 = load i8*, i8** %14
%153 = call i8* @strchr(i8* %152, i8 signext 32)
%154 = icmp ne i8* %153, null
br i1 %154, label %155, label %157
155: ; preds = %151
%156 = call i32 @error(i32 400)
store i32 0, i32* %4
store i32 1, i32* %13
br label %164
157: ; preds = %151
%158 = load i8*, i8** %14
%159 = call i64 @strncmp(i8* %158, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 8)
%160 = icmp ne i64 %159, 0
br i1 %160, label %161, label %163
161: ; preds = %157
%162 = call i32 @error(i32 505)
store i32 0, i32* %4
store i32 1, i32* %13
br label %164
163: ; preds = %157
store i32 1, i32* %4
store i32 1, i32* %13
br label %164
164: ; preds = %163, %161, %155, %83, %70, %40
%165 = load i8*, i8** %11
%166 = load i32, i32* %4
ret i32 %166
}

LLVM IR (-O2):
@.str = [4 x i8] c"GET\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [2 x i8] c"\22\00"
@.str.3 = [2 x i8] c"?\00"
@.str.4 = [9 x i8] c"HTTP/1.1\00"
define i32 @parse(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 32)
%5 = tail call i32 @strlen(i8* %0)
%6 = tail call i32 @strlen(i8* %4)
%7 = sub nsw i32 %5, %6
%8 = add nsw i32 %7, 1
%9 = zext i32 %8 to i64
%10 = alloca i8, i64 %9
%11 = call i32 @memset(i8* %10, i32 0, i32 %8)
%12 = call i32 @strncpy(i8* %10, i8* %0, i32 %7)
%13 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %92
15: ; preds = %3
%16 = load i8, i8* %4
%17 = icmp eq i8 %16, 32
%18 = zext i1 %17 to i64
%19 = getelementptr i8, i8* %4, i64 %18
%20 = call i8* @strchr(i8* %19, i8 signext 32)
%21 = call i32 @strlen(i8* %19)
%22 = call i32 @strlen(i8* %20)
%23 = sub nsw i32 %21, %22
%24 = add nsw i32 %23, 1
%25 = zext i32 %24 to i64
%26 = alloca i8, i64 %25
%27 = call i32 @memset(i8* %26, i32 0, i32 %24)
%28 = call i32 @strncpy(i8* %26, i8* %19, i32 %23)
%29 = call i64 @strncmp(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %92
31: ; preds = %15
%32 = call i32 @strlen(i8* %26)
%33 = icmp sgt i32 %32, 0
br i1 %33, label %41, label %38
34: ; preds = %41
%35 = call i32 @strlen(i8* %26)
%36 = sext i32 %35 to i64
%37 = icmp slt i64 %46, %36
br i1 %37, label %41, label %38
38: ; preds = %34, %31
%39 = call i32 @strlen(i8* %26)
%40 = icmp sgt i32 %39, 0
br i1 %40, label %47, label %82
41: ; preds = %31, %34
%42 = phi i64 [ %46, %34 ], [ 0, %31 ]
%43 = getelementptr inbounds i8, i8* %26, i64 %42
%44 = call i64 @strncmp(i8* %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1)
%45 = icmp eq i64 %44, 0
%46 = add nuw nsw i64 %42, 1
br i1 %45, label %92, label %34
47: ; preds = %38, %76
%48 = phi i64 [ %78, %76 ], [ 0, %38 ]
%49 = getelementptr inbounds i8, i8* %26, i64 %48
%50 = call i64 @strncmp(i8* %49, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %76
52: ; preds = %47
%53 = call i32 @strlen(i8* %1)
%54 = call i32 @memset(i8* %1, i32 0, i32 %53)
%55 = call i8* @strchr(i8* %26, i8 signext 63)
%56 = call i32 @strcpy(i8* %2, i8* %55)
%57 = call i32 @strlen(i8* %26)
%58 = icmp sgt i32 %57, 2
br i1 %58, label %65, label %59
59: ; preds = %65, %52
%60 = call i32 @strlen(i8* %26)
%61 = call i32 @strlen(i8* %2)
%62 = xor i32 %61, -1
%63 = add i32 %60, %62
%64 = call i32 @strncpy(i8* %1, i8* %26, i32 %63)
br label %82
65: ; preds = %52, %65
%66 = phi i64 [ %71, %65 ], [ 1, %52 ]
%67 = getelementptr inbounds i8, i8* %2, i64 %66
%68 = load i8, i8* %67
%69 = add nsw i64 %66, -1
%70 = getelementptr inbounds i8, i8* %2, i64 %69
store i8 %68, i8* %70
%71 = add nuw nsw i64 %66, 1
%72 = call i32 @strlen(i8* %26)
%73 = add nsw i32 %72, -1
%74 = sext i32 %73 to i64
%75 = icmp slt i64 %71, %74
br i1 %75, label %65, label %59
76: ; preds = %47
%77 = call i32 @strcpy(i8* %1, i8* %26)
%78 = add nuw nsw i64 %48, 1
%79 = call i32 @strlen(i8* %26)
%80 = sext i32 %79 to i64
%81 = icmp slt i64 %78, %80
br i1 %81, label %47, label %82
82: ; preds = %76, %38, %59
%83 = load i8, i8* %20
%84 = icmp eq i8 %83, 32
%85 = zext i1 %84 to i64
%86 = getelementptr i8, i8* %20, i64 %85
%87 = call i8* @strchr(i8* %86, i8 signext 32)
%88 = icmp eq i8* %87, null
br i1 %88, label %89, label %92
89: ; preds = %82
%90 = call i64 @strncmp(i8* %86, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 8)
%91 = icmp eq i64 %90, 0
br i1 %91, label %95, label %92
92: ; preds = %41, %89, %82, %15, %3
%93 = phi i32 [ 405, %3 ], [ 501, %15 ], [ 400, %82 ], [ 505, %89 ], [ 400, %41 ]
%94 = call i32 @error(i32 %93)
br label %95
95: ; preds = %92, %89
%96 = phi i32 [ 1, %89 ], [ 0, %92 ]
ret i32 %96
}