#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*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo(int *, int /*<<< orphan*/, int /*<<< orphan*/,
                       int /*<<< orphan*/, int, int, int, int, int, int);
int main() {
  int x[10], i;
  foo(x, 0, 0, 0, 2, 100, 200, 300, 400, 500);
  for (i = 0; i < 10; i++)
    if (x[i] != (i % 5 + 1) * 100)
      abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %ecx,%ecx
mov    $0x2,%r8d
mov    $0x64,%r9d
mov    %ecx,%esi
mov    %ecx,%edx
movl   $0xc8,(%rsp)
movl   $0x12c,0x8(%rsp)
movl   $0x190,0x10(%rsp)
movl   $0x1f4,0x18(%rsp)
call   1040 <foo@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    11cb <main+0x9b>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    -0x38(%rbp),%eax
add    $0x1,%edx
imul   $0x64,%edx,%ecx
cmp    %ecx,%eax
je     11b8 <main+0x88>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11bd <main+0x8d>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1180 <main+0x50>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x2,%r8d
mov    $0x64,%r9d
push   $0x1f4
push   $0x190
push   $0x12c
push   $0xc8
call   1040 <foo@plt>
add    $0x20,%rsp
movdqa (%rsp),%xmm0
movdqa 0x10(%rsp),%xmm1
pcmpeqd 0xe87(%rip),%xmm1
pcmpeqd %xmm2,%xmm2
pxor   %xmm2,%xmm1
pcmpeqd 0xe87(%rip),%xmm0
pxor   %xmm2,%xmm0
packssdw %xmm1,%xmm0
pmovmskb %xmm0,%eax
test   %eax,%eax
jne    11b4 <main+0x84>
cmpl   $0x190,0x20(%rsp)
jne    11b4 <main+0x84>
cmpl   $0x1f4,0x24(%rsp)
jne    11b4 <main+0x84>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @foo(i32* %4, i32 0, i32 0, i32 0, i32 2, i32 100, i32 200, i32 300, i32 400, i32 500)
store i32 0, i32* %3
br label %6
6: ; preds = %22, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %25
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = load i32, i32* %3
%15 = srem i32 %14, 5
%16 = add nsw i32 %15, 1
%17 = mul nsw i32 %16, 100
%18 = icmp ne i32 %13, %17
br i1 %18, label %19, label %21
19: ; preds = %9
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %9
br label %22
22: ; preds = %21
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %6
25: ; preds = %6
%26 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3, i32 0, i32 0, i32 0, i32 2, i32 100, i32 200, i32 300, i32 400, i32 500)
%5 = bitcast [10 x i32]* %1 to <8 x i32>*
%6 = load <8 x i32>, <8 x i32>* %5
%7 = freeze <8 x i32> %6
%8 = icmp ne <8 x i32> %7, <i32 100, i32 200, i32 300, i32 400, i32 500, i32 100, i32 200, i32 300>
%9 = bitcast <8 x i1> %8 to i8
%10 = icmp eq i8 %9, 0
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 400
%14 = select i1 %10, i1 %13, i1 false
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 500
%18 = select i1 %14, i1 %17, i1 false
br i1 %18, label %19, label %21
19: ; preds = %0
%20 = call i32 @exit(i32 0)
unreachable
21: ; preds = %0
%22 = call i32 (...) @abort()
unreachable
}