#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*/ PicocParse(char const *, char *, int /*<<< orphan*/, int,
                              int /*<<< orphan*/, int, int);
char *PlatformReadFile(char const *);
int /*<<< orphan*/ strlen(char *);
void PicocPlatformScanFile(const char *FileName) {
  char *SourceStr = PlatformReadFile(FileName);
  if (SourceStr != 0 && SourceStr[0] == '#' && SourceStr[1] == '!') {
    SourceStr[0] = '/';
    SourceStr[1] = '/';
  }
  PicocParse(FileName, SourceStr, strlen(SourceStr), 1, 0, 1, 1);
}


x86 assembly (clang, -O0):
<PicocPlatformScanFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <PlatformReadFile@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1184 <PicocPlatformScanFile+0x54>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1184 <PicocPlatformScanFile+0x54>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x21,%eax
jne    1184 <PicocPlatformScanFile+0x54>
mov    -0x10(%rbp),%rax
movb   $0x2f,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x2f,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%r9d
xor    %r8d,%r8d
mov    %r9d,%ecx
movl   $0x1,(%rsp)
call   1040 <PicocParse@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PicocPlatformScanFile>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <PlatformReadFile@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1154 <PicocPlatformScanFile+0x24>
cmpb   $0x23,(%rbx)
jne    1154 <PicocPlatformScanFile+0x24>
cmpb   $0x21,0x1(%rbx)
jne    1154 <PicocPlatformScanFile+0x24>
movw   $0x2f2f,(%rbx)
mov    %rbx,%rdi
call   1030 <strlen@plt>
movl   $0x1,(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
call   1040 <PicocParse@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @PicocPlatformScanFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @PlatformReadFile(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %25
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 35
br i1 %13, label %14, label %25
14: ; preds = %8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 33
br i1 %19, label %20, label %25
20: ; preds = %14
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 0
store i8 47, i8* %22
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 1
store i8 47, i8* %24
br label %25
25: ; preds = %20, %14, %8, %1
%26 = load i8*, i8** %2
%27 = load i8*, i8** %3
%28 = load i8*, i8** %3
%29 = call i32 @strlen(i8* %28)
%30 = call i32 @PicocParse(i8* %26, i8* %27, i32 %29, i32 1, i32 0, i32 1, i32 1)
ret void
}

LLVM IR (-O2):
define void @PicocPlatformScanFile(i8* %0) {
%2 = tail call i8* @PlatformReadFile(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 35
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %2, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 33
br i1 %10, label %11, label %12
11: ; preds = %7
store i8 47, i8* %2
store i8 47, i8* %8
br label %12
12: ; preds = %11, %7, %4, %1
%13 = tail call i32 @strlen(i8* %2)
%14 = tail call i32 @PicocParse(i8* %0, i8* %2, i32 %13, i32 1, i32 0, i32 1, i32 1)
ret void
}