#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 */
struct printable_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setnumber(struct printable_data *, char *, int);
void compute_stuff_nothing(struct printable_data *p, float *x, int w, int h,
                           int pd) {
  setnumber(p, "width", w);
  setnumber(p, "height", h);
  setnumber(p, "depth", 1);
  setnumber(p, "pixeldim", pd);
  setnumber(p, "nsamples", w * h * pd);
  setnumber(p, "npixels", w * h);
  setnumber(p, "dimension", 2);
}


x86 assembly (clang, -O0):
<compute_stuff_nothing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xec8(%rip),%rsi
call   1030 <setnumber@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xebb(%rip),%rsi
call   1030 <setnumber@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
mov    $0x1,%edx
call   1030 <setnumber@plt>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xea0(%rip),%rsi
call   1030 <setnumber@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
imul   -0x18(%rbp),%edx
imul   -0x1c(%rbp),%edx
lea    0xe8e(%rip),%rsi
call   1030 <setnumber@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
imul   -0x18(%rbp),%edx
lea    0xe80(%rip),%rsi
call   1030 <setnumber@plt>
mov    -0x8(%rbp),%rdi
lea    0xe78(%rip),%rsi
mov    $0x2,%edx
call   1030 <setnumber@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_stuff_nothing>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%r14d
mov    %ecx,%ebp
mov    %edx,%r15d
mov    %rdi,%rbx
lea    0xed7(%rip),%rsi
call   1030 <setnumber@plt>
lea    0xed1(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1030 <setnumber@plt>
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <setnumber@plt>
lea    0xeb9(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
call   1030 <setnumber@plt>
imul   %r15d,%ebp
imul   %ebp,%r14d
lea    0xea8(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
call   1030 <setnumber@plt>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1030 <setnumber@plt>
lea    0xe96(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <setnumber@plt>

LLVM IR (-O0):
%struct.printable_data = type { i32 }
@.str = [6 x i8] c"width\00"
@.str.1 = [7 x i8] c"height\00"
@.str.2 = [6 x i8] c"depth\00"
@.str.3 = [9 x i8] c"pixeldim\00"
@.str.4 = [9 x i8] c"nsamples\00"
@.str.5 = [8 x i8] c"npixels\00"
@.str.6 = [10 x i8] c"dimension\00"
define void @compute_stuff_nothing(%struct.printable_data* %0, float* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.printable_data*
%7 = alloca float*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.printable_data* %0, %struct.printable_data** %6
store float* %1, float** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.printable_data*, %struct.printable_data** %6
%12 = load i32, i32* %8
%13 = call i32 @setnumber(%struct.printable_data* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load %struct.printable_data*, %struct.printable_data** %6
%15 = load i32, i32* %9
%16 = call i32 @setnumber(%struct.printable_data* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = load %struct.printable_data*, %struct.printable_data** %6
%18 = call i32 @setnumber(%struct.printable_data* %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 1)
%19 = load %struct.printable_data*, %struct.printable_data** %6
%20 = load i32, i32* %10
%21 = call i32 @setnumber(%struct.printable_data* %19, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = load %struct.printable_data*, %struct.printable_data** %6
%23 = load i32, i32* %8
%24 = load i32, i32* %9
%25 = mul nsw i32 %23, %24
%26 = load i32, i32* %10
%27 = mul nsw i32 %25, %26
%28 = call i32 @setnumber(%struct.printable_data* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %27)
%29 = load %struct.printable_data*, %struct.printable_data** %6
%30 = load i32, i32* %8
%31 = load i32, i32* %9
%32 = mul nsw i32 %30, %31
%33 = call i32 @setnumber(%struct.printable_data* %29, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 %32)
%34 = load %struct.printable_data*, %struct.printable_data** %6
%35 = call i32 @setnumber(%struct.printable_data* %34, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
%struct.printable_data = type { i32 }
@.str = [6 x i8] c"width\00"
@.str.1 = [7 x i8] c"height\00"
@.str.2 = [6 x i8] c"depth\00"
@.str.3 = [9 x i8] c"pixeldim\00"
@.str.4 = [9 x i8] c"nsamples\00"
@.str.5 = [8 x i8] c"npixels\00"
@.str.6 = [10 x i8] c"dimension\00"
define void @compute_stuff_nothing(%struct.printable_data* %0, float* nocapture readnone %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @setnumber(%struct.printable_data* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
%7 = tail call i32 @setnumber(%struct.printable_data* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%8 = tail call i32 @setnumber(%struct.printable_data* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 1)
%9 = tail call i32 @setnumber(%struct.printable_data* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %4)
%10 = mul nsw i32 %3, %2
%11 = mul nsw i32 %10, %4
%12 = tail call i32 @setnumber(%struct.printable_data* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %11)
%13 = tail call i32 @setnumber(%struct.printable_data* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 %10)
%14 = tail call i32 @setnumber(%struct.printable_data* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 2)
ret void
}