#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  void *s_addr;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ sin;
typedef int /*<<< orphan*/ send_num;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int INADDR_LOOPBACK;
int /*<<< orphan*/ MSG_OOB;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ connect(int, struct sockaddr *, int);
void *htonl(int);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
int /*<<< orphan*/ send(int, ...);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ start_server();
int strlen(char *);
int execute_send() {
  start_server();
  int sfd = socket(AF_INET, SOCK_STREAM, 0);
  struct sockaddr_in sin;
  memset((void *)&sin, 0, sizeof(sin));
  sin.sin_family = AF_INET;
  sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
  sin.sin_port = htons(25588);
  socklen_t sin_len = sizeof(struct sockaddr);
  connect(sfd, (struct sockaddr *)&sin, sin_len);
  int send_num = htonl(25588);
  send(sfd, &send_num, sizeof(send_num), 0);
  char *secret_message = "None shall be revealed";
  send(sfd, secret_message, strlen(secret_message) + 1, MSG_OOB);
  return 0;
}


x86 assembly (clang, -O0):
<execute_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    $0x0,%al
call   1090 <start_server@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
mov    0x2e29(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10a0 <socket@plt>
mov    %eax,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1070 <memset@plt>
mov    0x2e26(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
call   1060 <htonl@plt>
mov    %rax,-0x18(%rbp)
mov    $0x63f4,%edi
call   1040 <htons@plt>
mov    %eax,-0x20(%rbp)
movl   $0x4,-0x24(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1080 <connect@plt>
mov    $0x63f4,%edi
call   1060 <htonl@plt>
mov    %eax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
mov    $0x0,%al
call   1050 <send@plt>
lea    0xddb(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x3c(%rbp),%edi
mov    -0x38(%rbp),%rsi
mov    %eax,%edx
add    $0x1,%edx
mov    0x2d8d(%rip),%rax
mov    (%rax),%ecx
mov    $0x0,%al
call   1050 <send@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_send>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
xor    %eax,%eax
call   1090 <start_server@plt>
mov    0x2e51(%rip),%r15
mov    (%r15),%edi
mov    0x2e27(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   10a0 <socket@plt>
mov    %eax,%ebx
lea    0x8(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1070 <memset@plt>
mov    (%r15),%eax
mov    %eax,0x18(%rsp)
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
call   1060 <htonl@plt>
mov    %rax,0x10(%rsp)
mov    $0x63f4,%edi
call   1040 <htons@plt>
mov    %eax,0x8(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1080 <connect@plt>
mov    $0x63f4,%edi
call   1060 <htonl@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
mov    %ebx,%edi
xor    %ecx,%ecx
xor    %eax,%eax
call   1050 <send@plt>
lea    0xddf(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%edx
mov    0x2dad(%rip),%rax
mov    (%rax),%ecx
mov    %ebx,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <send@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i8* }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@INADDR_LOOPBACK = global i32 0
@.str = [23 x i8] c"None shall be revealed\00"
@MSG_OOB = global i32 0
define i32 @execute_send() {
%1 = alloca i32
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = call i32 (...) @start_server()
%7 = load i32, i32* @AF_INET
%8 = load i32, i32* @SOCK_STREAM
%9 = call i32 @socket(i32 %7, i32 %8, i32 0)
store i32 %9, i32* %1
%10 = bitcast %struct.sockaddr_in* %2 to i8*
%11 = call i32 @memset(i8* %10, i32 0, i32 24)
%12 = load i32, i32* @AF_INET
%13 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i32 0, i32 2
store i32 %12, i32* %13
%14 = load i32, i32* @INADDR_LOOPBACK
%15 = call i8* @htonl(i32 %14)
%16 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i32 0, i32 1
%17 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %16, i32 0, i32 0
store i8* %15, i8** %17
%18 = call i32 @htons(i32 25588)
%19 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i32 0, i32 0
store i32 %18, i32* %19
store i32 4, i32* %3
%20 = load i32, i32* %1
%21 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%22 = load i32, i32* %3
%23 = call i32 @connect(i32 %20, %struct.sockaddr* %21, i32 %22)
%24 = call i8* @htonl(i32 25588)
%25 = ptrtoint i8* %24 to i32
store i32 %25, i32* %4
%26 = load i32, i32* %1
%27 = call i32 (i32, ...) @send(i32 %26, i32* %4, i64 4, i32 0)
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %5
%28 = load i32, i32* %1
%29 = load i8*, i8** %5
%30 = load i8*, i8** %5
%31 = call i32 @strlen(i8* %30)
%32 = add nsw i32 %31, 1
%33 = load i32, i32* @MSG_OOB
%34 = call i32 (i32, ...) @send(i32 %28, i8* %29, i32 %32, i32 %33)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i8* }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@INADDR_LOOPBACK = global i32 0
@.str = [23 x i8] c"None shall be revealed\00"
@MSG_OOB = global i32 0
define i32 @execute_send() {
%1 = alloca %struct.sockaddr_in
%2 = alloca i32
%3 = tail call i32 (...) @start_server()
%4 = load i32, i32* @AF_INET
%5 = load i32, i32* @SOCK_STREAM
%6 = tail call i32 @socket(i32 %4, i32 %5, i32 0)
%7 = bitcast %struct.sockaddr_in* %1 to i8*
%8 = call i32 @memset(i8* %7, i32 0, i32 24)
%9 = load i32, i32* @AF_INET
%10 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 2
store i32 %9, i32* %10
%11 = load i32, i32* @INADDR_LOOPBACK
%12 = call i8* @htonl(i32 %11)
%13 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 1, i32 0
store i8* %12, i8** %13
%14 = call i32 @htons(i32 25588)
%15 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 0
store i32 %14, i32* %15
%16 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%17 = call i32 @connect(i32 %6, %struct.sockaddr* %16, i32 4)
%18 = bitcast i32* %2 to i8*
%19 = call i8* @htonl(i32 25588)
%20 = ptrtoint i8* %19 to i64
%21 = trunc i64 %20 to i32
store i32 %21, i32* %2
%22 = call i32 (i32, ...) @send(i32 %6, i32* %2, i64 4, i32 0)
%23 = call i32 @strlen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%24 = add nsw i32 %23, 1
%25 = load i32, i32* @MSG_OOB
%26 = call i32 (i32, ...) @send(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %25)
ret i32 0
}