#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*/ file_merger(char *, char *);
int /*<<< orphan*/ get_file_list(char *, char **, int *);
int /*<<< orphan*/ printf(char *);
void handle_merge() {
  char *file_list[15];
  char *dirpath1 = "../../POCKETFILES/";
  int dir_len;
  get_file_list(dirpath1, file_list, &dir_len);
  if (dir_len < 5) {
    printf("\n\nOops! It seems there's not enough files to merge.\n\n");
  } else {
    file_merger(file_list[2], file_list[3]);
  }
}


x86 assembly (clang, -O0):
<handle_merge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    0xebe(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
lea    -0x80(%rbp),%rsi
lea    -0x8c(%rbp),%rdx
call   1050 <get_file_list@plt>
cmpl   $0x5,-0x8c(%rbp)
jge    117e <handle_merge+0x4e>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    118b <handle_merge+0x5b>
mov    -0x70(%rbp),%rdi
mov    -0x68(%rbp),%rsi
call   1040 <file_merger@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_merge>:
sub    $0x88,%rsp
lea    0xec2(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <get_file_list@plt>
cmpl   $0x4,0xc(%rsp)
jg     1168 <handle_merge+0x38>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
add    $0x88,%rsp
ret
mov    0x20(%rsp),%rdi
mov    0x28(%rsp),%rsi
call   1040 <file_merger@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"../../POCKETFILES/\00"
@.str.1 = [54 x i8] c"\0A\0AOops! It seems there's not enough files to merge.\0A\0A\00"
define void @handle_merge() {
%1 = alloca [15 x i8*]
%2 = alloca i8*
%3 = alloca i32
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds [15 x i8*], [15 x i8*]* %1, i64 0, i64 0
%6 = call i32 @get_file_list(i8* %4, i8** %5, i32* %3)
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 5
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
br label %17
11: ; preds = %0
%12 = getelementptr inbounds [15 x i8*], [15 x i8*]* %1, i64 0, i64 2
%13 = load i8*, i8** %12
%14 = getelementptr inbounds [15 x i8*], [15 x i8*]* %1, i64 0, i64 3
%15 = load i8*, i8** %14
%16 = call i32 @file_merger(i8* %13, i8* %15)
br label %17
17: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"../../POCKETFILES/\00"
@str = [53 x i8] c"\0A\0AOops! It seems there's not enough files to merge.\0A\00"
define void @handle_merge() {
%1 = alloca [15 x i8*]
%2 = alloca i32
%3 = bitcast [15 x i8*]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = getelementptr inbounds [15 x i8*], [15 x i8*]* %1, i64 0, i64 0
%6 = call i32 @get_file_list(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %5, i32* %2)
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 5
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
br label %17
11: ; preds = %0
%12 = getelementptr inbounds [15 x i8*], [15 x i8*]* %1, i64 0, i64 2
%13 = load i8*, i8** %12
%14 = getelementptr inbounds [15 x i8*], [15 x i8*]* %1, i64 0, i64 3
%15 = load i8*, i8** %14
%16 = call i32 @file_merger(i8* %13, i8* %15)
br label %17
17: ; preds = %11, %9
ret void
}