#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 bpf_sock {
  int /*<<< orphan*/ state;
  int /*<<< orphan*/ dst_port;
  int /*<<< orphan*/ *dst_ip6;
  int /*<<< orphan*/ dst_ip4;
  int /*<<< orphan*/ src_port;
  int /*<<< orphan*/ *src_ip6;
  int /*<<< orphan*/ src_ip4;
  int /*<<< orphan*/ priority;
  int /*<<< orphan*/ mark;
  int /*<<< orphan*/ protocol;
  int /*<<< orphan*/ type;
  int /*<<< orphan*/ family;
  int /*<<< orphan*/ bound_dev_if;
};

/* Variables and functions */
void skcpy(struct bpf_sock *dst, const struct bpf_sock *src) {
  dst->bound_dev_if = src->bound_dev_if;
  dst->family = src->family;
  dst->type = src->type;
  dst->protocol = src->protocol;
  dst->mark = src->mark;
  dst->priority = src->priority;
  dst->src_ip4 = src->src_ip4;
  dst->src_ip6[0] = src->src_ip6[0];
  dst->src_ip6[1] = src->src_ip6[1];
  dst->src_ip6[2] = src->src_ip6[2];
  dst->src_ip6[3] = src->src_ip6[3];
  dst->src_port = src->src_port;
  dst->dst_ip4 = src->dst_ip4;
  dst->dst_ip6[0] = src->dst_ip6[0];
  dst->dst_ip6[1] = src->dst_ip6[1];
  dst->dst_ip6[2] = src->dst_ip6[2];
  dst->dst_ip6[3] = src->dst_ip6[3];
  dst->dst_port = src->dst_port;
  dst->state = src->state;
}


