#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);
double iter_fcn(double, double);
void print_iter_seq(FILE *fout, double lambda, int nskip, int nsteps) {
  double x = (0.789);
  int i;
  for (i = 0; i < nskip; i++)
    x = iter_fcn(lambda, x);
  for (i = 0; i < nsteps; i++) {
    x = iter_fcn(lambda, x);
    fprintf(fout, "%.12f %.12f\n", lambda, x);
  }
}


x86 assembly (clang, -O0):
<print_iter_seq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1179 <print_iter_seq+0x59>
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <iter_fcn@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    114b <print_iter_seq+0x2b>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11c8 <print_iter_seq+0xa8>
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <iter_fcn@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xe53(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1180 <print_iter_seq+0x60>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_iter_seq>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edx,%ebx
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%r14
test   %esi,%esi
jle    1169 <print_iter_seq+0x49>
mov    %esi,%ebp
movsd  0xebd(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  0x8(%rsp),%xmm0
call   1030 <iter_fcn@plt>
movaps %xmm0,%xmm1
add    $0xffffffff,%ebp
jne    1150 <print_iter_seq+0x30>
test   %ebx,%ebx
jg     1175 <print_iter_seq+0x55>
jmp    11b0 <print_iter_seq+0x90>
movsd  0xe8f(%rip),%xmm1
test   %ebx,%ebx
jle    11b0 <print_iter_seq+0x90>
lea    0xe8c(%rip),%r15
nopl   0x0(%rax)
movsd  0x8(%rsp),%xmm0
call   1030 <iter_fcn@plt>
movaps %xmm0,%xmm1
movsd  %xmm0,0x10(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
movsd  0x8(%rsp),%xmm0
call   1040 <fprintf@plt>
movsd  0x10(%rsp),%xmm1
add    $0xffffffff,%ebx
jne    1180 <print_iter_seq+0x60>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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