#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*/ mult_array(double *, int, double);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ show_array(double *, int);
int main(int argc, char const *argv[]) {
  double dip[5] = {20.0, 17.66, 8.2, 15.3, 22.22};
  printf("The original dip array:\n");
  show_array(dip, 5);
  mult_array(dip, 5, 2.5);
  printf("The dip array after calling mult_array():\n");
  show_array(dip, 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movsd  0xeba(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xea5(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe90(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe7b(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe66(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x5,%esi
call   1050 <show_array@plt>
lea    -0x40(%rbp),%rdi
mov    $0x5,%esi
movsd  0xe2e(%rip),%xmm0
call   1060 <mult_array@plt>
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x5,%esi
call   1050 <show_array@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xec4(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x40363851eb851eb8,%rax
38 36 40
mov    %rax,0x20(%rsp)
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <show_array@plt>
movsd  0xea1(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <mult_array@plt>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <show_array@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"The original dip array:\0A\00"
@.str.1 = [43 x i8] c"The dip array after calling mult_array():\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x double]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [5 x double]* %6 to i8*
%8 = bitcast i8* %7 to [5 x double]*
%9 = getelementptr inbounds [5 x double], [5 x double]* %8, i32 0, i32 0
store double 2.000000e+01, double* %9
%10 = getelementptr inbounds [5 x double], [5 x double]* %8, i32 0, i32 1
store double 1.766000e+01, double* %10
%11 = getelementptr inbounds [5 x double], [5 x double]* %8, i32 0, i32 2
store double 0x4020666666666666, double* %11
%12 = getelementptr inbounds [5 x double], [5 x double]* %8, i32 0, i32 3
store double 1.530000e+01, double* %12
%13 = getelementptr inbounds [5 x double], [5 x double]* %8, i32 0, i32 4
store double 2.222000e+01, double* %13
%14 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%15 = getelementptr inbounds [5 x double], [5 x double]* %6, i64 0, i64 0
%16 = call i32 @show_array(double* %15, i32 5)
%17 = getelementptr inbounds [5 x double], [5 x double]* %6, i64 0, i64 0
%18 = call i32 @mult_array(double* %17, i32 5, double 2.500000e+00)
%19 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%20 = getelementptr inbounds [5 x double], [5 x double]* %6, i64 0, i64 0
%21 = call i32 @show_array(double* %20, i32 5)
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"The original dip array:\00"
@str.2 = [42 x i8] c"The dip array after calling mult_array():\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x double]
%4 = bitcast [5 x double]* %3 to i8*
%5 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 0
%6 = bitcast [5 x double]* %3 to <2 x double>*
store <2 x double> <double 2.000000e+01, double 1.766000e+01>, <2 x double>* %6
%7 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 2
%8 = bitcast double* %7 to <2 x double>*
store <2 x double> <double 0x4020666666666666, double 1.530000e+01>, <2 x double>* %8
%9 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 4
store double 2.222000e+01, double* %9
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%11 = call i32 @show_array(double* %5, i32 5)
%12 = call i32 @mult_array(double* %5, i32 5, double 2.500000e+00)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.2, i64 0, i64 0))
%14 = call i32 @show_array(double* %5, i32 5)
ret i32 0
}