#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*/ bar(unsigned long long *);
void fn2(void) {
  unsigned long long a[128];
  int i;
  for (i = 0; i < 128; i++)
    a[i] = (i + 1LL) * 0x0123456789ABCDEFLL;
  bar(a);
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x404(%rbp)
cmpl   $0x80,-0x404(%rbp)
jge    1171 <fn2+0x61>
movslq -0x404(%rbp),%rcx
add    $0x1,%rcx
movabs $0x123456789abcdef,%rax
45 23 01
imul   %rax,%rcx
movslq -0x404(%rbp),%rax
mov    %rcx,-0x400(%rbp,%rax,8)
ff
mov    -0x404(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x404(%rbp)
jmp    1125 <fn2+0x15>
lea    -0x400(%rbp),%rdi
call   1030 <bar@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
sub    $0x408,%rsp
movabs $0x48d159e26af37bc,%r8
15 8d 04
movabs $0x369d0369d0369cd,%rcx
d0 69 03
movabs $0x2468acf13579bde,%rdx
8a 46 02
movabs $0x123456789abcdef,%rsi
45 23 01
xor    %edi,%edi
mov    %r8,%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rsi,(%rsp,%rdi,8)
mov    %rdx,0x8(%rsp,%rdi,8)
mov    %rcx,0x10(%rsp,%rdi,8)
mov    %rax,0x18(%rsp,%rdi,8)
add    $0x4,%rdi
add    %r8,%rcx
add    %r8,%rdx
add    %r8,%rax
add    %r8,%rsi
cmp    $0x80,%rdi
jne    1150 <fn2+0x40>
mov    %rsp,%rdi
call   1030 <bar@plt>
add    $0x408,%rsp
ret

LLVM IR (-O0):
define void @fn2() {
%1 = alloca [128 x i64]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %14, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 128
br i1 %5, label %6, label %17
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = add nsw i64 %8, 1
%10 = mul nsw i64 %9, 81985529216486895
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [128 x i64], [128 x i64]* %1, i64 0, i64 %12
store i64 %10, i64* %13
br label %14
14: ; preds = %6
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %3
17: ; preds = %3
%18 = getelementptr inbounds [128 x i64], [128 x i64]* %1, i64 0, i64 0
%19 = call i32 @bar(i64* %18)
ret void
}

LLVM IR (-O2):
define void @fn2() {
%1 = alloca [128 x i64]
%2 = bitcast [128 x i64]* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = phi i64 [ 0, %0 ], [ %20, %3 ]
%5 = mul nuw i64 %4, 81985529216486895
%6 = add nuw i64 %5, 81985529216486895
%7 = getelementptr inbounds [128 x i64], [128 x i64]* %1, i64 0, i64 %4
store i64 %6, i64* %7
%8 = or i64 %4, 1
%9 = mul nuw i64 %8, 81985529216486895
%10 = add nuw i64 %9, 81985529216486895
%11 = getelementptr inbounds [128 x i64], [128 x i64]* %1, i64 0, i64 %8
store i64 %10, i64* %11
%12 = or i64 %4, 2
%13 = mul nuw i64 %12, 81985529216486895
%14 = add nuw i64 %13, 81985529216486895
%15 = getelementptr inbounds [128 x i64], [128 x i64]* %1, i64 0, i64 %12
store i64 %14, i64* %15
%16 = or i64 %4, 3
%17 = mul nuw i64 %16, 81985529216486895
%18 = add nuw i64 %17, 81985529216486895
%19 = getelementptr inbounds [128 x i64], [128 x i64]* %1, i64 0, i64 %16
store i64 %18, i64* %19
%20 = add nuw nsw i64 %4, 4
%21 = icmp eq i64 %20, 128
br i1 %21, label %22, label %3
22: ; preds = %3
%23 = getelementptr inbounds [128 x i64], [128 x i64]* %1, i64 0, i64 0
%24 = call i32 @bar(i64* %23)
ret void
}