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

/* Variables and functions */
int /*<<< orphan*/ add_ignored(int /*<<< orphan*/, char);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ removespaces(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strdup(char *);
char *strerror(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
char *strtok(char *, char *);
void load_ignore_sendmail(char *fn, char src) {
  FILE *fp = NULL;
  char buf[1024];
  char *m = NULL;
  if ((fp = fopen(fn, "r")) == NULL) {
    fprintf(stderr, "fopen: %s: %s\n", fn, strerror(errno));
    exit(-1);
  }
  memset(buf, 0, sizeof(buf));
  while ((fgets(buf, 1024, fp)) != NULL) {
    if (buf[0] == '#' || buf[0] == ' ')
      continue;
    m = strtok(buf, "\t");
    if (m == NULL)
      continue;
    removespaces(m, strlen(m));
    add_ignored(strdup(m), src);
    memset(buf, 0, sizeof(buf));
  }
  if (fclose(fp) != 0) {
    fprintf(stderr, "File: %s - Line: %d: %s.\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/EnderUNIX/spamGuard/refs/heads/master/"
            "functions.c",
            267, strerror(errno));
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<load_ignore_sendmail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x428(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe0d(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1256 <load_ignore_sendmail+0x96>
mov    0x2dd3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x434(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x430(%rbp)
mov    0x2db1(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x434(%rbp),%edi
mov    -0x430(%rbp),%rdx
mov    %rax,%rcx
lea    0xdbd(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
lea    -0x420(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x400,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     1331 <load_ignore_sendmail+0x171>
movsbl -0x420(%rbp),%eax
cmp    $0x23,%eax
je     12a8 <load_ignore_sendmail+0xe8>
movsbl -0x420(%rbp),%eax
cmp    $0x20,%eax
jne    12ad <load_ignore_sendmail+0xed>
jmp    1269 <load_ignore_sendmail+0xa9>
lea    -0x420(%rbp),%rdi
lea    0xd56(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,-0x428(%rbp)
cmpq   $0x0,-0x428(%rbp)
jne    12da <load_ignore_sendmail+0x11a>
jmp    1269 <load_ignore_sendmail+0xa9>
mov    -0x428(%rbp),%rax
mov    %rax,-0x440(%rbp)
mov    -0x428(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x440(%rbp),%rdi
mov    %eax,%esi
call   10e0 <removespaces@plt>
mov    -0x428(%rbp),%rdi
call   10c0 <strdup@plt>
mov    %eax,%edi
movsbl -0x9(%rbp),%esi
call   1050 <add_ignored@plt>
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
jmp    1269 <load_ignore_sendmail+0xa9>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0x0,%rax
je     138e <load_ignore_sendmail+0x1ce>
mov    0x2c95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x444(%rbp)
mov    0x2c7e(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x444(%rbp),%edi
mov    %rax,%r8
lea    0xca2(%rip),%rsi
lea    0xcb5(%rip),%rdx
mov    $0x10b,%ecx
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_ignore_sendmail>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x400,%rsp
mov    %esi,%r12d
mov    %rdi,%rbp
lea    0xe24(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     12b6 <load_ignore_sendmail+0xf6>
mov    %rax,%rbx
mov    %rsp,%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    %rbp,%rdi
mov    $0x400,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1299 <load_ignore_sendmail+0xd9>
mov    %rsp,%r14
lea    0xdef(%rip),%r15
movsbl %r12b,%r12d
jmp    1245 <load_ignore_sendmail+0x85>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x400,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1299 <load_ignore_sendmail+0xd9>
movzbl (%rsp),%eax
cmp    $0x20,%al
je     1230 <load_ignore_sendmail+0x70>
cmp    $0x23,%al
je     1230 <load_ignore_sendmail+0x70>
mov    %r14,%rdi
mov    %r15,%rsi
call   10a0 <strtok@plt>
test   %rax,%rax
je     1230 <load_ignore_sendmail+0x70>
mov    %rax,%rbp
mov    %rax,%rdi
call   1040 <strlen@plt>
mov    %rbp,%rdi
mov    %eax,%esi
call   10e0 <removespaces@plt>
mov    %rbp,%rdi
call   10c0 <strdup@plt>
mov    %eax,%edi
mov    %r12d,%esi
call   1050 <add_ignored@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
jmp    1230 <load_ignore_sendmail+0x70>
mov    %rbx,%rdi
call   1030 <fclose@plt>
test   %rax,%rax
jne    12ed <load_ignore_sendmail+0x12d>
add    $0x400,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d23(%rip),%rax
mov    (%rax),%ebx
mov    0x2d12(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xd2e(%rip),%rsi
mov    %ebx,%edi
mov    %rbp,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
mov    0x2cec(%rip),%rax
mov    (%rax),%ebx
mov    0x2cdb(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xd08(%rip),%rsi
lea    0xd1b(%rip),%rdx
mov    %ebx,%edi
mov    $0x10b,%ecx
mov    %rax,%r8
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [15 x i8] c"fopen: %s: %s\0A\00"
@errno = global i32 0
@.str.2 = [2 x i8] c"\09\00"
@.str.3 = [26 x i8] c"File: %s - Line: %d: %s.\0A\00"
@.str.4 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/EnderUNIX/spamGuard/refs/heads/master/functions.c\00"
define void @load_ignore_sendmail(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32*
%6 = alloca [1024 x i8]
%7 = alloca i8*
store i8* %0, i8** %3
store i8 %1, i8* %4
store i32* null, i32** %5
store i8* null, i8** %7
%8 = load i8*, i8** %3
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %3
%14 = load i32, i32* @errno
%15 = call i8* @strerror(i32 %14)
%16 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %13, i8* %15)
%17 = call i32 @exit(i32 -1)
unreachable
18: ; preds = %2
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%20 = call i32 @memset(i8* %19, i32 0, i32 1024)
br label %21
21: ; preds = %43, %42, %36, %18
%22 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%23 = load i32*, i32** %5
%24 = call i32* @fgets(i8* %22, i32 1024, i32* %23)
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %54
26: ; preds = %21
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 35
br i1 %30, label %36, label %31
31: ; preds = %26
%32 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 32
br i1 %35, label %36, label %37
36: ; preds = %31, %26
br label %21
37: ; preds = %31
%38 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%39 = call i8* @strtok(i8* %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i8* %39, i8** %7
%40 = load i8*, i8** %7
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %43
42: ; preds = %37
br label %21
43: ; preds = %37
%44 = load i8*, i8** %7
%45 = load i8*, i8** %7
%46 = call i32 @strlen(i8* %45)
%47 = call i32 @removespaces(i8* %44, i32 %46)
%48 = load i8*, i8** %7
%49 = call i32 @strdup(i8* %48)
%50 = load i8, i8* %4
%51 = call i32 @add_ignored(i32 %49, i8 signext %50)
%52 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%53 = call i32 @memset(i8* %52, i32 0, i32 1024)
br label %21
54: ; preds = %21
%55 = load i32*, i32** %5
%56 = call i64 @fclose(i32* %55)
%57 = icmp ne i64 %56, 0
br i1 %57, label %58, label %64
58: ; preds = %54
%59 = load i32, i32* @stderr
%60 = load i32, i32* @errno
%61 = call i8* @strerror(i32 %60)
%62 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.4, i64 0, i64 0), i32 267, i8* %61)
%63 = call i32 @exit(i32 -1)
unreachable
64: ; preds = %54
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [15 x i8] c"fopen: %s: %s\0A\00"
@errno = global i32 0
@.str.2 = [2 x i8] c"\09\00"
@.str.3 = [26 x i8] c"File: %s - Line: %d: %s.\0A\00"
@.str.4 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/EnderUNIX/spamGuard/refs/heads/master/functions.c\00"
define void @load_ignore_sendmail(i8* %0, i8 signext %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i32, i32* @errno
%10 = tail call i8* @strerror(i32 %9)
%11 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %10)
%12 = tail call i32 @exit(i32 -1)
unreachable
13: ; preds = %2
%14 = call i32 @memset(i8* %4, i32 0, i32 1024)
%15 = call i32* @fgets(i8* %4, i32 1024, i32* %5)
%16 = icmp eq i32* %15, null
br i1 %16, label %31, label %17
17: ; preds = %13, %28
%18 = load i8, i8* %4
switch i8 %18, label %19 [
i8 35, label %28
i8 32, label %28
]
19: ; preds = %17
%20 = call i8* @strtok(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp eq i8* %20, null
br i1 %21, label %28, label %22
22: ; preds = %19
%23 = call i32 @strlen(i8* %20)
%24 = call i32 @removespaces(i8* %20, i32 %23)
%25 = call i32 @strdup(i8* %20)
%26 = call i32 @add_ignored(i32 %25, i8 signext %1)
%27 = call i32 @memset(i8* %4, i32 0, i32 1024)
br label %28
28: ; preds = %22, %19, %17, %17
%29 = call i32* @fgets(i8* %4, i32 1024, i32* %5)
%30 = icmp eq i32* %29, null
br i1 %30, label %31, label %17
31: ; preds = %28, %13
%32 = call i64 @fclose(i32* %5)
%33 = icmp eq i64 %32, 0
br i1 %33, label %40, label %34
34: ; preds = %31
%35 = load i32, i32* @stderr
%36 = load i32, i32* @errno
%37 = call i8* @strerror(i32 %36)
%38 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.4, i64 0, i64 0), i32 267, i8* %37)
%39 = call i32 @exit(i32 -1)
unreachable
40: ; preds = %31
ret void
}