#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
FILE *dictfile_open(void) {
  FILE *dp;
  if ((dp = fopen("words", "r")) == NULL) {
    printf("WARNING: Could not open your dictionary file.\n");
    printf("Please ensure that the dictionary file is in the same");
    printf("directory as the main program.");
    exit(EXIT_FAILURE);
  }
  return dp;
}


x86 assembly (clang, -O0):
<dictfile_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    118b <dictfile_open+0x5b>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dictfile_open>:
push   %rax
lea    0xeb8(%rip),%rdi
lea    0xeb7(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     115b <dictfile_open+0x1b>
pop    %rcx
ret
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"words\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [47 x i8] c"WARNING: Could not open your dictionary file.\0A\00"
@.str.3 = [54 x i8] c"Please ensure that the dictionary file is in the same\00"
@.str.4 = [31 x i8] c"directory as the main program.\00"
@EXIT_FAILURE = global i32 0
define i32* @dictfile_open() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %10
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %0
%11 = load i32*, i32** %1
ret i32* %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"words\00"
@.str.1 = [2 x i8] c"r\00"
@.str.3 = [54 x i8] c"Please ensure that the dictionary file is in the same\00"
@.str.4 = [31 x i8] c"directory as the main program.\00"
@EXIT_FAILURE = global i32 0
@str = [46 x i8] c"WARNING: Could not open your dictionary file.\00"
define noalias i32* @dictfile_open() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
ret i32* %1
}