#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 /*<<< orphan*/ printf(char *, int, double);
void print_u(double *u, double n_x, double delta_x) {
  int i;
  for (i = 0; i < n_x; i++) {
    printf("%f %f\n", i * delta_x, u[i]);
  }
}


x86 assembly (clang, -O0):
<print_u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1176 <print_u+0x66>
cvtsi2sdl -0x1c(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%esi
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112d <print_u+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_u>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jbe    1172 <print_u+0x62>
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xed1(%rip),%r14
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
nopw   0x0(%rax,%rax,1)
mulsd  %xmm1,%xmm2
cvttsd2si %xmm2,%esi
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
add    $0x1,%rbx
xorps  %xmm2,%xmm2
cvtsi2sd %ebx,%xmm2
ucomisd %xmm2,%xmm0
ja     1140 <print_u+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%f %f\0A\00"
define void @print_u(double* nocapture %0, double %1, double %2) {
%4 = fcmp ogt double %1, 0.000000e+00
br i1 %4, label %5, label %17
5: ; preds = %3, %5
%6 = phi i64 [ %13, %5 ], [ 0, %3 ]
%7 = phi double [ %15, %5 ], [ 0.000000e+00, %3 ]
%8 = fmul double %7, %2
%9 = fptosi double %8 to i32
%10 = getelementptr inbounds double, double* %0, i64 %6
%11 = load double, double* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %9, double %11)
%13 = add nuw i64 %6, 1
%14 = trunc i64 %13 to i32
%15 = sitofp i32 %14 to double
%16 = fcmp olt double %15, %1
br i1 %16, label %5, label %17
17: ; preds = %5, %3
ret void
}