#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*/ printf(char *, char *);
scalar_t__ valid_row(int *, int);
int main(void) {
  int a[10] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1};
  printf("%s\n", valid_row(a, 10) ? "True" : "False");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movl   $0x1,-0x2c(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x1,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <valid_row@plt>
mov    %rax,%rcx
lea    0xe7f(%rip),%rsi
lea    0xe73(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
movl   $0x1,0x4(%rsp)
movl   $0x1,0xc(%rsp)
movl   $0x1,0x14(%rsp)
movl   $0x1,0x1c(%rsp)
movl   $0x1,0x24(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <valid_row@plt>
test   %rax,%rax
lea    0xe91(%rip),%rax
lea    0xe85(%rip),%rsi
cmove  %rax,%rsi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"True\00"
@.str.2 = [6 x i8] c"False\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = bitcast i8* %3 to [10 x i32]*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i32 0, i32 1
store i32 1, i32* %5
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i32 0, i32 3
store i32 1, i32* %6
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i32 0, i32 5
store i32 1, i32* %7
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i32 0, i32 7
store i32 1, i32* %8
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i32 0, i32 9
store i32 1, i32* %9
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%11 = call i64 @valid_row(i32* %10, i32 10)
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"True\00"
@.str.2 = [6 x i8] c"False\00"
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 1
store i32 1, i32* %3
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
store i32 1, i32* %4
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
store i32 1, i32* %5
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
store i32 1, i32* %6
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
store i32 1, i32* %7
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%9 = call i64 @valid_row(i32* %8, i32 10)
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 0
}