#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 */
int /*<<< orphan*/ qround(unsigned int *, int, int, int, int);
int /*<<< orphan*/ store32(unsigned char *, unsigned int);
void core(unsigned char out[64], const unsigned int in[16]) {
  unsigned int x[16];
  int i;
  for (i = 0; i < 16; ++i) {
    x[i] = in[i];
  }
  for (i = 0; i < 10; ++i) {
    qround(x, 0, 4, 8, 12);
    qround(x, 1, 5, 9, 13);
    qround(x, 2, 6, 10, 14);
    qround(x, 3, 7, 11, 15);
    qround(x, 0, 5, 10, 15);
    qround(x, 1, 6, 11, 12);
    qround(x, 2, 7, 8, 13);
    qround(x, 3, 4, 9, 14);
  }
  for (i = 0; i < 16; ++i) {
    x[i] = x[i] + in[i];
  }
  for (i = 0; i < 16; ++i) {
    store32(out + (4 * i), x[i]);
  }
}


x86 assembly (clang, -O0):
<core>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x54(%rbp)
cmpl   $0x10,-0x54(%rbp)
jge    1162 <core+0x42>
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0x54(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1137 <core+0x17>
movl   $0x0,-0x54(%rbp)
cmpl   $0xa,-0x54(%rbp)
jge    126b <core+0x14b>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
mov    $0x8,%ecx
mov    $0xc,%r8d
call   1040 <qround@plt>
lea    -0x50(%rbp),%rdi
mov    $0x1,%esi
mov    $0x5,%edx
mov    $0x9,%ecx
mov    $0xd,%r8d
call   1040 <qround@plt>
lea    -0x50(%rbp),%rdi
mov    $0x2,%esi
mov    $0x6,%edx
mov    $0xa,%ecx
mov    $0xe,%r8d
call   1040 <qround@plt>
lea    -0x50(%rbp),%rdi
mov    $0x3,%esi
mov    $0x7,%edx
mov    $0xb,%ecx
mov    $0xf,%r8d
call   1040 <qround@plt>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
mov    $0xa,%ecx
mov    $0xf,%r8d
call   1040 <qround@plt>
lea    -0x50(%rbp),%rdi
mov    $0x1,%esi
mov    $0x6,%edx
mov    $0xb,%ecx
mov    $0xc,%r8d
call   1040 <qround@plt>
lea    -0x50(%rbp),%rdi
mov    $0x2,%esi
mov    $0x7,%edx
mov    $0x8,%ecx
mov    $0xd,%r8d
call   1040 <qround@plt>
lea    -0x50(%rbp),%rdi
mov    $0x3,%esi
mov    $0x4,%edx
mov    $0x9,%ecx
mov    $0xe,%r8d
call   1040 <qround@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1169 <core+0x49>
movl   $0x0,-0x54(%rbp)
cmpl   $0x10,-0x54(%rbp)
jge    12a5 <core+0x185>
movslq -0x54(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%ecx
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rdx
add    (%rax,%rdx,4),%ecx
movslq -0x54(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1272 <core+0x152>
movl   $0x0,-0x54(%rbp)
cmpl   $0x10,-0x54(%rbp)
jge    12e0 <core+0x1c0>
mov    -0x8(%rbp),%rdi
mov    -0x54(%rbp),%eax
shl    $0x2,%eax
cltq
add    %rax,%rdi
movslq -0x54(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%esi
call   1030 <store32@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    12ac <core+0x18c>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<core>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
movups (%rsi),%xmm0
movups 0x10(%rsi),%xmm1
movups 0x20(%rsi),%xmm2
movups 0x30(%rsi),%xmm3
movaps %xmm3,0x30(%rsp)
movaps %xmm2,0x20(%rsp)
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    $0xa,%ebp
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
mov    $0x8,%ecx
mov    $0xc,%r8d
call   1040 <qround@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x5,%edx
mov    $0x9,%ecx
mov    $0xd,%r8d
call   1040 <qround@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x6,%edx
mov    $0xa,%ecx
mov    $0xe,%r8d
call   1040 <qround@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x7,%edx
mov    $0xb,%ecx
mov    $0xf,%r8d
call   1040 <qround@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
mov    $0xa,%ecx
mov    $0xf,%r8d
call   1040 <qround@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x6,%edx
mov    $0xb,%ecx
mov    $0xc,%r8d
call   1040 <qround@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x7,%edx
mov    $0x8,%ecx
mov    $0xd,%r8d
call   1040 <qround@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x4,%edx
mov    $0x9,%ecx
mov    $0xe,%r8d
call   1040 <qround@plt>
add    $0xffffffff,%ebp
jne    1160 <core+0x40>
movdqu (%r14),%xmm0
paddd  (%rsp),%xmm0
movdqa %xmm0,(%rsp)
movdqu 0x10(%r14),%xmm1
paddd  0x10(%rsp),%xmm1
movdqa %xmm1,0x10(%rsp)
movdqu 0x20(%r14),%xmm1
paddd  0x20(%rsp),%xmm1
movdqa %xmm1,0x20(%rsp)
movdqu 0x30(%r14),%xmm1
paddd  0x30(%rsp),%xmm1
movdqa %xmm1,0x30(%rsp)
movd   %xmm0,%esi
mov    %r15,%rdi
call   1030 <store32@plt>
lea    0x4(%r15),%rdi
mov    0x4(%rsp),%esi
call   1030 <store32@plt>
lea    0x8(%r15),%rdi
mov    0x8(%rsp),%esi
call   1030 <store32@plt>
lea    0xc(%r15),%rdi
mov    0xc(%rsp),%esi
call   1030 <store32@plt>
lea    0x10(%r15),%rdi
mov    0x10(%rsp),%esi
call   1030 <store32@plt>
lea    0x14(%r15),%rdi
mov    0x14(%rsp),%esi
call   1030 <store32@plt>
lea    0x18(%r15),%rdi
mov    0x18(%rsp),%esi
call   1030 <store32@plt>
lea    0x1c(%r15),%rdi
mov    0x1c(%rsp),%esi
call   1030 <store32@plt>
lea    0x20(%r15),%rdi
mov    0x20(%rsp),%esi
call   1030 <store32@plt>
lea    0x24(%r15),%rdi
mov    0x24(%rsp),%esi
call   1030 <store32@plt>
lea    0x28(%r15),%rdi
mov    0x28(%rsp),%esi
call   1030 <store32@plt>
lea    0x2c(%r15),%rdi
mov    0x2c(%rsp),%esi
call   1030 <store32@plt>
lea    0x30(%r15),%rdi
mov    0x30(%rsp),%esi
call   1030 <store32@plt>
lea    0x34(%r15),%rdi
mov    0x34(%rsp),%esi
call   1030 <store32@plt>
lea    0x38(%r15),%rdi
mov    0x38(%rsp),%esi
call   1030 <store32@plt>
add    $0x3c,%r15
mov    0x3c(%rsp),%esi
mov    %r15,%rdi
call   1030 <store32@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @core(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca [16 x i32]
%6 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 16
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = load i32*, i32** %4
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 %17
store i32 %15, i32* %18
br label %19
19: ; preds = %10
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
store i32 0, i32* %6
br label %23
23: ; preds = %43, %22
%24 = load i32, i32* %6
%25 = icmp slt i32 %24, 10
br i1 %25, label %26, label %46
26: ; preds = %23
%27 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 0
%28 = call i32 @qround(i32* %27, i32 0, i32 4, i32 8, i32 12)
%29 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 0
%30 = call i32 @qround(i32* %29, i32 1, i32 5, i32 9, i32 13)
%31 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 0
%32 = call i32 @qround(i32* %31, i32 2, i32 6, i32 10, i32 14)
%33 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 0
%34 = call i32 @qround(i32* %33, i32 3, i32 7, i32 11, i32 15)
%35 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 0
%36 = call i32 @qround(i32* %35, i32 0, i32 5, i32 10, i32 15)
%37 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 0
%38 = call i32 @qround(i32* %37, i32 1, i32 6, i32 11, i32 12)
%39 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 0
%40 = call i32 @qround(i32* %39, i32 2, i32 7, i32 8, i32 13)
%41 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 0
%42 = call i32 @qround(i32* %41, i32 3, i32 4, i32 9, i32 14)
br label %43
43: ; preds = %26
%44 = load i32, i32* %6
%45 = add nsw i32 %44, 1
store i32 %45, i32* %6
br label %23
46: ; preds = %23
store i32 0, i32* %6
br label %47
47: ; preds = %64, %46
%48 = load i32, i32* %6
%49 = icmp slt i32 %48, 16
br i1 %49, label %50, label %67
50: ; preds = %47
%51 = load i32, i32* %6
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 %52
%54 = load i32, i32* %53
%55 = load i32*, i32** %4
%56 = load i32, i32* %6
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i32, i32* %55, i64 %57
%59 = load i32, i32* %58
%60 = add i32 %54, %59
%61 = load i32, i32* %6
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 %62
store i32 %60, i32* %63
br label %64
64: ; preds = %50
%65 = load i32, i32* %6
%66 = add nsw i32 %65, 1
store i32 %66, i32* %6
br label %47
67: ; preds = %47
store i32 0, i32* %6
br label %68
68: ; preds = %82, %67
%69 = load i32, i32* %6
%70 = icmp slt i32 %69, 16
br i1 %70, label %71, label %85
71: ; preds = %68
%72 = load i8*, i8** %3
%73 = load i32, i32* %6
%74 = mul nsw i32 4, %73
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8, i8* %72, i64 %75
%77 = load i32, i32* %6
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 %78
%80 = load i32, i32* %79
%81 = call i32 @store32(i8* %76, i32 %80)
br label %82
82: ; preds = %71
%83 = load i32, i32* %6
%84 = add nsw i32 %83, 1
store i32 %84, i32* %6
br label %68
85: ; preds = %68
ret void
}

LLVM IR (-O2):
define void @core(i8* %0, i32* nocapture %1) {
%3 = bitcast i32* %1 to i8*
%4 = alloca [16 x i32]
%5 = bitcast [16 x i32]* %4 to i8*
%6 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 0
br label %7
7: ; preds = %2, %7
%8 = phi i32 [ 0, %2 ], [ %17, %7 ]
%9 = call i32 @qround(i32* %6, i32 0, i32 4, i32 8, i32 12)
%10 = call i32 @qround(i32* %6, i32 1, i32 5, i32 9, i32 13)
%11 = call i32 @qround(i32* %6, i32 2, i32 6, i32 10, i32 14)
%12 = call i32 @qround(i32* %6, i32 3, i32 7, i32 11, i32 15)
%13 = call i32 @qround(i32* %6, i32 0, i32 5, i32 10, i32 15)
%14 = call i32 @qround(i32* %6, i32 1, i32 6, i32 11, i32 12)
%15 = call i32 @qround(i32* %6, i32 2, i32 7, i32 8, i32 13)
%16 = call i32 @qround(i32* %6, i32 3, i32 4, i32 9, i32 14)
%17 = add nuw nsw i32 %8, 1
%18 = icmp eq i32 %17, 10
br i1 %18, label %19, label %7
19: ; preds = %7
%20 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 1
%21 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 2
%22 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 3
%23 = bitcast [16 x i32]* %4 to <4 x i32>*
%24 = load <4 x i32>, <4 x i32>* %23
%25 = bitcast i32* %1 to <4 x i32>*
%26 = load <4 x i32>, <4 x i32>* %25
%27 = add <4 x i32> %26, %24
%28 = bitcast [16 x i32]* %4 to <4 x i32>*
store <4 x i32> %27, <4 x i32>* %28
%29 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 4
%30 = getelementptr inbounds i32, i32* %1, i64 4
%31 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 5
%32 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 6
%33 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 7
%34 = bitcast i32* %29 to <4 x i32>*
%35 = load <4 x i32>, <4 x i32>* %34
%36 = bitcast i32* %30 to <4 x i32>*
%37 = load <4 x i32>, <4 x i32>* %36
%38 = add <4 x i32> %37, %35
%39 = bitcast i32* %29 to <4 x i32>*
store <4 x i32> %38, <4 x i32>* %39
%40 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 8
%41 = getelementptr inbounds i32, i32* %1, i64 8
%42 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 9
%43 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 10
%44 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 11
%45 = bitcast i32* %40 to <4 x i32>*
%46 = load <4 x i32>, <4 x i32>* %45
%47 = bitcast i32* %41 to <4 x i32>*
%48 = load <4 x i32>, <4 x i32>* %47
%49 = add <4 x i32> %48, %46
%50 = bitcast i32* %40 to <4 x i32>*
store <4 x i32> %49, <4 x i32>* %50
%51 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 12
%52 = getelementptr inbounds i32, i32* %1, i64 12
%53 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 13
%54 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 14
%55 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 15
%56 = bitcast i32* %51 to <4 x i32>*
%57 = load <4 x i32>, <4 x i32>* %56
%58 = bitcast i32* %52 to <4 x i32>*
%59 = load <4 x i32>, <4 x i32>* %58
%60 = add <4 x i32> %59, %57
%61 = bitcast i32* %51 to <4 x i32>*
store <4 x i32> %60, <4 x i32>* %61
%62 = extractelement <4 x i32> %27, i64 0
%63 = call i32 @store32(i8* %0, i32 %62)
%64 = getelementptr inbounds i8, i8* %0, i64 4
%65 = load i32, i32* %20
%66 = call i32 @store32(i8* %64, i32 %65)
%67 = getelementptr inbounds i8, i8* %0, i64 8
%68 = load i32, i32* %21
%69 = call i32 @store32(i8* %67, i32 %68)
%70 = getelementptr inbounds i8, i8* %0, i64 12
%71 = load i32, i32* %22
%72 = call i32 @store32(i8* %70, i32 %71)
%73 = getelementptr inbounds i8, i8* %0, i64 16
%74 = load i32, i32* %29
%75 = call i32 @store32(i8* %73, i32 %74)
%76 = getelementptr inbounds i8, i8* %0, i64 20
%77 = load i32, i32* %31
%78 = call i32 @store32(i8* %76, i32 %77)
%79 = getelementptr inbounds i8, i8* %0, i64 24
%80 = load i32, i32* %32
%81 = call i32 @store32(i8* %79, i32 %80)
%82 = getelementptr inbounds i8, i8* %0, i64 28
%83 = load i32, i32* %33
%84 = call i32 @store32(i8* %82, i32 %83)
%85 = getelementptr inbounds i8, i8* %0, i64 32
%86 = load i32, i32* %40
%87 = call i32 @store32(i8* %85, i32 %86)
%88 = getelementptr inbounds i8, i8* %0, i64 36
%89 = load i32, i32* %42
%90 = call i32 @store32(i8* %88, i32 %89)
%91 = getelementptr inbounds i8, i8* %0, i64 40
%92 = load i32, i32* %43
%93 = call i32 @store32(i8* %91, i32 %92)
%94 = getelementptr inbounds i8, i8* %0, i64 44
%95 = load i32, i32* %44
%96 = call i32 @store32(i8* %94, i32 %95)
%97 = getelementptr inbounds i8, i8* %0, i64 48
%98 = load i32, i32* %51
%99 = call i32 @store32(i8* %97, i32 %98)
%100 = getelementptr inbounds i8, i8* %0, i64 52
%101 = load i32, i32* %53
%102 = call i32 @store32(i8* %100, i32 %101)
%103 = getelementptr inbounds i8, i8* %0, i64 56
%104 = load i32, i32* %54
%105 = call i32 @store32(i8* %103, i32 %104)
%106 = getelementptr inbounds i8, i8* %0, i64 60
%107 = load i32, i32* %55
%108 = call i32 @store32(i8* %106, i32 %107)
ret void
}