#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*/ puts(char *);
int /*<<< orphan*/ qurt(double *, double *, double *);
int main() {
  double a[3], x1[2], x2[2];
  int result;
  a[0] = 1.75;
  a[1] = -3.2;
  a[2] = 2.45;
  qurt(a, x1, x2);
  result = *(int *)&x1[0];
  a[0] = 1.5;
  a[1] = -2.5;
  a[2] = 1.5;
  qurt(a, x1, x2);
  result += *(int *)&x1[1];
  a[0] = 1.8;
  a[1] = -4.275;
  a[2] = 8.31;
  qurt(a, x1, x2);
  result -= *(int *)&x1[1];
  if (result != -1776094907) {
    puts("qurt: fail\n");
  } else {
    puts("qurt: success\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xf01(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xed7(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1040 <qurt@plt>
mov    -0x30(%rbp),%eax
mov    %eax,-0x44(%rbp)
movsd  0xea3(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe9e(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe89(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1040 <qurt@plt>
mov    -0x28(%rbp),%eax
add    -0x44(%rbp),%eax
mov    %eax,-0x44(%rbp)
movsd  0xe5a(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe45(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe30(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1040 <qurt@plt>
mov    -0x28(%rbp),%ecx
mov    -0x44(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x44(%rbp)
cmpl   $0x9622f145,-0x44(%rbp)
je     120f <main+0xef>
lea    0xe3b(%rip),%rdi
call   1030 <puts@plt>
jmp    121b <main+0xfb>
lea    0xe36(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x400399999999999a,%rax
99 03 40
mov    %rax,0x10(%rsp)
mov    %rsp,%rbx
lea    0x20(%rsp),%r14
lea    0x30(%rsp),%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <qurt@plt>
mov    0x20(%rsp),%ebp
movaps 0xea6(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x3ff8000000000000,%rax
mov    %rax,0x10(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <qurt@plt>
add    0x28(%rsp),%ebp
movaps 0xe8a(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x40209eb851eb851f,%rax
9e 20 40
mov    %rax,0x10(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <qurt@plt>
sub    0x28(%rsp),%ebp
cmp    $0x9622f145,%ebp
lea    0xe74(%rip),%rax
lea    0xe61(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"qurt: fail\0A\00"
@.str.1 = [15 x i8] c"qurt: success\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x double]
%3 = alloca [2 x double]
%4 = alloca [2 x double]
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
store double 1.750000e+00, double* %6
%7 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 1
store double -3.200000e+00, double* %7
%8 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 2
store double 2.450000e+00, double* %8
%9 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%10 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%11 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%12 = call i32 @qurt(double* %9, double* %10, double* %11)
%13 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%14 = bitcast double* %13 to i32*
%15 = load i32, i32* %14
store i32 %15, i32* %5
%16 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
store double 1.500000e+00, double* %16
%17 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 1
store double -2.500000e+00, double* %17
%18 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 2
store double 1.500000e+00, double* %18
%19 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%20 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%21 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%22 = call i32 @qurt(double* %19, double* %20, double* %21)
%23 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 1
%24 = bitcast double* %23 to i32*
%25 = load i32, i32* %24
%26 = load i32, i32* %5
%27 = add nsw i32 %26, %25
store i32 %27, i32* %5
%28 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
store double 1.800000e+00, double* %28
%29 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 1
store double -4.275000e+00, double* %29
%30 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 2
store double 8.310000e+00, double* %30
%31 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%32 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%33 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%34 = call i32 @qurt(double* %31, double* %32, double* %33)
%35 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 1
%36 = bitcast double* %35 to i32*
%37 = load i32, i32* %36
%38 = load i32, i32* %5
%39 = sub nsw i32 %38, %37
store i32 %39, i32* %5
%40 = load i32, i32* %5
%41 = icmp ne i32 %40, -1776094907
br i1 %41, label %42, label %44
42: ; preds = %0
%43 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %46
44: ; preds = %0
%45 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %46
46: ; preds = %44, %42
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"qurt: fail\0A\00"
@.str.1 = [15 x i8] c"qurt: success\0A\00"
define i32 @main() {
%1 = alloca [3 x double]
%2 = alloca [2 x double]
%3 = alloca [2 x double]
%4 = bitcast [3 x double]* %1 to i8*
%5 = bitcast [2 x double]* %2 to i8*
%6 = bitcast [2 x double]* %3 to i8*
%7 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%8 = bitcast [3 x double]* %1 to <2 x double>*
store <2 x double> <double 1.750000e+00, double -3.200000e+00>, <2 x double>* %8
%9 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 2
store double 2.450000e+00, double* %9
%10 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 0
%11 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%12 = call i32 @qurt(double* %7, double* %10, double* %11)
%13 = bitcast [2 x double]* %2 to i32*
%14 = load i32, i32* %13
%15 = bitcast [3 x double]* %1 to <2 x double>*
store <2 x double> <double 1.500000e+00, double -2.500000e+00>, <2 x double>* %15
store double 1.500000e+00, double* %9
%16 = call i32 @qurt(double* %7, double* %10, double* %11)
%17 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 1
%18 = bitcast double* %17 to i32*
%19 = load i32, i32* %18
%20 = add nsw i32 %19, %14
%21 = bitcast [3 x double]* %1 to <2 x double>*
store <2 x double> <double 1.800000e+00, double -4.275000e+00>, <2 x double>* %21
store double 8.310000e+00, double* %9
%22 = call i32 @qurt(double* %7, double* %10, double* %11)
%23 = load i32, i32* %18
%24 = sub i32 %20, %23
%25 = icmp eq i32 %24, -1776094907
%26 = select i1 %25, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
%27 = call i32 @puts(i8* dereferenceable(1) %26)
ret i32 0
}