#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*/ buf;

/* Variables and functions */
scalar_t__ http_read_line(int, char *, int);
scalar_t__ snprintf(char *, int, char *, ...);
char *strchr(char *, char);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ touch(char *);
int /*<<< orphan*/ url_decode(char *, char *, int);
const char *http_request_line(int fd, char *reqpath, char *env,
                              size_t *env_len) {
  static char buf[8192];
  char *sp1, *sp2, *qp, *envp = env;
  int len = sizeof(buf);
  touch("http_request_line");
  if (http_read_line(fd, buf, sizeof(buf)) < 0)
    return "Socket IO error";
  sp1 = strchr(buf, ' ');
  if (!sp1)
    return "Cannot parse HTTP request (1)";
  *sp1 = '\0';
  sp1++;
  if (*sp1 != '/')
    return "Bad request path";
  sp2 = strchr(sp1, ' ');
  if (!sp2)
    return "Cannot parse HTTP request (2)";
  *sp2 = '\0';
  sp2++;
  if (strcmp(buf, "GET") && strcmp(buf, "POST"))
    return "Unsupported request (not GET or POST)";
  envp += snprintf(envp, len, "REQUEST_METHOD=%s", buf) + 1;
  envp += snprintf(envp, len, "SERVER_PROTOCOL=%s", sp2) + 1;
  if ((qp = strchr(sp1, '?'))) {
    *qp = '\0';
    envp += snprintf(envp, len, "QUERY_STRING=%s", qp + 1) + 1;
  }
  url_decode(reqpath, sp1, 2048);
  url_decode(reqpath, sp1, 2048);
  envp += snprintf(envp, len, "REQUEST_URI=%s", reqpath) + 1;
  envp += snprintf(envp, len, "SERVER_NAME=zoobar.org") + 1;
  *envp = 0;
  *env_len = envp - env + 1;
  return NULL;
}


