#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 *uint8_t;
typedef int uint32_t;
struct ether_header {
  int /*<<< orphan*/ ether_type;
  void **ether_dhost;
  void **ether_shost;
};

/* Variables and functions */
int /*<<< orphan*/ ETH_P_IP;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ memset(void **, int /*<<< orphan*/, int);
int /*<<< orphan*/ stderr;
uint32_t packet_eth(uint8_t *_buf, uint32_t _len, uint8_t *_smac,
                    uint8_t *_dmac) {
  struct ether_header *eh = (struct ether_header *)_buf;
  uint32_t ind = 0;
  int i = 0;
  if (_buf == NULL || _smac == NULL || _dmac == NULL) {
    fprintf(stderr,
            "error: packet_eth() buf or _smac or _dmac argument is NULL\n");
    exit(21);
  }
  if (_len < (sizeof(struct ether_header) + 68)) {
    fprintf(stderr, "error: packet_eth() argument len is too short\n");
    exit(21);
  }
  memset(_buf, 0, _len);
  eh->ether_shost[0] = _smac[0];
  eh->ether_shost[1] = _smac[1];
  eh->ether_shost[2] = _smac[2];
  eh->ether_shost[3] = _smac[3];
  eh->ether_shost[4] = _smac[4];
  eh->ether_shost[5] = _smac[5];
  eh->ether_dhost[0] = _dmac[0];
  eh->ether_dhost[1] = _dmac[1];
  eh->ether_dhost[2] = _dmac[2];
  eh->ether_dhost[3] = _dmac[3];
  eh->ether_dhost[4] = _dmac[4];
  eh->ether_dhost[5] = _dmac[5];
  eh->ether_type = htons(ETH_P_IP);
  ind += sizeof(struct ether_header);
  _buf[ind++] = 0xde;
  _buf[ind++] = 0xad;
  _buf[ind++] = 0xbe;
  _buf[ind++] = 0xef;
  for (i = 0; i < 64; i++)
    _buf[ind++] = i;
  return ind;
}


