#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*/ free(char *);
int /*<<< orphan*/ memmove(char *, char *, int);
char *oauth_url_unescape(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ strcat(char *, char *);
char *strchr(char *, char);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strncasecmp(char *, char *, int);
char *strstr(char *, char *);
char *strtok(char *, char *);
scalar_t__ xmalloc(int);
scalar_t__ xrealloc(char **, int);
char *xstrdup(char const *);
int oauth_split_post_paramters(const char *url, char ***argv, short qesc) {
  int argc = 0;
  char *token, *tmp, *t1;
  if (!argv)
    return 0;
  if (!url)
    return 0;
  t1 = xstrdup(url);
  while ((qesc & 1) && (tmp = strchr(t1, '+')))
    *tmp = ' ';
  tmp = t1;
  while ((token = strtok(tmp, "&?"))) {
    if (!strncasecmp("oauth_signature=", token, 16))
      continue;
    (*argv) = (char **)xrealloc(*argv, sizeof(char *) * (argc + 1));
    while (!(qesc & 2) && (tmp = strchr(token, '\001')))
      *tmp = '&';
    (*argv)[argc] = oauth_url_unescape(token, NULL);
    if (argc == 0 && strstr(token, ":/")) {
      char *slash = strstr(token, ":/");
      while (slash && *(++slash) == '/')
        ;
      if (slash && !strchr(slash, '/')) {
        free((*argv)[argc]);
        (*argv)[argc] = (char *)xmalloc(sizeof(char) * (2 + strlen(token)));
        strcpy((*argv)[argc], token);
        strcat((*argv)[argc], "/");
      }
    }
    if (argc == 0 && (tmp = strstr((*argv)[argc], ":80/"))) {
      memmove(tmp, tmp + 3, strlen(tmp + 2));
    }
    tmp = NULL;
    argc++;
  }
  free(t1);
  return argc;
}


x86 assembly (clang, -O0):
<oauth_split_post_paramters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %dx,%ax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
movl   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1205 <oauth_split_post_paramters+0x35>
movl   $0x0,-0x4(%rbp)
jmp    14ea <oauth_split_post_paramters+0x31a>
cmpq   $0x0,-0x10(%rbp)
jne    121c <oauth_split_post_paramters+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    14ea <oauth_split_post_paramters+0x31a>
mov    -0x10(%rbp),%rdi
call   1090 <xstrdup@plt>
mov    %rax,-0x38(%rbp)
movswl -0x1a(%rbp),%ecx
and    $0x1,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x41(%rbp)
je     125a <oauth_split_post_paramters+0x8a>
mov    -0x38(%rbp),%rdi
mov    $0x2b,%esi
call   1060 <strchr@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
setne  %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
test   $0x1,%al
jne    126a <oauth_split_post_paramters+0x9a>
jmp    1276 <oauth_split_post_paramters+0xa6>
mov    -0x30(%rbp),%rax
movb   $0x20,(%rax)
jmp    1229 <oauth_split_post_paramters+0x59>
mov    -0x38(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xd77(%rip),%rsi
call   10d0 <strtok@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     14db <oauth_split_post_paramters+0x30b>
mov    -0x28(%rbp),%rsi
lea    0xd5c(%rip),%rdi
mov    $0x10,%edx
call   10b0 <strncasecmp@plt>
cmp    $0x0,%eax
jne    12bf <oauth_split_post_paramters+0xef>
jmp    127e <oauth_split_post_paramters+0xae>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%esi
call   1070 <xrealloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movswl -0x1a(%rbp),%ecx
and    $0x2,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x42(%rbp)
jne    1314 <oauth_split_post_paramters+0x144>
mov    -0x28(%rbp),%rdi
mov    $0x1,%esi
call   1060 <strchr@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
setne  %al
mov    %al,-0x42(%rbp)
mov    -0x42(%rbp),%al
test   $0x1,%al
jne    1324 <oauth_split_post_paramters+0x154>
jmp    1330 <oauth_split_post_paramters+0x160>
mov    -0x30(%rbp),%rax
movb   $0x26,(%rax)
jmp    12e3 <oauth_split_post_paramters+0x113>
mov    -0x28(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   10a0 <oauth_url_unescape@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x20(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
cmpl   $0x0,-0x20(%rbp)
jne    1462 <oauth_split_post_paramters+0x292>
mov    -0x28(%rbp),%rdi
lea    0xcb0(%rip),%rsi
call   10f0 <strstr@plt>
cmp    $0x0,%rax
je     1462 <oauth_split_post_paramters+0x292>
mov    -0x28(%rbp),%rdi
lea    0xc96(%rip),%rsi
call   10f0 <strstr@plt>
mov    %rax,-0x40(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x40(%rbp)
mov    %al,-0x43(%rbp)
je     13b3 <oauth_split_post_paramters+0x1e3>
mov    -0x40(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x40(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x2f,%eax
sete   %al
mov    %al,-0x43(%rbp)
mov    -0x43(%rbp),%al
test   $0x1,%al
jne    13c3 <oauth_split_post_paramters+0x1f3>
jmp    13c8 <oauth_split_post_paramters+0x1f8>
jmp    1387 <oauth_split_post_paramters+0x1b7>
cmpq   $0x0,-0x40(%rbp)
je     145d <oauth_split_post_paramters+0x28d>
mov    -0x40(%rbp),%rdi
mov    $0x2f,%esi
call   1060 <strchr@plt>
cmp    $0x0,%rax
jne    145d <oauth_split_post_paramters+0x28d>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x2,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1080 <xmalloc@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x20(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbc2(%rip),%rsi
call   10e0 <strcat@plt>
jmp    1462 <oauth_split_post_paramters+0x292>
cmpl   $0x0,-0x20(%rbp)
jne    14c5 <oauth_split_post_paramters+0x2f5>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xb95(%rip),%rsi
call   10f0 <strstr@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
je     14c5 <oauth_split_post_paramters+0x2f5>
mov    -0x30(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x50(%rbp)
mov    -0x30(%rbp),%rdi
add    $0x2,%rdi
call   1050 <strlen@plt>
mov    -0x58(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    %eax,%edx
call   10c0 <memmove@plt>
movq   $0x0,-0x30(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    127e <oauth_split_post_paramters+0xae>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oauth_split_post_paramters>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %ebp,%ebp
test   %rdi,%rdi
je     13d3 <oauth_split_post_paramters+0x203>
test   %rsi,%rsi
je     13d3 <oauth_split_post_paramters+0x203>
mov    %edx,%ebx
mov    %rsi,0x10(%rsp)
call   1090 <xstrdup@plt>
mov    %rax,%r14
movzwl %bx,%eax
mov    %eax,0x4(%rsp)
test   $0x1,%al
jne    13b0 <oauth_split_post_paramters+0x1e0>
xor    %ebp,%ebp
lea    0xde7(%rip),%rbx
lea    0xde3(%rip),%r12
mov    %r14,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %rbx,%rsi
call   10d0 <strtok@plt>
test   %rax,%rax
je     13cb <oauth_split_post_paramters+0x1fb>
mov    %rax,%r13
mov    %r12,%rdi
mov    %rax,%rsi
mov    $0x10,%edx
call   10b0 <strncasecmp@plt>
test   %eax,%eax
je     1230 <oauth_split_post_paramters+0x60>
mov    0x10(%rsp),%r15
mov    (%r15),%rdi
lea    0x1(%rbp),%rax
mov    %rax,0x8(%rsp)
lea    0x0(,%rax,8),%esi
call   1070 <xrealloc@plt>
mov    %rax,(%r15)
testb  $0x2,0x4(%rsp)
jne    12a7 <oauth_split_post_paramters+0xd7>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r13,%rdi
mov    $0x1,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     12a7 <oauth_split_post_paramters+0xd7>
movb   $0x26,(%rax)
jmp    1290 <oauth_split_post_paramters+0xc0>
mov    %r13,%rdi
xor    %esi,%esi
call   10a0 <oauth_url_unescape@plt>
mov    (%r15),%rcx
mov    %rax,(%rcx,%rbp,8)
mov    $0x0,%r15d
test   %rbp,%rbp
mov    0x8(%rsp),%rbp
jne    1230 <oauth_split_post_paramters+0x60>
mov    %r13,%rdi
lea    0xd3e(%rip),%rsi
call   10f0 <strstr@plt>
test   %rax,%rax
mov    0x10(%rsp),%rbp
je     1351 <oauth_split_post_paramters+0x181>
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x2f,0x1(%rax)
lea    0x1(%rax),%rax
je     12f0 <oauth_split_post_paramters+0x120>
mov    %rax,%rdi
mov    $0x2f,%esi
call   1060 <strchr@plt>
test   %rax,%rax
jne    1351 <oauth_split_post_paramters+0x181>
mov    0x0(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1050 <strlen@plt>
lea    0x2(%rax),%edi
call   1080 <xmalloc@plt>
mov    0x0(%rbp),%rcx
mov    %rax,(%rcx)
mov    0x0(%rbp),%rax
mov    (%rax),%rdi
mov    %r13,%rsi
call   1040 <strcpy@plt>
mov    0x0(%rbp),%rax
mov    (%rax),%rdi
lea    0xcce(%rip),%rsi
call   10e0 <strcat@plt>
mov    0x0(%rbp),%rax
mov    (%rax),%rdi
lea    0xcb8(%rip),%rsi
call   10f0 <strstr@plt>
mov    %rax,%r13
mov    0x8(%rsp),%rax
mov    %rax,%rbp
mov    $0x0,%r15d
test   %r13,%r13
je     1230 <oauth_split_post_paramters+0x60>
lea    0x3(%r13),%rbp
mov    %r13,%rdi
add    $0x2,%rdi
mov    %rax,%r15
call   1050 <strlen@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
call   10c0 <memmove@plt>
mov    %r15,%rbp
xor    %r15d,%r15d
jmp    1230 <oauth_split_post_paramters+0x60>
nopl   0x0(%rax)
mov    %r14,%rdi
mov    $0x2b,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     1210 <oauth_split_post_paramters+0x40>
movb   $0x20,(%rax)
jmp    13b0 <oauth_split_post_paramters+0x1e0>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"&?\00"
@.str.1 = [17 x i8] c"oauth_signature=\00"
@.str.2 = [3 x i8] c":/\00"
@.str.3 = [2 x i8] c"/\00"
@.str.4 = [5 x i8] c":80/\00"
define i32 @oauth_split_post_paramters(i8* %0, i8*** %1, i16 signext %2) {
%4 = icmp eq i8*** %1, null
%5 = icmp eq i8* %0, null
%6 = or i1 %5, %4
br i1 %6, label %90, label %7
7: ; preds = %3
%8 = tail call i8* @xstrdup(i8* %0)
%9 = zext i16 %2 to i32
%10 = and i32 %9, 1
%11 = icmp eq i32 %10, 0
br i1 %11, label %19, label %12
12: ; preds = %7
%13 = tail call i8* @strchr(i8* dereferenceable(1) %8, i8 signext 43)
%14 = icmp eq i8* %13, null
br i1 %14, label %19, label %15
15: ; preds = %12, %15
%16 = phi i8* [ %17, %15 ], [ %13, %12 ]
store i8 32, i8* %16
%17 = tail call i8* @strchr(i8* dereferenceable(1) %8, i8 signext 43)
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %15
19: ; preds = %15, %12, %7
%20 = and i32 %9, 2
%21 = icmp eq i32 %20, 0
br label %22
22: ; preds = %50, %19
%23 = phi i64 [ 0, %19 ], [ %33, %50 ]
%24 = phi i8* [ %8, %19 ], [ null, %50 ]
br label %25
25: ; preds = %22, %28
%26 = tail call i8* @strtok(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%27 = icmp eq i8* %26, null
br i1 %27, label %87, label %28
28: ; preds = %25
%29 = tail call i32 @strncasecmp(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %26, i32 16)
%30 = icmp eq i32 %29, 0
br i1 %30, label %25, label %31
31: ; preds = %28
%32 = load i8**, i8*** %1
%33 = add nuw i64 %23, 1
%34 = trunc i64 %33 to i32
%35 = shl i32 %34, 3
%36 = tail call i64 @xrealloc(i8** %32, i32 %35)
%37 = inttoptr i64 %36 to i8**
store i8** %37, i8*** %1
br i1 %21, label %38, label %45
38: ; preds = %31
%39 = tail call i8* @strchr(i8* %26, i8 signext 1)
%40 = icmp eq i8* %39, null
br i1 %40, label %45, label %41
41: ; preds = %38, %41
%42 = phi i8* [ %43, %41 ], [ %39, %38 ]
store i8 38, i8* %42
%43 = tail call i8* @strchr(i8* %26, i8 signext 1)
%44 = icmp eq i8* %43, null
br i1 %44, label %45, label %41
45: ; preds = %41, %38, %31
%46 = tail call i8* @oauth_url_unescape(i8* %26, i32* null)
%47 = load i8**, i8*** %1
%48 = getelementptr inbounds i8*, i8** %47, i64 %23
store i8* %46, i8** %48
%49 = icmp eq i64 %23, 0
br i1 %49, label %51, label %50
50: ; preds = %45, %82, %77
br label %22
51: ; preds = %45
%52 = tail call i8* @strstr(i8* %26, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%53 = icmp eq i8* %52, null
br i1 %53, label %77, label %54
54: ; preds = %51, %54
%55 = phi i8* [ %56, %54 ], [ %52, %51 ]
%56 = getelementptr inbounds i8, i8* %55, i64 1
%57 = load i8, i8* %56
%58 = icmp eq i8 %57, 47
br i1 %58, label %54, label %59
59: ; preds = %54
%60 = tail call i8* @strchr(i8* %56, i8 signext 47)
%61 = icmp eq i8* %60, null
br i1 %61, label %62, label %77
62: ; preds = %59
%63 = load i8**, i8*** %1
%64 = load i8*, i8** %63
%65 = tail call i32 @free(i8* %64)
%66 = tail call i32 @strlen(i8* %26)
%67 = add nsw i32 %66, 2
%68 = tail call i64 @xmalloc(i32 %67)
%69 = inttoptr i64 %68 to i8*
%70 = load i8**, i8*** %1
store i8* %69, i8** %70
%71 = load i8**, i8*** %1
%72 = load i8*, i8** %71
%73 = tail call i32 @strcpy(i8* %72, i8* %26)
%74 = load i8**, i8*** %1
%75 = load i8*, i8** %74
%76 = tail call i32 @strcat(i8* %75, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %77
77: ; preds = %51, %62, %59
%78 = load i8**, i8*** %1
%79 = load i8*, i8** %78
%80 = tail call i8* @strstr(i8* dereferenceable(1) %79, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%81 = icmp eq i8* %80, null
br i1 %81, label %50, label %82
82: ; preds = %77
%83 = getelementptr inbounds i8, i8* %80, i64 3
%84 = getelementptr inbounds i8, i8* %80, i64 2
%85 = tail call i32 @strlen(i8* %84)
%86 = tail call i32 @memmove(i8* %80, i8* %83, i32 %85)
br label %50
87: ; preds = %25
%88 = trunc i64 %23 to i32
%89 = tail call i32 @free(i8* %8)
br label %90
90: ; preds = %3, %87
%91 = phi i32 [ %88, %87 ], [ 0, %3 ]
ret i32 %91
}