#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*/ count_lz_v4si(unsigned int *, int *);
int main() {
  unsigned int x[4] = {0x0, 0xFFFF, 0x1FFFF, 0xFFFFFFFF};
  int r[4] = {32, 16, 15, 0};
  int d[4], i;
  count_lz_v4si(x, d);
  for (i = 0; i < 4; i++) {
    if (d[i] != r[i])
      abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1040 <count_lz_v4si@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x4,-0x44(%rbp)
jge    11a9 <main+0x89>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
movslq -0x44(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
je     1196 <main+0x76>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    119b <main+0x7b>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    116f <main+0x4f>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <count_lz_v4si@plt>
movdqa (%rsp),%xmm0
pcmpeqd 0xeb6(%rip),%xmm0
movmskps %xmm0,%eax
cmp    $0xf,%eax
jne    1159 <main+0x39>
xor    %eax,%eax
add    $0x28,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const.main.x = [4 x i32] [i32 0, i32 65535, i32 131071, i32 -1]
@__const.main.r = [4 x i32] [i32 32, i32 16, i32 15, i32 0]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca [4 x i32]
%4 = alloca [4 x i32]
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [4 x i32]* %2 to i8*
%7 = bitcast [4 x i32]* %3 to i8*
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%10 = call i32 @count_lz_v4si(i32* %8, i32* %9)
store i32 0, i32* %5
br label %11
11: ; preds = %27, %0
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 4
br i1 %13, label %14, label %30
14: ; preds = %11
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = icmp ne i32 %18, %22
br i1 %23, label %24, label %26
24: ; preds = %14
%25 = call i32 (...) @abort()
unreachable
26: ; preds = %14
br label %27
27: ; preds = %26
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %11
30: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [4 x i32] [i32 0, i32 65535, i32 131071, i32 -1]
define i32 @main() {
%1 = alloca [4 x i32]
%2 = alloca <4 x i32>
%3 = bitcast [4 x i32]* %1 to i8*
%4 = bitcast <4 x i32>* %2 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds <4 x i32>, <4 x i32>* %2, i64 0, i64 0
%7 = call i32 @count_lz_v4si(i32* %5, i32* %6)
%8 = load <4 x i32>, <4 x i32>* %2
%9 = freeze <4 x i32> %8
%10 = icmp ne <4 x i32> %9, <i32 32, i32 16, i32 15, i32 0>
%11 = bitcast <4 x i1> %10 to i4
%12 = icmp eq i4 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %0
ret i32 0
14: ; preds = %0
%15 = call i32 (...) @abort()
unreachable
}