#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 main(void) {
  float float_vals[] = {1.2f, -3.7f, 6.2f, 8.55f};
  int i;
  void multiply_by_2(float array[], int n);
  multiply_by_2(float_vals, 4);
  for (i = 0; i < 4; ++i) {
    printf("%.2f ", float_vals[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1040 <multiply_by_2@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    118e <main+0x6e>
movslq -0x24(%rbp),%rax
movss  -0x20(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe97(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115a <main+0x3a>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movaps 0xec4(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1050 <multiply_by_2@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb3(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.float_vals = [4 x float] [float 0x3FF3333340000000, float 0xC00D9999A0000000, float 0x4018CCCCC0000000, float 0x40211999A0000000]
@.str = [6 x i8] c"%.2f \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x float]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [4 x float]* %2 to i8*
%5 = getelementptr inbounds [4 x float], [4 x float]* %2, i64 0, i64 0
store i32 0, i32* %3
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [4 x float], [4 x float]* %2, i64 0, i64 %11
%13 = load float, float* %12
%14 = fpext float %13 to double
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %14)
br label %16
16: ; preds = %9
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %6
19: ; preds = %6
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.float_vals = [4 x float] [float 0x3FF3333340000000, float 0xC00D9999A0000000, float 0x4018CCCCC0000000, float 0x40211999A0000000]
@.str = [6 x i8] c"%.2f \00"
define i32 @main() {
%1 = alloca [4 x float]
%2 = bitcast [4 x float]* %1 to i8*
%3 = getelementptr inbounds [4 x float], [4 x float]* %1, i64 0, i64 0
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %5)
%7 = getelementptr inbounds [4 x float], [4 x float]* %1, i64 0, i64 1
%8 = load float, float* %7
%9 = fpext float %8 to double
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %9)
%11 = getelementptr inbounds [4 x float], [4 x float]* %1, i64 0, i64 2
%12 = load float, float* %11
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %13)
%15 = getelementptr inbounds [4 x float], [4 x float]* %1, i64 0, i64 3
%16 = load float, float* %15
%17 = fpext float %16 to double
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %17)
%19 = call i32 @putchar(i32 10)
ret i32 0
}