#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 *);
int /*<<< orphan*/ get_target_param(char *);
char *mbed_get_target_path();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
void btnMake_Click() {
  char sparam[256];
  printf("\n\n=============================== Build "
         "=============================== \n");
  get_target_param(sparam);
  char *s = mbed_get_target_path();
  printf("%s\n\n", s);
  UI_Enable(0);
  sleep(300);
  exec_redirect_io("make.exe", sparam, "exec_done_cb");
}


x86 assembly (clang, -O0):
<btnMake_Click>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x100(%rbp),%rdi
call   1050 <get_target_param@plt>
mov    $0x0,%al
call   1070 <mbed_get_target_path@plt>
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <UI_Enable@plt>
mov    $0x12c,%edi
call   1080 <sleep@plt>
lea    -0x100(%rbp),%rsi
lea    0xe88(%rip),%rdi
lea    0xe8a(%rip),%rdx
call   1030 <exec_redirect_io@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btnMake_Click>:
push   %rbx
sub    $0x100,%rsp
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <get_target_param@plt>
xor    %eax,%eax
call   1080 <mbed_get_target_path@plt>
lea    0xe63(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1070 <UI_Enable@plt>
mov    $0x12c,%edi
call   1090 <sleep@plt>
lea    0xe46(%rip),%rdi
lea    0xe48(%rip),%rdx
mov    %rbx,%rsi
call   1040 <exec_redirect_io@plt>
add    $0x100,%rsp
pop    %rbx
ret

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

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