#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*/ My_HTTP_GET(char *, int);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void Locate_My_IP(void) {
  char message[64];
  bzero(message, 64);
  strcpy(message, "GET /ip HTTP/1.1\r\nHost:ipinfo.io\r\n\r\n");
  int message_length = strlen(message);
  My_HTTP_GET(message, message_length);
  bzero(message, 64);
  strcpy(message, "GET /city HTTP/1.1\r\nHost:ipinfo.io\r\n\r\n");
  message_length = strlen(message);
  My_HTTP_GET(message, message_length);
  bzero(message, 64);
  strcpy(message, "GET /country HTTP/1.1\r\nHost:ipinfo.io\r\n\r\n");
  message_length = strlen(message);
  My_HTTP_GET(message, message_length);
}


x86 assembly (clang, -O0):
<Locate_My_IP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
mov    $0x40,%esi
call   1060 <bzero@plt>
lea    -0x40(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1050 <My_HTTP_GET@plt>
lea    -0x40(%rbp),%rdi
mov    $0x40,%esi
call   1060 <bzero@plt>
lea    -0x40(%rbp),%rdi
lea    0xe8e(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1050 <My_HTTP_GET@plt>
lea    -0x40(%rbp),%rdi
mov    $0x40,%esi
call   1060 <bzero@plt>
lea    -0x40(%rbp),%rdi
lea    0xe7f(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1050 <My_HTTP_GET@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Locate_My_IP>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1060 <bzero@plt>
lea    0xea4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <My_HTTP_GET@plt>
mov    %rbx,%rdi
mov    $0x40,%esi
call   1060 <bzero@plt>
lea    0xe9b(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <My_HTTP_GET@plt>
mov    %rbx,%rdi
mov    $0x40,%esi
call   1060 <bzero@plt>
lea    0xe94(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <My_HTTP_GET@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"GET /ip HTTP/1.1\0D\0AHost:ipinfo.io\0D\0A\0D\0A\00"
@.str.1 = [39 x i8] c"GET /city HTTP/1.1\0D\0AHost:ipinfo.io\0D\0A\0D\0A\00"
@.str.2 = [42 x i8] c"GET /country HTTP/1.1\0D\0AHost:ipinfo.io\0D\0A\0D\0A\00"
define void @Locate_My_IP() {
%1 = alloca [64 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%4 = call i32 @bzero(i8* %3, i32 64)
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %2
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%10 = load i32, i32* %2
%11 = call i32 @My_HTTP_GET(i8* %9, i32 %10)
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%13 = call i32 @bzero(i8* %12, i32 64)
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%16 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%17 = call i32 @strlen(i8* %16)
store i32 %17, i32* %2
%18 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%19 = load i32, i32* %2
%20 = call i32 @My_HTTP_GET(i8* %18, i32 %19)
%21 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%22 = call i32 @bzero(i8* %21, i32 64)
%23 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%24 = call i32 @strcpy(i8* %23, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%25 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%26 = call i32 @strlen(i8* %25)
store i32 %26, i32* %2
%27 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%28 = load i32, i32* %2
%29 = call i32 @My_HTTP_GET(i8* %27, i32 %28)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"GET /ip HTTP/1.1\0D\0AHost:ipinfo.io\0D\0A\0D\0A\00"
@.str.1 = [39 x i8] c"GET /city HTTP/1.1\0D\0AHost:ipinfo.io\0D\0A\0D\0A\00"
@.str.2 = [42 x i8] c"GET /country HTTP/1.1\0D\0AHost:ipinfo.io\0D\0A\0D\0A\00"
define void @Locate_My_IP() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @bzero(i8* %2, i32 64)
%4 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @strlen(i8* %2)
%6 = call i32 @My_HTTP_GET(i8* %2, i32 %5)
%7 = call i32 @bzero(i8* %2, i32 64)
%8 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @strlen(i8* %2)
%10 = call i32 @My_HTTP_GET(i8* %2, i32 %9)
%11 = call i32 @bzero(i8* %2, i32 64)
%12 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @strlen(i8* %2)
%14 = call i32 @My_HTTP_GET(i8* %2, i32 %13)
ret void
}