#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*/ flushall();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
main() {
  float array1[3];
  float array2[3];
  int i;
  printf("Enter 3 decimal numbers: \n");
  for (i = 0; i < 3; i++) {
    scanf("%f", &*(array1 + i));
    flushall();
  }
  for (i = 0; i < 3; i++) {
    *(array2 + i) = *(array1 + i);
  }
  printf("\nThe contents of array1 are: \n");
  for (i = 0; i < 3; i++) {
    printf("%f \n", *(array1 + i));
  }
  printf("\nThe contents of array2 are: \n");
  for (i = 0; i < 3; i++) {
    printf("%f \n", *(array2 + i));
  }
  printf("\nPress 'enter' to exit...\n");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    119e <main+0x5e>
lea    -0x10(%rbp),%rsi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe97(%rip),%rdi
call   1060 <scanf@plt>
mov    $0x0,%al
call   1040 <flushall@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1164 <main+0x24>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    11d1 <main+0x91>
movslq -0x20(%rbp),%rax
movss  -0x10(%rbp,%rax,4),%xmm0
movslq -0x20(%rbp),%rax
movss  %xmm0,-0x1c(%rbp,%rax,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11a5 <main+0x65>
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    121a <main+0xda>
movslq -0x20(%rbp),%rax
movss  -0x10(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe38(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11e6 <main+0xa6>
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    1263 <main+0x123>
movslq -0x20(%rbp),%rax
movss  -0x1c(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdef(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    122f <main+0xef>
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
lea    0xe98(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <flushall@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <flushall@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <flushall@plt>
movss  0x8(%rsp),%xmm0
movss  %xmm0,0x14(%rsp)
movss  0xc(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movss  0x10(%rsp),%xmm0
movss  %xmm0,0x1c(%rsp)
lea    0xe53(%rip),%rdi
call   1030 <puts@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe1e(%rip),%rbx
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>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe22(%rip),%rdi
call   1030 <puts@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x18(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x1c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xdf8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Enter 3 decimal numbers: \0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [31 x i8] c"\0AThe contents of array1 are: \0A\00"
@.str.3 = [5 x i8] c"%f \0A\00"
@.str.4 = [31 x i8] c"\0AThe contents of array2 are: \0A\00"
@.str.5 = [27 x i8] c"\0APress 'enter' to exit...\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x float]
%3 = alloca [3 x float]
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds float, float* %10, i64 %12
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %13)
%15 = call i32 (...) @flushall()
br label %16
16: ; preds = %9
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %6
19: ; preds = %6
store i32 0, i32* %4
br label %20
20: ; preds = %33, %19
%21 = load i32, i32* %4
%22 = icmp slt i32 %21, 3
br i1 %22, label %23, label %36
23: ; preds = %20
%24 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
%25 = load i32, i32* %4
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds float, float* %24, i64 %26
%28 = load float, float* %27
%29 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds float, float* %29, i64 %31
store float %28, float* %32
br label %33
33: ; preds = %23
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %20
36: ; preds = %20
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %4
br label %38
38: ; preds = %49, %36
%39 = load i32, i32* %4
%40 = icmp slt i32 %39, 3
br i1 %40, label %41, label %52
41: ; preds = %38
%42 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
%43 = load i32, i32* %4
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds float, float* %42, i64 %44
%46 = load float, float* %45
%47 = fpext float %46 to double
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %47)
br label %49
49: ; preds = %41
%50 = load i32, i32* %4
%51 = add nsw i32 %50, 1
store i32 %51, i32* %4
br label %38
52: ; preds = %38
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %4
br label %54
54: ; preds = %65, %52
%55 = load i32, i32* %4
%56 = icmp slt i32 %55, 3
br i1 %56, label %57, label %68
57: ; preds = %54
%58 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%59 = load i32, i32* %4
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds float, float* %58, i64 %60
%62 = load float, float* %61
%63 = fpext float %62 to double
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %63)
br label %65
65: ; preds = %57
%66 = load i32, i32* %4
%67 = add nsw i32 %66, 1
store i32 %67, i32* %4
br label %54
68: ; preds = %54
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
%70 = call i32 (...) @getchar()
%71 = load i32, i32* %1
ret i32 %71
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.3 = [5 x i8] c"%f \0A\00"
@str = [26 x i8] c"Enter 3 decimal numbers: \00"
@str.6 = [30 x i8] c"\0AThe contents of array1 are: \00"
@str.7 = [30 x i8] c"\0AThe contents of array2 are: \00"
@str.8 = [26 x i8] c"\0APress 'enter' to exit...\00"
define i32 @main() {
%1 = alloca [3 x float]
%2 = bitcast [3 x float]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%6 = call i32 (...) @flushall()
%7 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %7)
%9 = call i32 (...) @flushall()
%10 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 2
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %10)
%12 = call i32 (...) @flushall()
%13 = load float, float* %4
%14 = load float, float* %7
%15 = load float, float* %10
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.6, i64 0, i64 0))
%17 = load float, float* %4
%18 = fpext float %17 to double
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %18)
%20 = load float, float* %7
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %21)
%23 = load float, float* %10
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %24)
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.7, i64 0, i64 0))
%27 = fpext float %13 to double
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %27)
%29 = fpext float %14 to double
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %29)
%31 = fpext float %15 to double
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %31)
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.8, i64 0, i64 0))
%34 = call i32 (...) @getchar()
ret i32 0
}