#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 uint16_t;

/* Variables and functions */
int /*<<< orphan*/ lwe_key_round(int *, int, int);
int /*<<< orphan*/ lwe_pack(unsigned char *, int, int *, int, int);
void lwe_round2(unsigned char *out, uint16_t *in) {
  lwe_key_round(in, 8 * 8, 15 - 4);
  int i;
  for (i = 0; i < 8 * 8; i++)
    in[i] >>= 15 - 4;
  lwe_pack(out, 256 / 8, in, 8 * 8, 4);
}


x86 assembly (clang, -O0):
<lwe_round2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x40,%esi
mov    $0xb,%edx
call   1030 <lwe_key_round@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    1173 <lwe_round2+0x53>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
sar    $0xb,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114a <lwe_round2+0x2a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x20,%esi
mov    $0x40,%ecx
mov    $0x4,%r8d
call   1040 <lwe_pack@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lwe_round2>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    $0x40,%esi
mov    $0xb,%edx
call   1030 <lwe_key_round@plt>
movdqu (%rbx),%xmm0
movdqu 0x10(%rbx),%xmm1
movdqu 0x20(%rbx),%xmm2
movdqu 0x30(%rbx),%xmm3
psrad  $0xb,%xmm0
movdqu %xmm0,(%rbx)
psrad  $0xb,%xmm1
movdqu %xmm1,0x10(%rbx)
psrad  $0xb,%xmm2
movdqu %xmm2,0x20(%rbx)
psrad  $0xb,%xmm3
movdqu %xmm3,0x30(%rbx)
movdqu 0x40(%rbx),%xmm0
psrad  $0xb,%xmm0
movdqu %xmm0,0x40(%rbx)
movdqu 0x50(%rbx),%xmm0
psrad  $0xb,%xmm0
movdqu %xmm0,0x50(%rbx)
movdqu 0x60(%rbx),%xmm0
psrad  $0xb,%xmm0
movdqu %xmm0,0x60(%rbx)
movdqu 0x70(%rbx),%xmm0
psrad  $0xb,%xmm0
movdqu %xmm0,0x70(%rbx)
movdqu 0x80(%rbx),%xmm0
psrad  $0xb,%xmm0
movdqu %xmm0,0x80(%rbx)
movdqu 0x90(%rbx),%xmm0
psrad  $0xb,%xmm0
movdqu %xmm0,0x90(%rbx)
movdqu 0xa0(%rbx),%xmm0
psrad  $0xb,%xmm0
movdqu %xmm0,0xa0(%rbx)
movdqu 0xb0(%rbx),%xmm0
psrad  $0xb,%xmm0
movdqu %xmm0,0xb0(%rbx)
movdqu 0xc0(%rbx),%xmm0
psrad  $0xb,%xmm0
movdqu %xmm0,0xc0(%rbx)
movdqu 0xd0(%rbx),%xmm0
psrad  $0xb,%xmm0
movdqu %xmm0,0xd0(%rbx)
movdqu 0xe0(%rbx),%xmm0
psrad  $0xb,%xmm0
movdqu %xmm0,0xe0(%rbx)
movdqu 0xf0(%rbx),%xmm0
psrad  $0xb,%xmm0
movdqu %xmm0,0xf0(%rbx)
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
mov    $0x40,%ecx
mov    $0x4,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <lwe_pack@plt>

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

