#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*/ free(float *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, float);
int main() {
  float *a = (float *)malloc(100 * sizeof(float));
  int i;
  for (i = 0; i < 100; ++i)
    a[i] = i;
  float *b = a + 5;
  for (i = 0; i < 5; ++i) {
    printf("%f,", b[i]);
  }
  free(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x190,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    117e <main+0x4e>
cvtsi2ssl -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1154 <main+0x24>
mov    -0x10(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    11c2 <main+0x92>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
lea    0xe51(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1191 <main+0x61>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x190,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movaps 0xeb8(%rip),%xmm0
movups %xmm0,(%rax)
movaps 0xebe(%rip),%xmm0
movups %xmm0,0x10(%rax)
movaps 0xec3(%rip),%xmm0
movups %xmm0,0x20(%rax)
movaps 0xec8(%rip),%xmm0
movups %xmm0,0x30(%rax)
movaps 0xecd(%rip),%xmm0
movups %xmm0,0x40(%rax)
movaps 0xed2(%rip),%xmm0
movups %xmm0,0x50(%rax)
movaps 0xed7(%rip),%xmm0
movups %xmm0,0x60(%rax)
movaps 0xedc(%rip),%xmm0
movups %xmm0,0x70(%rax)
movaps 0xee1(%rip),%xmm0
movups %xmm0,0x80(%rax)
movaps 0xee3(%rip),%xmm0
movups %xmm0,0x90(%rax)
movaps 0xee5(%rip),%xmm0
movups %xmm0,0xa0(%rax)
movaps 0xee7(%rip),%xmm0
movups %xmm0,0xb0(%rax)
movaps 0xee9(%rip),%xmm0
movups %xmm0,0xc0(%rax)
movaps 0xeeb(%rip),%xmm0
movups %xmm0,0xd0(%rax)
movaps 0xeed(%rip),%xmm0
movups %xmm0,0xe0(%rax)
movaps 0xeef(%rip),%xmm0
movups %xmm0,0xf0(%rax)
movaps 0xef1(%rip),%xmm0
movups %xmm0,0x100(%rax)
movaps 0xef3(%rip),%xmm0
movups %xmm0,0x110(%rax)
movaps 0xef5(%rip),%xmm0
movups %xmm0,0x120(%rax)
movaps 0xef7(%rip),%xmm0
movups %xmm0,0x130(%rax)
movaps 0xef9(%rip),%xmm0
movups %xmm0,0x140(%rax)
movaps 0xefb(%rip),%xmm0
movups %xmm0,0x150(%rax)
movaps 0xefd(%rip),%xmm0
movups %xmm0,0x160(%rax)
movaps 0xeff(%rip),%xmm0
movups %xmm0,0x170(%rax)
movaps 0xf01(%rip),%xmm0
movups %xmm0,0x180(%rax)
movss  0x14(%rax),%xmm0
lea    0xefe(%rip),%r14
mov    %r14,%rdi
call   1040 <printf@plt>
movss  0x18(%rbx),%xmm0
mov    %r14,%rdi
call   1040 <printf@plt>
movss  0x1c(%rbx),%xmm0
mov    %r14,%rdi
call   1040 <printf@plt>
movss  0x20(%rbx),%xmm0
mov    %r14,%rdi
call   1040 <printf@plt>
movss  0x24(%rbx),%xmm0
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f,\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float*
%3 = alloca i32
%4 = alloca float*
store i32 0, i32* %1
%5 = call i64 @malloc(i32 400)
%6 = inttoptr i64 %5 to float*
store float* %6, float** %2
store i32 0, i32* %3
br label %7
7: ; preds = %17, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 100
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to float
%13 = load float*, float** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds float, float* %13, i64 %15
store float %12, float* %16
br label %17
17: ; preds = %10
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %7
20: ; preds = %7
%21 = load float*, float** %2
%22 = getelementptr inbounds float, float* %21, i64 5
store float* %22, float** %4
store i32 0, i32* %3
br label %23
23: ; preds = %33, %20
%24 = load i32, i32* %3
%25 = icmp slt i32 %24, 5
br i1 %25, label %26, label %36
26: ; preds = %23
%27 = load float*, float** %4
%28 = load i32, i32* %3
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds float, float* %27, i64 %29
%31 = load float, float* %30
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %31)
br label %33
33: ; preds = %26
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %23
36: ; preds = %23
%37 = load float*, float** %2
%38 = call i32 @free(float* %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f,\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 400)
%2 = inttoptr i64 %1 to float*
%3 = inttoptr i64 %1 to <4 x float>*
store <4 x float> <float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00>, <4 x float>* %3
%4 = getelementptr inbounds float, float* %2, i64 4
%5 = bitcast float* %4 to <4 x float>*
store <4 x float> <float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00>, <4 x float>* %5
%6 = getelementptr inbounds float, float* %2, i64 8
%7 = bitcast float* %6 to <4 x float>*
store <4 x float> <float 8.000000e+00, float 9.000000e+00, float 1.000000e+01, float 1.100000e+01>, <4 x float>* %7
%8 = getelementptr inbounds float, float* %2, i64 12
%9 = bitcast float* %8 to <4 x float>*
store <4 x float> <float 1.200000e+01, float 1.300000e+01, float 1.400000e+01, float 1.500000e+01>, <4 x float>* %9
%10 = getelementptr inbounds float, float* %2, i64 16
%11 = bitcast float* %10 to <4 x float>*
store <4 x float> <float 1.600000e+01, float 1.700000e+01, float 1.800000e+01, float 1.900000e+01>, <4 x float>* %11
%12 = getelementptr inbounds float, float* %2, i64 20
%13 = bitcast float* %12 to <4 x float>*
store <4 x float> <float 2.000000e+01, float 2.100000e+01, float 2.200000e+01, float 2.300000e+01>, <4 x float>* %13
%14 = getelementptr inbounds float, float* %2, i64 24
%15 = bitcast float* %14 to <4 x float>*
store <4 x float> <float 2.400000e+01, float 2.500000e+01, float 2.600000e+01, float 2.700000e+01>, <4 x float>* %15
%16 = getelementptr inbounds float, float* %2, i64 28
%17 = bitcast float* %16 to <4 x float>*
store <4 x float> <float 2.800000e+01, float 2.900000e+01, float 3.000000e+01, float 3.100000e+01>, <4 x float>* %17
%18 = getelementptr inbounds float, float* %2, i64 32
%19 = bitcast float* %18 to <4 x float>*
store <4 x float> <float 3.200000e+01, float 3.300000e+01, float 3.400000e+01, float 3.500000e+01>, <4 x float>* %19
%20 = getelementptr inbounds float, float* %2, i64 36
%21 = bitcast float* %20 to <4 x float>*
store <4 x float> <float 3.600000e+01, float 3.700000e+01, float 3.800000e+01, float 3.900000e+01>, <4 x float>* %21
%22 = getelementptr inbounds float, float* %2, i64 40
%23 = bitcast float* %22 to <4 x float>*
store <4 x float> <float 4.000000e+01, float 4.100000e+01, float 4.200000e+01, float 4.300000e+01>, <4 x float>* %23
%24 = getelementptr inbounds float, float* %2, i64 44
%25 = bitcast float* %24 to <4 x float>*
store <4 x float> <float 4.400000e+01, float 4.500000e+01, float 4.600000e+01, float 4.700000e+01>, <4 x float>* %25
%26 = getelementptr inbounds float, float* %2, i64 48
%27 = bitcast float* %26 to <4 x float>*
store <4 x float> <float 4.800000e+01, float 4.900000e+01, float 5.000000e+01, float 5.100000e+01>, <4 x float>* %27
%28 = getelementptr inbounds float, float* %2, i64 52
%29 = bitcast float* %28 to <4 x float>*
store <4 x float> <float 5.200000e+01, float 5.300000e+01, float 5.400000e+01, float 5.500000e+01>, <4 x float>* %29
%30 = getelementptr inbounds float, float* %2, i64 56
%31 = bitcast float* %30 to <4 x float>*
store <4 x float> <float 5.600000e+01, float 5.700000e+01, float 5.800000e+01, float 5.900000e+01>, <4 x float>* %31
%32 = getelementptr inbounds float, float* %2, i64 60
%33 = bitcast float* %32 to <4 x float>*
store <4 x float> <float 6.000000e+01, float 6.100000e+01, float 6.200000e+01, float 6.300000e+01>, <4 x float>* %33
%34 = getelementptr inbounds float, float* %2, i64 64
%35 = bitcast float* %34 to <4 x float>*
store <4 x float> <float 6.400000e+01, float 6.500000e+01, float 6.600000e+01, float 6.700000e+01>, <4 x float>* %35
%36 = getelementptr inbounds float, float* %2, i64 68
%37 = bitcast float* %36 to <4 x float>*
store <4 x float> <float 6.800000e+01, float 6.900000e+01, float 7.000000e+01, float 7.100000e+01>, <4 x float>* %37
%38 = getelementptr inbounds float, float* %2, i64 72
%39 = bitcast float* %38 to <4 x float>*
store <4 x float> <float 7.200000e+01, float 7.300000e+01, float 7.400000e+01, float 7.500000e+01>, <4 x float>* %39
%40 = getelementptr inbounds float, float* %2, i64 76
%41 = bitcast float* %40 to <4 x float>*
store <4 x float> <float 7.600000e+01, float 7.700000e+01, float 7.800000e+01, float 7.900000e+01>, <4 x float>* %41
%42 = getelementptr inbounds float, float* %2, i64 80
%43 = bitcast float* %42 to <4 x float>*
store <4 x float> <float 8.000000e+01, float 8.100000e+01, float 8.200000e+01, float 8.300000e+01>, <4 x float>* %43
%44 = getelementptr inbounds float, float* %2, i64 84
%45 = bitcast float* %44 to <4 x float>*
store <4 x float> <float 8.400000e+01, float 8.500000e+01, float 8.600000e+01, float 8.700000e+01>, <4 x float>* %45
%46 = getelementptr inbounds float, float* %2, i64 88
%47 = bitcast float* %46 to <4 x float>*
store <4 x float> <float 8.800000e+01, float 8.900000e+01, float 9.000000e+01, float 9.100000e+01>, <4 x float>* %47
%48 = getelementptr inbounds float, float* %2, i64 92
%49 = bitcast float* %48 to <4 x float>*
store <4 x float> <float 9.200000e+01, float 9.300000e+01, float 9.400000e+01, float 9.500000e+01>, <4 x float>* %49
%50 = getelementptr inbounds float, float* %2, i64 96
%51 = bitcast float* %50 to <4 x float>*
store <4 x float> <float 9.600000e+01, float 9.700000e+01, float 9.800000e+01, float 9.900000e+01>, <4 x float>* %51
%52 = getelementptr inbounds float, float* %2, i64 5
%53 = load float, float* %52
%54 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %53)
%55 = getelementptr inbounds float, float* %2, i64 6
%56 = load float, float* %55
%57 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %56)
%58 = getelementptr inbounds float, float* %2, i64 7
%59 = load float, float* %58
%60 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %59)
%61 = getelementptr inbounds float, float* %2, i64 8
%62 = load float, float* %61
%63 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %62)
%64 = getelementptr inbounds float, float* %2, i64 9
%65 = load float, float* %64
%66 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %65)
%67 = tail call i32 @free(float* %2)
ret i32 0
}