#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 */
typedef int /*<<< orphan*/ uint32_t;
struct in6_addr {
  scalar_t__ s6_addr;
};

/* Variables and functions */
void ipv6_addr_set(struct in6_addr *addr, uint32_t w1, uint32_t w2, uint32_t w3,
                   uint32_t w4) {
  ((uint32_t *)addr->s6_addr)[0] = w1;
  ((uint32_t *)addr->s6_addr)[1] = w2;
  ((uint32_t *)addr->s6_addr)[2] = w3;
  ((uint32_t *)addr->s6_addr)[3] = w4;
}


x86 assembly (clang, -O0):
<ipv6_addr_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,0x4(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,0x8(%rax)
mov    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv6_addr_set>:
mov    (%rdi),%rax
mov    %esi,(%rax)
mov    %edx,0x4(%rax)
mov    %ecx,0x8(%rax)
mov    %r8d,0xc(%rax)
ret

LLVM IR (-O0):
%struct.in6_addr = type { i64 }
define void @ipv6_addr_set(%struct.in6_addr* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.in6_addr*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.in6_addr* %0, %struct.in6_addr** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %7
%12 = load %struct.in6_addr*, %struct.in6_addr** %6
%13 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %12, i32 0, i32 0
%14 = load i64, i64* %13
%15 = inttoptr i64 %14 to i32*
%16 = getelementptr inbounds i32, i32* %15, i64 0
store i32 %11, i32* %16
%17 = load i32, i32* %8
%18 = load %struct.in6_addr*, %struct.in6_addr** %6
%19 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %18, i32 0, i32 0
%20 = load i64, i64* %19
%21 = inttoptr i64 %20 to i32*
%22 = getelementptr inbounds i32, i32* %21, i64 1
store i32 %17, i32* %22
%23 = load i32, i32* %9
%24 = load %struct.in6_addr*, %struct.in6_addr** %6
%25 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %24, i32 0, i32 0
%26 = load i64, i64* %25
%27 = inttoptr i64 %26 to i32*
%28 = getelementptr inbounds i32, i32* %27, i64 2
store i32 %23, i32* %28
%29 = load i32, i32* %10
%30 = load %struct.in6_addr*, %struct.in6_addr** %6
%31 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %30, i32 0, i32 0
%32 = load i64, i64* %31
%33 = inttoptr i64 %32 to i32*
%34 = getelementptr inbounds i32, i32* %33, i64 3
store i32 %29, i32* %34
ret void
}

LLVM IR (-O2):
%struct.in6_addr = type { i64 }
define void @ipv6_addr_set(%struct.in6_addr* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %0, i64 0, i32 0
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to i32*
store i32 %1, i32* %8
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %2, i32* %9
%10 = getelementptr inbounds i32, i32* %8, i64 2
store i32 %3, i32* %10
%11 = getelementptr inbounds i32, i32* %8, i64 3
store i32 %4, i32* %11
ret void
}