void send_packet(const unsigned char *buf, unsigned int len) {
  int i;
  unsigned long crc;
  for (i = 0; i < len; i++)
    ((volatile unsigned char *)((((((((((0xf0000000)) + (4 * 1024 * 1024)) +
                                      (4 * 1024 * 1024)) +
                                     (4 * 1024 * 1024)) +
                                    (4 * 1024 * 1024)) +
                                   (4 * 1024 * 1024)) +
                                  (4 * 1024 * 1024)) +
                                 (4 * 1024 * 1024)) +
                                2048))[i] = buf[i];
  *((volatile unsigned int *)((
      (((((((((0xf0000000)) + (4 * 1024 * 1024)) + (4 * 1024 * 1024)) +
           (4 * 1024 * 1024)) +
          (4 * 1024 * 1024)) +
         (4 * 1024 * 1024)) +
        (4 * 1024 * 1024)) +
       (4 * 1024 * 1024)) +
      12))) = len;
  *((volatile unsigned int *)((
      (((((((((0xf0000000)) + (4 * 1024 * 1024)) + (4 * 1024 * 1024)) +
           (4 * 1024 * 1024)) +
          (4 * 1024 * 1024)) +
         (4 * 1024 * 1024)) +
        (4 * 1024 * 1024)) +
       (4 * 1024 * 1024)) +
      8))) = 1;
}


x86 assembly (clang, -O0):
<send_packet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1143 <send_packet+0x43>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
movslq -0x10(%rbp),%rcx
mov    $0xf1c00800,%eax
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <send_packet+0x12>
mov    -0xc(%rbp),%ecx
mov    $0xf1c0000c,%eax
mov    %ecx,(%rax)
mov    $0xf1c00008,%eax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_packet>:
mov    $0xf1c00803,%r10d
test   %esi,%esi
je     1190 <send_packet+0x90>
mov    %esi,%r9d
lea    -0x1(%r9),%rcx
mov    %r9d,%r8d
and    $0x3,%r8d
cmp    $0x3,%rcx
jae    1126 <send_packet+0x26>
xor    %ecx,%ecx
jmp    115f <send_packet+0x5f>
and    $0xfffffffc,%r9d
xor    %ecx,%ecx
nopl   0x0(%rax)
movzbl (%rdi,%rcx,1),%edx
mov    %dl,-0x3(%r10,%rcx,1)
movzbl 0x1(%rdi,%rcx,1),%edx
mov    %dl,-0x2(%r10,%rcx,1)
movzbl 0x2(%rdi,%rcx,1),%edx
mov    %dl,-0x1(%r10,%rcx,1)
movzbl 0x3(%rdi,%rcx,1),%edx
mov    %dl,(%r10,%rcx,1)
add    $0x4,%rcx
cmp    %rcx,%r9
jne    1130 <send_packet+0x30>
test   %r8,%r8
je     1190 <send_packet+0x90>
lea    (%r10,%rcx,1),%rdx
add    $0xfffffffffffffffd,%rdx
add    %rcx,%rdi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rcx,1),%eax
mov    %al,(%rdx,%rcx,1)
add    $0x1,%rcx
cmp    %rcx,%r8
jne    1180 <send_packet+0x80>
mov    %esi,-0x7f7(%r10)
movl   $0x1,-0x7fb(%r10)
ret

LLVM IR (-O0):
define void @send_packet(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %20, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp ult i32 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* inttoptr (i64 4055894016 to i8*), i64 %18
store volatile i8 %16, i8* %19
br label %20
20: ; preds = %11
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %7
23: ; preds = %7
%24 = load i32, i32* %4
store volatile i32 %24, i32* inttoptr (i64 4055891980 to i32*)
store volatile i32 1, i32* inttoptr (i64 4055891976 to i32*)
ret void
}

LLVM IR (-O2):
define void @send_packet(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %44, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = add nsw i64 %5, -1
%7 = and i64 %5, 3
%8 = icmp ult i64 %6, 3
br i1 %8, label %32, label %9
9: ; preds = %4
%10 = and i64 %5, 4294967292
br label %11
11: ; preds = %11, %9
%12 = phi i64 [ 0, %9 ], [ %29, %11 ]
%13 = phi i64 [ 0, %9 ], [ %30, %11 ]
%14 = getelementptr inbounds i8, i8* %0, i64 %12
%15 = load i8, i8* %14
%16 = getelementptr inbounds i8, i8* inttoptr (i64 4055894016 to i8*), i64 %12
store volatile i8 %15, i8* %16
%17 = or i64 %12, 1
%18 = getelementptr inbounds i8, i8* %0, i64 %17
%19 = load i8, i8* %18
%20 = getelementptr inbounds i8, i8* inttoptr (i64 4055894016 to i8*), i64 %17
store volatile i8 %19, i8* %20
%21 = or i64 %12, 2
%22 = getelementptr inbounds i8, i8* %0, i64 %21
%23 = load i8, i8* %22
%24 = getelementptr inbounds i8, i8* inttoptr (i64 4055894016 to i8*), i64 %21
store volatile i8 %23, i8* %24
%25 = or i64 %12, 3
%26 = getelementptr inbounds i8, i8* %0, i64 %25
%27 = load i8, i8* %26
%28 = getelementptr inbounds i8, i8* inttoptr (i64 4055894016 to i8*), i64 %25
store volatile i8 %27, i8* %28
%29 = add nuw nsw i64 %12, 4
%30 = add i64 %13, 4
%31 = icmp eq i64 %30, %10
br i1 %31, label %32, label %11
32: ; preds = %11, %4
%33 = phi i64 [ 0, %4 ], [ %29, %11 ]
%34 = icmp eq i64 %7, 0
br i1 %34, label %44, label %35
35: ; preds = %32, %35
%36 = phi i64 [ %41, %35 ], [ %33, %32 ]
%37 = phi i64 [ %42, %35 ], [ 0, %32 ]
%38 = getelementptr inbounds i8, i8* %0, i64 %36
%39 = load i8, i8* %38
%40 = getelementptr inbounds i8, i8* inttoptr (i64 4055894016 to i8*), i64 %36
store volatile i8 %39, i8* %40
%41 = add nuw nsw i64 %36, 1
%42 = add i64 %37, 1
%43 = icmp eq i64 %42, %7
br i1 %43, label %44, label %35
44: ; preds = %32, %35, %2
store volatile i32 %1, i32* inttoptr (i64 4055891980 to i32*)
store volatile i32 1, i32* inttoptr (i64 4055891976 to i32*)
ret void
}