#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*/ assertTrue(char *, int);
int /*<<< orphan*/ zero_out(double *, int);
void test_double() {
  double a[3];
  a[0] = 41;
  a[1] = 42;
  a[2] = 43;
  zero_out(a, sizeof(double) * 2);
  assertTrue("a[0] == 0", a[0] == 0);
  ;
  assertTrue("a[1] == 0", a[1] == 0);
  ;
  assertTrue("a[2] == 43", a[2] == 43);
  ;
}


x86 assembly (clang, -O0):
<test_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x10,%esi
call   1040 <zero_out@plt>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe9b(%rip),%rdi
call   1030 <assertTrue@plt>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe80(%rip),%rdi
call   1030 <assertTrue@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xe4c(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe60(%rip),%rdi
call   1030 <assertTrue@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_double>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x4045800000000000,%rax
80 45 40
mov    %rax,0x10(%rsp)
mov    %rsp,%rdi
mov    $0x10,%esi
call   1040 <zero_out@plt>
xorpd  %xmm1,%xmm1
movsd  (%rsp),%xmm0
cmpeqsd %xmm1,%xmm0
movq   %xmm0,%rsi
and    $0x1,%esi
lea    0xeb0(%rip),%rdi
call   1030 <assertTrue@plt>
xorpd  %xmm0,%xmm0
cmpeqsd 0x8(%rsp),%xmm0
movq   %xmm0,%rsi
and    $0x1,%esi
lea    0xe9b(%rip),%rdi
call   1030 <assertTrue@plt>
movsd  0xe7c(%rip),%xmm0
cmpeqsd 0x10(%rsp),%xmm0
movq   %xmm0,%rsi
and    $0x1,%esi
lea    0xe82(%rip),%rdi
call   1030 <assertTrue@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"a[0] == 0\00"
@.str.1 = [10 x i8] c"a[1] == 0\00"
@.str.2 = [11 x i8] c"a[2] == 43\00"
define void @test_double() {
%1 = alloca [3 x double]
%2 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
store double 4.100000e+01, double* %2
%3 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 1
store double 4.200000e+01, double* %3
%4 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 2
store double 4.300000e+01, double* %4
%5 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%6 = call i32 @zero_out(double* %5, i32 16)
%7 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%8 = load double, double* %7
%9 = fcmp oeq double %8, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = call i32 @assertTrue(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 1
%13 = load double, double* %12
%14 = fcmp oeq double %13, 0.000000e+00
%15 = zext i1 %14 to i32
%16 = call i32 @assertTrue(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 2
%18 = load double, double* %17
%19 = fcmp oeq double %18, 4.300000e+01
%20 = zext i1 %19 to i32
%21 = call i32 @assertTrue(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"a[0] == 0\00"
@.str.1 = [10 x i8] c"a[1] == 0\00"
@.str.2 = [11 x i8] c"a[2] == 43\00"
define void @test_double() {
%1 = alloca [3 x double]
%2 = bitcast [3 x double]* %1 to i8*
%3 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 1
%5 = bitcast [3 x double]* %1 to <2 x double>*
store <2 x double> <double 4.100000e+01, double 4.200000e+01>, <2 x double>* %5
%6 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 2
store double 4.300000e+01, double* %6
%7 = call i32 @zero_out(double* %3, i32 16)
%8 = load double, double* %3
%9 = fcmp oeq double %8, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = call i32 @assertTrue(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load double, double* %4
%13 = fcmp oeq double %12, 0.000000e+00
%14 = zext i1 %13 to i32
%15 = call i32 @assertTrue(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load double, double* %6
%17 = fcmp oeq double %16, 4.300000e+01
%18 = zext i1 %17 to i32
%19 = call i32 @assertTrue(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %18)
ret void
}