#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double, double);
void print3(double *p1, double *q3, double *p3, int nPuntos, FILE *f) {
  int i;
  for (i = 0; i < nPuntos - 1; i++) {
    if (p1[i] * p1[i + 1] <= 0.0) {
      fprintf(f, "%f %f\n", q3[i], p3[i]);
    }
  }
}


x86 assembly (clang, -O0):
<print3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11ac <print3+0x9c>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     1199 <print3+0x89>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xe6c(%rip),%rsi
call   1030 <fprintf@plt>
jmp    119e <print3+0x8e>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1132 <print3+0x22>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print3>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%ecx
jl     117e <print3+0x6e>
mov    %r8,%r14
mov    %ecx,%r13d
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
add    $0xffffffff,%r13d
xor    %eax,%eax
xorpd  %xmm1,%xmm1
jmp    1148 <print3+0x38>
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rax
cmp    %rbp,%r13
je     117e <print3+0x6e>
movsd  (%rbx,%rax,8),%xmm0
lea    0x1(%rax),%rbp
mulsd  0x8(%rbx,%rax,8),%xmm0
ucomisd %xmm0,%xmm1
jb     1140 <print3+0x30>
movsd  (%r12,%rax,8),%xmm0
movsd  (%r15,%rax,8),%xmm1
mov    %r14,%rdi
lea    0xe8d(%rip),%rsi
call   1030 <fprintf@plt>
xorpd  %xmm1,%xmm1
jmp    1140 <print3+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%f %f\0A\00"
define void @print3(double* %0, double* %1, double* %2, i32 %3, i32* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store i32 %3, i32* %9
store i32* %4, i32** %10
store i32 0, i32* %11
br label %12
12: ; preds = %45, %5
%13 = load i32, i32* %11
%14 = load i32, i32* %9
%15 = sub nsw i32 %14, 1
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %48
17: ; preds = %12
%18 = load double*, double** %6
%19 = load i32, i32* %11
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %18, i64 %20
%22 = load double, double* %21
%23 = load double*, double** %6
%24 = load i32, i32* %11
%25 = add nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %23, i64 %26
%28 = load double, double* %27
%29 = fmul double %22, %28
%30 = fcmp ole double %29, 0.000000e+00
br i1 %30, label %31, label %44
31: ; preds = %17
%32 = load i32*, i32** %10
%33 = load double*, double** %7
%34 = load i32, i32* %11
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %33, i64 %35
%37 = load double, double* %36
%38 = load double*, double** %8
%39 = load i32, i32* %11
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %38, i64 %40
%42 = load double, double* %41
%43 = call i32 @fprintf(i32* %32, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %37, double %42)
br label %44
44: ; preds = %31, %17
br label %45
45: ; preds = %44
%46 = load i32, i32* %11
%47 = add nsw i32 %46, 1
store i32 %47, i32* %11
br label %12
48: ; preds = %12
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%f %f\0A\00"
define void @print3(double* nocapture %0, double* nocapture %1, double* nocapture %2, i32 %3, i32* nocapture %4) {
%6 = icmp sgt i32 %3, 1
br i1 %6, label %7, label %27
7: ; preds = %5
%8 = add nsw i32 %3, -1
%9 = zext i32 %8 to i64
br label %10
10: ; preds = %7, %25
%11 = phi i64 [ 0, %7 ], [ %14, %25 ]
%12 = getelementptr inbounds double, double* %0, i64 %11
%13 = load double, double* %12
%14 = add nuw nsw i64 %11, 1
%15 = getelementptr inbounds double, double* %0, i64 %14
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = fcmp ugt double %17, 0.000000e+00
br i1 %18, label %25, label %19
19: ; preds = %10
%20 = getelementptr inbounds double, double* %1, i64 %11
%21 = load double, double* %20
%22 = getelementptr inbounds double, double* %2, i64 %11
%23 = load double, double* %22
%24 = tail call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %21, double %23)
br label %25
25: ; preds = %10, %19
%26 = icmp eq i64 %14, %9
br i1 %26, label %27, label %10
27: ; preds = %25, %5
ret void
}