#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 */
float getEncodeMap(int *, char *);
int /*<<< orphan*/ printf(char *, float, ...);
int main(int argc, char *argv[]) {
  int encodeMap[16] = {0};
  float ratio = getEncodeMap(encodeMap, argv[1]);
  int i = 0;
  for (i = 0; i < 16; i++) {
    printf("%x: %x\n", i, encodeMap[i]);
  }
  printf("Compressed ratio: %f%%\n", ratio);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1040 <memset@plt>
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1050 <getEncodeMap@plt>
movss  %xmm0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0x0,-0x58(%rbp)
cmpl   $0x10,-0x58(%rbp)
jge    11ad <main+0x7d>
cvtsi2ssl -0x58(%rbp),%xmm0
movslq -0x58(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%esi
lea    0xe68(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    117a <main+0x4a>
movss  -0x54(%rbp),%xmm0
lea    0xe4f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
mov    0x8(%rsi),%rsi
lea    0x10(%rsp),%rdi
call   1040 <getEncodeMap@plt>
movss  %xmm0,0xc(%rsp)
mov    0x10(%rsp),%esi
lea    0xee1(%rip),%rbx
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
movss  0xe8c(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x18(%rsp),%esi
movss  0xe7a(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x1c(%rsp),%esi
movss  0xe68(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x20(%rsp),%esi
movss  0xe56(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x24(%rsp),%esi
movss  0xe44(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x28(%rsp),%esi
movss  0xe32(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2c(%rsp),%esi
movss  0xe20(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x30(%rsp),%esi
movss  0xe0e(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x34(%rsp),%esi
movss  0xdfc(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x38(%rsp),%esi
movss  0xdea(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x3c(%rsp),%esi
movss  0xdd8(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x40(%rsp),%esi
movss  0xdc6(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x44(%rsp),%esi
movss  0xdb4(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x48(%rsp),%esi
movss  0xda2(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x4c(%rsp),%esi
movss  0xd90(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xd8b(%rip),%rdi
movss  0xc(%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%x: %x\0A\00"
@.str.1 = [24 x i8] c"Compressed ratio: %f%%\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i32]
%7 = alloca float
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [16 x i32]* %6 to i8*
%10 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 0
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call float @getEncodeMap(i32* %10, i8* %13)
store float %14, float* %7
store i32 0, i32* %8
store i32 0, i32* %8
br label %15
15: ; preds = %26, %2
%16 = load i32, i32* %8
%17 = icmp slt i32 %16, 16
br i1 %17, label %18, label %29
18: ; preds = %15
%19 = load i32, i32* %8
%20 = sitofp i32 %19 to float
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %20, i32 %24)
br label %26
26: ; preds = %18
%27 = load i32, i32* %8
%28 = add nsw i32 %27, 1
store i32 %28, i32* %8
br label %15
29: ; preds = %15
%30 = load float, float* %7
%31 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), float %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%x: %x\0A\00"
@.str.1 = [24 x i8] c"Compressed ratio: %f%%\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [16 x i32]
%4 = bitcast [16 x i32]* %3 to i8*
%5 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = call float @getEncodeMap(i32* %5, i8* %7)
%9 = load i32, i32* %5
%10 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 0.000000e+00, i32 %9)
%11 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 1
%12 = load i32, i32* %11
%13 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 1.000000e+00, i32 %12)
%14 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 2
%15 = load i32, i32* %14
%16 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 2.000000e+00, i32 %15)
%17 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 3
%18 = load i32, i32* %17
%19 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 3.000000e+00, i32 %18)
%20 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 4
%21 = load i32, i32* %20
%22 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 4.000000e+00, i32 %21)
%23 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 5
%24 = load i32, i32* %23
%25 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 5.000000e+00, i32 %24)
%26 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 6
%27 = load i32, i32* %26
%28 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 6.000000e+00, i32 %27)
%29 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 7
%30 = load i32, i32* %29
%31 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 7.000000e+00, i32 %30)
%32 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 8
%33 = load i32, i32* %32
%34 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 8.000000e+00, i32 %33)
%35 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 9
%36 = load i32, i32* %35
%37 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 9.000000e+00, i32 %36)
%38 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 10
%39 = load i32, i32* %38
%40 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 1.000000e+01, i32 %39)
%41 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 11
%42 = load i32, i32* %41
%43 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 1.100000e+01, i32 %42)
%44 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 12
%45 = load i32, i32* %44
%46 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 1.200000e+01, i32 %45)
%47 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 13
%48 = load i32, i32* %47
%49 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 1.300000e+01, i32 %48)
%50 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 14
%51 = load i32, i32* %50
%52 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 1.400000e+01, i32 %51)
%53 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 15
%54 = load i32, i32* %53
%55 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 1.500000e+01, i32 %54)
%56 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), float %8)
ret i32 0
}