#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*/ changeArays(int *, int *, int);
int /*<<< orphan*/ changeDoubles(double *, double *);
int /*<<< orphan*/ fill(int *, int);
int /*<<< orphan*/ printArray(int *, int *);
int main() {
  double d1 = 10, d2 = 20;
  double tmp1 = d1;
  d1 = d2;
  d2 = tmp1;
  double *pd1 = &d1, *pd2 = &d2;
  double tmp2 = *pd1;
  *pd1 = *pd2;
  *pd2 = tmp2;
  changeDoubles(&d1, &d2);
  int pole10[10], pole15[15], pole20[20];
  fill(pole10, 10);
  fill(pole15, 15);
  fill(pole20, 20);
  printArray(pole10, &pole10[9]);
  printArray(pole15, &pole15[14]);
  printArray(pole20, &pole20[19]);
  int poleA[10];
  int poleB[10];
  for (int i = 0; i < 10; i++)
    poleA[i] = 1;
  for (int i = 0; i < 10; i++)
    poleB[i] = 2;
  changeArays(poleA, poleB, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xeae(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe99(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <changeDoubles@plt>
lea    -0x60(%rbp),%rdi
mov    $0xa,%esi
call   1040 <fill@plt>
lea    -0xa0(%rbp),%rdi
mov    $0xf,%esi
call   1040 <fill@plt>
lea    -0xf0(%rbp),%rdi
mov    $0x14,%esi
call   1040 <fill@plt>
lea    -0x60(%rbp),%rdi
lea    -0x60(%rbp),%rsi
add    $0x24,%rsi
call   1050 <printArray@plt>
lea    -0xa0(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
add    $0x38,%rsi
call   1050 <printArray@plt>
lea    -0xf0(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
add    $0x4c,%rsi
call   1050 <printArray@plt>
movl   $0x0,-0x154(%rbp)
cmpl   $0xa,-0x154(%rbp)
jge    127d <main+0x13d>
movslq -0x154(%rbp),%rax
movl   $0x1,-0x120(%rbp,%rax,4)
mov    -0x154(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x154(%rbp)
jmp    124a <main+0x10a>
movl   $0x0,-0x158(%rbp)
cmpl   $0xa,-0x158(%rbp)
jge    12ba <main+0x17a>
movslq -0x158(%rbp),%rax
movl   $0x2,-0x150(%rbp,%rax,4)
mov    -0x158(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x158(%rbp)
jmp    1287 <main+0x147>
lea    -0x120(%rbp),%rdi
lea    -0x150(%rbp),%rsi
mov    $0xa,%edx
call   1030 <changeArays@plt>
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x130,%rsp
movabs $0x4024000000000000,%rax
mov    %rax,0x8(%rsp)
movabs $0x4034000000000000,%rax
mov    %rax,(%rsp)
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1060 <changeDoubles@plt>
lea    0x70(%rsp),%r14
mov    %r14,%rdi
mov    $0xa,%esi
call   1040 <fill@plt>
lea    0xa0(%rsp),%r15
mov    %r15,%rdi
mov    $0xf,%esi
call   1040 <fill@plt>
lea    0xe0(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <fill@plt>
lea    0x94(%rsp),%rsi
mov    %r14,%rdi
call   1050 <printArray@plt>
lea    0xd8(%rsp),%rsi
mov    %r15,%rdi
call   1050 <printArray@plt>
lea    0x12c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <printArray@plt>
movaps 0xe17(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movabs $0x100000001,%rax
mov    %rax,0x60(%rsp)
movaps 0xe07(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movabs $0x200000002,%rax
mov    %rax,0x30(%rsp)
lea    0x40(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0xa,%edx
call   1030 <changeArays@plt>
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca [10 x i32]
%9 = alloca [15 x i32]
%10 = alloca [20 x i32]
%11 = alloca [10 x i32]
%12 = alloca [10 x i32]
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %1
store double 1.000000e+01, double* %2
store double 2.000000e+01, double* %3
%15 = load double, double* %2
store double %15, double* %4
%16 = load double, double* %3
store double %16, double* %2
%17 = load double, double* %4
store double %17, double* %3
store double* %2, double** %5
store double* %3, double** %6
%18 = load double*, double** %5
%19 = load double, double* %18
store double %19, double* %7
%20 = load double*, double** %6
%21 = load double, double* %20
%22 = load double*, double** %5
store double %21, double* %22
%23 = load double, double* %7
%24 = load double*, double** %6
store double %23, double* %24
%25 = call i32 @changeDoubles(double* %2, double* %3)
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 0
%27 = call i32 @fill(i32* %26, i32 10)
%28 = getelementptr inbounds [15 x i32], [15 x i32]* %9, i64 0, i64 0
%29 = call i32 @fill(i32* %28, i32 15)
%30 = getelementptr inbounds [20 x i32], [20 x i32]* %10, i64 0, i64 0
%31 = call i32 @fill(i32* %30, i32 20)
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 0
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 9
%34 = call i32 @printArray(i32* %32, i32* %33)
%35 = getelementptr inbounds [15 x i32], [15 x i32]* %9, i64 0, i64 0
%36 = getelementptr inbounds [15 x i32], [15 x i32]* %9, i64 0, i64 14
%37 = call i32 @printArray(i32* %35, i32* %36)
%38 = getelementptr inbounds [20 x i32], [20 x i32]* %10, i64 0, i64 0
%39 = getelementptr inbounds [20 x i32], [20 x i32]* %10, i64 0, i64 19
%40 = call i32 @printArray(i32* %38, i32* %39)
store i32 0, i32* %13
br label %41
41: ; preds = %48, %0
%42 = load i32, i32* %13
%43 = icmp slt i32 %42, 10
br i1 %43, label %44, label %51
44: ; preds = %41
%45 = load i32, i32* %13
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [10 x i32], [10 x i32]* %11, i64 0, i64 %46
store i32 1, i32* %47
br label %48
48: ; preds = %44
%49 = load i32, i32* %13
%50 = add nsw i32 %49, 1
store i32 %50, i32* %13
br label %41
51: ; preds = %41
store i32 0, i32* %14
br label %52
52: ; preds = %59, %51
%53 = load i32, i32* %14
%54 = icmp slt i32 %53, 10
br i1 %54, label %55, label %62
55: ; preds = %52
%56 = load i32, i32* %14
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [10 x i32], [10 x i32]* %12, i64 0, i64 %57
store i32 2, i32* %58
br label %59
59: ; preds = %55
%60 = load i32, i32* %14
%61 = add nsw i32 %60, 1
store i32 %61, i32* %14
br label %52
62: ; preds = %52
%63 = getelementptr inbounds [10 x i32], [10 x i32]* %11, i64 0, i64 0
%64 = getelementptr inbounds [10 x i32], [10 x i32]* %12, i64 0, i64 0
%65 = call i32 @changeArays(i32* %63, i32* %64, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca [10 x i32]
%4 = alloca [15 x i32]
%5 = alloca [20 x i32]
%6 = alloca [10 x i32]
%7 = alloca [10 x i32]
%8 = bitcast double* %1 to i8*
%9 = bitcast double* %2 to i8*
store double 1.000000e+01, double* %1
store double 2.000000e+01, double* %2
%10 = call i32 @changeDoubles(double* %1, double* %2)
%11 = bitcast [10 x i32]* %3 to i8*
%12 = bitcast [15 x i32]* %4 to i8*
%13 = bitcast [20 x i32]* %5 to i8*
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%15 = call i32 @fill(i32* %14, i32 10)
%16 = getelementptr inbounds [15 x i32], [15 x i32]* %4, i64 0, i64 0
%17 = call i32 @fill(i32* %16, i32 15)
%18 = getelementptr inbounds [20 x i32], [20 x i32]* %5, i64 0, i64 0
%19 = call i32 @fill(i32* %18, i32 20)
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 9
%21 = call i32 @printArray(i32* %14, i32* %20)
%22 = getelementptr inbounds [15 x i32], [15 x i32]* %4, i64 0, i64 14
%23 = call i32 @printArray(i32* %16, i32* %22)
%24 = getelementptr inbounds [20 x i32], [20 x i32]* %5, i64 0, i64 19
%25 = call i32 @printArray(i32* %18, i32* %24)
%26 = bitcast [10 x i32]* %6 to i8*
%27 = bitcast [10 x i32]* %7 to i8*
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
%29 = bitcast [10 x i32]* %6 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %29
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 4
%31 = bitcast i32* %30 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %31
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 8
store i32 1, i32* %32
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 9
store i32 1, i32* %33
%34 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 0
%35 = bitcast [10 x i32]* %7 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %35
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 4
%37 = bitcast i32* %36 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %37
%38 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 8
store i32 2, i32* %38
%39 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 9
store i32 2, i32* %39
%40 = call i32 @changeArays(i32* %28, i32* %34, i32 10)
ret i32 0
}