x86 assembly (clang, -O0):
<skcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x38(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x38(%rax)
mov    -0x10(%rbp),%rax
mov    0x34(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x34(%rax)
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x30(%rax)
mov    -0x10(%rbp),%rax
mov    0x2c(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x2c(%rax)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x28(%rax)
mov    -0x10(%rbp),%rax
mov    0x24(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x24(%rax)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x20(%rax)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
mov    %ecx,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    0xc(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
mov    %ecx,0xc(%rax)
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    0xc(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0xc(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<skcpy>:
mov    0x38(%rsi),%eax
mov    %eax,0x38(%rdi)
mov    0x34(%rsi),%eax
mov    %eax,0x34(%rdi)
mov    0x30(%rsi),%eax
mov    %eax,0x30(%rdi)
movups 0x20(%rsi),%xmm0
movups %xmm0,0x20(%rdi)
mov    0x18(%rsi),%rax
mov    (%rax),%ecx
mov    0x18(%rdi),%rdx
mov    %ecx,(%rdx)
mov    0x4(%rax),%ecx
mov    %ecx,0x4(%rdx)
mov    0x8(%rax),%ecx
mov    %ecx,0x8(%rdx)
mov    0xc(%rax),%eax
mov    %eax,0xc(%rdx)
mov    0x14(%rsi),%eax
mov    %eax,0x14(%rdi)
mov    0x10(%rsi),%eax
mov    %eax,0x10(%rdi)
mov    0x8(%rsi),%rax
mov    (%rax),%ecx
mov    0x8(%rdi),%rdx
mov    %ecx,(%rdx)
mov    0x4(%rax),%ecx
mov    %ecx,0x4(%rdx)
mov    0x8(%rax),%ecx
mov    %ecx,0x8(%rdx)
mov    0xc(%rax),%eax
mov    %eax,0xc(%rdx)
mov    0x4(%rsi),%eax
mov    %eax,0x4(%rdi)
mov    (%rsi),%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
%struct.bpf_sock = type { i32, i32, i32*, i32, i32, i32*, i32, i32, i32, i32, i32, i32, i32 }
define void @skcpy(%struct.bpf_sock* %0, %struct.bpf_sock* %1) {
%3 = alloca %struct.bpf_sock*
%4 = alloca %struct.bpf_sock*
store %struct.bpf_sock* %0, %struct.bpf_sock** %3
store %struct.bpf_sock* %1, %struct.bpf_sock** %4
%5 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%6 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %5, i32 0, i32 12
%7 = load i32, i32* %6
%8 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%9 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %8, i32 0, i32 12
store i32 %7, i32* %9
%10 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%11 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %10, i32 0, i32 11
%12 = load i32, i32* %11
%13 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%14 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %13, i32 0, i32 11
store i32 %12, i32* %14
%15 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%16 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %15, i32 0, i32 10
%17 = load i32, i32* %16
%18 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%19 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %18, i32 0, i32 10
store i32 %17, i32* %19
%20 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%21 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %20, i32 0, i32 9
%22 = load i32, i32* %21
%23 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%24 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %23, i32 0, i32 9
store i32 %22, i32* %24
%25 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%26 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %25, i32 0, i32 8
%27 = load i32, i32* %26
%28 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%29 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %28, i32 0, i32 8
store i32 %27, i32* %29
%30 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%31 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %30, i32 0, i32 7
%32 = load i32, i32* %31
%33 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%34 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %33, i32 0, i32 7
store i32 %32, i32* %34
%35 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%36 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %35, i32 0, i32 6
%37 = load i32, i32* %36
%38 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%39 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %38, i32 0, i32 6
store i32 %37, i32* %39
%40 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%41 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %40, i32 0, i32 5
%42 = load i32*, i32** %41
%43 = getelementptr inbounds i32, i32* %42, i64 0
%44 = load i32, i32* %43
%45 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%46 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %45, i32 0, i32 5
%47 = load i32*, i32** %46
%48 = getelementptr inbounds i32, i32* %47, i64 0
store i32 %44, i32* %48
%49 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%50 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %49, i32 0, i32 5
%51 = load i32*, i32** %50
%52 = getelementptr inbounds i32, i32* %51, i64 1
%53 = load i32, i32* %52
%54 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%55 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %54, i32 0, i32 5
%56 = load i32*, i32** %55
%57 = getelementptr inbounds i32, i32* %56, i64 1
store i32 %53, i32* %57
%58 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%59 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %58, i32 0, i32 5
%60 = load i32*, i32** %59
%61 = getelementptr inbounds i32, i32* %60, i64 2
%62 = load i32, i32* %61
%63 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%64 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %63, i32 0, i32 5
%65 = load i32*, i32** %64
%66 = getelementptr inbounds i32, i32* %65, i64 2
store i32 %62, i32* %66
%67 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%68 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %67, i32 0, i32 5
%69 = load i32*, i32** %68
%70 = getelementptr inbounds i32, i32* %69, i64 3
%71 = load i32, i32* %70
%72 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%73 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %72, i32 0, i32 5
%74 = load i32*, i32** %73
%75 = getelementptr inbounds i32, i32* %74, i64 3
store i32 %71, i32* %75
%76 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%77 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %76, i32 0, i32 4
%78 = load i32, i32* %77
%79 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%80 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %79, i32 0, i32 4
store i32 %78, i32* %80
%81 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%82 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %81, i32 0, i32 3
%83 = load i32, i32* %82
%84 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%85 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %84, i32 0, i32 3
store i32 %83, i32* %85
%86 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%87 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %86, i32 0, i32 2
%88 = load i32*, i32** %87
%89 = getelementptr inbounds i32, i32* %88, i64 0
%90 = load i32, i32* %89
%91 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%92 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %91, i32 0, i32 2
%93 = load i32*, i32** %92
%94 = getelementptr inbounds i32, i32* %93, i64 0
store i32 %90, i32* %94
%95 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%96 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %95, i32 0, i32 2
%97 = load i32*, i32** %96
%98 = getelementptr inbounds i32, i32* %97, i64 1
%99 = load i32, i32* %98
%100 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%101 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %100, i32 0, i32 2
%102 = load i32*, i32** %101
%103 = getelementptr inbounds i32, i32* %102, i64 1
store i32 %99, i32* %103
%104 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%105 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %104, i32 0, i32 2
%106 = load i32*, i32** %105
%107 = getelementptr inbounds i32, i32* %106, i64 2
%108 = load i32, i32* %107
%109 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%110 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %109, i32 0, i32 2
%111 = load i32*, i32** %110
%112 = getelementptr inbounds i32, i32* %111, i64 2
store i32 %108, i32* %112
%113 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%114 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %113, i32 0, i32 2
%115 = load i32*, i32** %114
%116 = getelementptr inbounds i32, i32* %115, i64 3
%117 = load i32, i32* %116
%118 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%119 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %118, i32 0, i32 2
%120 = load i32*, i32** %119
%121 = getelementptr inbounds i32, i32* %120, i64 3
store i32 %117, i32* %121
%122 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%123 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %122, i32 0, i32 1
%124 = load i32, i32* %123
%125 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%126 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %125, i32 0, i32 1
store i32 %124, i32* %126
%127 = load %struct.bpf_sock*, %struct.bpf_sock** %4
%128 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %127, i32 0, i32 0
%129 = load i32, i32* %128
%130 = load %struct.bpf_sock*, %struct.bpf_sock** %3
%131 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %130, i32 0, i32 0
store i32 %129, i32* %131
ret void
}

LLVM IR (-O2):
%struct.bpf_sock = type { i32, i32, i32*, i32, i32, i32*, i32, i32, i32, i32, i32, i32, i32 }
define void @skcpy(%struct.bpf_sock* nocapture %0, %struct.bpf_sock* nocapture %1) {
%3 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %1, i64 0, i32 12
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %0, i64 0, i32 12
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %1, i64 0, i32 11
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %0, i64 0, i32 11
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %1, i64 0, i32 10
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %0, i64 0, i32 10
store i32 %10, i32* %11
%12 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %1, i64 0, i32 6
%13 = bitcast i32* %12 to <4 x i32>*
%14 = load <4 x i32>, <4 x i32>* %13
%15 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %0, i64 0, i32 6
%16 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> %14, <4 x i32>* %16
%17 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %1, i64 0, i32 5
%18 = load i32*, i32** %17
%19 = load i32, i32* %18
%20 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %0, i64 0, i32 5
%21 = load i32*, i32** %20
store i32 %19, i32* %21
%22 = getelementptr inbounds i32, i32* %18, i64 1
%23 = load i32, i32* %22
%24 = getelementptr inbounds i32, i32* %21, i64 1
store i32 %23, i32* %24
%25 = getelementptr inbounds i32, i32* %18, i64 2
%26 = load i32, i32* %25
%27 = getelementptr inbounds i32, i32* %21, i64 2
store i32 %26, i32* %27
%28 = getelementptr inbounds i32, i32* %18, i64 3
%29 = load i32, i32* %28
%30 = getelementptr inbounds i32, i32* %21, i64 3
store i32 %29, i32* %30
%31 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %1, i64 0, i32 4
%32 = load i32, i32* %31
%33 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %0, i64 0, i32 4
store i32 %32, i32* %33
%34 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %1, i64 0, i32 3
%35 = load i32, i32* %34
%36 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %0, i64 0, i32 3
store i32 %35, i32* %36
%37 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %1, i64 0, i32 2
%38 = load i32*, i32** %37
%39 = load i32, i32* %38
%40 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %0, i64 0, i32 2
%41 = load i32*, i32** %40
store i32 %39, i32* %41
%42 = getelementptr inbounds i32, i32* %38, i64 1
%43 = load i32, i32* %42
%44 = getelementptr inbounds i32, i32* %41, i64 1
store i32 %43, i32* %44
%45 = getelementptr inbounds i32, i32* %38, i64 2
%46 = load i32, i32* %45
%47 = getelementptr inbounds i32, i32* %41, i64 2
store i32 %46, i32* %47
%48 = getelementptr inbounds i32, i32* %38, i64 3
%49 = load i32, i32* %48
%50 = getelementptr inbounds i32, i32* %41, i64 3
store i32 %49, i32* %50
%51 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %1, i64 0, i32 1
%52 = load i32, i32* %51
%53 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %0, i64 0, i32 1
store i32 %52, i32* %53
%54 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %1, i64 0, i32 0
%55 = load i32, i32* %54
%56 = getelementptr inbounds %struct.bpf_sock, %struct.bpf_sock* %0, i64 0, i32 0
store i32 %55, i32* %56
ret void
}