#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 */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int main(int argc, char **argv) {
  char buf[80];
  FILE *f = fopen(argv[1], "r");
  fgets(buf, sizeof buf, f);
  if (buf[8] == 'P')
    if (buf[9] == 'U')
      abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeab(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x68(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rdx
mov    $0x50,%esi
call   1040 <fgets@plt>
movsbl -0x58(%rbp),%eax
cmp    $0x50,%eax
jne    1196 <main+0x66>
movsbl -0x57(%rbp),%eax
cmp    $0x55,%eax
jne    1191 <main+0x61>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1196 <main+0x66>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    0x8(%rsi),%rdi
lea    0xec1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rsp,%rdi
mov    $0x50,%esi
mov    %rax,%rdx
call   1040 <fgets@plt>
cmpb   $0x50,0x8(%rsp)
jne    1162 <main+0x32>
cmpb   $0x55,0x9(%rsp)
je     1169 <main+0x39>
xor    %eax,%eax
add    $0x58,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [80 x i8]
%7 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %11, i32** %7
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%13 = load i32*, i32** %7
%14 = call i32 @fgets(i8* %12, i32 80, i32* %13)
%15 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 8
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 80
br i1 %18, label %19, label %27
19: ; preds = %2
%20 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 9
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 85
br i1 %23, label %24, label %26
24: ; preds = %19
%25 = call i32 (...) @abort()
unreachable
26: ; preds = %19
br label %27
27: ; preds = %26, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @fgets(i8* %4, i32 80, i32* %7)
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 80
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 9
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 85
%15 = select i1 %11, i1 %14, i1 false
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %2
ret i32 0
}