int match(len1, len2)
int len1, len2;
{
  double z, pd, mean;
  double c = 1;
  double s2 = 6.8;
  if (len1 == 0 && len2 == 0)
    return (0);
  if (len1 < 0 || len2 < 0)
    return (0);
  mean = (len1 + len2 / c) / 2;
  z = (c * len1 - len2) / sqrt(s2 * mean);
  if (z < 0)
    z = -z;
  pd = 2 * (1 - pnorm(z));
  if (pd > 0)
    return ((int)(-100 * log(pd)));
  else
    return (2500);
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xead(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1178 <match+0x48>
cmpl   $0x0,-0xc(%rbp)
jne    1178 <match+0x48>
movl   $0x0,-0x4(%rbp)
jmp    129d <match+0x16d>
cmpl   $0x0,-0x8(%rbp)
jl     118c <match+0x5c>
cmpl   $0x0,-0xc(%rbp)
jge    1198 <match+0x68>
movl   $0x0,-0x4(%rbp)
jmp    129d <match+0x16d>
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  -0x30(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe5d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm2
cvtsi2sdl -0xc(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    123e <match+0x10e>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
call   1030 <pnorm@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1296 <match+0x166>
movsd  -0x20(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  0xd92(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    129d <match+0x16d>
movl   $0x9c4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
sub    $0x18,%rsp
mov    %esi,%eax
or     %edi,%eax
jle    116e <match+0x3e>
cvtsi2sd %edi,%xmm2
cvtsi2sd %esi,%xmm1
movapd %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xeae(%rip),%xmm0
mulsd  0xeae(%rip),%xmm0
subsd  %xmm1,%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
jb     1175 <match+0x45>
sqrtsd %xmm0,%xmm0
jmp    1188 <match+0x58>
xor    %eax,%eax
add    $0x18,%rsp
ret
movapd %xmm2,(%rsp)
call   1050 <sqrt@plt>
xorpd  %xmm3,%xmm3
movapd (%rsp),%xmm2
divsd  %xmm0,%xmm2
movapd 0xe8c(%rip),%xmm1
xorpd  %xmm2,%xmm1
movapd %xmm2,%xmm0
cmpltsd %xmm3,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
mov    $0x1,%al
call   1030 <pnorm@plt>
add    %eax,%eax
mov    $0x2,%ecx
sub    %eax,%ecx
test   %ecx,%ecx
jle    11de <match+0xae>
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
call   1040 <log@plt>
mulsd  0xe3b(%rip),%xmm0
cvttsd2si %xmm0,%eax
add    $0x18,%rsp
ret
mov    $0x9c4,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @match(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double 1.000000e+00, double* %9
store double 6.800000e+00, double* %10
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 0, i32* %3
br label %64
17: ; preds = %13, %2
%18 = load i32, i32* %4
%19 = icmp slt i32 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load i32, i32* %5
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %20, %17
store i32 0, i32* %3
br label %64
24: ; preds = %20
%25 = load i32, i32* %4
%26 = sitofp i32 %25 to double
%27 = load i32, i32* %5
%28 = sitofp i32 %27 to double
%29 = load double, double* %9
%30 = fdiv double %28, %29
%31 = fadd double %26, %30
%32 = fdiv double %31, 2.000000e+00
store double %32, double* %8
%33 = load double, double* %9
%34 = load i32, i32* %4
%35 = sitofp i32 %34 to double
%36 = load i32, i32* %5
%37 = sitofp i32 %36 to double
%38 = fneg double %37
%39 = call double @llvm.fmuladd.f64(double %33, double %35, double %38)
%40 = load double, double* %10
%41 = load double, double* %8
%42 = fmul double %40, %41
%43 = call double @sqrt(double %42)
%44 = fdiv double %39, %43
store double %44, double* %6
%45 = load double, double* %6
%46 = fcmp olt double %45, 0.000000e+00
br i1 %46, label %47, label %50
47: ; preds = %24
%48 = load double, double* %6
%49 = fneg double %48
store double %49, double* %6
br label %50
50: ; preds = %47, %24
%51 = load double, double* %6
%52 = call i32 (double, ...) bitcast (i32 (...)* @pnorm to i32 (double, ...)*)(double %51)
%53 = sub nsw i32 1, %52
%54 = mul nsw i32 2, %53
%55 = sitofp i32 %54 to double
store double %55, double* %7
%56 = load double, double* %7
%57 = fcmp ogt double %56, 0.000000e+00
br i1 %57, label %58, label %63
58: ; preds = %50
%59 = load double, double* %7
%60 = call double @log(double %59)
%61 = fmul double -1.000000e+02, %60
%62 = fptosi double %61 to i32
store i32 %62, i32* %3
br label %64
63: ; preds = %50
store i32 2500, i32* %3
br label %64
64: ; preds = %63, %58, %23, %16
%65 = load i32, i32* %3
ret i32 %65
}

LLVM IR (-O2):
define i32 @match(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %26
5: ; preds = %2
%6 = sitofp i32 %0 to double
%7 = sitofp i32 %1 to double
%8 = fadd double %6, %7
%9 = fmul double %8, 5.000000e-01
%10 = fsub double %6, %7
%11 = fmul double %9, 6.800000e+00
%12 = tail call double @sqrt(double %11)
%13 = fdiv double %10, %12
%14 = fcmp olt double %13, 0.000000e+00
%15 = fneg double %13
%16 = select i1 %14, double %15, double %13
%17 = tail call i32 (double, ...) bitcast (i32 (...)* @pnorm to i32 (double, ...)*)(double %16)
%18 = mul i32 %17, -2
%19 = add i32 %18, 2
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %5
%22 = sitofp i32 %19 to double
%23 = tail call double @log(double %22)
%24 = fmul double %23, -1.000000e+02
%25 = fptosi double %24 to i32
br label %26
26: ; preds = %5, %2, %21
%27 = phi i32 [ %25, %21 ], [ 0, %2 ], [ 2500, %5 ]
ret i32 %27
}