#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 */
float abs(float);
float calculate_actual_distance(float, float, float);
float calculate_calories(float, float);
float calculate_slope(float, float, float);
float calculate_virtual_distance(float, float);
float calculate_work(float, float, float);
float distance(float, float, float, float);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, float *, float *,
                          float *);
int /*<<< orphan*/ printf(char *, ...);
void simulate_walk(const char *position_file, float mass) {
  printf("Reading file: %s, with mass of %f lbs\n", position_file, mass);
  FILE *fp = fopen(position_file, "r");
  float icoords[3], fcoords[3];
  float dist, calories, slope, grade, virt_dist, estimated_work, actual_dist;
  fscanf(fp, "%f %f %f\n", &fcoords[0], &fcoords[1], &fcoords[2]);
  while (!feof(fp)) {
    icoords[0] = fcoords[0];
    icoords[1] = fcoords[1];
    icoords[2] = fcoords[2];
    fscanf(fp, "%f %f %f\n", &fcoords[0], &fcoords[1], &fcoords[2]);
    dist = distance(icoords[0], icoords[1], fcoords[0], fcoords[1]);
    calories = calculate_calories((dist / 1609.34f), mass);
    slope = calculate_slope(dist, icoords[2], fcoords[2]);
    virt_dist = calculate_virtual_distance(slope, dist);
    grade = (abs(icoords[2] - fcoords[2]) / dist);
    estimated_work = calculate_work(grade, mass * 0.453492, virt_dist);
    actual_dist =
        calculate_actual_distance(virt_dist, calories, estimated_work / 4.184);
    printf("(%f, %f, %f) -> (%f, %f, %f)\n", icoords[0], icoords[1], icoords[2],
           fcoords[0], fcoords[1], fcoords[2]);
    printf("\tDistance: %f\n", dist);
    printf("\tCalories: %f\n", calories);
    printf("\tSlope: %f\n", slope);
    printf("\tGrade: %f\n", grade);
    printf("\tVirtual distance: %f\n", virt_dist);
    printf("\tEsimated calories needed: %f\n", estimated_work);
    printf("\tActual virtual distance travelled: %f\n", actual_dist);
    printf("\n");
  }
  fclose(fp);
}


