#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 */
int calculate_data(double, double, int);
int /*<<< orphan*/ printf(char *, ...);
void print_data(int m, double h_x, double t, int k) {
  int i;
  double x;
  printf("%.3f ", t);
  for (i = 0; i <= m; i++) {
    x = i * h_x;
    printf("%.3d ", calculate_data(x, t, k));
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xebc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     119d <print_data+0x7d>
cvtsi2sdl -0x20(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x1c(%rbp),%edi
call   1040 <calculate_data@plt>
mov    %eax,%esi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1152 <print_data+0x32>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_data>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %esi,%r15d
movsd  %xmm0,0x8(%rsp)
mov    %edi,%ebp
lea    0xeb4(%rip),%rdi
movsd  %xmm1,0x10(%rsp)
movapd %xmm1,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
test   %ebp,%ebp
js     119e <print_data+0x6e>
add    $0x1,%ebp
lea    0xe9b(%rip),%r14
xor    %ebx,%ebx
nopl   (%rax)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %r15d,%edi
call   1050 <calculate_data@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1170 <print_data+0x40>
mov    $0xa,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%.3f \00"
@.str.1 = [6 x i8] c"%.3d \00"
define void @print_data(i32 %0, double %1, double %2, i32 %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %2)
%6 = icmp slt i32 %0, 0
br i1 %6, label %15, label %7
7: ; preds = %4, %7
%8 = phi i32 [ %13, %7 ], [ 0, %4 ]
%9 = sitofp i32 %8 to double
%10 = fmul double %9, %1
%11 = tail call i32 @calculate_data(double %10, double %2, i32 %3)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = add nuw i32 %8, 1
%14 = icmp eq i32 %8, %0
br i1 %14, label %15, label %7
15: ; preds = %7, %4
%16 = tail call i32 @putchar(i32 10)
ret void
}