#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 *, ...);
void ppMemF(float *mem, int len) {
  int i;
  printf("MEM1:\n");
  for (i = 0; i < len; i = i + 4) {
    printf("%lf, %lf, %lf, %lf\n", mem[i], mem[i + 1], mem[i + 2], mem[i + 3]);
    mem[i] = 0;
    mem[i + 1] = 0;
    mem[i + 2] = 0;
    mem[i + 3] = 0;
  }
}


x86 assembly (clang, -O0):
<ppMemF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11fe <ppMemF+0xee>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm2
cvtss2sd %xmm2,%xmm2
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xe6d(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <ppMemF+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppMemF>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %rdi,%rbx
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
test   %r15d,%r15d
jle    1191 <ppMemF+0x71>
xor    %ebp,%ebp
lea    0xec9(%rip),%r14
nopw   0x0(%rax,%rax,1)
movss  (%rbx,%rbp,4),%xmm0
movss  0x4(%rbx,%rbp,4),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
movss  0x8(%rbx,%rbp,4),%xmm2
cvtss2sd %xmm2,%xmm2
movss  0xc(%rbx,%rbp,4),%xmm3
cvtss2sd %xmm3,%xmm3
mov    %r14,%rdi
mov    $0x4,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
movups %xmm0,(%rbx,%rbp,4)
add    $0x4,%rbp
cmp    %r15d,%ebp
jl     1150 <ppMemF+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"MEM1:\0A\00"
@.str.1 = [20 x i8] c"%lf, %lf, %lf, %lf\0A\00"
define void @ppMemF(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %7
7: ; preds = %59, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %62
11: ; preds = %7
%12 = load float*, float** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds float, float* %12, i64 %14
%16 = load float, float* %15
%17 = fpext float %16 to double
%18 = load float*, float** %3
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds float, float* %18, i64 %21
%23 = load float, float* %22
%24 = fpext float %23 to double
%25 = load float*, float** %3
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 2
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds float, float* %25, i64 %28
%30 = load float, float* %29
%31 = fpext float %30 to double
%32 = load float*, float** %3
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds float, float* %32, i64 %35
%37 = load float, float* %36
%38 = fpext float %37 to double
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %17, double %24, double %31, double %38)
%40 = load float*, float** %3
%41 = load i32, i32* %5
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds float, float* %40, i64 %42
store float 0.000000e+00, float* %43
%44 = load float*, float** %3
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 1
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds float, float* %44, i64 %47
store float 0.000000e+00, float* %48
%49 = load float*, float** %3
%50 = load i32, i32* %5
%51 = add nsw i32 %50, 2
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds float, float* %49, i64 %52
store float 0.000000e+00, float* %53
%54 = load float*, float** %3
%55 = load i32, i32* %5
%56 = add nsw i32 %55, 3
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds float, float* %54, i64 %57
store float 0.000000e+00, float* %58
br label %59
59: ; preds = %11
%60 = load i32, i32* %5
%61 = add nsw i32 %60, 4
store i32 %61, i32* %5
br label %7
62: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"%lf, %lf, %lf, %lf\0A\00"
@str = [6 x i8] c"MEM1:\00"
define void @ppMemF(float* nocapture %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %27
5: ; preds = %2, %5
%6 = phi i64 [ %24, %5 ], [ 0, %2 ]
%7 = getelementptr inbounds float, float* %0, i64 %6
%8 = load float, float* %7
%9 = fpext float %8 to double
%10 = or i64 %6, 1
%11 = getelementptr inbounds float, float* %0, i64 %10
%12 = load float, float* %11
%13 = fpext float %12 to double
%14 = or i64 %6, 2
%15 = getelementptr inbounds float, float* %0, i64 %14
%16 = load float, float* %15
%17 = fpext float %16 to double
%18 = or i64 %6, 3
%19 = getelementptr inbounds float, float* %0, i64 %18
%20 = load float, float* %19
%21 = fpext float %20 to double
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %9, double %13, double %17, double %21)
%23 = bitcast float* %7 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %23
%24 = add nuw i64 %6, 4
%25 = trunc i64 %24 to i32
%26 = icmp slt i32 %25, %1
br i1 %26, label %5, label %27
27: ; preds = %5, %2
ret void
}