#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 SaveXY(FILE *f, double *x, double *y, int N) {
  int i;
  for (i = 0; i <= N; i++)
    fprintf(f, "%.12e\t%.12e\n", x[i], y[i]);
}


x86 assembly (clang, -O0):
<SaveXY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1172 <SaveXY+0x62>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112e <SaveXY+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SaveXY>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %ecx,%ecx
js     1160 <SaveXY+0x50>
mov    %ecx,%ebx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
add    $0x1,%ebx
xor    %ebp,%ebp
lea    0xeca(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
movsd  (%r15,%rbp,8),%xmm0
movsd  (%r14,%rbp,8),%xmm1
mov    %r12,%rdi
mov    %r13,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1140 <SaveXY+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%.12e\09%.12e\0A\00"
define void @SaveXY(i32* %0, double* %1, double* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
store i32 0, i32* %9
br label %10
10: ; preds = %27, %4
%11 = load i32, i32* %9
%12 = load i32, i32* %8
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %30
14: ; preds = %10
%15 = load i32*, i32** %5
%16 = load double*, double** %6
%17 = load i32, i32* %9
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = load i32, i32* %9
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %21, i64 %23
%25 = load double, double* %24
%26 = call i32 @fprintf(i32* %15, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %20, double %25)
br label %27
27: ; preds = %14
%28 = load i32, i32* %9
%29 = add nsw i32 %28, 1
store i32 %29, i32* %9
br label %10
30: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%.12e\09%.12e\0A\00"
define void @SaveXY(i32* nocapture %0, double* nocapture %1, double* nocapture %2, i32 %3) {
%5 = icmp slt i32 %3, 0
br i1 %5, label %18, label %6
6: ; preds = %4
%7 = add nuw i32 %3, 1
%8 = zext i32 %7 to i64
br label %9
9: ; preds = %6, %9
%10 = phi i64 [ 0, %6 ], [ %16, %9 ]
%11 = getelementptr inbounds double, double* %1, i64 %10
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %2, i64 %10
%14 = load double, double* %13
%15 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %12, double %14)
%16 = add nuw nsw i64 %10, 1
%17 = icmp eq i64 %16, %8
br i1 %17, label %18, label %9
18: ; preds = %9, %4
ret void
}