#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*/ getCurrentSConsole();
unsigned int getFileBuf(unsigned char *);
int /*<<< orphan*/ kInternalExecute(unsigned char *, unsigned int);
int /*<<< orphan*/ lockSConsole(int /*<<< orphan*/);
int /*<<< orphan*/ sConsoleWrite(int /*<<< orphan*/, char *);
void exec(unsigned int argc, unsigned char (*argv_pointer)[10]) {
  unsigned int bDir = getFileBuf(argv_pointer[1]);
  if (bDir == 0x00000000) {
    sConsoleWrite(getCurrentSConsole(), "No se encuentra el fichero!");
    return;
  }
  lockSConsole(getCurrentSConsole());
  kInternalExecute(argv_pointer[1], bDir);
  return;
}


x86 assembly (clang, -O0):
<exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0xa,%rdi
call   1040 <getFileBuf@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1193 <exec+0x43>
mov    $0x0,%al
call   1030 <getCurrentSConsole@plt>
mov    %eax,%edi
lea    0xe77(%rip),%rsi
call   1060 <sConsoleWrite@plt>
jmp    11b1 <exec+0x61>
mov    $0x0,%al
call   1030 <getCurrentSConsole@plt>
mov    %eax,%edi
call   1070 <lockSConsole@plt>
mov    -0x10(%rbp),%rdi
add    $0xa,%rdi
mov    -0x14(%rbp),%esi
call   1050 <kInternalExecute@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
add    $0xa,%rbx
mov    %rbx,%rdi
call   1040 <getFileBuf@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <getCurrentSConsole@plt>
test   %ebp,%ebp
je     1186 <exec+0x36>
mov    %eax,%edi
call   1070 <lockSConsole@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <kInternalExecute@plt>
lea    0xe73(%rip),%rsi
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <sConsoleWrite@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"No se encuentra el fichero!\00"
define void @exec(i32 %0, [10 x i8]* %1) {
%3 = alloca i32
%4 = alloca [10 x i8]*
%5 = alloca i32
store i32 %0, i32* %3
store [10 x i8]* %1, [10 x i8]** %4
%6 = load [10 x i8]*, [10 x i8]** %4
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 1
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%9 = call i32 @getFileBuf(i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 (...) @getCurrentSConsole()
%14 = call i32 @sConsoleWrite(i32 %13, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %23
15: ; preds = %2
%16 = call i32 (...) @getCurrentSConsole()
%17 = call i32 @lockSConsole(i32 %16)
%18 = load [10 x i8]*, [10 x i8]** %4
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %18, i64 1
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %19, i64 0, i64 0
%21 = load i32, i32* %5
%22 = call i32 @kInternalExecute(i8* %20, i32 %21)
br label %23
23: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"No se encuentra el fichero!\00"
define void @exec(i32 %0, [10 x i8]* %1) {
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 1, i64 0
%4 = tail call i32 @getFileBuf(i8* %3)
%5 = icmp eq i32 %4, 0
%6 = tail call i32 (...) @getCurrentSConsole()
br i1 %5, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @sConsoleWrite(i32 %6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %12
9: ; preds = %2
%10 = tail call i32 @lockSConsole(i32 %6)
%11 = tail call i32 @kInternalExecute(i8* %3, i32 %4)
br label %12
12: ; preds = %9, %7
ret void
}