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

/* Variables and functions */
int /*<<< orphan*/ BuildHuffmanTableFromLengths(int /*<<< orphan*/ *, int,
                                                int *, int);
void InitializeDeflateFixedDistanceCode(uint16_t *table) {
  int lengths[32];
  for (int i = 0; i < 32; i++)
    lengths[i] = 5;
  BuildHuffmanTableFromLengths(table, 15, lengths, 32);
}


x86 assembly (clang, -O0):
<InitializeDeflateFixedDistanceCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x94(%rbp)
cmpl   $0x20,-0x94(%rbp)
jge    115c <InitializeDeflateFixedDistanceCode+0x4c>
movslq -0x94(%rbp),%rax
movl   $0x5,-0x90(%rbp,%rax,4)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1129 <InitializeDeflateFixedDistanceCode+0x19>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rdx
mov    $0xf,%esi
mov    $0x20,%ecx
call   1030 <BuildHuffmanTableFromLengths@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitializeDeflateFixedDistanceCode>:
sub    $0x88,%rsp
movaps 0xee2(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
mov    %rsp,%rdx
mov    $0xf,%esi
mov    $0x20,%ecx
call   1030 <BuildHuffmanTableFromLengths@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define void @InitializeDeflateFixedDistanceCode(i32* %0) {
%2 = alloca i32*
%3 = alloca [32 x i32]
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 32
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 %10
store i32 5, i32* %11
br label %12
12: ; preds = %8
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
br label %5
15: ; preds = %5
%16 = load i32*, i32** %2
%17 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%18 = call i32 @BuildHuffmanTableFromLengths(i32* %16, i32 15, i32* %17, i32 32)
ret void
}

LLVM IR (-O2):
define void @InitializeDeflateFixedDistanceCode(i32* %0) {
%2 = alloca [32 x i32]
%3 = bitcast [32 x i32]* %2 to i8*
%4 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 0
%5 = bitcast [32 x i32]* %2 to <4 x i32>*
store <4 x i32> <i32 5, i32 5, i32 5, i32 5>, <4 x i32>* %5
%6 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 4
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> <i32 5, i32 5, i32 5, i32 5>, <4 x i32>* %7
%8 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 8
%9 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 5, i32 5, i32 5, i32 5>, <4 x i32>* %9
%10 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 12
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> <i32 5, i32 5, i32 5, i32 5>, <4 x i32>* %11
%12 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 16
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> <i32 5, i32 5, i32 5, i32 5>, <4 x i32>* %13
%14 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 20
%15 = bitcast i32* %14 to <4 x i32>*
store <4 x i32> <i32 5, i32 5, i32 5, i32 5>, <4 x i32>* %15
%16 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 24
%17 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> <i32 5, i32 5, i32 5, i32 5>, <4 x i32>* %17
%18 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 28
%19 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> <i32 5, i32 5, i32 5, i32 5>, <4 x i32>* %19
%20 = call i32 @BuildHuffmanTableFromLengths(i32* %0, i32 15, i32* %4, i32 32)
ret void
}