#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 EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char);
void PRP_LogItf_T_show_help(void) {
  int c;
  FILE *fp = fopen("../prp_pcap_tap_userspace/help", "rb");
  while ((c = fgetc(fp)) != EOF) {
    printf("%c", (char)c);
  }
  fclose(fp);
}


x86 assembly (clang, -O0):
<PRP_LogItf_T_show_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e76(%rip),%rcx
cmp    (%rcx),%eax
je     1191 <PRP_LogItf_T_show_help+0x51>
mov    -0x4(%rbp),%eax
lea    0xe9e(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
jmp    115f <PRP_LogItf_T_show_help+0x1f>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRP_LogItf_T_show_help>:
push   %r15
push   %r14
push   %rbx
lea    0xeb4(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <fgetc@plt>
mov    0x2e7e(%rip),%r15
cmp    (%r15),%eax
je     1198 <PRP_LogItf_T_show_help+0x58>
lea    0xeac(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <fgetc@plt>
cmp    (%r15),%eax
jne    1180 <PRP_LogItf_T_show_help+0x40>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"../prp_pcap_tap_userspace/help\00"
@.str.1 = [3 x i8] c"rb\00"
@EOF = global i32 0
@.str.2 = [3 x i8] c"%c\00"
define void @PRP_LogItf_T_show_help() {
%1 = alloca i32
%2 = alloca i32*
%3 = call i32* @fopen(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
br label %4
4: ; preds = %9, %0
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
store i32 %6, i32* %1
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = load i32, i32* %1
%11 = trunc i32 %10 to i8
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %11)
br label %4
13: ; preds = %4
%14 = load i32*, i32** %2
%15 = call i32 @fclose(i32* %14)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"../prp_pcap_tap_userspace/help\00"
@.str.1 = [3 x i8] c"rb\00"
@EOF = global i32 0
@.str.2 = [3 x i8] c"%c\00"
define void @PRP_LogItf_T_show_help() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fgetc(i32* %1)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %12, label %5
5: ; preds = %0, %5
%6 = phi i32 [ %9, %5 ], [ %2, %0 ]
%7 = trunc i32 %6 to i8
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %7)
%9 = tail call i32 @fgetc(i32* %1)
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %5
12: ; preds = %5, %0
%13 = tail call i32 @fclose(i32* %1)
ret void
}