#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*/ printf(char *, int, int, float);
float producer(int, int);
float consumer_raw(int x, int y) {
  float returnMe = producer(x, y) + producer(x + 1, y + 1) +
                   producer(x + 1, y) + producer(x, y + 1);
  printf("Recieved request for conumser(%d, %d)\n returning %f\n", x, y,
         returnMe);
  return returnMe;
}


x86 assembly (clang, -O0):
<consumer_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <producer@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
call   1030 <producer@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1030 <producer@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
call   1030 <producer@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
movss  -0xc(%rbp),%xmm0
lea    0xe50(%rip),%rdi
call   1040 <printf@plt>
movss  -0xc(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consumer_raw>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebx
call   1030 <producer@plt>
movss  %xmm0,0x4(%rsp)
lea    0x1(%rbx),%ebp
lea    0x1(%r14),%r15d
mov    %ebp,%edi
mov    %r15d,%esi
call   1030 <producer@plt>
addss  0x4(%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <producer@plt>
addss  0x4(%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
mov    %ebx,%edi
mov    %r15d,%esi
call   1030 <producer@plt>
addss  0x4(%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
lea    0xe79(%rip),%rdi
mov    %ebx,%esi
mov    %r14d,%edx
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [53 x i8] c"Recieved request for conumser(%d, %d)\0A returning %f\0A\00"
define float @consumer_raw(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call float @producer(i32 %6, i32 %7)
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
%13 = call float @producer(i32 %10, i32 %12)
%14 = fadd float %8, %13
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
%17 = load i32, i32* %4
%18 = call float @producer(i32 %16, i32 %17)
%19 = fadd float %14, %18
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
%23 = call float @producer(i32 %20, i32 %22)
%24 = fadd float %19, %23
store float %24, float* %5
%25 = load i32, i32* %3
%26 = load i32, i32* %4
%27 = load float, float* %5
%28 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %26, float %27)
%29 = load float, float* %5
ret float %29
}

LLVM IR (-O2):
@.str = [53 x i8] c"Recieved request for conumser(%d, %d)\0A returning %f\0A\00"
define float @consumer_raw(i32 %0, i32 %1) {
%3 = tail call float @producer(i32 %0, i32 %1)
%4 = add nsw i32 %0, 1
%5 = add nsw i32 %1, 1
%6 = tail call float @producer(i32 %4, i32 %5)
%7 = fadd float %3, %6
%8 = tail call float @producer(i32 %4, i32 %1)
%9 = fadd float %7, %8
%10 = tail call float @producer(i32 %0, i32 %5)
%11 = fadd float %9, %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, float %11)
ret float %11
}