#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 assign_quaddobl_coefficient_of_slice(int /*<<< orphan*/, int /*<<< orphan*/,
                                         double *);
int set_quaddobl_trace_slice(int first) {
  int fail;
  double r[8];
  r[1] = 0.0;
  r[2] = 0.0;
  r[3] = 0.0;
  r[4] = 0.0;
  r[5] = 0.0;
  r[6] = 0.0;
  r[7] = 0.0;
  if (first == 1)
    r[0] = -1.0;
  else
    r[0] = +1.0;
  fail = assign_quaddobl_coefficient_of_slice(0, 0, r);
  return fail;
}


x86 assembly (clang, -O0):
<set_quaddobl_trace_slice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    116f <set_quaddobl_trace_slice+0x5f>
movsd  0xea3(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    117c <set_quaddobl_trace_slice+0x6c>
movsd  0xe89(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
lea    -0x50(%rbp),%rdx
xor    %esi,%esi
mov    %esi,%edi
call   1030 <assign_quaddobl_coefficient_of_slice@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_quaddobl_trace_slice>:
sub    $0x48,%rsp
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
xorps  %xmm0,%xmm0
movups %xmm0,0x28(%rsp)
movups %xmm0,0x18(%rsp)
movups %xmm0,0x8(%rsp)
movq   $0x0,0x38(%rsp)
lea    0xec2(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,(%rsp)
mov    %rsp,%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <assign_quaddobl_coefficient_of_slice@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define i32 @set_quaddobl_trace_slice(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [8 x double]
store i32 %0, i32* %2
%5 = getelementptr inbounds [8 x double], [8 x double]* %4, i64 0, i64 1
store double 0.000000e+00, double* %5
%6 = getelementptr inbounds [8 x double], [8 x double]* %4, i64 0, i64 2
store double 0.000000e+00, double* %6
%7 = getelementptr inbounds [8 x double], [8 x double]* %4, i64 0, i64 3
store double 0.000000e+00, double* %7
%8 = getelementptr inbounds [8 x double], [8 x double]* %4, i64 0, i64 4
store double 0.000000e+00, double* %8
%9 = getelementptr inbounds [8 x double], [8 x double]* %4, i64 0, i64 5
store double 0.000000e+00, double* %9
%10 = getelementptr inbounds [8 x double], [8 x double]* %4, i64 0, i64 6
store double 0.000000e+00, double* %10
%11 = getelementptr inbounds [8 x double], [8 x double]* %4, i64 0, i64 7
store double 0.000000e+00, double* %11
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = getelementptr inbounds [8 x double], [8 x double]* %4, i64 0, i64 0
store double -1.000000e+00, double* %15
br label %18
16: ; preds = %1
%17 = getelementptr inbounds [8 x double], [8 x double]* %4, i64 0, i64 0
store double 1.000000e+00, double* %17
br label %18
18: ; preds = %16, %14
%19 = getelementptr inbounds [8 x double], [8 x double]* %4, i64 0, i64 0
%20 = call i32 @assign_quaddobl_coefficient_of_slice(i32 0, i32 0, double* %19)
store i32 %20, i32* %3
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @set_quaddobl_trace_slice(i32 %0) {
%2 = alloca [8 x double]
%3 = bitcast [8 x double]* %2 to i8*
%4 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 1
%5 = icmp eq i32 %0, 1
%6 = bitcast double* %4 to i8*
%7 = select i1 %5, double -1.000000e+00, double 1.000000e+00
%8 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 0
store double %7, double* %8
%9 = call i32 @assign_quaddobl_coefficient_of_slice(i32 0, i32 0, double* %8)
ret i32 %9
}