#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*/ UI_Enable(int /*<<< orphan*/);
int /*<<< orphan*/ exec_redirect_io(char *, char *, char *);
char *mbed_get_target_path();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sleep(int);
void dld_action(char *msg, char *cmdl, char *param) {
  char *s = mbed_get_target_path();
  printf("\n\n=============================== %s "
         "=============================== \n",
         msg);
  printf("%s\n\n", s);
  UI_Enable(0);
  sleep(300);
  exec_redirect_io(cmdl, param, "exec_done_cb");
}


x86 assembly (clang, -O0):
<dld_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1060 <mbed_get_target_path@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <UI_Enable@plt>
mov    $0x12c,%edi
call   1070 <sleep@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xe9d(%rip),%rdx
call   1030 <exec_redirect_io@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dld_action>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %eax,%eax
call   1060 <mbed_get_target_path@plt>
mov    %rax,%rbx
lea    0xe8e(%rip),%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <UI_Enable@plt>
mov    $0x12c,%edi
call   1070 <sleep@plt>
lea    0xeab(%rip),%rdx
mov    %r15,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <exec_redirect_io@plt>

LLVM IR (-O0):
@.str = [71 x i8] c"\0A\0A=============================== %s =============================== \0A\00"
@.str.1 = [5 x i8] c"%s\0A\0A\00"
@.str.2 = [13 x i8] c"exec_done_cb\00"
define void @dld_action(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = call i8* (...) @mbed_get_target_path()
store i8* %8, i8** %7
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %7
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = call i32 @UI_Enable(i32 0)
%14 = call i32 @sleep(i32 300)
%15 = load i8*, i8** %5
%16 = load i8*, i8** %6
%17 = call i32 @exec_redirect_io(i8* %15, i8* %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"\0A\0A=============================== %s =============================== \0A\00"
@.str.1 = [5 x i8] c"%s\0A\0A\00"
@.str.2 = [13 x i8] c"exec_done_cb\00"
define void @dld_action(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* (...) @mbed_get_target_path()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = tail call i32 @UI_Enable(i32 0)
%8 = tail call i32 @sleep(i32 300)
%9 = tail call i32 @exec_redirect_io(i8* %1, i8* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret void
}