#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ CheckedCommand(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  char *, int, int, int, char *, int);
int /*<<< orphan*/ printf(char *);
void DataSharedMem(FILE *p_cmd, FILE *p_res, int i_overlay, int i_width,
                   int i_height, char *psz_format, int i_shmid) {
  printf("Sending data via shared memory...");
  CheckedCommand(p_cmd, p_res, "DataSharedMem %d %d %d %s %d\n", i_overlay,
                 i_width, i_height, psz_format, i_shmid);
  printf(" done\n");
}


x86 assembly (clang, -O0):
<DataSharedMem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    -0x28(%rbp),%r10
mov    0x10(%rbp),%eax
lea    0xeb4(%rip),%rdx
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <CheckedCommand@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DataSharedMem>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,(%rsp)
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    0x40(%rsp),%r14d
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
lea    0xebc(%rip),%rdx
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    %r15d,%r9d
push   %r14
push   0x8(%rsp)
call   1050 <CheckedCommand@plt>
add    $0x10,%rsp
lea    0xeb5(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Sending data via shared memory...\00"
@.str.1 = [30 x i8] c"DataSharedMem %d %d %d %s %d\0A\00"
@.str.2 = [7 x i8] c" done\0A\00"
define void @DataSharedMem(i32* %0, i32* %1, i32 %2, i32 %3, i32 %4, i8* %5, i32 %6) {
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32
store i32* %0, i32** %8
store i32* %1, i32** %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i8* %5, i8** %13
store i32 %6, i32* %14
%15 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%16 = load i32*, i32** %8
%17 = load i32*, i32** %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load i32, i32* %12
%21 = load i8*, i8** %13
%22 = load i32, i32* %14
%23 = call i32 @CheckedCommand(i32* %16, i32* %17, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 %19, i32 %20, i8* %21, i32 %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Sending data via shared memory...\00"
@.str.1 = [30 x i8] c"DataSharedMem %d %d %d %s %d\0A\00"
@str = [6 x i8] c" done\00"
define void @DataSharedMem(i32* %0, i32* %1, i32 %2, i32 %3, i32 %4, i8* %5, i32 %6) {
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @CheckedCommand(i32* %0, i32* %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %2, i32 %3, i32 %4, i8* %5, i32 %6)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}