x86 assembly (clang, -O0):
<packet_eth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     118e <packet_eth+0x4e>
cmpq   $0x0,-0x18(%rbp)
je     118e <packet_eth+0x4e>
cmpq   $0x0,-0x20(%rbp)
jne    11ad <packet_eth+0x6d>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
lea    0xe62(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x15,%edi
call   1060 <exit@plt>
movslq -0xc(%rbp),%rax
cmp    $0x5c,%rax
jae    11da <packet_eth+0x9a>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
lea    0xe71(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x15,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    -0x28(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rcx,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rcx,0x10(%rax)
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rcx,0x18(%rax)
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rcx,0x20(%rax)
mov    -0x18(%rbp),%rax
mov    0x28(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rcx,0x28(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rcx,0x8(%rax)
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rcx,0x10(%rax)
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rcx,0x18(%rax)
mov    -0x20(%rbp),%rax
mov    0x20(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rcx,0x20(%rax)
mov    -0x20(%rbp),%rax
mov    0x28(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rcx,0x28(%rax)
mov    0x2cfd(%rip),%rax
mov    (%rax),%edi
call   1030 <htons@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
movslq -0x2c(%rbp),%rax
add    $0x18,%rax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x2c(%rbp)
movslq %ecx,%rcx
mov    $0xde,%edx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x2c(%rbp)
movslq %ecx,%rcx
mov    $0xad,%edx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x2c(%rbp)
movslq %ecx,%rcx
mov    $0xbe,%edx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x2c(%rbp)
movslq %ecx,%rcx
mov    $0xef,%edx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x30(%rbp)
cmpl   $0x40,-0x30(%rbp)
jge    139a <packet_eth+0x25a>
movslq -0x30(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x2c(%rbp)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1368 <packet_eth+0x228>
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<packet_eth>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     140e <packet_eth+0x2ce>
mov    %rdx,%r15
test   %rdx,%rdx
je     140e <packet_eth+0x2ce>
mov    %rcx,%r14
test   %rcx,%rcx
je     140e <packet_eth+0x2ce>
mov    %esi,%edx
cmp    $0x5b,%esi
jbe    1420 <packet_eth+0x2e0>
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <memset@plt>
mov    (%r15),%rax
mov    0x10(%rbx),%rcx
mov    %rax,(%rcx)
mov    0x8(%r15),%rax
mov    0x10(%rbx),%rcx
mov    %rax,0x8(%rcx)
mov    0x10(%r15),%rax
mov    0x10(%rbx),%rcx
mov    %rax,0x10(%rcx)
mov    0x18(%r15),%rax
mov    0x10(%rbx),%rcx
mov    %rax,0x18(%rcx)
mov    0x20(%r15),%rax
mov    0x10(%rbx),%rcx
mov    %rax,0x20(%rcx)
mov    0x28(%r15),%rax
mov    0x10(%rbx),%rcx
mov    %rax,0x28(%rcx)
mov    (%r14),%rax
mov    0x8(%rbx),%rcx
mov    %rax,(%rcx)
mov    0x8(%r14),%rax
mov    0x8(%rbx),%rcx
mov    %rax,0x8(%rcx)
mov    0x10(%r14),%rax
mov    0x8(%rbx),%rcx
mov    %rax,0x10(%rcx)
mov    0x18(%r14),%rax
mov    0x8(%rbx),%rcx
mov    %rax,0x18(%rcx)
mov    0x20(%r14),%rax
mov    0x8(%rbx),%rcx
mov    %rax,0x20(%rcx)
mov    0x28(%r14),%rax
mov    0x8(%rbx),%rcx
mov    %rax,0x28(%rcx)
mov    0x2dca(%rip),%rax
mov    (%rax),%edi
call   1030 <htons@plt>
mov    %eax,(%rbx)
movq   $0xde,0xc0(%rbx)
movq   $0xad,0xc8(%rbx)
movq   $0xbe,0xd0(%rbx)
movq   $0xef,0xd8(%rbx)
movaps 0xdb6(%rip),%xmm0
movups %xmm0,0xe0(%rbx)
movaps 0xdb8(%rip),%xmm0
movups %xmm0,0xf0(%rbx)
movaps 0xdba(%rip),%xmm0
movups %xmm0,0x100(%rbx)
movaps 0xdbc(%rip),%xmm0
movups %xmm0,0x110(%rbx)
movaps 0xdbe(%rip),%xmm0
movups %xmm0,0x120(%rbx)
movaps 0xdc0(%rip),%xmm0
movups %xmm0,0x130(%rbx)
movaps 0xdc2(%rip),%xmm0
movups %xmm0,0x140(%rbx)
movaps 0xdc4(%rip),%xmm0
movups %xmm0,0x150(%rbx)
movaps 0xdc6(%rip),%xmm0
movups %xmm0,0x160(%rbx)
movaps 0xdc8(%rip),%xmm0
movups %xmm0,0x170(%rbx)
movaps 0xdca(%rip),%xmm0
movups %xmm0,0x180(%rbx)
movaps 0xdcc(%rip),%xmm0
movups %xmm0,0x190(%rbx)
movaps 0xdce(%rip),%xmm0
movups %xmm0,0x1a0(%rbx)
movaps 0xdd0(%rip),%xmm0
movups %xmm0,0x1b0(%rbx)
movaps 0xdd2(%rip),%xmm0
movups %xmm0,0x1c0(%rbx)
movaps 0xdd4(%rip),%xmm0
movups %xmm0,0x1d0(%rbx)
movaps 0xdd6(%rip),%xmm0
movups %xmm0,0x1e0(%rbx)
movaps 0xdd8(%rip),%xmm0
movups %xmm0,0x1f0(%rbx)
movaps 0xdda(%rip),%xmm0
movups %xmm0,0x200(%rbx)
movaps 0xddc(%rip),%xmm0
movups %xmm0,0x210(%rbx)
movaps 0xdde(%rip),%xmm0
movups %xmm0,0x220(%rbx)
movaps 0xde0(%rip),%xmm0
movups %xmm0,0x230(%rbx)
movaps 0xde2(%rip),%xmm0
movups %xmm0,0x240(%rbx)
movaps 0xde4(%rip),%xmm0
movups %xmm0,0x250(%rbx)
movaps 0xde6(%rip),%xmm0
movups %xmm0,0x260(%rbx)
movaps 0xde8(%rip),%xmm0
movups %xmm0,0x270(%rbx)
movaps 0xdea(%rip),%xmm0
movups %xmm0,0x280(%rbx)
movaps 0xdec(%rip),%xmm0
movups %xmm0,0x290(%rbx)
movaps 0xdee(%rip),%xmm0
movups %xmm0,0x2a0(%rbx)
movaps 0xdf0(%rip),%xmm0
movups %xmm0,0x2b0(%rbx)
movaps 0xdf2(%rip),%xmm0
movups %xmm0,0x2c0(%rbx)
movaps 0xdf4(%rip),%xmm0
movups %xmm0,0x2d0(%rbx)
mov    $0x5c,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2bcb(%rip),%rax
mov    (%rax),%edi
lea    0xde2(%rip),%rsi
jmp    1430 <packet_eth+0x2f0>
mov    0x2bb9(%rip),%rax
mov    (%rax),%edi
lea    0xe0c(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x15,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.ether_header = type { i32, i8**, i8** }
@stderr = global i32 0
@.str = [60 x i8] c"error: packet_eth() buf or _smac or _dmac argument is NULL\0A\00"
@.str.1 = [47 x i8] c"error: packet_eth() argument len is too short\0A\00"
@ETH_P_IP = global i32 0
define i32 @packet_eth(i8** %0, i32 %1, i8** %2, i8** %3) {
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca %struct.ether_header*
%10 = alloca i32
%11 = alloca i32
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%12 = load i8**, i8*** %5
%13 = bitcast i8** %12 to %struct.ether_header*
store %struct.ether_header* %13, %struct.ether_header** %9
store i32 0, i32* %10
store i32 0, i32* %11
%14 = load i8**, i8*** %5
%15 = icmp eq i8** %14, null
br i1 %15, label %22, label %16
16: ; preds = %4
%17 = load i8**, i8*** %7
%18 = icmp eq i8** %17, null
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load i8**, i8*** %8
%21 = icmp eq i8** %20, null
br i1 %21, label %22, label %26
22: ; preds = %19, %16, %4
%23 = load i32, i32* @stderr
%24 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%25 = call i32 @exit(i32 21)
unreachable
26: ; preds = %19
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = icmp ult i64 %28, 92
br i1 %29, label %30, label %34
30: ; preds = %26
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%33 = call i32 @exit(i32 21)
unreachable
34: ; preds = %26
%35 = load i8**, i8*** %5
%36 = load i32, i32* %6
%37 = call i32 @memset(i8** %35, i32 0, i32 %36)
%38 = load i8**, i8*** %7
%39 = getelementptr inbounds i8*, i8** %38, i64 0
%40 = load i8*, i8** %39
%41 = load %struct.ether_header*, %struct.ether_header** %9
%42 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %41, i32 0, i32 2
%43 = load i8**, i8*** %42
%44 = getelementptr inbounds i8*, i8** %43, i64 0
store i8* %40, i8** %44
%45 = load i8**, i8*** %7
%46 = getelementptr inbounds i8*, i8** %45, i64 1
%47 = load i8*, i8** %46
%48 = load %struct.ether_header*, %struct.ether_header** %9
%49 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %48, i32 0, i32 2
%50 = load i8**, i8*** %49
%51 = getelementptr inbounds i8*, i8** %50, i64 1
store i8* %47, i8** %51
%52 = load i8**, i8*** %7
%53 = getelementptr inbounds i8*, i8** %52, i64 2
%54 = load i8*, i8** %53
%55 = load %struct.ether_header*, %struct.ether_header** %9
%56 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %55, i32 0, i32 2
%57 = load i8**, i8*** %56
%58 = getelementptr inbounds i8*, i8** %57, i64 2
store i8* %54, i8** %58
%59 = load i8**, i8*** %7
%60 = getelementptr inbounds i8*, i8** %59, i64 3
%61 = load i8*, i8** %60
%62 = load %struct.ether_header*, %struct.ether_header** %9
%63 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %62, i32 0, i32 2
%64 = load i8**, i8*** %63
%65 = getelementptr inbounds i8*, i8** %64, i64 3
store i8* %61, i8** %65
%66 = load i8**, i8*** %7
%67 = getelementptr inbounds i8*, i8** %66, i64 4
%68 = load i8*, i8** %67
%69 = load %struct.ether_header*, %struct.ether_header** %9
%70 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %69, i32 0, i32 2
%71 = load i8**, i8*** %70
%72 = getelementptr inbounds i8*, i8** %71, i64 4
store i8* %68, i8** %72
%73 = load i8**, i8*** %7
%74 = getelementptr inbounds i8*, i8** %73, i64 5
%75 = load i8*, i8** %74
%76 = load %struct.ether_header*, %struct.ether_header** %9
%77 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %76, i32 0, i32 2
%78 = load i8**, i8*** %77
%79 = getelementptr inbounds i8*, i8** %78, i64 5
store i8* %75, i8** %79
%80 = load i8**, i8*** %8
%81 = getelementptr inbounds i8*, i8** %80, i64 0
%82 = load i8*, i8** %81
%83 = load %struct.ether_header*, %struct.ether_header** %9
%84 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %83, i32 0, i32 1
%85 = load i8**, i8*** %84
%86 = getelementptr inbounds i8*, i8** %85, i64 0
store i8* %82, i8** %86
%87 = load i8**, i8*** %8
%88 = getelementptr inbounds i8*, i8** %87, i64 1
%89 = load i8*, i8** %88
%90 = load %struct.ether_header*, %struct.ether_header** %9
%91 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %90, i32 0, i32 1
%92 = load i8**, i8*** %91
%93 = getelementptr inbounds i8*, i8** %92, i64 1
store i8* %89, i8** %93
%94 = load i8**, i8*** %8
%95 = getelementptr inbounds i8*, i8** %94, i64 2
%96 = load i8*, i8** %95
%97 = load %struct.ether_header*, %struct.ether_header** %9
%98 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %97, i32 0, i32 1
%99 = load i8**, i8*** %98
%100 = getelementptr inbounds i8*, i8** %99, i64 2
store i8* %96, i8** %100
%101 = load i8**, i8*** %8
%102 = getelementptr inbounds i8*, i8** %101, i64 3
%103 = load i8*, i8** %102
%104 = load %struct.ether_header*, %struct.ether_header** %9
%105 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %104, i32 0, i32 1
%106 = load i8**, i8*** %105
%107 = getelementptr inbounds i8*, i8** %106, i64 3
store i8* %103, i8** %107
%108 = load i8**, i8*** %8
%109 = getelementptr inbounds i8*, i8** %108, i64 4
%110 = load i8*, i8** %109
%111 = load %struct.ether_header*, %struct.ether_header** %9
%112 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %111, i32 0, i32 1
%113 = load i8**, i8*** %112
%114 = getelementptr inbounds i8*, i8** %113, i64 4
store i8* %110, i8** %114
%115 = load i8**, i8*** %8
%116 = getelementptr inbounds i8*, i8** %115, i64 5
%117 = load i8*, i8** %116
%118 = load %struct.ether_header*, %struct.ether_header** %9
%119 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %118, i32 0, i32 1
%120 = load i8**, i8*** %119
%121 = getelementptr inbounds i8*, i8** %120, i64 5
store i8* %117, i8** %121
%122 = load i32, i32* @ETH_P_IP
%123 = call i32 @htons(i32 %122)
%124 = load %struct.ether_header*, %struct.ether_header** %9
%125 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %124, i32 0, i32 0
store i32 %123, i32* %125
%126 = load i32, i32* %10
%127 = sext i32 %126 to i64
%128 = add i64 %127, 24
%129 = trunc i64 %128 to i32
store i32 %129, i32* %10
%130 = load i8**, i8*** %5
%131 = load i32, i32* %10
%132 = add nsw i32 %131, 1
store i32 %132, i32* %10
%133 = sext i32 %131 to i64
%134 = getelementptr inbounds i8*, i8** %130, i64 %133
store i8* inttoptr (i64 222 to i8*), i8** %134
%135 = load i8**, i8*** %5
%136 = load i32, i32* %10
%137 = add nsw i32 %136, 1
store i32 %137, i32* %10
%138 = sext i32 %136 to i64
%139 = getelementptr inbounds i8*, i8** %135, i64 %138
store i8* inttoptr (i64 173 to i8*), i8** %139
%140 = load i8**, i8*** %5
%141 = load i32, i32* %10
%142 = add nsw i32 %141, 1
store i32 %142, i32* %10
%143 = sext i32 %141 to i64
%144 = getelementptr inbounds i8*, i8** %140, i64 %143
store i8* inttoptr (i64 190 to i8*), i8** %144
%145 = load i8**, i8*** %5
%146 = load i32, i32* %10
%147 = add nsw i32 %146, 1
store i32 %147, i32* %10
%148 = sext i32 %146 to i64
%149 = getelementptr inbounds i8*, i8** %145, i64 %148
store i8* inttoptr (i64 239 to i8*), i8** %149
store i32 0, i32* %11
br label %150
150: ; preds = %162, %34
%151 = load i32, i32* %11
%152 = icmp slt i32 %151, 64
br i1 %152, label %153, label %165
153: ; preds = %150
%154 = load i32, i32* %11
%155 = sext i32 %154 to i64
%156 = inttoptr i64 %155 to i8*
%157 = load i8**, i8*** %5
%158 = load i32, i32* %10
%159 = add nsw i32 %158, 1
store i32 %159, i32* %10
%160 = sext i32 %158 to i64
%161 = getelementptr inbounds i8*, i8** %157, i64 %160
store i8* %156, i8** %161
br label %162
162: ; preds = %153
%163 = load i32, i32* %11
%164 = add nsw i32 %163, 1
store i32 %164, i32* %11
br label %150
165: ; preds = %150
%166 = load i32, i32* %10
ret i32 %166
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"error: packet_eth() buf or _smac or _dmac argument is NULL\0A\00"
@.str.1 = [47 x i8] c"error: packet_eth() argument len is too short\0A\00"
@ETH_P_IP = global i32 0
define i32 @packet_eth(i8** %0, i32 %1, i8** %2, i8** %3) {
%5 = icmp eq i8** %0, null
%6 = icmp eq i8** %2, null
%7 = or i1 %5, %6
%8 = icmp eq i8** %3, null
%9 = or i1 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %4
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 @exit(i32 21)
unreachable
14: ; preds = %4
%15 = icmp ult i32 %1, 92
br i1 %15, label %16, label %20
16: ; preds = %14
%17 = load i32, i32* @stderr
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%19 = tail call i32 @exit(i32 21)
unreachable
20: ; preds = %14
%21 = tail call i32 @memset(i8** %0, i32 0, i32 %1)
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8*, i8** %0, i64 2
%24 = bitcast i8** %23 to i8***
%25 = load i8**, i8*** %24
store i8* %22, i8** %25
%26 = getelementptr inbounds i8*, i8** %2, i64 1
%27 = load i8*, i8** %26
%28 = load i8**, i8*** %24
%29 = getelementptr inbounds i8*, i8** %28, i64 1
store i8* %27, i8** %29
%30 = getelementptr inbounds i8*, i8** %2, i64 2
%31 = load i8*, i8** %30
%32 = load i8**, i8*** %24
%33 = getelementptr inbounds i8*, i8** %32, i64 2
store i8* %31, i8** %33
%34 = getelementptr inbounds i8*, i8** %2, i64 3
%35 = load i8*, i8** %34
%36 = load i8**, i8*** %24
%37 = getelementptr inbounds i8*, i8** %36, i64 3
store i8* %35, i8** %37
%38 = getelementptr inbounds i8*, i8** %2, i64 4
%39 = load i8*, i8** %38
%40 = load i8**, i8*** %24
%41 = getelementptr inbounds i8*, i8** %40, i64 4
store i8* %39, i8** %41
%42 = getelementptr inbounds i8*, i8** %2, i64 5
%43 = load i8*, i8** %42
%44 = load i8**, i8*** %24
%45 = getelementptr inbounds i8*, i8** %44, i64 5
store i8* %43, i8** %45
%46 = load i8*, i8** %3
%47 = getelementptr inbounds i8*, i8** %0, i64 1
%48 = bitcast i8** %47 to i8***
%49 = load i8**, i8*** %48
store i8* %46, i8** %49
%50 = getelementptr inbounds i8*, i8** %3, i64 1
%51 = load i8*, i8** %50
%52 = load i8**, i8*** %48
%53 = getelementptr inbounds i8*, i8** %52, i64 1
store i8* %51, i8** %53
%54 = getelementptr inbounds i8*, i8** %3, i64 2
%55 = load i8*, i8** %54
%56 = load i8**, i8*** %48
%57 = getelementptr inbounds i8*, i8** %56, i64 2
store i8* %55, i8** %57
%58 = getelementptr inbounds i8*, i8** %3, i64 3
%59 = load i8*, i8** %58
%60 = load i8**, i8*** %48
%61 = getelementptr inbounds i8*, i8** %60, i64 3
store i8* %59, i8** %61
%62 = getelementptr inbounds i8*, i8** %3, i64 4
%63 = load i8*, i8** %62
%64 = load i8**, i8*** %48
%65 = getelementptr inbounds i8*, i8** %64, i64 4
store i8* %63, i8** %65
%66 = getelementptr inbounds i8*, i8** %3, i64 5
%67 = load i8*, i8** %66
%68 = load i8**, i8*** %48
%69 = getelementptr inbounds i8*, i8** %68, i64 5
store i8* %67, i8** %69
%70 = load i32, i32* @ETH_P_IP
%71 = tail call i32 @htons(i32 %70)
%72 = bitcast i8** %0 to i32*
store i32 %71, i32* %72
%73 = getelementptr inbounds i8*, i8** %0, i64 24
store i8* inttoptr (i64 222 to i8*), i8** %73
%74 = getelementptr inbounds i8*, i8** %0, i64 25
store i8* inttoptr (i64 173 to i8*), i8** %74
%75 = getelementptr inbounds i8*, i8** %0, i64 26
store i8* inttoptr (i64 190 to i8*), i8** %75
%76 = getelementptr inbounds i8*, i8** %0, i64 27
store i8* inttoptr (i64 239 to i8*), i8** %76
%77 = getelementptr inbounds i8*, i8** %0, i64 28
%78 = bitcast i8** %77 to <2 x i8*>*
store <2 x i8*> <i8* null, i8* inttoptr (i64 1 to i8*)>, <2 x i8*>* %78
%79 = getelementptr inbounds i8*, i8** %0, i64 30
%80 = bitcast i8** %79 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 2 to i8*), i8* inttoptr (i64 3 to i8*)>, <2 x i8*>* %80
%81 = getelementptr inbounds i8*, i8** %0, i64 32
%82 = bitcast i8** %81 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 4 to i8*), i8* inttoptr (i64 5 to i8*)>, <2 x i8*>* %82
%83 = getelementptr inbounds i8*, i8** %0, i64 34
%84 = bitcast i8** %83 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 6 to i8*), i8* inttoptr (i64 7 to i8*)>, <2 x i8*>* %84
%85 = getelementptr inbounds i8*, i8** %0, i64 36
%86 = bitcast i8** %85 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 8 to i8*), i8* inttoptr (i64 9 to i8*)>, <2 x i8*>* %86
%87 = getelementptr inbounds i8*, i8** %0, i64 38
%88 = bitcast i8** %87 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 10 to i8*), i8* inttoptr (i64 11 to i8*)>, <2 x i8*>* %88
%89 = getelementptr inbounds i8*, i8** %0, i64 40
%90 = bitcast i8** %89 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 12 to i8*), i8* inttoptr (i64 13 to i8*)>, <2 x i8*>* %90
%91 = getelementptr inbounds i8*, i8** %0, i64 42
%92 = bitcast i8** %91 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 14 to i8*), i8* inttoptr (i64 15 to i8*)>, <2 x i8*>* %92
%93 = getelementptr inbounds i8*, i8** %0, i64 44
%94 = bitcast i8** %93 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 16 to i8*), i8* inttoptr (i64 17 to i8*)>, <2 x i8*>* %94
%95 = getelementptr inbounds i8*, i8** %0, i64 46
%96 = bitcast i8** %95 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 18 to i8*), i8* inttoptr (i64 19 to i8*)>, <2 x i8*>* %96
%97 = getelementptr inbounds i8*, i8** %0, i64 48
%98 = bitcast i8** %97 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 20 to i8*), i8* inttoptr (i64 21 to i8*)>, <2 x i8*>* %98
%99 = getelementptr inbounds i8*, i8** %0, i64 50
%100 = bitcast i8** %99 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 22 to i8*), i8* inttoptr (i64 23 to i8*)>, <2 x i8*>* %100
%101 = getelementptr inbounds i8*, i8** %0, i64 52
%102 = bitcast i8** %101 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 24 to i8*), i8* inttoptr (i64 25 to i8*)>, <2 x i8*>* %102
%103 = getelementptr inbounds i8*, i8** %0, i64 54
%104 = bitcast i8** %103 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 26 to i8*), i8* inttoptr (i64 27 to i8*)>, <2 x i8*>* %104
%105 = getelementptr inbounds i8*, i8** %0, i64 56
%106 = bitcast i8** %105 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 28 to i8*), i8* inttoptr (i64 29 to i8*)>, <2 x i8*>* %106
%107 = getelementptr inbounds i8*, i8** %0, i64 58
%108 = bitcast i8** %107 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 30 to i8*), i8* inttoptr (i64 31 to i8*)>, <2 x i8*>* %108
%109 = getelementptr inbounds i8*, i8** %0, i64 60
%110 = bitcast i8** %109 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 32 to i8*), i8* inttoptr (i64 33 to i8*)>, <2 x i8*>* %110
%111 = getelementptr inbounds i8*, i8** %0, i64 62
%112 = bitcast i8** %111 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 34 to i8*), i8* inttoptr (i64 35 to i8*)>, <2 x i8*>* %112
%113 = getelementptr inbounds i8*, i8** %0, i64 64
%114 = bitcast i8** %113 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 36 to i8*), i8* inttoptr (i64 37 to i8*)>, <2 x i8*>* %114
%115 = getelementptr inbounds i8*, i8** %0, i64 66
%116 = bitcast i8** %115 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 38 to i8*), i8* inttoptr (i64 39 to i8*)>, <2 x i8*>* %116
%117 = getelementptr inbounds i8*, i8** %0, i64 68
%118 = bitcast i8** %117 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 40 to i8*), i8* inttoptr (i64 41 to i8*)>, <2 x i8*>* %118
%119 = getelementptr inbounds i8*, i8** %0, i64 70
%120 = bitcast i8** %119 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 42 to i8*), i8* inttoptr (i64 43 to i8*)>, <2 x i8*>* %120
%121 = getelementptr inbounds i8*, i8** %0, i64 72
%122 = bitcast i8** %121 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 44 to i8*), i8* inttoptr (i64 45 to i8*)>, <2 x i8*>* %122
%123 = getelementptr inbounds i8*, i8** %0, i64 74
%124 = bitcast i8** %123 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 46 to i8*), i8* inttoptr (i64 47 to i8*)>, <2 x i8*>* %124
%125 = getelementptr inbounds i8*, i8** %0, i64 76
%126 = bitcast i8** %125 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 48 to i8*), i8* inttoptr (i64 49 to i8*)>, <2 x i8*>* %126
%127 = getelementptr inbounds i8*, i8** %0, i64 78
%128 = bitcast i8** %127 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 50 to i8*), i8* inttoptr (i64 51 to i8*)>, <2 x i8*>* %128
%129 = getelementptr inbounds i8*, i8** %0, i64 80
%130 = bitcast i8** %129 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 52 to i8*), i8* inttoptr (i64 53 to i8*)>, <2 x i8*>* %130
%131 = getelementptr inbounds i8*, i8** %0, i64 82
%132 = bitcast i8** %131 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 54 to i8*), i8* inttoptr (i64 55 to i8*)>, <2 x i8*>* %132
%133 = getelementptr inbounds i8*, i8** %0, i64 84
%134 = bitcast i8** %133 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 56 to i8*), i8* inttoptr (i64 57 to i8*)>, <2 x i8*>* %134
%135 = getelementptr inbounds i8*, i8** %0, i64 86
%136 = bitcast i8** %135 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 58 to i8*), i8* inttoptr (i64 59 to i8*)>, <2 x i8*>* %136
%137 = getelementptr inbounds i8*, i8** %0, i64 88
%138 = bitcast i8** %137 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 60 to i8*), i8* inttoptr (i64 61 to i8*)>, <2 x i8*>* %138
%139 = getelementptr inbounds i8*, i8** %0, i64 90
%140 = bitcast i8** %139 to <2 x i8*>*
store <2 x i8*> <i8* inttoptr (i64 62 to i8*), i8* inttoptr (i64 63 to i8*)>, <2 x i8*>* %140
ret i32 92
}