#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 int8_t;
typedef int int64_t;

/* Variables and functions */
void st_i64_le(void *x, int64_t i) {
  ((((((int8_t *)x)[7]) = ((i >> 32 >> 16) >> 8) % 256,
     (((uint8_t *)x)[6]) = ((i >> 32 >> 16) % 256)),
    ((((uint8_t *)x)[5]) = ((i >> 32) >> 8) % 256,
     (((uint8_t *)x)[4]) = ((i >> 32) % 256))),
   (((((uint8_t *)x)[3]) = ((i >> 16) >> 8) % 256,
     (((uint8_t *)x)[2]) = ((i >> 16) % 256)),
    ((((uint8_t *)x)[1]) = ((i) >> 8) % 256,
     (((uint8_t *)x)[0]) = ((i) % 256))));
}


x86 assembly (clang, -O0):
<st_i64_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
sar    $0x10,%eax
sar    $0x8,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    %edx,0x1c(%rax)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
sar    $0x10,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    %edx,0x18(%rax)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
sar    $0x8,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    %edx,0x14(%rax)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    %edx,0x10(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
sar    $0x8,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    %edx,0xc(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    %edx,0x8(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    %edx,0x4(%rax)
mov    -0xc(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_i64_le>:
mov    %esi,%eax
shr    $0x10,%eax
mov    %esi,%ecx
sar    $0x18,%ecx
lea    0xff(%rax),%edx
test   %ax,%ax
cmovns %eax,%edx
mov    %ecx,0xc(%rdi)
and    $0xffffff00,%edx
sub    %edx,%eax
cwtl
mov    %eax,0x8(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
lea    0xff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
lea    0xff(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
mov    %eax,0x4(%rdi)
and    $0xffffff00,%ecx
sub    %ecx,%esi
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @st_i64_le(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = lshr i32 %1, 16
%5 = ashr i32 %1, 24
%6 = getelementptr inbounds i8, i8* %0, i64 12
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
%8 = trunc i32 %4 to i16
%9 = srem i16 %8, 256
%10 = sext i16 %9 to i32
%11 = getelementptr inbounds i8, i8* %0, i64 8
%12 = bitcast i8* %11 to i32*
store i32 %10, i32* %12
%13 = ashr i32 %1, 8
%14 = srem i32 %13, 256
%15 = getelementptr inbounds i8, i8* %0, i64 4
%16 = bitcast i8* %15 to i32*
store i32 %14, i32* %16
%17 = srem i32 %1, 256
store i32 %17, i32* %3
ret void
}