#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__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
scalar_t__ strcasestr(char *, char *);
char *strtok(char *, char *);
int deny_byname(FILE *fp, char *name) {
  char line[256];
  char *token;
  rewind(fp);
  while (fgets(line, 256, fp)) {
    if ((token = strtok(line, " \n")) != NULL && strcasestr(name, token)) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<deny_byname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <rewind@plt>
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x100,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     11ca <deny_byname+0x8a>
lea    -0x120(%rbp),%rdi
lea    0xe77(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x128(%rbp)
cmp    $0x0,%rax
je     11c5 <deny_byname+0x85>
mov    -0x18(%rbp),%rdi
mov    -0x128(%rbp),%rsi
call   1060 <strcasestr@plt>
cmp    $0x0,%rax
je     11c5 <deny_byname+0x85>
movl   $0x1,-0x4(%rbp)
jmp    11d1 <deny_byname+0x91>
jmp    115c <deny_byname+0x1c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deny_byname>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <rewind@plt>
mov    %rsp,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1040 <fgets@plt>
xor    %r15d,%r15d
test   %rax,%rax
je     11bb <deny_byname+0x7b>
lea    0xe87(%rip),%r12
mov    %rsp,%rbp
jmp    1195 <deny_byname+0x55>
xchg   %ax,%ax
mov    %rbp,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     11bb <deny_byname+0x7b>
mov    %rbp,%rdi
mov    %r12,%rsi
call   1050 <strtok@plt>
test   %rax,%rax
je     1180 <deny_byname+0x40>
mov    %r14,%rdi
mov    %rax,%rsi
call   1060 <strcasestr@plt>
test   %rax,%rax
je     1180 <deny_byname+0x40>
mov    $0x1,%r15d
mov    %r15d,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c" \0A\00"
define i32 @deny_byname(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca [256 x i8]
%7 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
%8 = load i32*, i32** %4
%9 = call i32 @rewind(i32* %8)
br label %10
10: ; preds = %25, %2
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%12 = load i32*, i32** %4
%13 = call i64 @fgets(i8* %11, i32 256, i32* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%17 = call i8* @strtok(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %17, i8** %7
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %25
19: ; preds = %15
%20 = load i8*, i8** %5
%21 = load i8*, i8** %7
%22 = call i64 @strcasestr(i8* %20, i8* %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %19
store i32 1, i32* %3
br label %27
25: ; preds = %19, %15
br label %10
26: ; preds = %10
store i32 0, i32* %3
br label %27
27: ; preds = %26, %24
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@.str = [3 x i8] c" \0A\00"
define i32 @deny_byname(i32* nocapture %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @rewind(i32* %0)
%6 = call i64 @fgets(i8* %4, i32 256, i32* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %2, %14
%9 = call i8* @strtok(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i8* %9, null
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = call i64 @strcasestr(i8* %1, i8* %9)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11, %8
%15 = call i64 @fgets(i8* %4, i32 256, i32* %0)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %11, %14, %2
%18 = phi i32 [ 0, %2 ], [ 0, %14 ], [ 1, %11 ]
ret i32 %18
}