#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 */
scalar_t__ snowflakes(int *, int);
scalar_t__ snowflakes_brute(int *, int);
int test_level_ground() {
  int low[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  int high[] = {9, 9, 9, 9, 9, 9, 9, 9, 9, 9};
  return 0 == snowflakes_brute(low, 10) && 0 == snowflakes_brute(high, 10) &&
         0 == snowflakes(low, 10) && 0 == snowflakes(high, 10);
}


x86 assembly (clang, -O0):
<test_level_ground>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    -0x60(%rbp),%rdi
lea    0xe9d(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <snowflakes_brute@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x61(%rbp)
jne    11ec <test_level_ground+0xac>
lea    -0x60(%rbp),%rdi
mov    $0xa,%esi
call   1030 <snowflakes_brute@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x61(%rbp)
jne    11ec <test_level_ground+0xac>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1060 <snowflakes@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x61(%rbp)
jne    11ec <test_level_ground+0xac>
lea    -0x60(%rbp),%rdi
mov    $0xa,%esi
call   1060 <snowflakes@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
mov    %al,-0x61(%rbp)
mov    -0x61(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_level_ground>:
push   %rbx
sub    $0x60,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movq   $0x0,0x50(%rsp)
mov    0xede(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea6(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x30(%rsp),%rdi
mov    $0xa,%esi
call   1030 <snowflakes_brute@plt>
xor    %ebx,%ebx
test   %rax,%rax
jne    11af <test_level_ground+0x8f>
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <snowflakes_brute@plt>
test   %rax,%rax
jne    11af <test_level_ground+0x8f>
lea    0x30(%rsp),%rdi
mov    $0xa,%esi
call   1040 <snowflakes@plt>
test   %rax,%rax
jne    11af <test_level_ground+0x8f>
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <snowflakes@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    %ebx,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_level_ground.high = [10 x i32] [i32 9, i32 9, i32 9, i32 9, i32 9, i32 9, i32 9, i32 9, i32 9, i32 9]
define i32 @test_level_ground() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i64 @snowflakes_brute(i32* %5, i32 10)
%7 = icmp eq i64 0, %6
br i1 %7, label %8, label %20
8: ; preds = %0
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%10 = call i64 @snowflakes_brute(i32* %9, i32 10)
%11 = icmp eq i64 0, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%14 = call i64 @snowflakes(i32* %13, i32 10)
%15 = icmp eq i64 0, %14
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%18 = call i64 @snowflakes(i32* %17, i32 10)
%19 = icmp eq i64 0, %18
br label %20
20: ; preds = %16, %12, %8, %0
%21 = phi i1 [ false, %12 ], [ false, %8 ], [ false, %0 ], [ %19, %16 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
@__const.test_level_ground.high = [10 x i32] [i32 9, i32 9, i32 9, i32 9, i32 9, i32 9, i32 9, i32 9, i32 9, i32 9]
define i32 @test_level_ground() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i64 @snowflakes_brute(i32* %5, i32 10)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %0
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%10 = call i64 @snowflakes_brute(i32* %9, i32 10)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = call i64 @snowflakes(i32* %5, i32 10)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = call i64 @snowflakes(i32* %9, i32 10)
%17 = icmp eq i64 %16, 0
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %15, %12, %8, %0
%20 = phi i32 [ 0, %12 ], [ 0, %8 ], [ 0, %0 ], [ %18, %15 ]
ret i32 %20
}