#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 /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ u32t8le(int /*<<< orphan*/, int /*<<< orphan*/ *);
void chacha20_serialize(uint32_t in[16], uint8_t output[64]) {
  int i;
  for (i = 0; i < 16; i++) {
    u32t8le(in[i], output + (i << 2));
  }
}


x86 assembly (clang, -O0):
<chacha20_serialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    1162 <chacha20_serialize+0x52>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x2,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
call   1030 <u32t8le@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <chacha20_serialize+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chacha20_serialize>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rdi),%edi
call   1030 <u32t8le@plt>
mov    0x4(%r14),%edi
lea    0x10(%rbx),%rsi
call   1030 <u32t8le@plt>
mov    0x8(%r14),%edi
lea    0x20(%rbx),%rsi
call   1030 <u32t8le@plt>
mov    0xc(%r14),%edi
lea    0x30(%rbx),%rsi
call   1030 <u32t8le@plt>
mov    0x10(%r14),%edi
lea    0x40(%rbx),%rsi
call   1030 <u32t8le@plt>
mov    0x14(%r14),%edi
lea    0x50(%rbx),%rsi
call   1030 <u32t8le@plt>
mov    0x18(%r14),%edi
lea    0x60(%rbx),%rsi
call   1030 <u32t8le@plt>
mov    0x1c(%r14),%edi
lea    0x70(%rbx),%rsi
call   1030 <u32t8le@plt>
mov    0x20(%r14),%edi
lea    0x80(%rbx),%rsi
call   1030 <u32t8le@plt>
mov    0x24(%r14),%edi
lea    0x90(%rbx),%rsi
call   1030 <u32t8le@plt>
mov    0x28(%r14),%edi
lea    0xa0(%rbx),%rsi
call   1030 <u32t8le@plt>
mov    0x2c(%r14),%edi
lea    0xb0(%rbx),%rsi
call   1030 <u32t8le@plt>
mov    0x30(%r14),%edi
lea    0xc0(%rbx),%rsi
call   1030 <u32t8le@plt>
mov    0x34(%r14),%edi
lea    0xd0(%rbx),%rsi
call   1030 <u32t8le@plt>
mov    0x38(%r14),%edi
lea    0xe0(%rbx),%rsi
call   1030 <u32t8le@plt>
mov    0x3c(%r14),%edi
add    $0xf0,%rbx
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <u32t8le@plt>

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

LLVM IR (-O2):
define void @chacha20_serialize(i32* nocapture %0, i32* %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @u32t8le(i32 %3, i32* %1)
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %1, i64 4
%8 = tail call i32 @u32t8le(i32 %6, i32* %7)
%9 = getelementptr inbounds i32, i32* %0, i64 2
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %1, i64 8
%12 = tail call i32 @u32t8le(i32 %10, i32* %11)
%13 = getelementptr inbounds i32, i32* %0, i64 3
%14 = load i32, i32* %13
%15 = getelementptr inbounds i32, i32* %1, i64 12
%16 = tail call i32 @u32t8le(i32 %14, i32* %15)
%17 = getelementptr inbounds i32, i32* %0, i64 4
%18 = load i32, i32* %17
%19 = getelementptr inbounds i32, i32* %1, i64 16
%20 = tail call i32 @u32t8le(i32 %18, i32* %19)
%21 = getelementptr inbounds i32, i32* %0, i64 5
%22 = load i32, i32* %21
%23 = getelementptr inbounds i32, i32* %1, i64 20
%24 = tail call i32 @u32t8le(i32 %22, i32* %23)
%25 = getelementptr inbounds i32, i32* %0, i64 6
%26 = load i32, i32* %25
%27 = getelementptr inbounds i32, i32* %1, i64 24
%28 = tail call i32 @u32t8le(i32 %26, i32* %27)
%29 = getelementptr inbounds i32, i32* %0, i64 7
%30 = load i32, i32* %29
%31 = getelementptr inbounds i32, i32* %1, i64 28
%32 = tail call i32 @u32t8le(i32 %30, i32* %31)
%33 = getelementptr inbounds i32, i32* %0, i64 8
%34 = load i32, i32* %33
%35 = getelementptr inbounds i32, i32* %1, i64 32
%36 = tail call i32 @u32t8le(i32 %34, i32* %35)
%37 = getelementptr inbounds i32, i32* %0, i64 9
%38 = load i32, i32* %37
%39 = getelementptr inbounds i32, i32* %1, i64 36
%40 = tail call i32 @u32t8le(i32 %38, i32* %39)
%41 = getelementptr inbounds i32, i32* %0, i64 10
%42 = load i32, i32* %41
%43 = getelementptr inbounds i32, i32* %1, i64 40
%44 = tail call i32 @u32t8le(i32 %42, i32* %43)
%45 = getelementptr inbounds i32, i32* %0, i64 11
%46 = load i32, i32* %45
%47 = getelementptr inbounds i32, i32* %1, i64 44
%48 = tail call i32 @u32t8le(i32 %46, i32* %47)
%49 = getelementptr inbounds i32, i32* %0, i64 12
%50 = load i32, i32* %49
%51 = getelementptr inbounds i32, i32* %1, i64 48
%52 = tail call i32 @u32t8le(i32 %50, i32* %51)
%53 = getelementptr inbounds i32, i32* %0, i64 13
%54 = load i32, i32* %53
%55 = getelementptr inbounds i32, i32* %1, i64 52
%56 = tail call i32 @u32t8le(i32 %54, i32* %55)
%57 = getelementptr inbounds i32, i32* %0, i64 14
%58 = load i32, i32* %57
%59 = getelementptr inbounds i32, i32* %1, i64 56
%60 = tail call i32 @u32t8le(i32 %58, i32* %59)
%61 = getelementptr inbounds i32, i32* %0, i64 15
%62 = load i32, i32* %61
%63 = getelementptr inbounds i32, i32* %1, i64 60
%64 = tail call i32 @u32t8le(i32 %62, i32* %63)
ret void
}