#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 sqrt(double);
void rectifying_similarities_from_affine_fundamental_matrix(float s1[3],
                                                            float s2[3],
                                                            double f[5]) {
  double c = f[0];
  double d = f[1];
  double a = f[2];
  double b = f[3];
  double e = f[4];
  double r = sqrt(a * a + b * b);
  double s = sqrt(c * c + d * d);
  double z = sqrt(r / s);
  double t = 0.5 * e / sqrt(r * s);
  s1[0] = (float)(z * b / r);
  s1[1] = (float)(z * a / r);
  s1[2] = (float)t;
  double zz = 1 / z;
  s2[0] = (float)(zz * -d / s);
  s2[1] = (float)(zz * -c / s);
  s2[2] = -t;
}


x86 assembly (clang, -O0):
<rectifying_similarities_from_affine_fundamental_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  0xe37(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movsd  -0x60(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
movsd  0xdb4(%rip),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x50(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movsd  -0x68(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x50(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rectifying_similarities_from_affine_fundamental_matrix>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rdx),%xmm0
movaps %xmm0,0x40(%rsp)
movsd  0x8(%rdx),%xmm0
movaps %xmm0,0x30(%rsp)
movsd  0x10(%rdx),%xmm0
movsd  0x18(%rdx),%xmm1
movsd  0x20(%rdx),%xmm2
movsd  %xmm1,0x20(%rsp)
mulsd  %xmm1,%xmm1
movsd  %xmm0,0x28(%rsp)
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm0
movsd  %xmm2,(%rsp)
jb     116c <rectifying_similarities_from_affine_fundamental_matrix+0x5c>
sqrtsd %xmm0,%xmm3
jmp    1179 <rectifying_similarities_from_affine_fundamental_matrix+0x69>
call   1030 <sqrt@plt>
xorpd  %xmm4,%xmm4
movapd %xmm0,%xmm3
movapd 0x30(%rsp),%xmm1
mulsd  %xmm1,%xmm1
movapd 0x40(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ucomisd %xmm4,%xmm0
movsd  %xmm3,0x8(%rsp)
jb     11a6 <rectifying_similarities_from_affine_fundamental_matrix+0x96>
xorps  %xmm4,%xmm4
sqrtsd %xmm0,%xmm4
jmp    11b5 <rectifying_similarities_from_affine_fundamental_matrix+0xa5>
call   1030 <sqrt@plt>
movsd  0x8(%rsp),%xmm3
movapd %xmm0,%xmm4
movapd %xmm3,%xmm0
divsd  %xmm4,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  %xmm4,0x10(%rsp)
jb     11d3 <rectifying_similarities_from_affine_fundamental_matrix+0xc3>
sqrtsd %xmm0,%xmm5
jmp    11ec <rectifying_similarities_from_affine_fundamental_matrix+0xdc>
call   1030 <sqrt@plt>
xorpd  %xmm1,%xmm1
movsd  0x10(%rsp),%xmm4
movsd  0x8(%rsp),%xmm3
movapd %xmm0,%xmm5
movsd  (%rsp),%xmm2
mulsd  0xe07(%rip),%xmm2
movapd %xmm3,%xmm0
mulsd  %xmm4,%xmm0
ucomisd %xmm1,%xmm0
jb     120d <rectifying_similarities_from_affine_fundamental_matrix+0xfd>
sqrtsd %xmm0,%xmm0
jmp    1234 <rectifying_similarities_from_affine_fundamental_matrix+0x124>
movsd  %xmm2,(%rsp)
movsd  %xmm5,0x18(%rsp)
call   1030 <sqrt@plt>
movsd  0x18(%rsp),%xmm5
movsd  0x10(%rsp),%xmm4
movsd  0x8(%rsp),%xmm3
movsd  (%rsp),%xmm2
movsd  0x20(%rsp),%xmm1
mulsd  %xmm5,%xmm1
divsd  %xmm3,%xmm1
cvtsd2ss %xmm1,%xmm1
divsd  %xmm0,%xmm2
movss  %xmm1,(%rbx)
movsd  0x28(%rsp),%xmm0
mulsd  %xmm5,%xmm0
divsd  %xmm3,%xmm0
cvtsd2ss %xmm0,%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
movss  %xmm0,0x4(%rbx)
movss  %xmm1,0x8(%rbx)
movsd  0xd8f(%rip),%xmm0
divsd  %xmm5,%xmm0
movapd 0xd8b(%rip),%xmm2
movapd 0x30(%rsp),%xmm3
xorpd  %xmm2,%xmm3
mulsd  %xmm0,%xmm3
divsd  %xmm4,%xmm3
cvtsd2ss %xmm3,%xmm3
movss  %xmm3,(%r14)
movapd 0x40(%rsp),%xmm3
xorpd  %xmm2,%xmm3
mulsd  %xmm0,%xmm3
divsd  %xmm4,%xmm3
xorps  %xmm0,%xmm0
cvtsd2ss %xmm3,%xmm0
movss  %xmm0,0x4(%r14)
xorps  0xd5a(%rip),%xmm1
movss  %xmm1,0x8(%r14)
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @rectifying_similarities_from_affine_fundamental_matrix(float* %0, float* %1, double* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
store float* %0, float** %4
store float* %1, float** %5
store double* %2, double** %6
%17 = load double*, double** %6
%18 = getelementptr inbounds double, double* %17, i64 0
%19 = load double, double* %18
store double %19, double* %7
%20 = load double*, double** %6
%21 = getelementptr inbounds double, double* %20, i64 1
%22 = load double, double* %21
store double %22, double* %8
%23 = load double*, double** %6
%24 = getelementptr inbounds double, double* %23, i64 2
%25 = load double, double* %24
store double %25, double* %9
%26 = load double*, double** %6
%27 = getelementptr inbounds double, double* %26, i64 3
%28 = load double, double* %27
store double %28, double* %10
%29 = load double*, double** %6
%30 = getelementptr inbounds double, double* %29, i64 4
%31 = load double, double* %30
store double %31, double* %11
%32 = load double, double* %9
%33 = load double, double* %9
%34 = load double, double* %10
%35 = load double, double* %10
%36 = fmul double %34, %35
%37 = call double @llvm.fmuladd.f64(double %32, double %33, double %36)
%38 = call double @sqrt(double %37)
store double %38, double* %12
%39 = load double, double* %7
%40 = load double, double* %7
%41 = load double, double* %8
%42 = load double, double* %8
%43 = fmul double %41, %42
%44 = call double @llvm.fmuladd.f64(double %39, double %40, double %43)
%45 = call double @sqrt(double %44)
store double %45, double* %13
%46 = load double, double* %12
%47 = load double, double* %13
%48 = fdiv double %46, %47
%49 = call double @sqrt(double %48)
store double %49, double* %14
%50 = load double, double* %11
%51 = fmul double 5.000000e-01, %50
%52 = load double, double* %12
%53 = load double, double* %13
%54 = fmul double %52, %53
%55 = call double @sqrt(double %54)
%56 = fdiv double %51, %55
store double %56, double* %15
%57 = load double, double* %14
%58 = load double, double* %10
%59 = fmul double %57, %58
%60 = load double, double* %12
%61 = fdiv double %59, %60
%62 = fptrunc double %61 to float
%63 = load float*, float** %4
%64 = getelementptr inbounds float, float* %63, i64 0
store float %62, float* %64
%65 = load double, double* %14
%66 = load double, double* %9
%67 = fmul double %65, %66
%68 = load double, double* %12
%69 = fdiv double %67, %68
%70 = fptrunc double %69 to float
%71 = load float*, float** %4
%72 = getelementptr inbounds float, float* %71, i64 1
store float %70, float* %72
%73 = load double, double* %15
%74 = fptrunc double %73 to float
%75 = load float*, float** %4
%76 = getelementptr inbounds float, float* %75, i64 2
store float %74, float* %76
%77 = load double, double* %14
%78 = fdiv double 1.000000e+00, %77
store double %78, double* %16
%79 = load double, double* %16
%80 = load double, double* %8
%81 = fneg double %80
%82 = fmul double %79, %81
%83 = load double, double* %13
%84 = fdiv double %82, %83
%85 = fptrunc double %84 to float
%86 = load float*, float** %5
%87 = getelementptr inbounds float, float* %86, i64 0
store float %85, float* %87
%88 = load double, double* %16
%89 = load double, double* %7
%90 = fneg double %89
%91 = fmul double %88, %90
%92 = load double, double* %13
%93 = fdiv double %91, %92
%94 = fptrunc double %93 to float
%95 = load float*, float** %5
%96 = getelementptr inbounds float, float* %95, i64 1
store float %94, float* %96
%97 = load double, double* %15
%98 = fneg double %97
%99 = fptrunc double %98 to float
%100 = load float*, float** %5
%101 = getelementptr inbounds float, float* %100, i64 2
store float %99, float* %101
ret void
}

LLVM IR (-O2):
define void @rectifying_similarities_from_affine_fundamental_matrix(float* nocapture writeonly %0, float* nocapture writeonly %1, double* nocapture %2) {
%4 = load double, double* %2
%5 = getelementptr inbounds double, double* %2, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %2, i64 2
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %2, i64 3
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %2, i64 4
%12 = load double, double* %11
%13 = fmul double %10, %10
%14 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %13)
%15 = tail call double @sqrt(double %14)
%16 = fmul double %6, %6
%17 = tail call double @llvm.fmuladd.f64(double %4, double %4, double %16)
%18 = tail call double @sqrt(double %17)
%19 = fdiv double %15, %18
%20 = tail call double @sqrt(double %19)
%21 = fmul double %12, 5.000000e-01
%22 = fmul double %15, %18
%23 = tail call double @sqrt(double %22)
%24 = fdiv double %21, %23
%25 = fmul double %10, %20
%26 = fdiv double %25, %15
%27 = fptrunc double %26 to float
store float %27, float* %0
%28 = fmul double %8, %20
%29 = fdiv double %28, %15
%30 = fptrunc double %29 to float
%31 = getelementptr inbounds float, float* %0, i64 1
store float %30, float* %31
%32 = fptrunc double %24 to float
%33 = getelementptr inbounds float, float* %0, i64 2
store float %32, float* %33
%34 = fdiv double 1.000000e+00, %20
%35 = fneg double %6
%36 = fmul double %34, %35
%37 = fdiv double %36, %18
%38 = fptrunc double %37 to float
store float %38, float* %1
%39 = fneg double %4
%40 = fmul double %34, %39
%41 = fdiv double %40, %18
%42 = fptrunc double %41 to float
%43 = getelementptr inbounds float, float* %1, i64 1
store float %42, float* %43
%44 = fneg float %32
%45 = getelementptr inbounds float, float* %1, i64 2
store float %44, float* %45
ret void
}