#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*/ func(int *);
int main() {
  int a[10];
  int i;
  func(a);
  for (i = 0; i < 10; i++) {
    if (a[i] != 100) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <func@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    1167 <main+0x57>
movslq -0x34(%rbp),%rax
cmpl   $0x64,-0x30(%rbp,%rax,4)
je     1154 <main+0x44>
movl   $0x1,-0x4(%rbp)
jmp    116e <main+0x5e>
jmp    1159 <main+0x49>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    112f <main+0x1f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    %rsp,%rdi
call   1030 <func@plt>
movdqa 0xedc(%rip),%xmm0
movdqa 0x10(%rsp),%xmm1
pcmpeqd %xmm0,%xmm1
pcmpeqd %xmm2,%xmm2
pcmpeqd (%rsp),%xmm0
pxor   %xmm2,%xmm1
pxor   %xmm2,%xmm0
packssdw %xmm1,%xmm0
pmovmskb %xmm0,%eax
test   %eax,%eax
setne  %al
cmpl   $0x64,0x20(%rsp)
setne  %cl
cmpl   $0x64,0x24(%rsp)
setne  %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
add    $0x28,%rsp
ret

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 @func(i32* %4)
store i32 0, i32* %3
br label %6
6: ; preds = %17, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %20
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 = icmp ne i32 %13, 100
br i1 %14, label %15, label %16
15: ; preds = %9
store i32 1, i32* %1
br label %21
16: ; preds = %9
br label %17
17: ; preds = %16
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %6
20: ; preds = %6
store i32 0, i32* %1
br label %21
21: ; preds = %20, %15
%22 = load i32, i32* %1
ret i32 %22
}

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 @func(i32* %3)
%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 100, i32 100, i32 100, i32 100, i32 100, i32 100, i32 100>
%9 = bitcast <8 x i1> %8 to i8
%10 = icmp ne i8 %9, 0
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%12 = load i32, i32* %11
%13 = icmp ne i32 %12, 100
%14 = select i1 %10, i1 true, i1 %13
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, 100
%18 = select i1 %14, i1 true, i1 %17
%19 = zext i1 %18 to i32
ret i32 %19
}