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


x86 assembly (clang, -O0):
<set_dobldobl_trace_slice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%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    114f <set_dobldobl_trace_slice+0x3f>
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    115c <set_dobldobl_trace_slice+0x4c>
movsd  0xea9(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    -0x30(%rbp),%rdx
xor    %esi,%esi
mov    %esi,%edi
call   1030 <assign_dobldobl_coefficient_of_slice@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @set_dobldobl_trace_slice(i32 %0) {
%2 = alloca [4 x double]
%3 = bitcast [4 x double]* %2 to i8*
%4 = getelementptr inbounds [4 x double], [4 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 [4 x double], [4 x double]* %2, i64 0, i64 0
store double %7, double* %8
%9 = call i32 @assign_dobldobl_coefficient_of_slice(i32 0, i32 0, double* %8)
ret i32 %9
}