#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 u_char;

/* Variables and functions */
int /*<<< orphan*/ INADDRSZ;
int /*<<< orphan*/ memcpy(char *, char const *, int /*<<< orphan*/);
void map_v4v6_address(const char *src, char *dst) {
  u_char *p = (u_char *)dst;
  int i;
  memcpy(dst + 12, src, INADDRSZ);
  for (i = 0; i < 10; i++)
    *p++ = 0x00;
  *p++ = 0xff;
  *p = 0xff;
}


x86 assembly (clang, -O0):
<map_v4v6_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    $0xc,%rdi
mov    -0x8(%rbp),%rsi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    1176 <map_v4v6_address+0x66>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
movl   $0x0,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1149 <map_v4v6_address+0x39>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
movl   $0xff,(%rax)
mov    -0x18(%rbp),%rax
movl   $0xff,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_v4v6_address>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xc(%rbx),%rdi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edx
call   1030 <memcpy@plt>
xorps  %xmm0,%xmm0
movups %xmm0,(%rbx)
movups %xmm0,0x10(%rbx)
movq   $0x0,0x20(%rbx)
movabs $0xff000000ff,%rax
mov    %rax,0x28(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@INADDRSZ = global i32 0
define void @map_v4v6_address(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 12
%11 = load i8*, i8** %3
%12 = load i32, i32* @INADDRSZ
%13 = call i32 @memcpy(i8* %10, i8* %11, i32 %12)
store i32 0, i32* %6
br label %14
14: ; preds = %20, %2
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 10
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load i32*, i32** %5
%19 = getelementptr inbounds i32, i32* %18, i32 1
store i32* %19, i32** %5
store i32 0, i32* %18
br label %20
20: ; preds = %17
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %14
23: ; preds = %14
%24 = load i32*, i32** %5
%25 = getelementptr inbounds i32, i32* %24, i32 1
store i32* %25, i32** %5
store i32 255, i32* %24
%26 = load i32*, i32** %5
store i32 255, i32* %26
ret void
}

LLVM IR (-O2):
@INADDRSZ = global i32 0
define void @map_v4v6_address(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 12
%4 = load i32, i32* @INADDRSZ
%5 = tail call i32 @memcpy(i8* %3, i8* %0, i32 %4)
%6 = getelementptr i8, i8* %1, i64 40
%7 = bitcast i8* %6 to i32*
%8 = getelementptr i8, i8* %1, i64 44
%9 = bitcast i8* %8 to i32*
store i32 255, i32* %7
store i32 255, i32* %9
ret void
}