#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_tz_v2si(unsigned int *, int *);
int /*<<< orphan*/ count_tz_v4si(unsigned int *, int *);
int main() {
  unsigned int x4[4] = {0x0, 0xFF80, 0x1FFFF, 0xFF000000};
  int r[4] = {32, 7, 0, 24};
  int d[4], i;
  count_tz_v4si(x4, d);
  for (i = 0; i < 4; i++) {
    if (d[i] != r[i])
      abort();
  };
  count_tz_v2si(x4, d);
  for (i = 0; i < 2; 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    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1040 <count_tz_v4si@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x4,-0x44(%rbp)
jge    11b9 <main+0x89>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
movslq -0x44(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
je     11a6 <main+0x76>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11ab <main+0x7b>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    117f <main+0x4f>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <count_tz_v2si@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x2,-0x44(%rbp)
jge    1207 <main+0xd7>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
movslq -0x44(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
je     11f4 <main+0xc4>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11f9 <main+0xc9>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11cd <main+0x9d>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xec5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <count_tz_v4si@plt>
cmpl   $0x20,(%rsp)
jne    1189 <main+0x59>
cmpl   $0x7,0x4(%rsp)
jne    1189 <main+0x59>
cmpl   $0x0,0x8(%rsp)
jne    1189 <main+0x59>
cmpl   $0x18,0xc(%rsp)
jne    1189 <main+0x59>
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
call   1050 <count_tz_v2si@plt>
cmpl   $0x20,(%rsp)
jne    1189 <main+0x59>
cmpl   $0x7,0x4(%rsp)
jne    1189 <main+0x59>
xor    %eax,%eax
add    $0x28,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const.main.x4 = [4 x i32] [i32 0, i32 65408, i32 131071, i32 -16777216]
@__const.main.r = [4 x i32] [i32 32, i32 7, i32 0, i32 24]
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_tz_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
%31 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%32 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%33 = call i32 @count_tz_v2si(i32* %31, i32* %32)
store i32 0, i32* %5
br label %34
34: ; preds = %50, %30
%35 = load i32, i32* %5
%36 = icmp slt i32 %35, 2
br i1 %36, label %37, label %53
37: ; preds = %34
%38 = load i32, i32* %5
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = load i32, i32* %5
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = icmp ne i32 %41, %45
br i1 %46, label %47, label %49
47: ; preds = %37
%48 = call i32 (...) @abort()
unreachable
49: ; preds = %37
br label %50
50: ; preds = %49
%51 = load i32, i32* %5
%52 = add nsw i32 %51, 1
store i32 %52, i32* %5
br label %34
53: ; preds = %34
ret i32 0
}

LLVM IR (-O2):
@__const.main.x4 = [4 x i32] [i32 0, i32 65408, i32 131071, i32 -16777216]
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_tz_v4si(i32* %5, i32* %6)
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 32
br i1 %9, label %10, label %29
10: ; preds = %0
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 7
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 0
%17 = select i1 %13, i1 %16, i1 false
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 24
%21 = select i1 %17, i1 %20, i1 false
br i1 %21, label %22, label %29
22: ; preds = %10
%23 = call i32 @count_tz_v2si(i32* %5, i32* %6)
%24 = load i32, i32* %6
%25 = icmp eq i32 %24, 32
%26 = load i32, i32* %11
%27 = icmp eq i32 %26, 7
%28 = select i1 %25, i1 %27, i1 false
br i1 %28, label %31, label %32
29: ; preds = %10, %0
%30 = call i32 (...) @abort()
unreachable
31: ; preds = %22
ret i32 0
32: ; preds = %22
%33 = call i32 (...) @abort()
unreachable
}