#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, int);
void showForGnuplot(int X[], int s) {
  int j;
  for (j = 5; j < (5 * 10) - 5 + 2; j++)
    printf("%d %2.4f \n", j, X[j] * 1.0 / (s * 1.0));
}


x86 assembly (clang, -O0):
<showForGnuplot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
cmpl   $0x2f,-0x10(%rbp)
jge    117f <showForGnuplot+0x6f>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm0
movsd  0xeb8(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xea7(%rip),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <showForGnuplot+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showForGnuplot>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
cvtsi2sd %esi,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x5,%ebx
lea    0xece(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xorps  %xmm0,%xmm0
cvtsi2sdl (%r14,%rbx,4),%xmm0
divsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x2f,%rbx
jne    1140 <showForGnuplot+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%d %2.4f \0A\00"
define void @showForGnuplot(i32* nocapture %0, i32 %1) {
%3 = sitofp i32 %1 to double
br label %4
4: ; preds = %2, %4
%5 = phi i64 [ 5, %2 ], [ %13, %4 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, %3
%10 = fptosi double %9 to i32
%11 = trunc i64 %5 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %10)
%13 = add nuw nsw i64 %5, 1
%14 = icmp eq i64 %13, 47
br i1 %14, label %15, label %4
15: ; preds = %4
ret void
}