#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 */
double M_LOG10E;
double exp(double);
double log(double);
void init_q2p_table(double *p_match, double *p_mismatch, int size) {
  int i;
  for (i = 0; i < size; i++) {
    double a = (i == 0) ? -0.01 : (double)i / -10 * (1.0 / M_LOG10E);
    p_match[i] = log(1 - exp(a));
    p_mismatch[i] = a - (log(3.0));
  }
}


x86 assembly (clang, -O0):
<init_q2p_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1202 <init_q2p_table+0xe2>
cmpl   $0x0,-0x18(%rbp)
jne    1162 <init_q2p_table+0x42>
movsd  0xeb8(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    118f <init_q2p_table+0x6f>
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  0xe99(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe85(%rip),%xmm1
mov    0x2e66(%rip),%rax
divsd  (%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe52(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1040 <log@plt>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe42(%rip),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
subsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113a <init_q2p_table+0x1a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_q2p_table>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
test   %edx,%edx
jle    11d4 <init_q2p_table+0xb4>
mov    %rsi,%r14
mov    %rdi,%r15
movabs $0xc01270cf5c68861a,%rax
70 12 c0
mov    %rax,(%rdi)
movabs $0xbff1bce03d3c5f34,%rax
bc f1 bf
mov    %rax,(%rsi)
cmp    $0x1,%edx
je     11d4 <init_q2p_table+0xb4>
mov    %edx,%r12d
mov    $0x1,%ebx
mov    0x2e7f(%rip),%r13
nopl   0x0(%rax)
xorps  %xmm2,%xmm2
cvtsi2sd %ebx,%xmm2
divsd  0xe81(%rip),%xmm2
movsd  0xe81(%rip),%xmm0
divsd  0x0(%r13),%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <exp@plt>
movsd  0xe64(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1040 <log@plt>
movsd  %xmm0,(%r15,%rbx,8)
movsd  0x8(%rsp),%xmm0
addsd  0xe4b(%rip),%xmm0
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1170 <init_q2p_table+0x50>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@M_LOG10E = global double 0.000000e+00
define void @init_q2p_table(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %9
9: ; preds = %41, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %44
13: ; preds = %9
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
br label %24
17: ; preds = %13
%18 = load i32, i32* %7
%19 = sitofp i32 %18 to double
%20 = fdiv double %19, -1.000000e+01
%21 = load double, double* @M_LOG10E
%22 = fdiv double 1.000000e+00, %21
%23 = fmul double %20, %22
br label %24
24: ; preds = %17, %16
%25 = phi double [ -1.000000e-02, %16 ], [ %23, %17 ]
store double %25, double* %8
%26 = load double, double* %8
%27 = call double @exp(double %26)
%28 = fsub double 1.000000e+00, %27
%29 = call double @log(double %28)
%30 = load double*, double** %4
%31 = load i32, i32* %7
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double, double* %30, i64 %32
store double %29, double* %33
%34 = load double, double* %8
%35 = call double @log(double 3.000000e+00)
%36 = fsub double %34, %35
%37 = load double*, double** %5
%38 = load i32, i32* %7
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %37, i64 %39
store double %36, double* %40
br label %41
41: ; preds = %24
%42 = load i32, i32* %7
%43 = add nsw i32 %42, 1
store i32 %43, i32* %7
br label %9
44: ; preds = %9
ret void
}

LLVM IR (-O2):
@M_LOG10E = global double 0.000000e+00
define void @init_q2p_table(double* nocapture writeonly %0, double* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %24
5: ; preds = %3
%6 = zext i32 %2 to i64
store double 0xC01270CF5C68861A, double* %0
store double 0xBFF1BCE03D3C5F34, double* %1
%7 = icmp eq i32 %2, 1
br i1 %7, label %24, label %8
8: ; preds = %5, %8
%9 = phi i64 [ %22, %8 ], [ 1, %5 ]
%10 = trunc i64 %9 to i32
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, -1.000000e+01
%13 = load double, double* @M_LOG10E
%14 = fdiv double 1.000000e+00, %13
%15 = fmul double %12, %14
%16 = tail call double @exp(double %15)
%17 = fsub double 1.000000e+00, %16
%18 = tail call double @log(double %17)
%19 = getelementptr inbounds double, double* %0, i64 %9
store double %18, double* %19
%20 = fadd double %15, 0xBFF193EA7AAD030B
%21 = getelementptr inbounds double, double* %1, i64 %9
store double %20, double* %21
%22 = add nuw nsw i64 %9, 1
%23 = icmp eq i64 %22, %6
br i1 %23, label %24, label %8
24: ; preds = %8, %5, %3
ret void
}