#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 uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t cctools_htonll(uint64_t hostlonglong) {
  uint64_t out = 0;
  uint8_t *d = (uint8_t *)&out;
  d[7] = hostlonglong >> 0;
  d[6] = hostlonglong >> 8;
  d[5] = hostlonglong >> 16;
  d[4] = hostlonglong >> 24;
  d[3] = hostlonglong >> 32;
  d[2] = hostlonglong >> 40;
  d[1] = hostlonglong >> 48;
  d[0] = hostlonglong >> 56;
  return out;
}


x86 assembly (clang, -O0):
<cctools_htonll>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x0,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x1c(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x4(%rbp),%eax
mov    $0x28,%ecx
sar    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x4(%rbp),%eax
mov    $0x30,%ecx
sar    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%eax
mov    $0x38,%ecx
sar    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cctools_htonll>:
ret

LLVM IR (-O0):
define i32 @cctools_htonll(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %2
store i32 0, i32* %3
store i32* %3, i32** %4
%5 = load i32, i32* %2
%6 = ashr i32 %5, 0
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 7
store i32 %6, i32* %8
%9 = load i32, i32* %2
%10 = ashr i32 %9, 8
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 6
store i32 %10, i32* %12
%13 = load i32, i32* %2
%14 = ashr i32 %13, 16
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 5
store i32 %14, i32* %16
%17 = load i32, i32* %2
%18 = ashr i32 %17, 24
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i64 4
store i32 %18, i32* %20
%21 = load i32, i32* %2
%22 = ashr i32 %21, 32
%23 = load i32*, i32** %4
%24 = getelementptr inbounds i32, i32* %23, i64 3
store i32 %22, i32* %24
%25 = load i32, i32* %2
%26 = ashr i32 %25, 40
%27 = load i32*, i32** %4
%28 = getelementptr inbounds i32, i32* %27, i64 2
store i32 %26, i32* %28
%29 = load i32, i32* %2
%30 = ashr i32 %29, 48
%31 = load i32*, i32** %4
%32 = getelementptr inbounds i32, i32* %31, i64 1
store i32 %30, i32* %32
%33 = load i32, i32* %2
%34 = ashr i32 %33, 56
%35 = load i32*, i32** %4
%36 = getelementptr inbounds i32, i32* %35, i64 0
store i32 %34, i32* %36
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
define i32 @cctools_htonll(i32 %0) {
ret i32 poison
}