LLVM IR (-O2):
define void @lwe_round2(i8* %0, i32* %1) {
%3 = tail call i32 @lwe_key_round(i32* %1, i32 64, i32 11)
%4 = bitcast i32* %1 to <4 x i32>*
%5 = load <4 x i32>, <4 x i32>* %4
%6 = ashr <4 x i32> %5, <i32 11, i32 11, i32 11, i32 11>
%7 = bitcast i32* %1 to <4 x i32>*
store <4 x i32> %6, <4 x i32>* %7
%8 = getelementptr inbounds i32, i32* %1, i64 4
%9 = bitcast i32* %8 to <4 x i32>*
%10 = load <4 x i32>, <4 x i32>* %9
%11 = ashr <4 x i32> %10, <i32 11, i32 11, i32 11, i32 11>
%12 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> %11, <4 x i32>* %12
%13 = getelementptr inbounds i32, i32* %1, i64 8
%14 = bitcast i32* %13 to <4 x i32>*
%15 = load <4 x i32>, <4 x i32>* %14
%16 = ashr <4 x i32> %15, <i32 11, i32 11, i32 11, i32 11>
%17 = bitcast i32* %13 to <4 x i32>*
store <4 x i32> %16, <4 x i32>* %17
%18 = getelementptr inbounds i32, i32* %1, i64 12
%19 = bitcast i32* %18 to <4 x i32>*
%20 = load <4 x i32>, <4 x i32>* %19
%21 = ashr <4 x i32> %20, <i32 11, i32 11, i32 11, i32 11>
%22 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> %21, <4 x i32>* %22
%23 = getelementptr inbounds i32, i32* %1, i64 16
%24 = bitcast i32* %23 to <4 x i32>*
%25 = load <4 x i32>, <4 x i32>* %24
%26 = ashr <4 x i32> %25, <i32 11, i32 11, i32 11, i32 11>
%27 = bitcast i32* %23 to <4 x i32>*
store <4 x i32> %26, <4 x i32>* %27
%28 = getelementptr inbounds i32, i32* %1, i64 20
%29 = bitcast i32* %28 to <4 x i32>*
%30 = load <4 x i32>, <4 x i32>* %29
%31 = ashr <4 x i32> %30, <i32 11, i32 11, i32 11, i32 11>
%32 = bitcast i32* %28 to <4 x i32>*
store <4 x i32> %31, <4 x i32>* %32
%33 = getelementptr inbounds i32, i32* %1, i64 24
%34 = bitcast i32* %33 to <4 x i32>*
%35 = load <4 x i32>, <4 x i32>* %34
%36 = ashr <4 x i32> %35, <i32 11, i32 11, i32 11, i32 11>
%37 = bitcast i32* %33 to <4 x i32>*
store <4 x i32> %36, <4 x i32>* %37
%38 = getelementptr inbounds i32, i32* %1, i64 28
%39 = bitcast i32* %38 to <4 x i32>*
%40 = load <4 x i32>, <4 x i32>* %39
%41 = ashr <4 x i32> %40, <i32 11, i32 11, i32 11, i32 11>
%42 = bitcast i32* %38 to <4 x i32>*
store <4 x i32> %41, <4 x i32>* %42
%43 = getelementptr inbounds i32, i32* %1, i64 32
%44 = bitcast i32* %43 to <4 x i32>*
%45 = load <4 x i32>, <4 x i32>* %44
%46 = ashr <4 x i32> %45, <i32 11, i32 11, i32 11, i32 11>
%47 = bitcast i32* %43 to <4 x i32>*
store <4 x i32> %46, <4 x i32>* %47
%48 = getelementptr inbounds i32, i32* %1, i64 36
%49 = bitcast i32* %48 to <4 x i32>*
%50 = load <4 x i32>, <4 x i32>* %49
%51 = ashr <4 x i32> %50, <i32 11, i32 11, i32 11, i32 11>
%52 = bitcast i32* %48 to <4 x i32>*
store <4 x i32> %51, <4 x i32>* %52
%53 = getelementptr inbounds i32, i32* %1, i64 40
%54 = bitcast i32* %53 to <4 x i32>*
%55 = load <4 x i32>, <4 x i32>* %54
%56 = ashr <4 x i32> %55, <i32 11, i32 11, i32 11, i32 11>
%57 = bitcast i32* %53 to <4 x i32>*
store <4 x i32> %56, <4 x i32>* %57
%58 = getelementptr inbounds i32, i32* %1, i64 44
%59 = bitcast i32* %58 to <4 x i32>*
%60 = load <4 x i32>, <4 x i32>* %59
%61 = ashr <4 x i32> %60, <i32 11, i32 11, i32 11, i32 11>
%62 = bitcast i32* %58 to <4 x i32>*
store <4 x i32> %61, <4 x i32>* %62
%63 = getelementptr inbounds i32, i32* %1, i64 48
%64 = bitcast i32* %63 to <4 x i32>*
%65 = load <4 x i32>, <4 x i32>* %64
%66 = ashr <4 x i32> %65, <i32 11, i32 11, i32 11, i32 11>
%67 = bitcast i32* %63 to <4 x i32>*
store <4 x i32> %66, <4 x i32>* %67
%68 = getelementptr inbounds i32, i32* %1, i64 52
%69 = bitcast i32* %68 to <4 x i32>*
%70 = load <4 x i32>, <4 x i32>* %69
%71 = ashr <4 x i32> %70, <i32 11, i32 11, i32 11, i32 11>
%72 = bitcast i32* %68 to <4 x i32>*
store <4 x i32> %71, <4 x i32>* %72
%73 = getelementptr inbounds i32, i32* %1, i64 56
%74 = bitcast i32* %73 to <4 x i32>*
%75 = load <4 x i32>, <4 x i32>* %74
%76 = ashr <4 x i32> %75, <i32 11, i32 11, i32 11, i32 11>
%77 = bitcast i32* %73 to <4 x i32>*
store <4 x i32> %76, <4 x i32>* %77
%78 = getelementptr inbounds i32, i32* %1, i64 60
%79 = bitcast i32* %78 to <4 x i32>*
%80 = load <4 x i32>, <4 x i32>* %79
%81 = ashr <4 x i32> %80, <i32 11, i32 11, i32 11, i32 11>
%82 = bitcast i32* %78 to <4 x i32>*
store <4 x i32> %81, <4 x i32>* %82
%83 = tail call i32 @lwe_pack(i8* %0, i32 32, i32* %1, i32 64, i32 4)
ret void
}