#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ paw_debug();
char *paw_get_word(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
scalar_t__ strcmp(char *, char *);
int paw_find_word(char *my_word, FILE *fp) {
  char *w;
  rewind(fp);
  w = paw_get_word(fp);
  if (strcmp(my_word, w) != 0) {
    rewind(fp);
    w = paw_get_word(fp);
    while ((w != ((char *)EOF)) && (strcmp(my_word, w) != 0))
      w = paw_get_word(fp);
  }
  if (w == ((char *)EOF)) {
    if (paw_debug())
      printf("warning: %s section not found\n", my_word);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<paw_find_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <rewind@plt>
mov    -0x18(%rbp),%rdi
call   1030 <paw_get_word@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     11fd <paw_find_word+0xad>
mov    -0x18(%rbp),%rdi
call   1050 <rewind@plt>
mov    -0x18(%rbp),%rdi
call   1030 <paw_get_word@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    0x2e3a(%rip),%rax
mov    (%rax),%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0x21(%rbp)
je     11d6 <paw_find_word+0x86>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    11e6 <paw_find_word+0x96>
jmp    11f8 <paw_find_word+0xa8>
mov    -0x18(%rbp),%rdi
call   1030 <paw_get_word@plt>
mov    %rax,-0x20(%rbp)
jmp    11a3 <paw_find_word+0x53>
jmp    11fd <paw_find_word+0xad>
mov    -0x20(%rbp),%rax
mov    0x2de0(%rip),%rcx
mov    (%rcx),%rcx
cmp    %rcx,%rax
jne    1241 <paw_find_word+0xf1>
mov    $0x0,%al
call   1070 <paw_debug@plt>
cmp    $0x0,%rax
je     1235 <paw_find_word+0xe5>
mov    -0x10(%rbp),%rsi
lea    0xdd0(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1248 <paw_find_word+0xf8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<paw_find_word>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <rewind@plt>
mov    %r15,%rdi
call   1030 <paw_get_word@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11c1 <paw_find_word+0x71>
mov    %r15,%rdi
call   1050 <rewind@plt>
mov    %r15,%rdi
call   1030 <paw_get_word@plt>
mov    %rax,%rbx
mov    0x2e4e(%rip),%rbp
cmp    0x0(%rbp),%rax
je     11c1 <paw_find_word+0x71>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11c1 <paw_find_word+0x71>
mov    %r15,%rdi
call   1030 <paw_get_word@plt>
mov    %rax,%rbx
cmp    0x0(%rbp),%rax
jne    11a0 <paw_find_word+0x50>
mov    0x2e20(%rip),%rax
xor    %ebp,%ebp
cmp    (%rax),%rbx
jne    11ef <paw_find_word+0x9f>
xor    %eax,%eax
call   1070 <paw_debug@plt>
mov    $0x1,%ebp
test   %rax,%rax
je     11ef <paw_find_word+0x9f>
lea    0xe19(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [31 x i8] c"warning: %s section not found\0A\00"
define i32 @paw_find_word(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
%7 = load i32*, i32** %5
%8 = call i32 @rewind(i32* %7)
%9 = load i32*, i32** %5
%10 = call i8* @paw_get_word(i32* %9)
store i8* %10, i8** %6
%11 = load i8*, i8** %4
%12 = load i8*, i8** %6
%13 = call i64 @strcmp(i8* %11, i8* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %36
15: ; preds = %2
%16 = load i32*, i32** %5
%17 = call i32 @rewind(i32* %16)
%18 = load i32*, i32** %5
%19 = call i8* @paw_get_word(i32* %18)
store i8* %19, i8** %6
br label %20
20: ; preds = %32, %15
%21 = load i8*, i8** %6
%22 = load i64, i64* @EOF
%23 = inttoptr i64 %22 to i8*
%24 = icmp ne i8* %21, %23
br i1 %24, label %25, label %30
25: ; preds = %20
%26 = load i8*, i8** %4
%27 = load i8*, i8** %6
%28 = call i64 @strcmp(i8* %26, i8* %27)
%29 = icmp ne i64 %28, 0
br label %30
30: ; preds = %25, %20
%31 = phi i1 [ false, %20 ], [ %29, %25 ]
br i1 %31, label %32, label %35
32: ; preds = %30
%33 = load i32*, i32** %5
%34 = call i8* @paw_get_word(i32* %33)
store i8* %34, i8** %6
br label %20
35: ; preds = %30
br label %36
36: ; preds = %35, %2
%37 = load i8*, i8** %6
%38 = load i64, i64* @EOF
%39 = inttoptr i64 %38 to i8*
%40 = icmp eq i8* %37, %39
br i1 %40, label %41, label %48
41: ; preds = %36
%42 = call i64 (...) @paw_debug()
%43 = icmp ne i64 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = load i8*, i8** %4
%46 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %45)
br label %47
47: ; preds = %44, %41
store i32 1, i32* %3
br label %49
48: ; preds = %36
store i32 0, i32* %3
br label %49
49: ; preds = %48, %47
%50 = load i32, i32* %3
ret i32 %50
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [31 x i8] c"warning: %s section not found\0A\00"
define i32 @paw_find_word(i8* %0, i32* %1) {
%3 = tail call i32 @rewind(i32* %1)
%4 = tail call i8* @paw_get_word(i32* %1)
%5 = tail call i64 @strcmp(i8* %0, i8* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %22, label %7
7: ; preds = %2
%8 = tail call i32 @rewind(i32* %1)
%9 = tail call i8* @paw_get_word(i32* %1)
%10 = load i64, i64* @EOF
%11 = inttoptr i64 %10 to i8*
%12 = icmp eq i8* %9, %11
br i1 %12, label %22, label %13
13: ; preds = %7, %17
%14 = phi i8* [ %18, %17 ], [ %9, %7 ]
%15 = tail call i64 @strcmp(i8* %0, i8* %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %22, label %17
17: ; preds = %13
%18 = tail call i8* @paw_get_word(i32* %1)
%19 = load i64, i64* @EOF
%20 = inttoptr i64 %19 to i8*
%21 = icmp eq i8* %18, %20
br i1 %21, label %22, label %13
22: ; preds = %17, %13, %7, %2
%23 = phi i8* [ %4, %2 ], [ %9, %7 ], [ %18, %17 ], [ %14, %13 ]
%24 = load i64, i64* @EOF
%25 = inttoptr i64 %24 to i8*
%26 = icmp eq i8* %23, %25
br i1 %26, label %27, label %32
27: ; preds = %22
%28 = tail call i64 (...) @paw_debug()
%29 = icmp eq i64 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %32
32: ; preds = %22, %27, %30
%33 = phi i32 [ 1, %30 ], [ 1, %27 ], [ 0, %22 ]
ret i32 %33
}