#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*/ print_double_array(double *, int);
int /*<<< orphan*/ print_int_array(int *, int);
int main() {
  int i;
  int a[(10)];
  double b[(10)];
  for (i = 0; i < (10); i++) {
    a[i] = i;
    b[i] = (double)i;
  }
  print_int_array(a, (10));
  print_double_array(b, (10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    116b <main+0x4b>
mov    -0x8(%rbp),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
cvtsi2sdl -0x8(%rbp),%xmm0
movslq -0x8(%rbp),%rax
movsd  %xmm0,-0x80(%rbp,%rax,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x19>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <print_int_array@plt>
lea    -0x80(%rbp),%rdi
mov    $0xa,%esi
call   1030 <print_double_array@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x88,%rsp
xorps  %xmm0,%xmm0
movhps 0xecf(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed3(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xedc(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xee0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movabs $0x900000008,%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <print_int_array@plt>
lea    0x30(%rsp),%rdi
mov    $0xa,%esi
call   1030 <print_double_array@plt>
xor    %eax,%eax
add    $0x88,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32]
%4 = alloca [10 x double]
store i32 0, i32* %1
store i32 0, i32* %2
br label %5
5: ; preds = %18, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %11
store i32 %9, i32* %12
%13 = load i32, i32* %2
%14 = sitofp i32 %13 to double
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [10 x double], [10 x double]* %4, i64 0, i64 %16
store double %14, double* %17
br label %18
18: ; preds = %8
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %5
21: ; preds = %5
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%23 = call i32 @print_int_array(i32* %22, i32 10)
%24 = getelementptr inbounds [10 x double], [10 x double]* %4, i64 0, i64 0
%25 = call i32 @print_double_array(double* %24, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [10 x double]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x double]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [10 x double], [10 x double]* %2, i64 0, i64 0
%7 = bitcast [10 x double]* %2 to <2 x double>*
store <2 x double> <double 0.000000e+00, double 1.000000e+00>, <2 x double>* %7
%8 = getelementptr inbounds [10 x double], [10 x double]* %2, i64 0, i64 2
%9 = bitcast [10 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %9
%10 = bitcast double* %8 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 3.000000e+00>, <2 x double>* %10
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%12 = getelementptr inbounds [10 x double], [10 x double]* %2, i64 0, i64 4
%13 = bitcast double* %12 to <2 x double>*
store <2 x double> <double 4.000000e+00, double 5.000000e+00>, <2 x double>* %13
%14 = getelementptr inbounds [10 x double], [10 x double]* %2, i64 0, i64 6
%15 = bitcast i32* %11 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %15
%16 = bitcast double* %14 to <2 x double>*
store <2 x double> <double 6.000000e+00, double 7.000000e+00>, <2 x double>* %16
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
store i32 8, i32* %17
%18 = getelementptr inbounds [10 x double], [10 x double]* %2, i64 0, i64 8
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
store i32 9, i32* %19
%20 = bitcast double* %18 to <2 x double>*
store <2 x double> <double 8.000000e+00, double 9.000000e+00>, <2 x double>* %20
%21 = call i32 @print_int_array(i32* %5, i32 10)
%22 = call i32 @print_double_array(double* %6, i32 10)
ret i32 0
}