#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*/ array_is_zero(unsigned int const *, int);
char const *test_array_is_zero(void) {
  unsigned int const arr1[32] = {
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  unsigned int const arr2[32] = {
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
      0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00};
  do {
    if (!(array_is_zero(arr1, 32))) {
      return "Test case for fully zero array arr1 failed.";
    }
  } while (0);
  do {
    if (!(array_is_zero(arr2, 32 / 2))) {
      return "Test case for semi-zero array arr2 failed.";
    }
  } while (0);
  do {
    if (!(!array_is_zero(arr2, 32))) {
      return "Test case for non-zero array arr2 failed.";
    }
  } while (0);
  return "";
}


x86 assembly (clang, -O0):
<test_array_is_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
lea    -0x110(%rbp),%rdi
lea    0xea4(%rip),%rsi
mov    $0x80,%edx
call   1050 <memcpy@plt>
lea    -0x90(%rbp),%rdi
mov    $0x20,%esi
call   1040 <array_is_zero@plt>
cmp    $0x0,%eax
jne    1190 <test_array_is_zero+0x60>
lea    0xef9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1208 <test_array_is_zero+0xd8>
jmp    1195 <test_array_is_zero+0x65>
jmp    119a <test_array_is_zero+0x6a>
lea    -0x110(%rbp),%rdi
mov    $0x10,%esi
call   1040 <array_is_zero@plt>
cmp    $0x0,%eax
jne    11c4 <test_array_is_zero+0x94>
lea    0xef1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1208 <test_array_is_zero+0xd8>
jmp    11c9 <test_array_is_zero+0x99>
jmp    11ce <test_array_is_zero+0x9e>
lea    -0x110(%rbp),%rdi
mov    $0x20,%esi
call   1040 <array_is_zero@plt>
cmp    $0x0,%eax
je     11f8 <test_array_is_zero+0xc8>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1208 <test_array_is_zero+0xd8>
jmp    11fd <test_array_is_zero+0xcd>
lea    0xea7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_array_is_zero>:
sub    $0x108,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps 0xf0f(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xef3(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xed7(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xebb(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe9f(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe83(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe67(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe4b(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x80(%rsp),%rdi
mov    $0x20,%esi
call   1030 <array_is_zero@plt>
test   %eax,%eax
je     1209 <test_array_is_zero+0xf9>
mov    %rsp,%rdi
mov    $0x10,%esi
call   1030 <array_is_zero@plt>
test   %eax,%eax
je     1218 <test_array_is_zero+0x108>
mov    %rsp,%rdi
mov    $0x20,%esi
call   1030 <array_is_zero@plt>
test   %eax,%eax
lea    0xeb5(%rip),%rcx
lea    0xeda(%rip),%rax
cmove  %rcx,%rax
add    $0x108,%rsp
ret
lea    0xe70(%rip),%rax
add    $0x108,%rsp
ret
lea    0xe8d(%rip),%rax
add    $0x108,%rsp
ret

LLVM IR (-O0):
@__const.test_array_is_zero.arr2 = [32 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 0]
@.str = [44 x i8] c"Test case for fully zero array arr1 failed.\00"
@.str.1 = [43 x i8] c"Test case for semi-zero array arr2 failed.\00"
@.str.2 = [42 x i8] c"Test case for non-zero array arr2 failed.\00"
@.str.3 = [1 x i8] zeroinitializer
define i8* @test_array_is_zero() {
%1 = alloca i8*
%2 = alloca [32 x i32]
%3 = alloca [32 x i32]
%4 = bitcast [32 x i32]* %2 to i8*
%5 = bitcast [32 x i32]* %3 to i8*
br label %6
6: ; preds = %0
%7 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 0
%8 = call i32 @array_is_zero(i32* %7, i32 32)
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %6
store i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8** %1
br label %27
11: ; preds = %6
br label %12
12: ; preds = %11
br label %13
13: ; preds = %12
%14 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%15 = call i32 @array_is_zero(i32* %14, i32 16)
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %13
store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %27
18: ; preds = %13
br label %19
19: ; preds = %18
br label %20
20: ; preds = %19
%21 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%22 = call i32 @array_is_zero(i32* %21, i32 32)
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %20
store i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8** %1
br label %27
25: ; preds = %20
br label %26
26: ; preds = %25
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8** %1
br label %27
27: ; preds = %26, %24, %17, %10
%28 = load i8*, i8** %1
ret i8* %28
}

LLVM IR (-O2):
@__const.test_array_is_zero.arr2 = [32 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 0]
@.str = [44 x i8] c"Test case for fully zero array arr1 failed.\00"
@.str.1 = [43 x i8] c"Test case for semi-zero array arr2 failed.\00"
@.str.2 = [42 x i8] c"Test case for non-zero array arr2 failed.\00"
@.str.3 = [1 x i8] zeroinitializer
define i8* @test_array_is_zero() {
%1 = alloca [32 x i32]
%2 = alloca [32 x i32]
%3 = bitcast [32 x i32]* %1 to i8*
%4 = bitcast [32 x i32]* %2 to i8*
%5 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 0
%6 = call i32 @array_is_zero(i32* %5, i32 32)
%7 = icmp eq i32 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %0
%9 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 0
%10 = call i32 @array_is_zero(i32* %9, i32 16)
%11 = icmp eq i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = call i32 @array_is_zero(i32* %9, i32 32)
%14 = icmp eq i32 %13, 0
%15 = select i1 %14, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0)
br label %16
16: ; preds = %12, %8, %0
%17 = phi i8* [ getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), %0 ], [ getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), %8 ], [ %15, %12 ]
ret i8* %17
}