#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*/ linear_conversion(float const *, float *, int);
int /*<<< orphan*/ printImage(float *, int, int, char const *);
int /*<<< orphan*/ xfree(float *);
float *xmalloc(int);
void printImage_LinearConversion(const float *imageIn, int w, int h,
                                 const char *name) {
  float *imTemp = xmalloc(w * h * sizeof(float));
  linear_conversion(imageIn, imTemp, w * h);
  printImage(imTemp, w, h, name);
  xfree(imTemp);
}


x86 assembly (clang, -O0):
<printImage_LinearConversion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <xmalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0xc(%rbp),%edx
imul   -0x10(%rbp),%edx
call   1050 <linear_conversion@plt>
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1060 <printImage@plt>
mov    -0x20(%rbp),%rdi
call   1030 <xfree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printImage_LinearConversion>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r12d
mov    %esi,%r13d
mov    %rdi,%r15
mov    %edx,%ebp
imul   %esi,%ebp
lea    0x0(,%rbp,4),%edi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
mov    %ebp,%edx
call   1050 <linear_conversion@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
mov    %r12d,%edx
mov    %r14,%rcx
call   1060 <printImage@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <xfree@plt>

LLVM IR (-O0):
define void @printImage_LinearConversion(float* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca float*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca float*
store float* %0, float** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = mul nsw i32 %10, %11
%13 = sext i32 %12 to i64
%14 = mul i64 %13, 4
%15 = trunc i64 %14 to i32
%16 = call float* @xmalloc(i32 %15)
store float* %16, float** %9
%17 = load float*, float** %5
%18 = load float*, float** %9
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = mul nsw i32 %19, %20
%22 = call i32 @linear_conversion(float* %17, float* %18, i32 %21)
%23 = load float*, float** %9
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = load i8*, i8** %8
%27 = call i32 @printImage(float* %23, i32 %24, i32 %25, i8* %26)
%28 = load float*, float** %9
%29 = call i32 @xfree(float* %28)
ret void
}

LLVM IR (-O2):
define void @printImage_LinearConversion(float* %0, i32 %1, i32 %2, i8* %3) {
%5 = mul nsw i32 %2, %1
%6 = shl i32 %5, 2
%7 = tail call float* @xmalloc(i32 %6)
%8 = tail call i32 @linear_conversion(float* %0, float* %7, i32 %5)
%9 = tail call i32 @printImage(float* %7, i32 %1, i32 %2, i8* %3)
%10 = tail call i32 @xfree(float* %7)
ret void
}