#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*/ debug_display_fields(int, char const **, int const *,
                                        int const);
int /*<<< orphan*/ printf(char *);
int debug_display_rf() {
  const char *fields[] = {
      "File Name", "File Size", "File Type", "User Name", "Permission",
  };
  const int fields_len[] = {
      1, 1, 1, 1, 1,
  };
  int i, ptr;
  const int n_fields = 5;
  const int entry_size = 8;
  ptr = 31744;
  for (i = 0; i < 60; ++i) {
    debug_display_fields(ptr, fields, fields_len, n_fields);
    printf("\n");
    ptr = ptr + entry_size;
  }
  return 1;
}


x86 assembly (clang, -O0):
<debug_display_rf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    0xeb1(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xeb0(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xeaf(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xeae(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xead(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0x40(%rbp)
movl   $0x5,-0x5c(%rbp)
movl   $0x8,-0x60(%rbp)
movl   $0x7c00,-0x58(%rbp)
movl   $0x0,-0x54(%rbp)
cmpl   $0x3c,-0x54(%rbp)
jge    11fc <debug_display_rf+0xcc>
mov    -0x58(%rbp),%edi
lea    -0x30(%rbp),%rsi
lea    -0x50(%rbp),%rdx
mov    $0x5,%ecx
call   1050 <debug_display_fields@plt>
lea    0xe53(%rip),%rdi
call   1030 <printf@plt>
mov    -0x58(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x58(%rbp)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11ba <debug_display_rf+0x8a>
mov    $0x1,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_display_rf>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
lea    0xed0(%rip),%rax
mov    %rax,0x20(%rsp)
lea    0xece(%rip),%rax
mov    %rax,0x28(%rsp)
lea    0xecc(%rip),%rax
mov    %rax,0x30(%rsp)
lea    0xeca(%rip),%rax
mov    %rax,0x38(%rsp)
lea    0xec8(%rip),%rax
mov    %rax,0x40(%rsp)
mov    0xee5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    $0x7c00,%ebx
lea    0x20(%rsp),%r14
mov    %rsp,%r15
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
mov    $0x5,%ecx
call   1040 <debug_display_fields@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x8,%ebx
cmp    $0x7de0,%ebx
jne    1190 <debug_display_rf+0x70>
mov    $0x1,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"File Name\00"
@.str.1 = [10 x i8] c"File Size\00"
@.str.2 = [10 x i8] c"File Type\00"
@.str.3 = [10 x i8] c"User Name\00"
@.str.4 = [11 x i8] c"Permission\00"
@__const.debug_display_rf.fields_len = [5 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1]
@.str.5 = [2 x i8] c"\0A\00"
define i32 @debug_display_rf() {
%1 = alloca [5 x i8*]
%2 = alloca [5 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast [5 x i8*]* %1 to i8*
%8 = bitcast i8* %7 to [5 x i8*]*
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i32 0, i32 0
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i32 0, i32 1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i32 0, i32 2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0), i8** %11
%12 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i32 0, i32 3
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i32 0, i32 0), i8** %12
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i32 0, i32 4
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i32 0, i32 0), i8** %13
%14 = bitcast [5 x i32]* %2 to i8*
store i32 5, i32* %5
store i32 8, i32* %6
store i32 31744, i32* %4
store i32 0, i32* %3
br label %15
15: ; preds = %26, %0
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 60
br i1 %17, label %18, label %29
18: ; preds = %15
%19 = load i32, i32* %4
%20 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 0
%21 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%22 = call i32 @debug_display_fields(i32 %19, i8** %20, i32* %21, i32 5)
%23 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 8
store i32 %25, i32* %4
br label %26
26: ; preds = %18
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %15
29: ; preds = %15
ret i32 1
}

LLVM IR (-O2):
@.str = [10 x i8] c"File Name\00"
@.str.1 = [10 x i8] c"File Size\00"
@.str.2 = [10 x i8] c"File Type\00"
@.str.3 = [10 x i8] c"User Name\00"
@.str.4 = [11 x i8] c"Permission\00"
@__const.debug_display_rf.fields_len = [5 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1]
define i32 @debug_display_rf() {
%1 = alloca [5 x i8*]
%2 = alloca [5 x i32]
%3 = bitcast [5 x i8*]* %1 to i8*
%4 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 3
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %1, i64 0, i64 4
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8** %8
%9 = bitcast [5 x i32]* %2 to i8*
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
br label %11
11: ; preds = %0, %11
%12 = phi i32 [ 0, %0 ], [ %17, %11 ]
%13 = phi i32 [ 31744, %0 ], [ %16, %11 ]
%14 = call i32 @debug_display_fields(i32 %13, i8** %4, i32* %10, i32 5)
%15 = call i32 @putchar(i32 10)
%16 = add nuw nsw i32 %13, 8
%17 = add nuw nsw i32 %12, 1
%18 = icmp eq i32 %17, 60
br i1 %18, label %19, label %11
19: ; preds = %11
ret i32 1
}