#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 */
long double pow(double, unsigned long);
void calc_score_dist(int mxdlen, long double d, long double **dist) {
  unsigned long i, scr2;
  for (i = 1; i <= mxdlen; i++) {
    for (scr2 = mxdlen; scr2 <= mxdlen + 10; scr2++) {
    }
    dist[i][scr2] *= pow(1.0 / d, i);
  }
}


x86 assembly (clang, -O0):
<calc_score_dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
mov    %edi,-0x4(%rbp)
fstpt  -0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movq   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmp    %rcx,%rax
ja     11b7 <calc_score_dist+0xa7>
movslq -0x4(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0xa,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
ja     1172 <calc_score_dist+0x62>
jmp    1161 <calc_score_dist+0x51>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1146 <calc_score_dist+0x36>
fldt   -0x20(%rbp)
fld1
fdivp  %st,%st(1)
fstpl  -0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x30(%rbp),%rdi
call   1030 <pow@plt>
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x38(%rbp),%rcx
shl    $0x4,%rcx
fldt   (%rax,%rcx,1)
fmulp  %st,%st(1)
fstpt  (%rax,%rcx,1)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    112d <calc_score_dist+0x1d>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_score_dist>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
fldt   0x40(%rsp)
test   %edi,%edi
je     1189 <calc_score_dist+0x79>
mov    %rsi,%r14
movslq %edi,%r15
fld1
fdivp  %st,%st(1)
lea    0xb(%r15),%r12
cmp    %r15,%r12
cmovbe %r15,%r12
fstpl  0x10(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%ebx
shl    $0x4,%r12
fldz
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
fstp   %st(0)
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <pow@plt>
mov    (%r14,%rbx,8),%rax
fldt   (%rax,%r12,1)
fmulp  %st,%st(1)
fstpt  (%rax,%r12,1)
add    $0x1,%rbx
cmp    %r15,%rbx
fldz
jbe    1160 <calc_score_dist+0x50>
fstp   %st(0)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @calc_score_dist(i32 %0, x86_fp80 %1, x86_fp80** %2) {
%4 = alloca i32
%5 = alloca x86_fp80
%6 = alloca x86_fp80**
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %4
store x86_fp80 %1, x86_fp80* %5
store x86_fp80** %2, x86_fp80*** %6
store i64 1, i64* %7
br label %9
9: ; preds = %41, %3
%10 = load i64, i64* %7
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = icmp ule i64 %10, %12
br i1 %13, label %14, label %44
14: ; preds = %9
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
store i64 %16, i64* %8
br label %17
17: ; preds = %24, %14
%18 = load i64, i64* %8
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 10
%21 = sext i32 %20 to i64
%22 = icmp ule i64 %18, %21
br i1 %22, label %23, label %27
23: ; preds = %17
br label %24
24: ; preds = %23
%25 = load i64, i64* %8
%26 = add i64 %25, 1
store i64 %26, i64* %8
br label %17
27: ; preds = %17
%28 = load x86_fp80, x86_fp80* %5
%29 = fdiv x86_fp80 0xK3FFF8000000000000000, %28
%30 = fptrunc x86_fp80 %29 to double
%31 = load i64, i64* %7
%32 = call x86_fp80 @pow(double %30, i64 %31)
%33 = load x86_fp80**, x86_fp80*** %6
%34 = load i64, i64* %7
%35 = getelementptr inbounds x86_fp80*, x86_fp80** %33, i64 %34
%36 = load x86_fp80*, x86_fp80** %35
%37 = load i64, i64* %8
%38 = getelementptr inbounds x86_fp80, x86_fp80* %36, i64 %37
%39 = load x86_fp80, x86_fp80* %38
%40 = fmul x86_fp80 %39, %32
store x86_fp80 %40, x86_fp80* %38
br label %41
41: ; preds = %27
%42 = load i64, i64* %7
%43 = add i64 %42, 1
store i64 %43, i64* %7
br label %9
44: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @calc_score_dist(i32 %0, x86_fp80 %1, x86_fp80** nocapture %2) {
%4 = sext i32 %0 to i64
%5 = icmp eq i32 %0, 0
br i1 %5, label %22, label %6
6: ; preds = %3
%7 = fdiv x86_fp80 0xK3FFF8000000000000000, %1
%8 = fptrunc x86_fp80 %7 to double
%9 = sext i32 %0 to i64
%10 = add nsw i64 %9, 11
%11 = call i64 @llvm.umax.i64(i64 %10, i64 %4)
br label %12
12: ; preds = %6, %12
%13 = phi i64 [ 1, %6 ], [ %20, %12 ]
%14 = tail call x86_fp80 @pow(double %8, i64 %13)
%15 = getelementptr inbounds x86_fp80*, x86_fp80** %2, i64 %13
%16 = load x86_fp80*, x86_fp80** %15
%17 = getelementptr inbounds x86_fp80, x86_fp80* %16, i64 %11
%18 = load x86_fp80, x86_fp80* %17
%19 = fmul x86_fp80 %14, %18
store x86_fp80 %19, x86_fp80* %17
%20 = add i64 %13, 1
%21 = icmp ugt i64 %20, %4
br i1 %21, label %22, label %12
22: ; preds = %12, %3
ret void
}