#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 */
double atof(char *);
int /*<<< orphan*/ printf(char *, double, double);
double weierstrass(double);
int main(int argc, char *argv[]) {
  double ini = atof(argv[1]);
  double end = atof(argv[2]);
  double dt = 0.001;
  double x;
  for (x = ini; x < end; x = x + dt) {
    double y = weierstrass(x);
    printf("%f %f\n", x, y);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xe8e(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11ce <main+0x9e>
movsd  -0x30(%rbp),%xmm0
call   1030 <weierstrass@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
lea    0xe53(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x30(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1181 <main+0x51>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <atof@plt>
movsd  %xmm0,(%rsp)
mov    0x10(%rbx),%rdi
call   1040 <atof@plt>
movsd  (%rsp),%xmm1
ucomisd %xmm1,%xmm0
jbe    11a8 <main+0x78>
lea    0xea7(%rip),%rbx
movsd  %xmm0,0x8(%rsp)
nopw   0x0(%rax,%rax,1)
movsd  %xmm1,(%rsp)
movsd  (%rsp),%xmm0
call   1030 <weierstrass@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  (%rsp),%xmm0
call   1050 <printf@plt>
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
addsd  0xe5e(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%f %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call double @atof(i8* %13)
store double %14, double* %6
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call double @atof(i8* %17)
store double %18, double* %7
store double 1.000000e-03, double* %8
%19 = load double, double* %6
store double %19, double* %9
br label %20
20: ; preds = %30, %2
%21 = load double, double* %9
%22 = load double, double* %7
%23 = fcmp olt double %21, %22
br i1 %23, label %24, label %34
24: ; preds = %20
%25 = load double, double* %9
%26 = call double @weierstrass(double %25)
store double %26, double* %10
%27 = load double, double* %9
%28 = load double, double* %10
%29 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %27, double %28)
br label %30
30: ; preds = %24
%31 = load double, double* %9
%32 = load double, double* %8
%33 = fadd double %31, %32
store double %33, double* %9
br label %20
34: ; preds = %20
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%f %f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call double @atof(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call double @atof(i8* %7)
%9 = fcmp olt double %5, %8
br i1 %9, label %10, label %16
10: ; preds = %2, %10
%11 = phi double [ %14, %10 ], [ %5, %2 ]
%12 = tail call double @weierstrass(double %11)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %11, double %12)
%14 = fadd double %11, 1.000000e-03
%15 = fcmp olt double %14, %8
br i1 %15, label %10, label %16
16: ; preds = %10, %2
ret i32 0
}