#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 *);
char *http_get(char *);
char *http_post(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
void *pthread_fuc(void *data) {
  char *res = NULL;
  res =
      http_post("http://123.57.135.235:666/back.php", "user=111&password=222");
  if (res) {
    printf("res is :%s\n", res);
    free(res);
  }
  res = http_get("http://123.57.135.235:666/back.php?user=111&password=222");
  if (res) {
    printf("res is :%s\n", res);
    free(res);
  }
}


x86 assembly (clang, -O0):
<pthread_fuc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xea5(%rip),%rdi
lea    0xef0(%rip),%rsi
call   1040 <http_post@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     118f <pthread_fuc+0x4f>
mov    -0x18(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
lea    0xe99(%rip),%rdi
call   1060 <http_get@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11c3 <pthread_fuc+0x83>
mov    -0x18(%rbp),%rsi
lea    0xe6e(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_fuc>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xf03(%rip),%rsi
call   1040 <http_post@plt>
test   %rax,%rax
je     1173 <pthread_fuc+0x33>
mov    %rax,%rbx
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xeb5(%rip),%rdi
call   1060 <http_get@plt>
test   %rax,%rax
je     119e <pthread_fuc+0x5e>
mov    %rax,%rbx
lea    0xe95(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"http://123.57.135.235:666/back.php\00"
@.str.1 = [22 x i8] c"user=111&password=222\00"
@.str.2 = [12 x i8] c"res is :%s\0A\00"
@.str.3 = [57 x i8] c"http://123.57.135.235:666/back.php?user=111&password=222\00"
define i8* @pthread_fuc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* null, i8** %4
%5 = call i8* @http_post(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %4
%12 = call i32 @free(i8* %11)
br label %13
13: ; preds = %8, %1
%14 = call i8* @http_get(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0))
store i8* %14, i8** %4
%15 = load i8*, i8** %4
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i8*, i8** %4
%19 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = load i8*, i8** %4
%21 = call i32 @free(i8* %20)
br label %22
22: ; preds = %17, %13
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
@.str = [35 x i8] c"http://123.57.135.235:666/back.php\00"
@.str.1 = [22 x i8] c"user=111&password=222\00"
@.str.2 = [12 x i8] c"res is :%s\0A\00"
@.str.3 = [57 x i8] c"http://123.57.135.235:666/back.php?user=111&password=222\00"
define noalias i8* @pthread_fuc(i8* nocapture readnone %0) {
%2 = tail call i8* @http_post(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%6 = tail call i32 @free(i8* %2)
br label %7
7: ; preds = %4, %1
%8 = tail call i8* @http_get(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0))
%9 = icmp eq i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%12 = tail call i32 @free(i8* %8)
br label %13
13: ; preds = %10, %7
ret i8* undef
}