x86 assembly (clang, -O0):
<http_request_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
movl   $0x2000,-0x4c(%rbp)
lea    0xe73(%rip),%rdi
call   1030 <touch@plt>
mov    -0xc(%rbp),%edi
lea    0x2ec4(%rip),%rsi
mov    $0x2000,%edx
call   1080 <http_read_line@plt>
cmp    $0x0,%rax
jge    11c0 <http_request_line+0x60>
lea    0xe5b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13d5 <http_request_line+0x275>
lea    0x2e99(%rip),%rdi
mov    $0x20,%esi
call   1040 <strchr@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    11f0 <http_request_line+0x90>
lea    0xe3b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13d5 <http_request_line+0x275>
mov    -0x30(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1223 <http_request_line+0xc3>
lea    0xe26(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13d5 <http_request_line+0x275>
mov    -0x30(%rbp),%rdi
mov    $0x20,%esi
call   1040 <strchr@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1250 <http_request_line+0xf0>
lea    0xe0a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13d5 <http_request_line+0x275>
mov    -0x38(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
lea    0x2df6(%rip),%rdi
lea    0xdfe(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     12ad <http_request_line+0x14d>
lea    0x2dd9(%rip),%rdi
lea    0xde5(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     12ad <http_request_line+0x14d>
lea    0xdd4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13d5 <http_request_line+0x275>
mov    -0x48(%rbp),%rdi
mov    -0x4c(%rbp),%esi
lea    0xde3(%rip),%rdx
lea    0x2d9e(%rip),%rcx
mov    $0x0,%al
call   1050 <snprintf@plt>
add    $0x1,%rax
add    -0x48(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    -0x38(%rbp),%rcx
lea    0xdc9(%rip),%rdx
mov    $0x0,%al
call   1050 <snprintf@plt>
add    $0x1,%rax
add    -0x48(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x30(%rbp),%rdi
mov    $0x3f,%esi
call   1040 <strchr@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
je     1346 <http_request_line+0x1e6>
mov    -0x40(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x48(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    -0x40(%rbp),%rcx
add    $0x1,%rcx
lea    0xd90(%rip),%rdx
mov    $0x0,%al
call   1050 <snprintf@plt>
add    $0x1,%rax
add    -0x48(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    $0x800,%edx
call   1060 <url_decode@plt>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    $0x800,%edx
call   1060 <url_decode@plt>
mov    -0x48(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    -0x18(%rbp),%rcx
lea    0xd57(%rip),%rdx
mov    $0x0,%al
call   1050 <snprintf@plt>
add    $0x1,%rax
add    -0x48(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x4c(%rbp),%esi
lea    0xd45(%rip),%rdx
mov    $0x0,%al
call   1050 <snprintf@plt>
add    $0x1,%rax
add    -0x48(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x48(%rbp),%rcx
mov    -0x20(%rbp),%rax
sub    %rax,%rcx
add    $0x1,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_request_line>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %edi,%ebx
lea    0xe83(%rip),%rdi
call   1030 <touch@plt>
lea    0x2ed7(%rip),%rsi
mov    %ebx,%edi
mov    $0x2000,%edx
call   1080 <http_read_line@plt>
test   %rax,%rax
js     1214 <http_request_line+0xb4>
lea    0x2ebf(%rip),%rdi
mov    $0x20,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1220 <http_request_line+0xc0>
mov    %rax,%rbx
movb   $0x0,(%rax)
cmpb   $0x2f,0x1(%rax)
jne    122c <http_request_line+0xcc>
add    $0x1,%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1238 <http_request_line+0xd8>
mov    %rax,%r13
movb   $0x0,(%rax)
lea    0x2e81(%rip),%rdi
lea    0xe89(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1244 <http_request_line+0xe4>
lea    0x2e69(%rip),%rdi
lea    0xe75(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1244 <http_request_line+0xe4>
lea    0xe69(%rip),%rbx
jmp    133b <http_request_line+0x1db>
lea    0xdf7(%rip),%rbx
jmp    133b <http_request_line+0x1db>
lea    0xdfb(%rip),%rbx
jmp    133b <http_request_line+0x1db>
lea    0xe0d(%rip),%rbx
jmp    133b <http_request_line+0x1db>
lea    0xe12(%rip),%rbx
jmp    133b <http_request_line+0x1db>
add    $0x1,%r13
lea    0xe4f(%rip),%rdx
lea    0x2e0a(%rip),%rcx
mov    %r15,%rdi
mov    $0x2000,%esi
xor    %eax,%eax
call   1050 <snprintf@plt>
mov    %rax,%rbp
lea    (%rax,%r15,1),%rdi
add    $0x1,%rdi
add    %r15,%rbp
lea    0xe36(%rip),%rdx
mov    $0x2000,%esi
mov    %r13,%rcx
xor    %eax,%eax
call   1050 <snprintf@plt>
lea    (%rax,%rbp,1),%r13
add    $0x2,%r13
mov    %rbx,%rdi
mov    $0x3f,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     12ca <http_request_line+0x16a>
movb   $0x0,(%rax)
add    $0x1,%rax
lea    0xe12(%rip),%rdx
mov    %r13,%rdi
mov    $0x2000,%esi
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <snprintf@plt>
add    %rax,%r13
add    $0x1,%r13
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0x800,%edx
call   1060 <url_decode@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0x800,%edx
call   1060 <url_decode@plt>
lea    0xde2(%rip),%rdx
xor    %ebx,%ebx
mov    %r13,%rdi
mov    $0x2000,%esi
mov    %r12,%rcx
xor    %eax,%eax
call   1050 <snprintf@plt>
lea    (%rax,%r13,1),%rbp
lea    (%rax,%r13,1),%rdi
add    $0x1,%rdi
lea    0xdca(%rip),%rdx
mov    $0x2000,%esi
xor    %eax,%eax
call   1050 <snprintf@plt>
lea    (%rax,%rbp,1),%rcx
add    $0x2,%rcx
movb   $0x0,0x2(%rax,%rbp,1)
sub    %r15,%rcx
add    $0x1,%rcx
mov    %rcx,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@http_request_line.buf = internal global [8192 x i8] zeroinitializer
@.str = [18 x i8] c"http_request_line\00"
@.str.1 = [16 x i8] c"Socket IO error\00"
@.str.2 = [30 x i8] c"Cannot parse HTTP request (1)\00"
@.str.3 = [17 x i8] c"Bad request path\00"
@.str.4 = [30 x i8] c"Cannot parse HTTP request (2)\00"
@.str.5 = [4 x i8] c"GET\00"
@.str.6 = [5 x i8] c"POST\00"
@.str.7 = [38 x i8] c"Unsupported request (not GET or POST)\00"
@.str.8 = [18 x i8] c"REQUEST_METHOD=%s\00"
@.str.9 = [19 x i8] c"SERVER_PROTOCOL=%s\00"
@.str.10 = [16 x i8] c"QUERY_STRING=%s\00"
@.str.11 = [15 x i8] c"REQUEST_URI=%s\00"
@.str.12 = [23 x i8] c"SERVER_NAME=zoobar.org\00"
define i8* @http_request_line(i32 %0, i8* %1, i8* %2, i64* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64* %3, i64** %9
%15 = load i8*, i8** %8
store i8* %15, i8** %13
store i32 8192, i32* %14
%16 = call i32 @touch(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* %6
%18 = call i64 @http_read_line(i32 %17, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @http_request_line.buf, i64 0, i64 0), i32 8192)
%19 = icmp slt i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %4
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8** %5
br label %106
21: ; preds = %4
%22 = call i8* @strchr(i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @http_request_line.buf, i64 0, i64 0), i8 signext 32)
store i8* %22, i8** %10
%23 = load i8*, i8** %10
%24 = icmp ne i8* %23, null
br i1 %24, label %26, label %25
25: ; preds = %21
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8** %5
br label %106
26: ; preds = %21
%27 = load i8*, i8** %10
store i8 0, i8* %27
%28 = load i8*, i8** %10
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %10
%30 = load i8*, i8** %10
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %32, 47
br i1 %33, label %34, label %35
34: ; preds = %26
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8** %5
br label %106
35: ; preds = %26
%36 = load i8*, i8** %10
%37 = call i8* @strchr(i8* %36, i8 signext 32)
store i8* %37, i8** %11
%38 = load i8*, i8** %11
%39 = icmp ne i8* %38, null
br i1 %39, label %41, label %40
40: ; preds = %35
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8** %5
br label %106
41: ; preds = %35
%42 = load i8*, i8** %11
store i8 0, i8* %42
%43 = load i8*, i8** %11
%44 = getelementptr inbounds i8, i8* %43, i32 1
store i8* %44, i8** %11
%45 = call i64 @strcmp(i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @http_request_line.buf, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%46 = icmp ne i64 %45, 0
br i1 %46, label %47, label %51
47: ; preds = %41
%48 = call i64 @strcmp(i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @http_request_line.buf, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%49 = icmp ne i64 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %47
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0), i8** %5
br label %106
51: ; preds = %47, %41
%52 = load i8*, i8** %13
%53 = load i32, i32* %14
%54 = call i64 (i8*, i32, i8*, ...) @snprintf(i8* %52, i32 %53, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @http_request_line.buf, i64 0, i64 0))
%55 = add nsw i64 %54, 1
%56 = load i8*, i8** %13
%57 = getelementptr inbounds i8, i8* %56, i64 %55
store i8* %57, i8** %13
%58 = load i8*, i8** %13
%59 = load i32, i32* %14
%60 = load i8*, i8** %11
%61 = call i64 (i8*, i32, i8*, ...) @snprintf(i8* %58, i32 %59, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i8* %60)
%62 = add nsw i64 %61, 1
%63 = load i8*, i8** %13
%64 = getelementptr inbounds i8, i8* %63, i64 %62
store i8* %64, i8** %13
%65 = load i8*, i8** %10
%66 = call i8* @strchr(i8* %65, i8 signext 63)
store i8* %66, i8** %12
%67 = icmp ne i8* %66, null
br i1 %67, label %68, label %78
68: ; preds = %51
%69 = load i8*, i8** %12
store i8 0, i8* %69
%70 = load i8*, i8** %13
%71 = load i32, i32* %14
%72 = load i8*, i8** %12
%73 = getelementptr inbounds i8, i8* %72, i64 1
%74 = call i64 (i8*, i32, i8*, ...) @snprintf(i8* %70, i32 %71, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* %73)
%75 = add nsw i64 %74, 1
%76 = load i8*, i8** %13
%77 = getelementptr inbounds i8, i8* %76, i64 %75
store i8* %77, i8** %13
br label %78
78: ; preds = %68, %51
%79 = load i8*, i8** %7
%80 = load i8*, i8** %10
%81 = call i32 @url_decode(i8* %79, i8* %80, i32 2048)
%82 = load i8*, i8** %7
%83 = load i8*, i8** %10
%84 = call i32 @url_decode(i8* %82, i8* %83, i32 2048)
%85 = load i8*, i8** %13
%86 = load i32, i32* %14
%87 = load i8*, i8** %7
%88 = call i64 (i8*, i32, i8*, ...) @snprintf(i8* %85, i32 %86, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i8* %87)
%89 = add nsw i64 %88, 1
%90 = load i8*, i8** %13
%91 = getelementptr inbounds i8, i8* %90, i64 %89
store i8* %91, i8** %13
%92 = load i8*, i8** %13
%93 = load i32, i32* %14
%94 = call i64 (i8*, i32, i8*, ...) @snprintf(i8* %92, i32 %93, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0))
%95 = add nsw i64 %94, 1
%96 = load i8*, i8** %13
%97 = getelementptr inbounds i8, i8* %96, i64 %95
store i8* %97, i8** %13
%98 = load i8*, i8** %13
store i8 0, i8* %98
%99 = load i8*, i8** %13
%100 = load i8*, i8** %8
%101 = ptrtoint i8* %99 to i64
%102 = ptrtoint i8* %100 to i64
%103 = sub i64 %101, %102
%104 = add nsw i64 %103, 1
%105 = load i64*, i64** %9
store i64 %104, i64* %105
store i8* null, i8** %5
br label %106
106: ; preds = %78, %50, %40, %34, %25, %20
%107 = load i8*, i8** %5
ret i8* %107
}

LLVM IR (-O2):
@http_request_line.buf = internal global [8192 x i8] zeroinitializer
@.str = [18 x i8] c"http_request_line\00"
@.str.1 = [16 x i8] c"Socket IO error\00"
@.str.2 = [30 x i8] c"Cannot parse HTTP request (1)\00"
@.str.3 = [17 x i8] c"Bad request path\00"
@.str.4 = [30 x i8] c"Cannot parse HTTP request (2)\00"
@.str.5 = [4 x i8] c"GET\00"
@.str.6 = [5 x i8] c"POST\00"
@.str.7 = [38 x i8] c"Unsupported request (not GET or POST)\00"
@.str.8 = [18 x i8] c"REQUEST_METHOD=%s\00"
@.str.9 = [19 x i8] c"SERVER_PROTOCOL=%s\00"
@.str.10 = [16 x i8] c"QUERY_STRING=%s\00"
@.str.11 = [15 x i8] c"REQUEST_URI=%s\00"
@.str.12 = [23 x i8] c"SERVER_NAME=zoobar.org\00"
define i8* @http_request_line(i32 %0, i8* %1, i8* %2, i64* nocapture writeonly %3) {
%5 = tail call i32 @touch(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = tail call i64 @http_read_line(i32 %0, i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @http_request_line.buf, i64 0, i64 0), i32 8192)
%7 = icmp slt i64 %6, 0
br i1 %7, label %53, label %8
8: ; preds = %4
%9 = tail call i8* @strchr(i8* dereferenceable(1) getelementptr inbounds ([8192 x i8], [8192 x i8]* @http_request_line.buf, i64 0, i64 0), i8 signext 32)
%10 = icmp eq i8* %9, null
br i1 %10, label %53, label %11
11: ; preds = %8
store i8 0, i8* %9
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 47
br i1 %14, label %15, label %53
15: ; preds = %11
%16 = tail call i8* @strchr(i8* %12, i8 signext 32)
%17 = icmp eq i8* %16, null
br i1 %17, label %53, label %18
18: ; preds = %15
store i8 0, i8* %16
%19 = getelementptr inbounds i8, i8* %16, i64 1
%20 = tail call i64 @strcmp(i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @http_request_line.buf, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %18
%23 = tail call i64 @strcmp(i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @http_request_line.buf, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %53
25: ; preds = %22, %18
%26 = tail call i64 (i8*, i32, i8*, ...) @snprintf(i8* %2, i32 8192, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([8192 x i8], [8192 x i8]* @http_request_line.buf, i64 0, i64 0))
%27 = add nsw i64 %26, 1
%28 = getelementptr inbounds i8, i8* %2, i64 %27
%29 = tail call i64 (i8*, i32, i8*, ...) @snprintf(i8* %28, i32 8192, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i8* %19)
%30 = add nsw i64 %29, 1
%31 = getelementptr inbounds i8, i8* %28, i64 %30
%32 = tail call i8* @strchr(i8* %12, i8 signext 63)
%33 = icmp eq i8* %32, null
br i1 %33, label %39, label %34
34: ; preds = %25
store i8 0, i8* %32
%35 = getelementptr inbounds i8, i8* %32, i64 1
%36 = tail call i64 (i8*, i32, i8*, ...) @snprintf(i8* %31, i32 8192, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* %35)
%37 = add nsw i64 %36, 1
%38 = getelementptr inbounds i8, i8* %31, i64 %37
br label %39
39: ; preds = %34, %25
%40 = phi i8* [ %38, %34 ], [ %31, %25 ]
%41 = tail call i32 @url_decode(i8* %1, i8* %12, i32 2048)
%42 = tail call i32 @url_decode(i8* %1, i8* %12, i32 2048)
%43 = tail call i64 (i8*, i32, i8*, ...) @snprintf(i8* %40, i32 8192, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i8* %1)
%44 = add nsw i64 %43, 1
%45 = getelementptr inbounds i8, i8* %40, i64 %44
%46 = tail call i64 (i8*, i32, i8*, ...) @snprintf(i8* %45, i32 8192, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0))
%47 = add nsw i64 %46, 1
%48 = getelementptr inbounds i8, i8* %45, i64 %47
store i8 0, i8* %48
%49 = ptrtoint i8* %48 to i64
%50 = ptrtoint i8* %2 to i64
%51 = sub i64 1, %50
%52 = add i64 %51, %49
store i64 %52, i64* %3
br label %53
53: ; preds = %22, %15, %11, %8, %4, %39
%54 = phi i8* [ null, %39 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), %8 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), %11 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), %15 ], [ getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0), %22 ]
ret i8* %54
}