#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 http_get(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
scalar_t__ read(int, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *httpsqs_get(char *name) {
  char data[3];
  char dataarr[2][2000];
  char pos[10];
  int sock;
  char *query;
  int i = 0, j = 0, flag = 0;
  char queuedata[2000];
  char *fq;
  query = (char *)malloc((strlen(name) + strlen("utf-8") + 25) * sizeof(char));
  sprintf(query, "/?charset=%s&name=%s&opt=get", "utf-8", name);
  sock = http_get(query);
  free(query);
  memset(dataarr[0], 0, strlen(dataarr[0]));
  memset(dataarr[1], 0, strlen(dataarr[1]));
  while (read(sock, data, 1) > 0) {
    if (j == 3) {
      if (data[0] == 'P') {
        flag = 1;
      }
      if (flag == 1) {
        i++;
        if (i >= 6) {
          dataarr[0][i - 6] = data[0];
        }
      }
    }
    if (j == 4 && strlen(dataarr[0]) > 2) {
      for (i = 0; i < strlen(dataarr[0]) - 2; i++) {
        pos[i] = dataarr[0][i];
      }
      pos[strlen(pos)] = '\0';
      memset(dataarr[0], 0, strlen(dataarr[0]));
      strcpy(dataarr[0], pos);
      i = 0;
      if (strlen(pos) > 0) {
        flag = 2;
      }
    }
    if (flag == 2 && strlen(pos) > 0) {
      if (j == 8) {
        dataarr[1][i] = data[0];
        i++;
      }
    }
    if (data[0] == '\n') {
      j++;
    }
  }
  if (strlen(dataarr[1]) > 0) {
    dataarr[1][strlen(dataarr[1])] = '\0';
  }
  memset(queuedata, 0, strlen(queuedata));
  sprintf(queuedata, "Pos:%s\nData:%s", dataarr[0], dataarr[1]);
  fq = (char *)malloc(strlen(queuedata) * sizeof(char));
  strcpy(fq, queuedata);
  return fq;
}


x86 assembly (clang, -O0):
<httpsqs_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x17e0,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xfcc(%rbp)
movl   $0x0,-0xfd0(%rbp)
movl   $0x0,-0xfd4(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x17cc(%rbp)
lea    0xe3d(%rip),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x17cc(%rbp),%eax
add    %ecx,%eax
add    $0x19,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0xfc8(%rbp)
mov    -0xfc8(%rbp),%rdi
mov    -0x8(%rbp),%rcx
lea    0xe0b(%rip),%rsi
lea    0xdfe(%rip),%rdx
call   10a0 <sprintf@plt>
mov    -0xfc8(%rbp),%rdi
call   1090 <http_get@plt>
mov    %eax,-0xfc0(%rbp)
mov    -0xfc8(%rbp),%rdi
call   1030 <free@plt>
lea    -0xfb0(%rbp),%rax
mov    %rax,-0x17c8(%rbp)
lea    -0xfb0(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x17c8(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    -0xfb0(%rbp),%rax
add    $0x7d0,%rax
mov    %rax,-0x17c0(%rbp)
lea    -0xfb0(%rbp),%rdi
add    $0x7d0,%rdi
call   1050 <strlen@plt>
mov    -0x17c0(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1060 <memset@plt>
mov    -0xfc0(%rbp),%edi
lea    -0xb(%rbp),%rsi
mov    $0x1,%edx
call   1070 <read@plt>
cmp    $0x0,%rax
jle    148d <httpsqs_get+0x30d>
cmpl   $0x3,-0xfd0(%rbp)
jne    1310 <httpsqs_get+0x190>
movsbl -0xb(%rbp),%eax
cmp    $0x50,%eax
jne    12c8 <httpsqs_get+0x148>
movl   $0x1,-0xfd4(%rbp)
cmpl   $0x1,-0xfd4(%rbp)
jne    130b <httpsqs_get+0x18b>
mov    -0xfcc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfcc(%rbp)
cmpl   $0x6,-0xfcc(%rbp)
jl     1306 <httpsqs_get+0x186>
mov    -0xb(%rbp),%cl
mov    -0xfcc(%rbp),%eax
sub    $0x6,%eax
cltq
mov    %cl,-0xfb0(%rbp,%rax,1)
jmp    130b <httpsqs_get+0x18b>
jmp    1310 <httpsqs_get+0x190>
cmpl   $0x4,-0xfd0(%rbp)
jne    1418 <httpsqs_get+0x298>
lea    -0xfb0(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x2,%eax
jle    1418 <httpsqs_get+0x298>
movl   $0x0,-0xfcc(%rbp)
mov    -0xfcc(%rbp),%eax
mov    %eax,-0x17d0(%rbp)
lea    -0xfb0(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x17d0(%rbp),%eax
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    1397 <httpsqs_get+0x217>
movslq -0xfcc(%rbp),%rax
mov    -0xfb0(%rbp,%rax,1),%cl
movslq -0xfcc(%rbp),%rax
mov    %cl,-0xfba(%rbp,%rax,1)
mov    -0xfcc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfcc(%rbp)
jmp    133c <httpsqs_get+0x1bc>
lea    -0xfba(%rbp),%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,-0xfba(%rbp,%rax,1)
lea    -0xfb0(%rbp),%rax
mov    %rax,-0x17d8(%rbp)
lea    -0xfb0(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x17d8(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    -0xfb0(%rbp),%rdi
lea    -0xfba(%rbp),%rsi
call   1040 <strcpy@plt>
movl   $0x0,-0xfcc(%rbp)
lea    -0xfba(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x0,%eax
jle    1413 <httpsqs_get+0x293>
movl   $0x2,-0xfd4(%rbp)
jmp    1418 <httpsqs_get+0x298>
cmpl   $0x2,-0xfd4(%rbp)
jne    146c <httpsqs_get+0x2ec>
lea    -0xfba(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x0,%eax
jle    146c <httpsqs_get+0x2ec>
cmpl   $0x8,-0xfd0(%rbp)
jne    1467 <httpsqs_get+0x2e7>
mov    -0xb(%rbp),%cl
movslq -0xfcc(%rbp),%rax
mov    %cl,-0x7e0(%rbp,%rax,1)
mov    -0xfcc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfcc(%rbp)
jmp    146c <httpsqs_get+0x2ec>
movsbl -0xb(%rbp),%eax
cmp    $0xa,%eax
jne    1488 <httpsqs_get+0x308>
mov    -0xfd0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfd0(%rbp)
jmp    1286 <httpsqs_get+0x106>
lea    -0xfb0(%rbp),%rdi
add    $0x7d0,%rdi
call   1050 <strlen@plt>
cmp    $0x0,%eax
jle    14c6 <httpsqs_get+0x346>
lea    -0xfb0(%rbp),%rdi
add    $0x7d0,%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,-0x7e0(%rbp,%rax,1)
lea    -0x17b0(%rbp),%rax
mov    %rax,-0x17e0(%rbp)
lea    -0x17b0(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x17e0(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    -0x17b0(%rbp),%rdi
lea    -0xfb0(%rbp),%rdx
lea    -0xfb0(%rbp),%rcx
add    $0x7d0,%rcx
lea    0xb10(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0x17b0(%rbp),%rdi
call   1050 <strlen@plt>
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x17b8(%rbp)
mov    -0x17b8(%rbp),%rdi
lea    -0x17b0(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x17b8(%rbp),%rax
add    $0x17e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<httpsqs_get>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1798,%rsp
mov    %rdi,%rbp
call   1050 <strlen@plt>
mov    %eax,%ebx
lea    0xe5e(%rip),%r14
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    (%rbx,%rax,1),%edi
add    $0x19,%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
lea    0xe47(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
mov    %rbp,%rcx
call   10a0 <sprintf@plt>
mov    %rbx,%rdi
call   1090 <http_get@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
xor    %r12d,%r12d
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1060 <memset@plt>
lea    0x7f0(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1060 <memset@plt>
lea    0xd(%rsp),%rsi
mov    %ebp,%edi
mov    $0x1,%edx
call   1070 <read@plt>
test   %rax,%rax
jle    1397 <httpsqs_get+0x217>
lea    0x20(%rsp),%rbx
xor    %r13d,%r13d
xor    %r14d,%r14d
mov    %ebp,0x10(%rsp)
jmp    127a <httpsqs_get+0xfa>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
cmpb   $0xa,0xd(%rsp)
sete   %al
add    %eax,%r14d
mov    %ebp,%edi
lea    0xd(%rsp),%rsi
mov    $0x1,%edx
call   1070 <read@plt>
mov    %r15d,%r12d
test   %rax,%rax
jle    1397 <httpsqs_get+0x217>
cmp    $0x4,%r14d
je     12c0 <httpsqs_get+0x140>
cmp    $0x3,%r14d
jne    1350 <httpsqs_get+0x1d0>
mov    0xd(%rsp),%al
cmp    $0x50,%al
mov    $0x1,%ecx
cmove  %ecx,%r13d
cmp    $0x1,%r13d
jne    1350 <httpsqs_get+0x1d0>
lea    0x1(%r12),%r15d
mov    $0x1,%r13d
cmp    $0x5,%r12d
jl     1250 <httpsqs_get+0xd0>
add    $0xfffffffb,%r12d
mov    %al,0x20(%rsp,%r12,1)
jmp    1250 <httpsqs_get+0xd0>
nop
mov    %rbx,%rdi
call   1050 <strlen@plt>
cmp    $0x3,%eax
jl     1350 <httpsqs_get+0x1d0>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cmp    $0x3,%eax
jl     12ff <httpsqs_get+0x17f>
xor    %ebp,%ebp
movzbl 0x20(%rsp,%rbp,1),%eax
mov    %al,0x16(%rsp,%rbp,1)
add    $0x1,%rbp
mov    %rbx,%rdi
call   1050 <strlen@plt>
add    $0xfffffffe,%eax
cltq
cmp    %rax,%rbp
jl     12e0 <httpsqs_get+0x160>
lea    0x16(%rsp),%rbp
mov    %rbp,%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,0x16(%rsp,%rax,1)
mov    %rbx,%rdi
call   1050 <strlen@plt>
xor    %r12d,%r12d
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1060 <memset@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <strcpy@plt>
mov    %rbp,%rdi
call   1050 <strlen@plt>
mov    $0x0,%r15d
test   %eax,%eax
mov    0x10(%rsp),%ebp
jg     135d <httpsqs_get+0x1dd>
nopl   0x0(%rax,%rax,1)
mov    %r12d,%r15d
cmp    $0x2,%r13d
jne    1250 <httpsqs_get+0xd0>
lea    0x16(%rsp),%rdi
call   1050 <strlen@plt>
mov    $0x2,%r13d
test   %eax,%eax
jle    1250 <httpsqs_get+0xd0>
cmp    $0x8,%r14d
jne    1250 <httpsqs_get+0xd0>
mov    0xd(%rsp),%al
movslq %r15d,%r15
mov    %al,0x7f0(%rsp,%r15,1)
add    $0x1,%r15d
jmp    1250 <httpsqs_get+0xd0>
lea    0x7f0(%rsp),%rbp
mov    %rbp,%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    13bd <httpsqs_get+0x23d>
mov    %rbp,%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,0x7f0(%rsp,%rax,1)
lea    0xfc0(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1060 <memset@plt>
lea    0xc43(%rip),%rsi
lea    0x20(%rsp),%rdx
mov    %rbx,%rdi
mov    %rbp,%rcx
call   10a0 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    %rbp,%rax
add    $0x1798,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"utf-8\00"
@.str.1 = [29 x i8] c"/?charset=%s&name=%s&opt=get\00"
@.str.2 = [15 x i8] c"Pos:%s\0AData:%s\00"
define i8* @httpsqs_get(i8* %0) {
%2 = alloca [3 x i8]
%3 = alloca [2 x [2000 x i8]]
%4 = alloca [10 x i8]
%5 = alloca [2000 x i8]
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [2 x [2000 x i8]], [2 x [2000 x i8]]* %3, i64 0, i64 0, i64 0
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [2000 x i8], [2000 x i8]* %5, i64 0, i64 0
%10 = tail call i32 @strlen(i8* %0)
%11 = tail call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%12 = add i32 %10, 25
%13 = add i32 %12, %11
%14 = tail call i64 @malloc(i32 %13)
%15 = inttoptr i64 %14 to i8*
%16 = tail call i32 @sprintf(i8* dereferenceable(1) %15, i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%17 = tail call i32 @http_get(i8* %15)
%18 = tail call i32 @free(i8* %15)
%19 = call i32 @strlen(i8* %7)
%20 = call i32 @memset(i8* %7, i32 0, i32 %19)
%21 = getelementptr inbounds [2 x [2000 x i8]], [2 x [2000 x i8]]* %3, i64 0, i64 1, i64 0
%22 = call i32 @strlen(i8* %21)
%23 = call i32 @memset(i8* %21, i32 0, i32 %22)
%24 = call i64 @read(i32 %17, i8* %6, i32 1)
%25 = icmp sgt i64 %24, 0
br i1 %25, label %26, label %91
26: ; preds = %1, %82
%27 = phi i32 [ %84, %82 ], [ 0, %1 ]
%28 = phi i32 [ %83, %82 ], [ 0, %1 ]
%29 = phi i32 [ %88, %82 ], [ 0, %1 ]
switch i32 %29, label %67 [
i32 3, label %30
i32 4, label %42
]
30: ; preds = %26
%31 = load i8, i8* %6
%32 = icmp eq i8 %31, 80
%33 = select i1 %32, i32 1, i32 %28
%34 = icmp eq i32 %33, 1
br i1 %34, label %35, label %67
35: ; preds = %30
%36 = add nsw i32 %27, 1
%37 = icmp sgt i32 %27, 4
br i1 %37, label %38, label %82
38: ; preds = %35
%39 = add nsw i32 %27, -5
%40 = zext i32 %39 to i64
%41 = getelementptr inbounds [2 x [2000 x i8]], [2 x [2000 x i8]]* %3, i64 0, i64 0, i64 %40
store i8 %31, i8* %41
br label %82
42: ; preds = %26
%43 = call i32 @strlen(i8* %7)
%44 = icmp sgt i32 %43, 2
br i1 %44, label %45, label %67
45: ; preds = %42
%46 = call i32 @strlen(i8* %7)
%47 = icmp sgt i32 %46, 2
br i1 %47, label %48, label %58
48: ; preds = %45, %48
%49 = phi i64 [ %53, %48 ], [ 0, %45 ]
%50 = getelementptr inbounds [2 x [2000 x i8]], [2 x [2000 x i8]]* %3, i64 0, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %49
store i8 %51, i8* %52
%53 = add nuw nsw i64 %49, 1
%54 = call i32 @strlen(i8* %7)
%55 = add nsw i32 %54, -2
%56 = sext i32 %55 to i64
%57 = icmp slt i64 %53, %56
br i1 %57, label %48, label %58
58: ; preds = %48, %45
%59 = call i32 @strlen(i8* %8)
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 %60
store i8 0, i8* %61
%62 = call i32 @strlen(i8* %7)
%63 = call i32 @memset(i8* %7, i32 0, i32 %62)
%64 = call i32 @strcpy(i8* %7, i8* %8)
%65 = call i32 @strlen(i8* %8)
%66 = icmp sgt i32 %65, 0
br i1 %66, label %71, label %67
67: ; preds = %26, %30, %58, %42
%68 = phi i32 [ %28, %42 ], [ %28, %58 ], [ %33, %30 ], [ %28, %26 ]
%69 = phi i32 [ %27, %42 ], [ 0, %58 ], [ %27, %30 ], [ %27, %26 ]
%70 = icmp eq i32 %68, 2
br i1 %70, label %71, label %82
71: ; preds = %58, %67
%72 = phi i32 [ %69, %67 ], [ 0, %58 ]
%73 = call i32 @strlen(i8* %8)
%74 = icmp sgt i32 %73, 0
%75 = icmp eq i32 %29, 8
%76 = select i1 %74, i1 %75, i1 false
br i1 %76, label %77, label %82
77: ; preds = %71
%78 = load i8, i8* %6
%79 = sext i32 %72 to i64
%80 = getelementptr inbounds [2 x [2000 x i8]], [2 x [2000 x i8]]* %3, i64 0, i64 1, i64 %79
store i8 %78, i8* %80
%81 = add nsw i32 %72, 1
br label %82
82: ; preds = %38, %35, %77, %71, %67
%83 = phi i32 [ 2, %77 ], [ 2, %71 ], [ %68, %67 ], [ 1, %35 ], [ 1, %38 ]
%84 = phi i32 [ %81, %77 ], [ %72, %71 ], [ %69, %67 ], [ %36, %35 ], [ %36, %38 ]
%85 = load i8, i8* %6
%86 = icmp eq i8 %85, 10
%87 = zext i1 %86 to i32
%88 = add nuw nsw i32 %29, %87
%89 = call i64 @read(i32 %17, i8* %6, i32 1)
%90 = icmp sgt i64 %89, 0
br i1 %90, label %26, label %91
91: ; preds = %82, %1
%92 = call i32 @strlen(i8* %21)
%93 = icmp sgt i32 %92, 0
br i1 %93, label %94, label %98
94: ; preds = %91
%95 = call i32 @strlen(i8* %21)
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [2 x [2000 x i8]], [2 x [2000 x i8]]* %3, i64 0, i64 1, i64 %96
store i8 0, i8* %97
br label %98
98: ; preds = %94, %91
%99 = call i32 @strlen(i8* %9)
%100 = call i32 @memset(i8* %9, i32 0, i32 %99)
%101 = call i32 @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %7, i8* %21)
%102 = call i32 @strlen(i8* %9)
%103 = call i64 @malloc(i32 %102)
%104 = inttoptr i64 %103 to i8*
%105 = call i32 @strcpy(i8* %104, i8* %9)
ret i8* %104
}