#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 */
scalar_t__ EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, char *, char *);
int /*<<< orphan*/ getFilePath(char *, int);
int /*<<< orphan*/ printf(char *, char *, char *);
void listCommands() {
  char directory[100];
  getFilePath(directory, false);
  FILE *commandFile;
  commandFile = fopen(directory, "r");
  char command[100];
  char action[100];
  while (fscanf(commandFile, "%[^\x001F]\x001F%[^\x001E]\x001E", command,
                action) != EOF) {
    printf("* %s: %s\n", command, action);
  }
  fclose(commandFile);
}


x86 assembly (clang, -O0):
<listCommands>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
call   1030 <getFilePath@plt>
lea    -0x70(%rbp),%rdi
lea    0xe8f(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rdi
lea    -0xe0(%rbp),%rdx
lea    -0x150(%rbp),%rcx
lea    0xe6f(%rip),%rsi
call   1060 <fscanf@plt>
mov    0x2e49(%rip),%rcx
cmp    (%rcx),%rax
je     11c7 <listCommands+0x77>
lea    -0xe0(%rbp),%rsi
lea    -0x150(%rbp),%rdx
lea    0xe52(%rip),%rdi
call   1050 <printf@plt>
jmp    117a <listCommands+0x2a>
mov    -0x78(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listCommands>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x148,%rsp
lea    0xe0(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <getFilePath@plt>
lea    0xe86(%rip),%rsi
mov    %rbx,%rdi
call   1070 <fopen@plt>
mov    %rax,%r15
lea    0xe76(%rip),%rsi
lea    0x70(%rsp),%rdx
mov    %rsp,%rcx
mov    %rax,%rdi
call   1060 <fscanf@plt>
mov    0x2e45(%rip),%rbp
cmp    0x0(%rbp),%rax
je     11e5 <listCommands+0x95>
lea    0xe5f(%rip),%r14
lea    0x70(%rsp),%r12
mov    %rsp,%rbx
lea    0xe43(%rip),%r13
nop
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
call   1060 <fscanf@plt>
cmp    0x0(%rbp),%rax
jne    11c0 <listCommands+0x70>
mov    %r15,%rdi
call   1040 <fclose@plt>
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [13 x i8] c"%[^\1F]\1F%[^\1E]\1E\00"
@EOF = global i64 0
@.str.2 = [10 x i8] c"* %s: %s\0A\00"
define void @listCommands() {
%1 = alloca [100 x i8]
%2 = alloca i32*
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = call i32 @getFilePath(i8* %5, i32 0)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %2
br label %9
9: ; preds = %16, %0
%10 = load i32*, i32** %2
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%13 = call i64 @fscanf(i32* %10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %12)
%14 = load i64, i64* @EOF
%15 = icmp ne i64 %13, %14
br i1 %15, label %16, label %20
16: ; preds = %9
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%19 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %17, i8* %18)
br label %9
20: ; preds = %9
%21 = load i32*, i32** %2
%22 = call i32 @fclose(i32* %21)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [13 x i8] c"%[^\1F]\1F%[^\1E]\1E\00"
@EOF = global i64 0
@.str.2 = [10 x i8] c"* %s: %s\0A\00"
define void @listCommands() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @getFilePath(i8* %4, i32 0)
%6 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = call i64 @fscanf(i32* %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* %8)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %17, label %12
12: ; preds = %0, %12
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %7, i8* %8)
%14 = call i64 @fscanf(i32* %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* %8)
%15 = load i64, i64* @EOF
%16 = icmp eq i64 %14, %15
br i1 %16, label %17, label %12
17: ; preds = %12, %0
%18 = call i32 @fclose(i32* %6)
ret void
}