#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 /*<<< orphan*/ nclip(float *, float *, size_t, float, float);
int /*<<< orphan*/ nmultiply(float *, float *, size_t, float);
int /*<<< orphan*/ nnadd(float *, float *, float *, size_t);
int /*<<< orphan*/ nnmultiply(float *, float *, float *, size_t);
int /*<<< orphan*/ nsubtract(float *, float *, size_t, double);
void stack_line(float *bg, float *fg, float *mat, size_t len, float factor,
                float lo, float hi) {
  nclip(mat, fg, len, lo, hi);
  nmultiply(fg, fg, len, factor);
  nnmultiply(fg, fg, mat, len);
  nsubtract(mat, mat, len, 1.0);
  nnmultiply(bg, bg, mat, len);
  nnadd(bg, bg, fg, len);
}


x86 assembly (clang, -O0):
<stack_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movss  %xmm0,-0x24(%rbp)
movss  %xmm1,-0x28(%rbp)
movss  %xmm2,-0x2c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
movss  -0x28(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm1
call   1040 <nclip@plt>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
movss  -0x24(%rbp),%xmm0
call   1070 <nmultiply@plt>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1060 <nnmultiply@plt>
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
movsd  0xe2f(%rip),%xmm0
call   1050 <nsubtract@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1060 <nnmultiply@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <nnadd@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_line>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rdx,%rdi
mov    %rcx,%rdx
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1040 <nclip@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
movss  0x4(%rsp),%xmm0
call   1070 <nmultiply@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
call   1060 <nnmultiply@plt>
movsd  0xe58(%rip),%xmm0
mov    %r12,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
call   1050 <nsubtract@plt>
mov    %r15,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
call   1060 <nnmultiply@plt>
mov    %r15,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <nnadd@plt>

LLVM IR (-O0):
define void @stack_line(float* %0, float* %1, float* %2, i64 %3, float %4, float %5, float %6) {
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca i64
%12 = alloca float
%13 = alloca float
%14 = alloca float
store float* %0, float** %8
store float* %1, float** %9
store float* %2, float** %10
store i64 %3, i64* %11
store float %4, float* %12
store float %5, float* %13
store float %6, float* %14
%15 = load float*, float** %10
%16 = load float*, float** %9
%17 = load i64, i64* %11
%18 = load float, float* %13
%19 = load float, float* %14
%20 = call i32 @nclip(float* %15, float* %16, i64 %17, float %18, float %19)
%21 = load float*, float** %9
%22 = load float*, float** %9
%23 = load i64, i64* %11
%24 = load float, float* %12
%25 = call i32 @nmultiply(float* %21, float* %22, i64 %23, float %24)
%26 = load float*, float** %9
%27 = load float*, float** %9
%28 = load float*, float** %10
%29 = load i64, i64* %11
%30 = call i32 @nnmultiply(float* %26, float* %27, float* %28, i64 %29)
%31 = load float*, float** %10
%32 = load float*, float** %10
%33 = load i64, i64* %11
%34 = call i32 @nsubtract(float* %31, float* %32, i64 %33, double 1.000000e+00)
%35 = load float*, float** %8
%36 = load float*, float** %8
%37 = load float*, float** %10
%38 = load i64, i64* %11
%39 = call i32 @nnmultiply(float* %35, float* %36, float* %37, i64 %38)
%40 = load float*, float** %8
%41 = load float*, float** %8
%42 = load float*, float** %9
%43 = load i64, i64* %11
%44 = call i32 @nnadd(float* %40, float* %41, float* %42, i64 %43)
ret void
}

LLVM IR (-O2):
define void @stack_line(float* %0, float* %1, float* %2, i64 %3, float %4, float %5, float %6) {
%8 = tail call i32 @nclip(float* %2, float* %1, i64 %3, float %5, float %6)
%9 = tail call i32 @nmultiply(float* %1, float* %1, i64 %3, float %4)
%10 = tail call i32 @nnmultiply(float* %1, float* %1, float* %2, i64 %3)
%11 = tail call i32 @nsubtract(float* %2, float* %2, i64 %3, double 1.000000e+00)
%12 = tail call i32 @nnmultiply(float* %0, float* %0, float* %2, i64 %3)
%13 = tail call i32 @nnadd(float* %0, float* %0, float* %1, i64 %3)
ret void
}