#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 *malloc(int);
float *make_profile2(float *prof, int *seq, int len, float **subm) {
  int i, j, c;
  prof = malloc(sizeof(float) * (len + 1) * 64);
  prof += (64 * len);
  for (i = 0; i < 64; i++) {
    prof[i] = 0;
  }
  prof[55] = 1;
  i = len;
  while (i--) {
    prof -= 64;
    for (j = 0; j < 64; j++) {
      prof[j] = 0;
    }
    c = seq[i];
    prof[c] += 1;
    prof += 32;
    for (j = 23; j--;) {
      prof[j] = subm[c][j];
    }
    prof[23] = 1;
    prof -= 32;
  }
  return prof;
}


x86 assembly (clang, -O0):
<make_profile2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
shl    $0x6,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%ecx
shl    $0x6,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x40,-0x24(%rbp)
jge    1189 <make_profile2+0x79>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1161 <make_profile2+0x51>
mov    -0x8(%rbp),%rax
movss  0xe6b(%rip),%xmm0
movss  %xmm0,0xdc(%rax)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x24(%rbp)
cmp    $0x0,%eax
je     128e <make_profile2+0x17e>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffff00,%rax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x40,-0x28(%rbp)
jge    11f4 <make_profile2+0xe4>
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11cc <make_profile2+0xbc>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movss  0xdee(%rip),%xmm0
addss  (%rax,%rcx,4),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x8(%rbp)
movl   $0x17,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x28(%rbp)
cmp    $0x0,%eax
je     126c <make_profile2+0x15c>
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
jmp    1231 <make_profile2+0x121>
mov    -0x8(%rbp),%rax
movss  0xd88(%rip),%xmm0
movss  %xmm0,0x5c(%rax)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffff80,%rax
mov    %rax,-0x8(%rbp)
jmp    11a3 <make_profile2+0x93>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_profile2>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %edx,%edi
shl    $0x8,%edi
add    $0x100,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    %ebp,%eax
shl    $0x6,%eax
movslq %eax,%rdx
lea    (%rcx,%rdx,4),%rax
xorps  %xmm0,%xmm0
movups %xmm0,0xd0(%rcx,%rdx,4)
movups %xmm0,(%rcx,%rdx,4)
movups %xmm0,0x10(%rcx,%rdx,4)
movups %xmm0,0x20(%rcx,%rdx,4)
movups %xmm0,0x30(%rcx,%rdx,4)
movups %xmm0,0x40(%rcx,%rdx,4)
movups %xmm0,0x50(%rcx,%rdx,4)
movups %xmm0,0x60(%rcx,%rdx,4)
movups %xmm0,0x70(%rcx,%rdx,4)
movups %xmm0,0x80(%rcx,%rdx,4)
movups %xmm0,0x90(%rcx,%rdx,4)
movups %xmm0,0xa0(%rcx,%rdx,4)
movups %xmm0,0xb0(%rcx,%rdx,4)
movups %xmm0,0xc0(%rcx,%rdx,4)
movups %xmm0,0xe0(%rcx,%rdx,4)
movups %xmm0,0xf0(%rcx,%rdx,4)
movl   $0x3f800000,0xdc(%rcx,%rdx,4)
test   %ebp,%ebp
je     12c0 <make_profile2+0x1b0>
movslq %ebp,%rdx
mov    %ebp,%ecx
lea    (%r14,%rdx,4),%rdx
add    $0xfffffffffffffffc,%rdx
shl    $0x8,%rcx
xor    %esi,%esi
movss  0xe2d(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movups %xmm0,-0x10(%rax,%rsi,1)
movups %xmm0,-0x20(%rax,%rsi,1)
movups %xmm0,-0x30(%rax,%rsi,1)
movups %xmm0,-0x40(%rax,%rsi,1)
movups %xmm0,-0x50(%rax,%rsi,1)
movups %xmm0,-0x60(%rax,%rsi,1)
movups %xmm0,-0x70(%rax,%rsi,1)
movups %xmm0,-0x80(%rax,%rsi,1)
movups %xmm0,-0x90(%rax,%rsi,1)
ff
movups %xmm0,-0xa0(%rax,%rsi,1)
ff
movups %xmm0,-0xb0(%rax,%rsi,1)
ff
movups %xmm0,-0xc0(%rax,%rsi,1)
ff
movups %xmm0,-0xd0(%rax,%rsi,1)
ff
movups %xmm0,-0xe0(%rax,%rsi,1)
ff
movups %xmm0,-0xf0(%rax,%rsi,1)
ff
movups %xmm0,-0x100(%rax,%rsi,1)
ff
movslq (%rdx),%rdi
lea    (%rax,%rdi,4),%rbp
movss  -0x100(%rsi,%rbp,1),%xmm2
ff ff
addss  %xmm1,%xmm2
movss  %xmm2,-0x100(%rsi,%rbp,1)
ff ff
mov    (%rbx,%rdi,8),%rdi
movups 0x4c(%rdi),%xmm2
movups %xmm2,-0x34(%rax,%rsi,1)
movups 0x40(%rdi),%xmm2
movups %xmm2,-0x40(%rax,%rsi,1)
movups (%rdi),%xmm2
movups 0x10(%rdi),%xmm3
movups 0x20(%rdi),%xmm4
movups 0x30(%rdi),%xmm5
movups %xmm5,-0x50(%rax,%rsi,1)
movups %xmm4,-0x60(%rax,%rsi,1)
movups %xmm3,-0x70(%rax,%rsi,1)
movups %xmm2,-0x80(%rax,%rsi,1)
movl   $0x3f800000,-0x24(%rax,%rsi,1)
3f
add    $0xfffffffffffffffc,%rdx
add    $0xffffffffffffff00,%rsi
mov    %rcx,%rdi
add    %rsi,%rdi
jne    11e0 <make_profile2+0xd0>
add    %rsi,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias float* @make_profile2(float* nocapture readnone %0, i32* nocapture %1, i32 %2, float** nocapture %3) {
%5 = shl i32 %2, 8
%6 = add i32 %5, 256
%7 = tail call float* @malloc(i32 %6)
%8 = shl nsw i32 %2, 6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds float, float* %7, i64 %9
%11 = bitcast float* %10 to i8*
%12 = getelementptr inbounds float, float* %10, i64 55
store float 1.000000e+00, float* %12
%13 = icmp eq i32 %2, 0
br i1 %13, label %44, label %14
14: ; preds = %4
%15 = add nsw i64 %9, -64
%16 = add nsw i64 %9, -32
%17 = sext i32 %2 to i64
%18 = zext i32 %2 to i64
br label %19
19: ; preds = %14, %19
%20 = phi i64 [ %17, %14 ], [ %30, %19 ]
%21 = phi i64 [ 0, %14 ], [ %42, %19 ]
%22 = phi float* [ %10, %14 ], [ %31, %19 ]
%23 = mul nsw i64 %21, -64
%24 = add nsw i64 %16, %23
%25 = getelementptr float, float* %7, i64 %24
%26 = bitcast float* %25 to i8*
%27 = add nsw i64 %15, %23
%28 = getelementptr float, float* %7, i64 %27
%29 = bitcast float* %28 to i8*
%30 = add nsw i64 %20, -1
%31 = getelementptr inbounds float, float* %22, i64 -64
%32 = getelementptr inbounds i32, i32* %1, i64 %30
%33 = load i32, i32* %32
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds float, float* %31, i64 %34
%36 = load float, float* %35
%37 = fadd float %36, 1.000000e+00
store float %37, float* %35
%38 = getelementptr inbounds float*, float** %3, i64 %34
%39 = bitcast float** %38 to i8**
%40 = load i8*, i8** %39
%41 = getelementptr inbounds float, float* %22, i64 -9
store float 1.000000e+00, float* %41
%42 = add nuw nsw i64 %21, 1
%43 = icmp eq i64 %42, %18
br i1 %43, label %44, label %19
44: ; preds = %19, %4
%45 = phi float* [ %10, %4 ], [ %31, %19 ]
ret float* %45
}