#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_hints(int *, int, int, unsigned char const *);
int /*<<< orphan*/ lwe_pack(unsigned char *, int, int *, int, int);
void lwe_reconcile(unsigned char *out, uint16_t *w, const unsigned char *hint) {
  lwe_key_round_hints(w, 8 * 8, 15 - 4, hint);
  int i;
  for (i = 0; i < 8 * 8; i++) {
    w[i] >>= 15 - 4;
  }
  lwe_pack(out, 256 / 8, w, 8 * 8, 4);
}


x86 assembly (clang, -O0):
<lwe_reconcile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x40,%esi
mov    $0xb,%edx
call   1040 <lwe_key_round_hints@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x40,-0x1c(%rbp)
jge    117b <lwe_reconcile+0x5b>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
sar    $0xb,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1152 <lwe_reconcile+0x32>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x20,%esi
mov    $0x40,%ecx
mov    $0x4,%r8d
call   1030 <lwe_pack@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lwe_reconcile>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    $0x40,%esi
mov    $0xb,%edx
call   1040 <lwe_key_round_hints@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    1030 <lwe_pack@plt>

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

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