#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 atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sho_wf(double, double, int, int);
int main(int argc, char *argv[]) {
  int n, l;
  double mw, r, rstep, rmax;
  if (argc != 6) {
    printf("Usage: ./sho_print mw n l rstep rmax\n");
    return 1;
  }
  mw = atof(argv[1]);
  n = atoi(argv[2]);
  l = atoi(argv[3]);
  rstep = atof(argv[4]);
  rmax = atof(argv[5]);
  for (r = 0.; r <= rmax; r += rstep)
    printf("%.5lf\t%.8le\n", r, sho_wf(r, mw, n, l));
  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)
cmpl   $0x6,-0x8(%rbp)
je     117a <main+0x3a>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    123b <main+0xfb>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1234 <main+0xf4>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <sho_wf@plt>
movsd  -0x40(%rbp),%xmm0
mov    %eax,%esi
lea    0xe0d(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  -0x30(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    11d8 <main+0x98>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
cmp    $0x6,%edi
jne    1205 <main+0xb5>
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
call   1040 <atof@plt>
movsd  %xmm0,0x20(%rsp)
mov    0x10(%r14),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebx
mov    0x18(%r14),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebp
mov    0x20(%r14),%rdi
call   1040 <atof@plt>
movsd  %xmm0,0x18(%rsp)
mov    0x28(%r14),%rdi
call   1040 <atof@plt>
xor    %r14d,%r14d
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1217 <main+0xc7>
lea    0xe49(%rip),%r15
movsd  %xmm0,0x10(%rsp)
nopl   (%rax)
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
movsd  0x20(%rsp),%xmm1
mov    %ebx,%edi
mov    %ebp,%esi
call   1050 <sho_wf@plt>
mov    %r15,%rdi
movsd  0x8(%rsp),%xmm0
mov    %eax,%esi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
addsd  0x18(%rsp),%xmm1
ucomisd %xmm1,%xmm0
jae    11c0 <main+0x70>
jmp    1217 <main+0xc7>
lea    0xe01(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Usage: ./sho_print mw n l rstep rmax\0A\00"
@.str.1 = [13 x i8] c"%.5lf\09%.8le\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 6
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %54
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call double @atof(i8* %19)
store double %20, double* %8
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
%24 = call i32 @atoi(i8* %23)
store i32 %24, i32* %6
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 3
%27 = load i8*, i8** %26
%28 = call i32 @atoi(i8* %27)
store i32 %28, i32* %7
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 4
%31 = load i8*, i8** %30
%32 = call double @atof(i8* %31)
store double %32, double* %10
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 5
%35 = load i8*, i8** %34
%36 = call double @atof(i8* %35)
store double %36, double* %11
store double 0.000000e+00, double* %9
br label %37
37: ; preds = %49, %16
%38 = load double, double* %9
%39 = load double, double* %11
%40 = fcmp ole double %38, %39
br i1 %40, label %41, label %53
41: ; preds = %37
%42 = load double, double* %9
%43 = load double, double* %9
%44 = load double, double* %8
%45 = load i32, i32* %6
%46 = load i32, i32* %7
%47 = call i32 @sho_wf(double %43, double %44, i32 %45, i32 %46)
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %42, i32 %47)
br label %49
49: ; preds = %41
%50 = load double, double* %10
%51 = load double, double* %9
%52 = fadd double %51, %50
store double %52, double* %9
br label %37
53: ; preds = %37
store i32 0, i32* %3
br label %54
54: ; preds = %53, %14
%55 = load i32, i32* %3
ret i32 %55
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"%.5lf\09%.8le\0A\00"
@str = [37 x i8] c"Usage: ./sho_print mw n l rstep rmax\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 6
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %29
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call double @atof(i8* %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = getelementptr inbounds i8*, i8** %1, i64 3
%14 = load i8*, i8** %13
%15 = tail call i32 @atoi(i8* %14)
%16 = getelementptr inbounds i8*, i8** %1, i64 4
%17 = load i8*, i8** %16
%18 = tail call double @atof(i8* %17)
%19 = getelementptr inbounds i8*, i8** %1, i64 5
%20 = load i8*, i8** %19
%21 = tail call double @atof(i8* %20)
%22 = fcmp ult double %21, 0.000000e+00
br i1 %22, label %29, label %23
23: ; preds = %6, %23
%24 = phi double [ %27, %23 ], [ 0.000000e+00, %6 ]
%25 = tail call i32 @sho_wf(double %24, double %9, i32 %12, i32 %15)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %24, i32 %25)
%27 = fadd double %18, %24
%28 = fcmp ugt double %27, %21
br i1 %28, label %29, label %23
29: ; preds = %23, %6, %4
%30 = phi i32 [ 1, %4 ], [ 0, %6 ], [ 0, %23 ]
ret i32 %30
}