#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 void *uint32_t;
struct in6_addr {
  void **s6_addr32;
};

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


x86 assembly (clang, -O0):
<ipv6_addr_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rcx,0x8(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rcx,0x10(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv6_addr_set>:
mov    (%rdi),%rax
mov    %rsi,(%rax)
mov    (%rdi),%rax
mov    %rdx,0x8(%rax)
mov    (%rdi),%rax
mov    %rcx,0x10(%rax)
mov    (%rdi),%rax
mov    %r8,0x18(%rax)
ret

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

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