#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 */

/* Variables and functions */
long sw64(long);
void init_frec(char *data, long id, long start, long count) {
  *((long *)(&data[id * 32 + 0])) = sw64(id);
  *((long *)(&data[id * 32 + 8])) = sw64(start);
  *((long *)(&data[id * 32 + 16])) = sw64(count);
}


x86 assembly (clang, -O0):
<init_frec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sw64@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x5,%rcx
mov    %rdx,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
call   1030 <sw64@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x5,%rcx
mov    %rdx,0x8(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
call   1030 <sw64@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x5,%rcx
mov    %rdx,0x10(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_frec>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
mov    %rsi,%rdi
call   1030 <sw64@plt>
shl    $0x5,%rbx
mov    %rax,(%r12,%rbx,1)
mov    %r15,%rdi
call   1030 <sw64@plt>
mov    %rax,0x8(%r12,%rbx,1)
mov    %r14,%rdi
call   1030 <sw64@plt>
mov    %rax,0x10(%r12,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @init_frec(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %6
%10 = call i64 @sw64(i64 %9)
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = mul nsw i64 %12, 32
%14 = add nsw i64 %13, 0
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = bitcast i8* %15 to i64*
store i64 %10, i64* %16
%17 = load i64, i64* %7
%18 = call i64 @sw64(i64 %17)
%19 = load i8*, i8** %5
%20 = load i64, i64* %6
%21 = mul nsw i64 %20, 32
%22 = add nsw i64 %21, 8
%23 = getelementptr inbounds i8, i8* %19, i64 %22
%24 = bitcast i8* %23 to i64*
store i64 %18, i64* %24
%25 = load i64, i64* %8
%26 = call i64 @sw64(i64 %25)
%27 = load i8*, i8** %5
%28 = load i64, i64* %6
%29 = mul nsw i64 %28, 32
%30 = add nsw i64 %29, 16
%31 = getelementptr inbounds i8, i8* %27, i64 %30
%32 = bitcast i8* %31 to i64*
store i64 %26, i64* %32
ret void
}

LLVM IR (-O2):
define void @init_frec(i8* nocapture writeonly %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 @sw64(i64 %1)
%6 = shl nsw i64 %1, 5
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = bitcast i8* %7 to i64*
store i64 %5, i64* %8
%9 = tail call i64 @sw64(i64 %2)
%10 = or i64 %6, 8
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = bitcast i8* %11 to i64*
store i64 %9, i64* %12
%13 = tail call i64 @sw64(i64 %3)
%14 = or i64 %6, 16
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = bitcast i8* %15 to i64*
store i64 %13, i64* %16
ret void
}