#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 */
int plot_line(int **, int, int, double, double, double);
int plot_epipolar(int (*p)[2], double fm[9], int w, int h, int i, int j) {
  double a = i * fm[0] + j * fm[3] + fm[6];
  double b = i * fm[1] + j * fm[4] + fm[7];
  double c = i * fm[2] + j * fm[5] + fm[8];
  return plot_line(p, w, h, a, b, c);
}


x86 assembly (clang, -O0):
<plot_epipolar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
cvtsi2sdl -0x20(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
addsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
cvtsi2sdl -0x20(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x20(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
addsd  0x38(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
cvtsi2sdl -0x20(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x28(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
addsd  0x40(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
call   1030 <plot_line@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plot_epipolar>:
cvtsi2sd %r8d,%xmm2
cvtsi2sd %r9d,%xmm3
movsd  0x18(%rsi),%xmm1
mulsd  %xmm3,%xmm1
movsd  (%rsi),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  0x30(%rsi),%xmm0
movsd  0x20(%rsi),%xmm4
mulsd  %xmm3,%xmm4
movsd  0x8(%rsi),%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm4,%xmm1
addsd  0x38(%rsi),%xmm1
mulsd  0x28(%rsi),%xmm3
mulsd  0x10(%rsi),%xmm2
addsd  %xmm3,%xmm2
addsd  0x40(%rsi),%xmm2
mov    %edx,%esi
mov    %ecx,%edx
jmp    1030 <plot_line@plt>

LLVM IR (-O0):
define i32 @plot_epipolar([2 x i32]* %0, double* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca [2 x i32]*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca double
%15 = alloca double
store [2 x i32]* %0, [2 x i32]** %7
store double* %1, double** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%16 = load i32, i32* %11
%17 = sitofp i32 %16 to double
%18 = load double*, double** %8
%19 = getelementptr inbounds double, double* %18, i64 0
%20 = load double, double* %19
%21 = load i32, i32* %12
%22 = sitofp i32 %21 to double
%23 = load double*, double** %8
%24 = getelementptr inbounds double, double* %23, i64 3
%25 = load double, double* %24
%26 = fmul double %22, %25
%27 = call double @llvm.fmuladd.f64(double %17, double %20, double %26)
%28 = load double*, double** %8
%29 = getelementptr inbounds double, double* %28, i64 6
%30 = load double, double* %29
%31 = fadd double %27, %30
store double %31, double* %13
%32 = load i32, i32* %11
%33 = sitofp i32 %32 to double
%34 = load double*, double** %8
%35 = getelementptr inbounds double, double* %34, i64 1
%36 = load double, double* %35
%37 = load i32, i32* %12
%38 = sitofp i32 %37 to double
%39 = load double*, double** %8
%40 = getelementptr inbounds double, double* %39, i64 4
%41 = load double, double* %40
%42 = fmul double %38, %41
%43 = call double @llvm.fmuladd.f64(double %33, double %36, double %42)
%44 = load double*, double** %8
%45 = getelementptr inbounds double, double* %44, i64 7
%46 = load double, double* %45
%47 = fadd double %43, %46
store double %47, double* %14
%48 = load i32, i32* %11
%49 = sitofp i32 %48 to double
%50 = load double*, double** %8
%51 = getelementptr inbounds double, double* %50, i64 2
%52 = load double, double* %51
%53 = load i32, i32* %12
%54 = sitofp i32 %53 to double
%55 = load double*, double** %8
%56 = getelementptr inbounds double, double* %55, i64 5
%57 = load double, double* %56
%58 = fmul double %54, %57
%59 = call double @llvm.fmuladd.f64(double %49, double %52, double %58)
%60 = load double*, double** %8
%61 = getelementptr inbounds double, double* %60, i64 8
%62 = load double, double* %61
%63 = fadd double %59, %62
store double %63, double* %15
%64 = load [2 x i32]*, [2 x i32]** %7
%65 = bitcast [2 x i32]* %64 to i32**
%66 = load i32, i32* %9
%67 = load i32, i32* %10
%68 = load double, double* %13
%69 = load double, double* %14
%70 = load double, double* %15
%71 = call i32 @plot_line(i32** %65, i32 %66, i32 %67, double %68, double %69, double %70)
ret i32 %71
}

LLVM IR (-O2):
define i32 @plot_epipolar([2 x i32]* %0, double* nocapture %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = sitofp i32 %4 to double
%8 = load double, double* %1
%9 = sitofp i32 %5 to double
%10 = getelementptr inbounds double, double* %1, i64 3
%11 = load double, double* %10
%12 = fmul double %11, %9
%13 = tail call double @llvm.fmuladd.f64(double %7, double %8, double %12)
%14 = getelementptr inbounds double, double* %1, i64 6
%15 = load double, double* %14
%16 = fadd double %15, %13
%17 = getelementptr inbounds double, double* %1, i64 1
%18 = load double, double* %17
%19 = getelementptr inbounds double, double* %1, i64 4
%20 = load double, double* %19
%21 = fmul double %20, %9
%22 = tail call double @llvm.fmuladd.f64(double %7, double %18, double %21)
%23 = getelementptr inbounds double, double* %1, i64 7
%24 = load double, double* %23
%25 = fadd double %24, %22
%26 = getelementptr inbounds double, double* %1, i64 2
%27 = load double, double* %26
%28 = getelementptr inbounds double, double* %1, i64 5
%29 = load double, double* %28
%30 = fmul double %29, %9
%31 = tail call double @llvm.fmuladd.f64(double %7, double %27, double %30)
%32 = getelementptr inbounds double, double* %1, i64 8
%33 = load double, double* %32
%34 = fadd double %33, %31
%35 = bitcast [2 x i32]* %0 to i32**
%36 = tail call i32 @plot_line(i32** %35, i32 %2, i32 %3, double %16, double %25, double %34)
ret i32 %36
}