#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__ value_at(int *, int, int);
int check_row(int *board, int r) {
  int row_filled = 1;
  for (int c = 0; c < 10; c++) {
    if (value_at(board, r, c) == 0) {
      row_filled = 0;
    }
  }
  return row_filled;
}


x86 assembly (clang, -O0):
<check_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    116a <check_row+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <value_at@plt>
cmp    $0x0,%rax
jne    1157 <check_row+0x47>
movl   $0x0,-0x10(%rbp)
jmp    115c <check_row+0x4c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <check_row+0x1d>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_row>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edx,%edx
call   1030 <value_at@plt>
test   %rax,%rax
setne  0x7(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
call   1030 <value_at@plt>
test   %rax,%rax
setne  0x6(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x2,%edx
call   1030 <value_at@plt>
test   %rax,%rax
setne  %r12b
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x3,%edx
call   1030 <value_at@plt>
test   %rax,%rax
setne  0x5(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x4,%edx
call   1030 <value_at@plt>
test   %rax,%rax
setne  0x4(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x5,%edx
call   1030 <value_at@plt>
test   %rax,%rax
setne  %r15b
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x6,%edx
call   1030 <value_at@plt>
test   %rax,%rax
setne  0x3(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x7,%edx
call   1030 <value_at@plt>
test   %rax,%rax
setne  %r14b
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x8,%edx
call   1030 <value_at@plt>
test   %rax,%rax
setne  %r13b
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x9,%edx
call   1030 <value_at@plt>
test   %rax,%rax
setne  %al
and    %r13b,%al
and    0x3(%rsp),%r14b
and    %al,%r14b
and    0x4(%rsp),%r15b
and    0x5(%rsp),%r15b
and    %r14b,%r15b
and    0x6(%rsp),%r12b
and    0x7(%rsp),%r12b
and    %r15b,%r12b
movzbl %r12b,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @check_row(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 1, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load i32*, i32** %3
%12 = load i32, i32* %4
%13 = load i32, i32* %6
%14 = call i64 @value_at(i32* %11, i32 %12, i32 %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 0, i32* %5
br label %17
17: ; preds = %16, %10
br label %18
18: ; preds = %17
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @check_row(i32* %0, i32 %1) {
%3 = tail call i64 @value_at(i32* %0, i32 %1, i32 0)
%4 = icmp ne i64 %3, 0
%5 = tail call i64 @value_at(i32* %0, i32 %1, i32 1)
%6 = icmp ne i64 %5, 0
%7 = tail call i64 @value_at(i32* %0, i32 %1, i32 2)
%8 = icmp ne i64 %7, 0
%9 = tail call i64 @value_at(i32* %0, i32 %1, i32 3)
%10 = icmp ne i64 %9, 0
%11 = tail call i64 @value_at(i32* %0, i32 %1, i32 4)
%12 = icmp ne i64 %11, 0
%13 = tail call i64 @value_at(i32* %0, i32 %1, i32 5)
%14 = icmp ne i64 %13, 0
%15 = tail call i64 @value_at(i32* %0, i32 %1, i32 6)
%16 = icmp ne i64 %15, 0
%17 = tail call i64 @value_at(i32* %0, i32 %1, i32 7)
%18 = icmp ne i64 %17, 0
%19 = tail call i64 @value_at(i32* %0, i32 %1, i32 8)
%20 = icmp ne i64 %19, 0
%21 = tail call i64 @value_at(i32* %0, i32 %1, i32 9)
%22 = icmp ne i64 %21, 0
%23 = select i1 %22, i1 %20, i1 false
%24 = select i1 %23, i1 %18, i1 false
%25 = select i1 %24, i1 %16, i1 false
%26 = select i1 %25, i1 %14, i1 false
%27 = select i1 %26, i1 %12, i1 false
%28 = select i1 %27, i1 %10, i1 false
%29 = select i1 %28, i1 %8, i1 false
%30 = select i1 %29, i1 %6, i1 false
%31 = select i1 %30, i1 %4, i1 false
%32 = zext i1 %31 to i32
ret i32 %32
}