#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 */
struct ListNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ findWord(int, int, int, char *, char const **,
                            struct ListNode **);
struct ListNode *findWords(const char board[4][4]) {
  struct ListNode *words = NULL;
  int wordSize, i, j;
  char *word = NULL;
  for (i = 0; i < 4; ++i) {
    for (j = 0; j < 4; ++j) {
      wordSize = 1;
      findWord(i, j, wordSize, word, board, &words);
    }
  }
  return words;
}


x86 assembly (clang, -O0):
<findWords>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jge    1190 <findWords+0x80>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    117d <findWords+0x6d>
movl   $0x1,-0x14(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    -0x10(%rbp),%r9
call   1030 <findWord@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1144 <findWords+0x34>
jmp    1182 <findWords+0x72>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1133 <findWords+0x23>
mov    -0x10(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findWords>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movq   $0x0,(%rsp)
mov    %rsp,%r14
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <findWord@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <findWord@plt>
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <findWord@plt>
xor    %edi,%edi
mov    $0x3,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <findWord@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <findWord@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <findWord@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <findWord@plt>
mov    $0x1,%edi
mov    $0x3,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <findWord@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <findWord@plt>
mov    $0x2,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <findWord@plt>
mov    $0x2,%edi
mov    $0x2,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <findWord@plt>
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <findWord@plt>
mov    $0x3,%edi
xor    %esi,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <findWord@plt>
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <findWord@plt>
mov    $0x3,%edi
mov    $0x2,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <findWord@plt>
mov    $0x3,%edi
mov    $0x3,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <findWord@plt>
mov    (%rsp),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ListNode = type { i32 }
define %struct.ListNode* @findWords([4 x i8]* %0) {
%2 = alloca [4 x i8]*
%3 = alloca %struct.ListNode*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store [4 x i8]* %0, [4 x i8]** %2
store %struct.ListNode* null, %struct.ListNode** %3
store i8* null, i8** %7
store i32 0, i32* %5
br label %8
8: ; preds = %27, %1
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 4
br i1 %10, label %11, label %30
11: ; preds = %8
store i32 0, i32* %6
br label %12
12: ; preds = %23, %11
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 4
br i1 %14, label %15, label %26
15: ; preds = %12
store i32 1, i32* %4
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = load i32, i32* %4
%19 = load i8*, i8** %7
%20 = load [4 x i8]*, [4 x i8]** %2
%21 = bitcast [4 x i8]* %20 to i8**
%22 = call i32 @findWord(i32 %16, i32 %17, i32 %18, i8* %19, i8** %21, %struct.ListNode** %3)
br label %23
23: ; preds = %15
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %12
26: ; preds = %12
br label %27
27: ; preds = %26
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %8
30: ; preds = %8
%31 = load %struct.ListNode*, %struct.ListNode** %3
ret %struct.ListNode* %31
}

LLVM IR (-O2):
%struct.ListNode = type { i32 }
define %struct.ListNode* @findWords([4 x i8]* %0) {
%2 = alloca %struct.ListNode*
%3 = bitcast %struct.ListNode** %2 to i8*
store %struct.ListNode* null, %struct.ListNode** %2
%4 = bitcast [4 x i8]* %0 to i8**
%5 = call i32 @findWord(i32 0, i32 0, i32 1, i8* null, i8** %4, %struct.ListNode** %2)
%6 = call i32 @findWord(i32 0, i32 1, i32 1, i8* null, i8** %4, %struct.ListNode** %2)
%7 = call i32 @findWord(i32 0, i32 2, i32 1, i8* null, i8** %4, %struct.ListNode** %2)
%8 = call i32 @findWord(i32 0, i32 3, i32 1, i8* null, i8** %4, %struct.ListNode** %2)
%9 = call i32 @findWord(i32 1, i32 0, i32 1, i8* null, i8** %4, %struct.ListNode** %2)
%10 = call i32 @findWord(i32 1, i32 1, i32 1, i8* null, i8** %4, %struct.ListNode** %2)
%11 = call i32 @findWord(i32 1, i32 2, i32 1, i8* null, i8** %4, %struct.ListNode** %2)
%12 = call i32 @findWord(i32 1, i32 3, i32 1, i8* null, i8** %4, %struct.ListNode** %2)
%13 = call i32 @findWord(i32 2, i32 0, i32 1, i8* null, i8** %4, %struct.ListNode** %2)
%14 = call i32 @findWord(i32 2, i32 1, i32 1, i8* null, i8** %4, %struct.ListNode** %2)
%15 = call i32 @findWord(i32 2, i32 2, i32 1, i8* null, i8** %4, %struct.ListNode** %2)
%16 = call i32 @findWord(i32 2, i32 3, i32 1, i8* null, i8** %4, %struct.ListNode** %2)
%17 = call i32 @findWord(i32 3, i32 0, i32 1, i8* null, i8** %4, %struct.ListNode** %2)
%18 = call i32 @findWord(i32 3, i32 1, i32 1, i8* null, i8** %4, %struct.ListNode** %2)
%19 = call i32 @findWord(i32 3, i32 2, i32 1, i8* null, i8** %4, %struct.ListNode** %2)
%20 = call i32 @findWord(i32 3, i32 3, i32 1, i8* null, i8** %4, %struct.ListNode** %2)
%21 = load %struct.ListNode*, %struct.ListNode** %2
ret %struct.ListNode* %21
}