#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 */
struct sockaddr_in {
  int /*<<< orphan*/ sin_zero;
  int /*<<< orphan*/ sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ inet_aton(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(int /*<<< orphan*/, int /*<<< orphan*/, int);
struct sockaddr_in init_address(int sin_port) {
  struct sockaddr_in server_st;
  server_st.sin_family = AF_INET;
  server_st.sin_port = htons(sin_port);
  inet_aton("192.168.3.40", &server_st.sin_addr);
  memset(server_st.sin_zero, 0, 8);
  return server_st;
}


x86 assembly (clang, -O0):
<init_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0x8(%rbp)
lea    -0xc(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1050 <inet_aton@plt>
mov    -0x10(%rbp),%edi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_address>:
sub    $0x18,%rsp
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
call   1030 <htons@plt>
mov    %eax,0x10(%rsp)
lea    0xc(%rsp),%rsi
lea    0xeaa(%rip),%rdi
call   1050 <inet_aton@plt>
mov    0x8(%rsp),%edi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    0x8(%rsp),%rax
mov    0x10(%rsp),%rdx
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, i32, i32, i32 }
@AF_INET = global i32 0
@.str = [13 x i8] c"192.168.3.40\00"
define { i64, i64 } @init_address(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* @AF_INET
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i32 0, i32 3
store i32 %4, i32* %5
%6 = load i32, i32* %3
%7 = call i32 @htons(i32 %6)
%8 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i32 0, i32 2
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i32 0, i32 1
%10 = call i32 @inet_aton(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @memset(i32 %12, i32 0, i32 8)
%14 = bitcast %struct.sockaddr_in* %2 to { i64, i64 }*
%15 = load { i64, i64 }, { i64, i64 }* %14
ret { i64, i64 } %15
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, i32, i32, i32 }
@AF_INET = global i32 0
@.str = [13 x i8] c"192.168.3.40\00"
define { i64, i64 } @init_address(i32 %0) {
%2 = alloca { i64, i64 }
%3 = bitcast { i64, i64 }* %2 to %struct.sockaddr_in*
%4 = load i32, i32* @AF_INET
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 3
store i32 %4, i32* %5
%6 = tail call i32 @htons(i32 %0)
%7 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %2, i64 0, i32 1
%8 = bitcast i64* %7 to i32*
store i32 %6, i32* %8
%9 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
%10 = call i32 @inet_aton(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = bitcast { i64, i64 }* %2 to i32*
%12 = load i32, i32* %11
%13 = call i32 @memset(i32 %12, i32 0, i32 8)
%14 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %2, i64 0, i32 0
%15 = load i64, i64* %14
%16 = insertvalue { i64, i64 } poison, i64 %15, 0
%17 = load i64, i64* %7
%18 = insertvalue { i64, i64 } %16, i64 %17, 1
ret { i64, i64 } %18
}