#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*/ init_arr(float *, int *);
int /*<<< orphan*/ printf(char *, long, int, float);
int main(void) {
  int j;
  long i;
  float arr[2];
  init_arr(arr, &j);
  for (i = 0; i < j; i++) {
    printf("%ld %d: %.6e\n", i, j, arr[i]);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <init_arr@plt>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmp    %rcx,%rax
jge    1183 <main+0x63>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rax
movss  -0x18(%rbp,%rax,4),%xmm0
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1144 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1030 <init_arr@plt>
mov    0xc(%rsp),%edx
test   %edx,%edx
jle    116f <main+0x4f>
xor    %ebx,%ebx
lea    0xeb9(%rip),%r14
nopw   0x0(%rax,%rax,1)
movss  0x10(%rsp,%rbx,4),%xmm0
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rdx
cmp    %rdx,%rbx
jl     1150 <main+0x30>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"%ld %d: %.6e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x float]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [2 x float]* %2 to i8*
%5 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
%6 = call i32 @init_arr(float* %5, i32* %1)
%7 = load i32, i32* %1
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %0, %9
%10 = phi i32 [ %16, %9 ], [ %7, %0 ]
%11 = phi i64 [ %15, %9 ], [ 0, %0 ]
%12 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 %11
%13 = load float, float* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %11, i32 %10, float %13)
%15 = add nuw nsw i64 %11, 1
%16 = load i32, i32* %1
%17 = sext i32 %16 to i64
%18 = icmp slt i64 %15, %17
br i1 %18, label %9, label %19
19: ; preds = %9, %0
ret i32 0
}