#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 */
int /*<<< orphan*/ pst_debug_func(char *);
int /*<<< orphan*/ pst_debug_func_ret();
int /*<<< orphan*/ pst_debug_msg_info(int, char *, int);
int /*<<< orphan*/ pst_debug_msg_text(char *, ...);
char *strpbrk(char *, char *);
void check_filename(char *fname) {
  char *t = fname;
  {
    pst_debug_func("check_filename");
    {
      pst_debug_msg_info(
          673,
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/anarchivist/pyflag/refs/heads/main/src/"
          "mailtools/readpst.c",
          9);
      pst_debug_msg_text("Entering function %s\n", "check_filename");
    };
  };
  if (!t) {
    {
      {
        pst_debug_msg_info(
            675,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/anarchivist/pyflag/refs/heads/main/src/"
            "mailtools/readpst.c",
            10);
        pst_debug_msg_text("Leaving function\n");
      };
      pst_debug_func_ret();
    };
    return;
  }
  while ((t = strpbrk(t, "/\\:"))) {
    *t = '_';
  }
  {
    {
      pst_debug_msg_info(
          682,
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/anarchivist/pyflag/refs/heads/main/src/"
          "mailtools/readpst.c",
          10);
      pst_debug_msg_text("Leaving function\n");
    };
    pst_debug_func_ret();
  };
}


x86 assembly (clang, -O0):
<check_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xe95(%rip),%rdi
call   1060 <pst_debug_func@plt>
mov    $0x2a1,%edi
lea    0xe93(%rip),%rsi
mov    $0x9,%edx
call   1040 <pst_debug_msg_info@plt>
lea    0xf17(%rip),%rdi
lea    0xe6c(%rip),%rsi
mov    $0x0,%al
call   1050 <pst_debug_msg_text@plt>
cmpq   $0x0,-0x10(%rbp)
jne    11d6 <check_filename+0x86>
mov    $0x2a3,%edi
lea    0xe5d(%rip),%rsi
mov    $0xa,%edx
call   1040 <pst_debug_msg_info@plt>
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1050 <pst_debug_msg_text@plt>
mov    $0x0,%al
call   1070 <pst_debug_func_ret@plt>
jmp    1230 <check_filename+0xe0>
jmp    11db <check_filename+0x8b>
mov    -0x10(%rbp),%rdi
lea    0xee6(%rip),%rsi
call   1030 <strpbrk@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1205 <check_filename+0xb5>
mov    -0x10(%rbp),%rax
movb   $0x5f,(%rax)
jmp    11db <check_filename+0x8b>
mov    $0x2aa,%edi
lea    0xdfe(%rip),%rsi
mov    $0xa,%edx
call   1040 <pst_debug_msg_info@plt>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1050 <pst_debug_msg_text@plt>
mov    $0x0,%al
call   1070 <pst_debug_func_ret@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_filename>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xea3(%rip),%rbp
mov    %rbp,%rdi
call   1060 <pst_debug_func@plt>
lea    0xea3(%rip),%rsi
mov    $0x2a1,%edi
mov    $0x9,%edx
call   1040 <pst_debug_msg_info@plt>
lea    0xf22(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <pst_debug_msg_text@plt>
test   %rbx,%rbx
je     11d5 <check_filename+0x85>
lea    0xf34(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strpbrk@plt>
mov    $0x2aa,%ebp
test   %rax,%rax
je     11da <check_filename+0x8a>
lea    0xf1b(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movb   $0x5f,(%rax)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strpbrk@plt>
test   %rax,%rax
jne    11c0 <check_filename+0x70>
jmp    11da <check_filename+0x8a>
mov    $0x2a3,%ebp
lea    0xe2e(%rip),%rsi
mov    %ebp,%edi
mov    $0xa,%edx
call   1040 <pst_debug_msg_info@plt>
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1050 <pst_debug_msg_text@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <pst_debug_func_ret@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"check_filename\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/anarchivist/pyflag/refs/heads/main/src/mailtools/readpst.c\00"
@.str.2 = [22 x i8] c"Entering function %s\0A\00"
@.str.3 = [18 x i8] c"Leaving function\0A\00"
@.str.4 = [4 x i8] c"/\\:\00"
define void @check_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = call i32 @pst_debug_func(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @pst_debug_msg_info(i32 673, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 9)
%7 = call i32 (i8*, ...) @pst_debug_msg_text(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %1
%11 = call i32 @pst_debug_msg_info(i32 675, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 10)
%12 = call i32 (i8*, ...) @pst_debug_msg_text(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (...) @pst_debug_func_ret()
br label %25
14: ; preds = %1
br label %15
15: ; preds = %19, %14
%16 = load i8*, i8** %3
%17 = call i8* @strpbrk(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
store i8* %17, i8** %3
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i8*, i8** %3
store i8 95, i8* %20
br label %15
21: ; preds = %15
%22 = call i32 @pst_debug_msg_info(i32 682, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 10)
%23 = call i32 (i8*, ...) @pst_debug_msg_text(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%24 = call i32 (...) @pst_debug_func_ret()
br label %25
25: ; preds = %21, %10
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"check_filename\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/anarchivist/pyflag/refs/heads/main/src/mailtools/readpst.c\00"
@.str.2 = [22 x i8] c"Entering function %s\0A\00"
@.str.3 = [18 x i8] c"Leaving function\0A\00"
@.str.4 = [4 x i8] c"/\\:\00"
define void @check_filename(i8* %0) {
%2 = tail call i32 @pst_debug_func(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @pst_debug_msg_info(i32 673, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 9)
%4 = tail call i32 (i8*, ...) @pst_debug_msg_text(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %0, null
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = tail call i8* @strpbrk(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%8 = icmp eq i8* %7, null
br i1 %8, label %13, label %9
9: ; preds = %6, %9
%10 = phi i8* [ %11, %9 ], [ %7, %6 ]
store i8 95, i8* %10
%11 = tail call i8* @strpbrk(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %9
13: ; preds = %9, %6, %1
%14 = phi i32 [ 675, %1 ], [ 682, %6 ], [ 682, %9 ]
%15 = tail call i32 @pst_debug_msg_info(i32 %14, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 10)
%16 = tail call i32 (i8*, ...) @pst_debug_msg_text(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%17 = tail call i32 (...) @pst_debug_func_ret()
ret void
}