x86 assembly (clang, -O0):
<simulate_walk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe2f(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe44(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    -0x30(%rbp),%rcx
add    $0x4,%rcx
lea    -0x30(%rbp),%r8
add    $0x8,%r8
lea    0xe1e(%rip),%rsi
call   1070 <fscanf@plt>
mov    -0x18(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1242 <simulate_walk+0x82>
jmp    145a <simulate_walk+0x29a>
movss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    -0x30(%rbp),%rcx
add    $0x4,%rcx
lea    -0x30(%rbp),%r8
add    $0x8,%r8
lea    0xdbe(%rip),%rsi
call   1070 <fscanf@plt>
movss  -0x24(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
movss  -0x30(%rbp),%xmm2
movss  -0x2c(%rbp),%xmm3
call   10e0 <distance@plt>
movss  %xmm0,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
movss  0xd61(%rip),%xmm1
divss  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
call   10b0 <calculate_calories@plt>
movss  %xmm0,-0x38(%rbp)
movss  -0x34(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
movss  -0x28(%rbp),%xmm2
call   1090 <calculate_slope@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
movss  -0x34(%rbp),%xmm1
call   10a0 <calculate_virtual_distance@plt>
movss  %xmm0,-0x44(%rbp)
movss  -0x1c(%rbp),%xmm0
subss  -0x28(%rbp),%xmm0
call   1040 <abs@plt>
divss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x40(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xcea(%rip),%xmm2
mulsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  -0x44(%rbp),%xmm2
call   1030 <calculate_work@plt>
movss  %xmm0,-0x48(%rbp)
movss  -0x44(%rbp),%xmm0
movss  -0x38(%rbp),%xmm1
movss  -0x48(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movsd  0xcb0(%rip),%xmm3
divsd  %xmm3,%xmm2
cvtsd2ss %xmm2,%xmm2
call   10c0 <calculate_actual_distance@plt>
movss  %xmm0,-0x4c(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x20(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x1c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x30(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
movss  -0x2c(%rbp),%xmm4
cvtss2sd %xmm4,%xmm4
movss  -0x28(%rbp),%xmm5
cvtss2sd %xmm5,%xmm5
lea    0xca8(%rip),%rdi
mov    $0x6,%al
call   1060 <printf@plt>
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcaf(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xca7(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  -0x3c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc9f(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc94(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  -0x44(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc89(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  -0x48(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc89(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  -0x4c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc91(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
lea    0xc15(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1224 <simulate_walk+0x64>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simulate_walk>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
movss  %xmm0,0x30(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xe22(%rip),%rdi
mov    %rbx,%rsi
movsd  %xmm0,0x18(%rsp)
mov    $0x1,%al
call   1070 <printf@plt>
lea    0xe32(%rip),%rsi
mov    %rbx,%rdi
call   10e0 <fopen@plt>
mov    %rax,%rbx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
lea    0xe18(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rax,%rdi
call   1080 <fscanf@plt>
mov    %rbx,%rdi
call   1090 <feof@plt>
test   %eax,%eax
jne    147e <simulate_walk+0x2ae>
movsd  0x18(%rsp),%xmm0
mulsd  0xdb0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x2c(%rsp)
lea    0xe22(%rip),%r13
lea    0xe27(%rip),%r15
lea    0xe2c(%rip),%rbp
lea    0xe3c(%rip),%r12
lea    0xe54(%rip),%r14
nopl   (%rax)
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x28(%rsp)
movss  0x8(%rsp),%xmm0
movss  %xmm0,0x24(%rsp)
movss  0xc(%rsp),%xmm0
movss  %xmm0,0x10(%rsp)
mov    %rbx,%rdi
lea    0xd8f(%rip),%rsi
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
call   1080 <fscanf@plt>
movss  0x4(%rsp),%xmm2
movss  0x8(%rsp),%xmm3
movss  0x28(%rsp),%xmm0
movss  0x24(%rsp),%xmm1
call   10f0 <distance@plt>
movss  %xmm0,0x18(%rsp)
divss  0xd23(%rip),%xmm0
movss  0x30(%rsp),%xmm1
call   10c0 <calculate_calories@plt>
movss  %xmm0,0x20(%rsp)
movss  0xc(%rsp),%xmm2
movss  0x18(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
call   10a0 <calculate_slope@plt>
movss  %xmm0,0x3c(%rsp)
movss  0x18(%rsp),%xmm1
call   10b0 <calculate_virtual_distance@plt>
movss  %xmm0,0x14(%rsp)
movss  0x10(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
call   1050 <abs@plt>
divss  0x18(%rsp),%xmm0
movss  %xmm0,0x34(%rsp)
movss  0x2c(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
call   1040 <calculate_work@plt>
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x40(%rsp)
divsd  0xc9c(%rip),%xmm0
xorps  %xmm2,%xmm2
cvtsd2ss %xmm0,%xmm2
movss  0x14(%rsp),%xmm0
movss  0x20(%rsp),%xmm1
call   10d0 <calculate_actual_distance@plt>
movss  %xmm0,0x38(%rsp)
movss  0x28(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x24(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x10(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  0x4(%rsp),%xmm3
movss  0x8(%rsp),%xmm4
cvtss2sd %xmm3,%xmm3
cvtss2sd %xmm4,%xmm4
movss  0xc(%rsp),%xmm5
cvtss2sd %xmm5,%xmm5
lea    0xc7a(%rip),%rdi
mov    $0x6,%al
call   1070 <printf@plt>
movss  0x18(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc80(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movss  0x20(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc77(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movss  0x3c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movss  0x34(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    %r12,%rdi
movsd  0x40(%rsp),%xmm0
mov    $0x1,%al
call   1070 <printf@plt>
movss  0x38(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1090 <feof@plt>
test   %eax,%eax
je     1280 <simulate_walk+0xb0>
mov    %rbx,%rdi
call   1060 <fclose@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Reading file: %s, with mass of %f lbs\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [10 x i8] c"%f %f %f\0A\00"
@.str.3 = [30 x i8] c"(%f, %f, %f) -> (%f, %f, %f)\0A\00"
@.str.4 = [15 x i8] c"\09Distance: %f\0A\00"
@.str.5 = [15 x i8] c"\09Calories: %f\0A\00"
@.str.6 = [12 x i8] c"\09Slope: %f\0A\00"
@.str.7 = [12 x i8] c"\09Grade: %f\0A\00"
@.str.8 = [23 x i8] c"\09Virtual distance: %f\0A\00"
@.str.9 = [31 x i8] c"\09Esimated calories needed: %f\0A\00"
@.str.10 = [40 x i8] c"\09Actual virtual distance travelled: %f\0A\00"
@.str.11 = [2 x i8] c"\0A\00"
define void @simulate_walk(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
%5 = alloca i32*
%6 = alloca [3 x float]
%7 = alloca [3 x float]
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%15 = load i8*, i8** %3
%16 = load float, float* %4
%17 = fpext float %16 to double
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %15, double %17)
%19 = load i8*, i8** %3
%20 = call i32* @fopen(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %20, i32** %5
%21 = load i32*, i32** %5
%22 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 0
%23 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 1
%24 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 2
%25 = call i32 @fscanf(i32* %21, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), float* %22, float* %23, float* %24)
br label %26
26: ; preds = %31, %2
%27 = load i32*, i32** %5
%28 = call i32 @feof(i32* %27)
%29 = icmp ne i32 %28, 0
%30 = xor i1 %29, true
br i1 %30, label %31, label %131
31: ; preds = %26
%32 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 0
%33 = load float, float* %32
%34 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 0
store float %33, float* %34
%35 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 1
%36 = load float, float* %35
%37 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 1
store float %36, float* %37
%38 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 2
%39 = load float, float* %38
%40 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 2
store float %39, float* %40
%41 = load i32*, i32** %5
%42 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 0
%43 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 1
%44 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 2
%45 = call i32 @fscanf(i32* %41, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), float* %42, float* %43, float* %44)
%46 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 0
%47 = load float, float* %46
%48 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 1
%49 = load float, float* %48
%50 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 0
%51 = load float, float* %50
%52 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 1
%53 = load float, float* %52
%54 = call float @distance(float %47, float %49, float %51, float %53)
store float %54, float* %8
%55 = load float, float* %8
%56 = fdiv float %55, 0x4099255C20000000
%57 = load float, float* %4
%58 = call float @calculate_calories(float %56, float %57)
store float %58, float* %9
%59 = load float, float* %8
%60 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 2
%61 = load float, float* %60
%62 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 2
%63 = load float, float* %62
%64 = call float @calculate_slope(float %59, float %61, float %63)
store float %64, float* %10
%65 = load float, float* %10
%66 = load float, float* %8
%67 = call float @calculate_virtual_distance(float %65, float %66)
store float %67, float* %12
%68 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 2
%69 = load float, float* %68
%70 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 2
%71 = load float, float* %70
%72 = fsub float %69, %71
%73 = call float @abs(float %72)
%74 = load float, float* %8
%75 = fdiv float %73, %74
store float %75, float* %11
%76 = load float, float* %11
%77 = load float, float* %4
%78 = fpext float %77 to double
%79 = fmul double %78, 4.534920e-01
%80 = fptrunc double %79 to float
%81 = load float, float* %12
%82 = call float @calculate_work(float %76, float %80, float %81)
store float %82, float* %13
%83 = load float, float* %12
%84 = load float, float* %9
%85 = load float, float* %13
%86 = fpext float %85 to double
%87 = fdiv double %86, 4.184000e+00
%88 = fptrunc double %87 to float
%89 = call float @calculate_actual_distance(float %83, float %84, float %88)
store float %89, float* %14
%90 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 0
%91 = load float, float* %90
%92 = fpext float %91 to double
%93 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 1
%94 = load float, float* %93
%95 = fpext float %94 to double
%96 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 2
%97 = load float, float* %96
%98 = fpext float %97 to double
%99 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 0
%100 = load float, float* %99
%101 = fpext float %100 to double
%102 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 1
%103 = load float, float* %102
%104 = fpext float %103 to double
%105 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 2
%106 = load float, float* %105
%107 = fpext float %106 to double
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), double %92, double %95, double %98, double %101, double %104, double %107)
%109 = load float, float* %8
%110 = fpext float %109 to double
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %110)
%112 = load float, float* %9
%113 = fpext float %112 to double
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double %113)
%115 = load float, float* %10
%116 = fpext float %115 to double
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), double %116)
%118 = load float, float* %11
%119 = fpext float %118 to double
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), double %119)
%121 = load float, float* %12
%122 = fpext float %121 to double
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), double %122)
%124 = load float, float* %13
%125 = fpext float %124 to double
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), double %125)
%127 = load float, float* %14
%128 = fpext float %127 to double
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.10, i64 0, i64 0), double %128)
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %26
131: ; preds = %26
%132 = load i32*, i32** %5
%133 = call i32 @fclose(i32* %132)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Reading file: %s, with mass of %f lbs\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [10 x i8] c"%f %f %f\0A\00"
@.str.3 = [30 x i8] c"(%f, %f, %f) -> (%f, %f, %f)\0A\00"
@.str.4 = [15 x i8] c"\09Distance: %f\0A\00"
@.str.5 = [15 x i8] c"\09Calories: %f\0A\00"
@.str.6 = [12 x i8] c"\09Slope: %f\0A\00"
@.str.7 = [12 x i8] c"\09Grade: %f\0A\00"
@.str.8 = [23 x i8] c"\09Virtual distance: %f\0A\00"
@.str.9 = [31 x i8] c"\09Esimated calories needed: %f\0A\00"
@.str.10 = [40 x i8] c"\09Actual virtual distance travelled: %f\0A\00"
define void @simulate_walk(i8* %0, float %1) {
%3 = alloca [3 x float]
%4 = fpext float %1 to double
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0, double %4)
%6 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = bitcast [3 x float]* %3 to i8*
%8 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%9 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 1
%10 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 2
%11 = call i32 @fscanf(i32* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), float* %8, float* %9, float* %10)
%12 = call i32 @feof(i32* %6)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %65
14: ; preds = %2
%15 = fmul double %4, 4.534920e-01
%16 = fptrunc double %15 to float
br label %17
17: ; preds = %14, %17
%18 = load float, float* %8
%19 = load float, float* %9
%20 = load float, float* %10
%21 = call i32 @fscanf(i32* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), float* %8, float* %9, float* %10)
%22 = load float, float* %8
%23 = load float, float* %9
%24 = call float @distance(float %18, float %19, float %22, float %23)
%25 = fdiv float %24, 0x4099255C20000000
%26 = call float @calculate_calories(float %25, float %1)
%27 = load float, float* %10
%28 = call float @calculate_slope(float %24, float %20, float %27)
%29 = call float @calculate_virtual_distance(float %28, float %24)
%30 = load float, float* %10
%31 = fsub float %20, %30
%32 = call float @abs(float %31)
%33 = fdiv float %32, %24
%34 = call float @calculate_work(float %33, float %16, float %29)
%35 = fpext float %34 to double
%36 = fdiv double %35, 4.184000e+00
%37 = fptrunc double %36 to float
%38 = call float @calculate_actual_distance(float %29, float %26, float %37)
%39 = fpext float %18 to double
%40 = fpext float %19 to double
%41 = fpext float %20 to double
%42 = load float, float* %8
%43 = fpext float %42 to double
%44 = load float, float* %9
%45 = fpext float %44 to double
%46 = load float, float* %10
%47 = fpext float %46 to double
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), double %39, double %40, double %41, double %43, double %45, double %47)
%49 = fpext float %24 to double
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %49)
%51 = fpext float %26 to double
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double %51)
%53 = fpext float %28 to double
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), double %53)
%55 = fpext float %33 to double
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), double %55)
%57 = fpext float %29 to double
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), double %57)
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), double %35)
%60 = fpext float %38 to double
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.10, i64 0, i64 0), double %60)
%62 = call i32 @putchar(i32 10)
%63 = call i32 @feof(i32* %6)
%64 = icmp eq i32 %63, 0
br i1 %64, label %17, label %65
65: ; preds = %17, %2
%66 = call i32 @fclose(i32* %6)
ret void
}