#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 get_edf_bound(double, int);
int /*<<< orphan*/ pow(double, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  double bound, i;
  int j;
  int k[] = {1, 2, 4, 16};
  int len_k = 4;
  printf("U");
  for (j = 0; j < len_k; j++)
    printf(" k=%d", k[j]);
  printf("\n");
  for (i = 0; i < 1.0; i += 0.001) {
    printf("%lf", i);
    for (j = 0; j < len_k; j++) {
      bound = get_edf_bound(i, k[j]);
      printf(" %lf", pow(bound, 4));
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x4,-0x34(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    11a1 <main+0x71>
movslq -0x1c(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1171 <main+0x41>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe41(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1259 <main+0x129>
movsd  -0x18(%rbp),%xmm0
lea    0xe55(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1234 <main+0x104>
movsd  -0x18(%rbp),%xmm0
movslq -0x1c(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edi
call   1050 <get_edf_bound@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
mov    %eax,%esi
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11e4 <main+0xb4>
lea    0xded(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xdbe(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11b7 <main+0x87>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x55,%edi
call   1030 <putchar@plt>
lea    0xebb(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xorpd  %xmm0,%xmm0
lea    0xe71(%rip),%r14
lea    0xe69(%rip),%rbx
nopl   (%rax)
movsd  %xmm0,(%rsp)
mov    %r14,%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  (%rsp),%xmm0
mov    $0x1,%edi
call   1060 <get_edf_bound@plt>
mov    $0x4,%edi
call   1050 <pow@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  (%rsp),%xmm0
mov    $0x2,%edi
call   1060 <get_edf_bound@plt>
mov    $0x4,%edi
call   1050 <pow@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  (%rsp),%xmm0
mov    $0x4,%edi
call   1060 <get_edf_bound@plt>
mov    $0x4,%edi
call   1050 <pow@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  (%rsp),%xmm0
mov    $0x10,%edi
call   1060 <get_edf_bound@plt>
mov    $0x4,%edi
call   1050 <pow@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  (%rsp),%xmm0
addsd  0xd91(%rip),%xmm0
movsd  0xd91(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     11b0 <main+0x70>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.k = [4 x i32] [i32 1, i32 2, i32 4, i32 16]
@.str = [2 x i8] c"U\00"
@.str.1 = [6 x i8] c" k=%d\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [4 x i8] c"%lf\00"
@.str.4 = [5 x i8] c" %lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca [4 x i32]
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [4 x i32]* %5 to i8*
store i32 4, i32* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %9
9: ; preds = %19, %0
%10 = load i32, i32* %4
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %22
13: ; preds = %9
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %13
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %9
22: ; preds = %9
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store double 0.000000e+00, double* %3
br label %24
24: ; preds = %49, %22
%25 = load double, double* %3
%26 = fcmp olt double %25, 1.000000e+00
br i1 %26, label %27, label %52
27: ; preds = %24
%28 = load double, double* %3
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %28)
store i32 0, i32* %4
br label %30
30: ; preds = %44, %27
%31 = load i32, i32* %4
%32 = load i32, i32* %6
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %47
34: ; preds = %30
%35 = load double, double* %3
%36 = load i32, i32* %4
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = call double @get_edf_bound(double %35, i32 %39)
store double %40, double* %2
%41 = load double, double* %2
%42 = call i32 @pow(double %41, i32 4)
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %42)
br label %44
44: ; preds = %34
%45 = load i32, i32* %4
%46 = add nsw i32 %45, 1
store i32 %46, i32* %4
br label %30
47: ; preds = %30
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %49
49: ; preds = %47
%50 = load double, double* %3
%51 = fadd double %50, 1.000000e-03
store double %51, double* %3
br label %24
52: ; preds = %24
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c" k=%d\00"
@.str.3 = [4 x i8] c"%lf\00"
@.str.4 = [5 x i8] c" %lf\00"
define i32 @main() {
%1 = tail call i32 @putchar(i32 85)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 4)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 16)
%6 = tail call i32 @putchar(i32 10)
br label %7
7: ; preds = %0, %7
%8 = phi double [ 0.000000e+00, %0 ], [ %23, %7 ]
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %8)
%10 = tail call double @get_edf_bound(double %8, i32 1)
%11 = tail call i32 @pow(double %10, i32 4)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %11)
%13 = tail call double @get_edf_bound(double %8, i32 2)
%14 = tail call i32 @pow(double %13, i32 4)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %14)
%16 = tail call double @get_edf_bound(double %8, i32 4)
%17 = tail call i32 @pow(double %16, i32 4)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %17)
%19 = tail call double @get_edf_bound(double %8, i32 16)
%20 = tail call i32 @pow(double %19, i32 4)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %20)
%22 = tail call i32 @putchar(i32 10)
%23 = fadd double %8, 1.000000e-03
%24 = fcmp olt double %23, 1.000000e+00
br i1 %24, label %7, label %25
25: ; preds = %7
ret i32 0
}