#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 */
float Prod(float const, char const);
float Dot_prod(const float x1, const char x2, const float y1, const char y2,
               const float z1, const char z2, const float t1, const char t2) {
  return (Prod(x1, x2) + Prod(y1, y2) + Prod(z1, z2) + Prod(t1, t2));
}


x86 assembly (clang, -O0):
<Dot_prod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
movss  %xmm0,-0x4(%rbp)
mov    %sil,-0x5(%rbp)
movss  %xmm1,-0xc(%rbp)
mov    %dl,-0xd(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    %cl,-0x15(%rbp)
movss  %xmm3,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
movss  -0x4(%rbp),%xmm0
movsbl -0x5(%rbp),%edi
call   1030 <Prod@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0xc(%rbp),%xmm0
movsbl -0xd(%rbp),%edi
call   1030 <Prod@plt>
movaps %xmm0,%xmm1
movss  -0x2c(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x14(%rbp),%xmm0
movsbl -0x15(%rbp),%edi
call   1030 <Prod@plt>
movaps %xmm0,%xmm1
movss  -0x28(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x1c(%rbp),%xmm0
movsbl -0x1d(%rbp),%edi
call   1030 <Prod@plt>
movaps %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
addss  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dot_prod>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%r14d
movss  %xmm3,0xc(%rsp)
mov    %edx,%ebp
movss  %xmm2,0x4(%rsp)
mov    %esi,%ebx
movss  %xmm1,(%rsp)
call   1030 <Prod@plt>
movss  %xmm0,0x8(%rsp)
movss  (%rsp),%xmm0
mov    %ebx,%edi
call   1030 <Prod@plt>
addss  0x8(%rsp),%xmm0
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
mov    %ebp,%edi
call   1030 <Prod@plt>
addss  (%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
movss  0xc(%rsp),%xmm0
mov    %r14d,%edi
call   1030 <Prod@plt>
addss  0x4(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define float @Dot_prod(float %0, i8 signext %1, float %2, i8 signext %3, float %4, i8 signext %5, float %6, i8 signext %7) {
%9 = alloca float
%10 = alloca i8
%11 = alloca float
%12 = alloca i8
%13 = alloca float
%14 = alloca i8
%15 = alloca float
%16 = alloca i8
store float %0, float* %9
store i8 %1, i8* %10
store float %2, float* %11
store i8 %3, i8* %12
store float %4, float* %13
store i8 %5, i8* %14
store float %6, float* %15
store i8 %7, i8* %16
%17 = load float, float* %9
%18 = load i8, i8* %10
%19 = call float @Prod(float %17, i8 signext %18)
%20 = load float, float* %11
%21 = load i8, i8* %12
%22 = call float @Prod(float %20, i8 signext %21)
%23 = fadd float %19, %22
%24 = load float, float* %13
%25 = load i8, i8* %14
%26 = call float @Prod(float %24, i8 signext %25)
%27 = fadd float %23, %26
%28 = load float, float* %15
%29 = load i8, i8* %16
%30 = call float @Prod(float %28, i8 signext %29)
%31 = fadd float %27, %30
ret float %31
}

LLVM IR (-O2):
define float @Dot_prod(float %0, i8 signext %1, float %2, i8 signext %3, float %4, i8 signext %5, float %6, i8 signext %7) {
%9 = tail call float @Prod(float %0, i8 signext %1)
%10 = tail call float @Prod(float %2, i8 signext %3)
%11 = fadd float %9, %10
%12 = tail call float @Prod(float %4, i8 signext %5)
%13 = fadd float %11, %12
%14 = tail call float @Prod(float %6, i8 signext %7)
%15 = fadd float %13, %14
ret float %15
}