#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*/ libc_printf(char *, int, char *);
int libc_system(char *);
int /*<<< orphan*/ memcpy(char *, char *, unsigned int);
void debugDelay(char *message_, unsigned int _message_high) {
  int r;
  char message[_message_high + 1];
  memcpy(message, message_, _message_high + 1);
  libc_printf((char *)"debug delay:  %s\\n", 18, message);
  r = libc_system("sleep 3");
}


x86 assembly (clang, -O0):
<debugDelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1040 <memcpy@plt>
mov    -0x28(%rbp),%rdx
lea    0xe7e(%rip),%rdi
mov    $0x12,%esi
call   1030 <libc_printf@plt>
lea    0xe80(%rip),%rdi
call   1050 <libc_system@plt>
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debugDelay>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,%rax
lea    0x1(%rsi),%edx
mov    %rsp,%rbx
lea    0xf(%rdx),%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <memcpy@plt>
lea    0xea1(%rip),%rdi
mov    $0x12,%esi
mov    %rbx,%rdx
call   1030 <libc_printf@plt>
lea    0xea0(%rip),%rdi
call   1050 <libc_system@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"debug delay: %s\\n\00"
@.str.1 = [8 x i8] c"sleep 3\00"
define void @debugDelay(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = add i32 %8, 1
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %6
%12 = alloca i8, i64 %10
store i64 %10, i64* %7
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = add i32 %14, 1
%16 = call i32 @memcpy(i8* %12, i8* %13, i32 %15)
%17 = call i32 @libc_printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 18, i8* %12)
%18 = call i32 @libc_system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i32 %18, i32* %5
%19 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"debug delay: %s\\n\00"
@.str.1 = [8 x i8] c"sleep 3\00"
define void @debugDelay(i8* %0, i32 %1) {
%3 = add i32 %1, 1
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @memcpy(i8* %5, i8* %0, i32 %3)
%7 = call i32 @libc_printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 18, i8* %5)
%8 = call i32 @libc_system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}