int main() {
  int w = 37, x = 22, y = 1, z = 10;
  printf("%s%d\n%s%d\n%s%d\n%s%d\n\n", "w = ", w, "x = ", x, "y = ", y,
         "z = ", z);
  printf("%s%d\n%s%d\n%s%d\n", "The product of w and x is ", product(2, w, x),
         "The product of w, x and y is ", product(3, w, x, y),
         "The product of w, x, y and z is ", product(4, w, x, y, z));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x25,-0x8(%rbp)
movl   $0x16,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r11d
mov    -0x14(%rbp),%eax
lea    0xea0(%rip),%rdi
lea    0xeaf(%rip),%rsi
lea    0xead(%rip),%rcx
lea    0xeab(%rip),%r9
lea    0xea9(%rip),%r10
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x2,%edi
mov    $0x0,%al
call   1040 <product@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x3,%edi
mov    $0x0,%al
call   1040 <product@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    $0x4,%edi
mov    $0x0,%al
call   1040 <product@plt>
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%r8d
lea    0xe46(%rip),%rdi
lea    0xe4f(%rip),%rsi
lea    0xe63(%rip),%rcx
lea    0xe7a(%rip),%r9
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x8,%rsp
lea    0xef6(%rip),%rbp
lea    0xeca(%rip),%rdi
lea    0xed9(%rip),%rsi
lea    0xed7(%rip),%rcx
lea    0xed5(%rip),%r9
mov    $0x25,%edx
mov    $0x16,%r8d
xor    %eax,%eax
push   $0xa
push   %rbp
push   $0x1
call   1030 <printf@plt>
add    $0x20,%rsp
mov    $0x2,%edi
mov    $0x25,%esi
mov    $0x16,%edx
xor    %eax,%eax
call   1040 <product@plt>
mov    %eax,%r14d
mov    $0x3,%edi
mov    $0x25,%esi
mov    $0x16,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1040 <product@plt>
mov    %eax,%ebp
mov    $0x4,%edi
mov    $0x25,%esi
mov    $0x16,%edx
mov    $0x1,%ecx
mov    $0xa,%r8d
xor    %eax,%eax
call   1040 <product@plt>
mov    %eax,%ebx
sub    $0x8,%rsp
lea    0xe60(%rip),%rdi
lea    0xe69(%rip),%rsi
lea    0xe7d(%rip),%rcx
lea    0xe94(%rip),%r9
mov    %r14d,%edx
mov    %ebp,%r8d
xor    %eax,%eax
push   %rbx
call   1030 <printf@plt>
add    $0x10,%rsp
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"%s%d\0A%s%d\0A%s%d\0A%s%d\0A\0A\00"
@.str.1 = [5 x i8] c"w = \00"
@.str.2 = [5 x i8] c"x = \00"
@.str.3 = [5 x i8] c"y = \00"
@.str.4 = [5 x i8] c"z = \00"
@.str.5 = [16 x i8] c"%s%d\0A%s%d\0A%s%d\0A\00"
@.str.6 = [27 x i8] c"The product of w and x is \00"
@.str.7 = [30 x i8] c"The product of w, x and y is \00"
@.str.8 = [33 x i8] c"The product of w, x, y and z is \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 37, i32* %2
store i32 22, i32* %3
store i32 1, i32* %4
store i32 10, i32* %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @product to i32 (i32, i32, i32, ...)*)(i32 2, i32 %11, i32 %12)
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @product to i32 (i32, i32, i32, i32, ...)*)(i32 3, i32 %14, i32 %15, i32 %16)
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = call i32 (i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @product to i32 (i32, i32, i32, i32, i32, ...)*)(i32 4, i32 %18, i32 %19, i32 %20, i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i32 %13, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %17, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i32 %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"%s%d\0A%s%d\0A%s%d\0A%s%d\0A\0A\00"
@.str.1 = [5 x i8] c"w = \00"
@.str.2 = [5 x i8] c"x = \00"
@.str.3 = [5 x i8] c"y = \00"
@.str.4 = [5 x i8] c"z = \00"
@.str.5 = [16 x i8] c"%s%d\0A%s%d\0A%s%d\0A\00"
@.str.6 = [27 x i8] c"The product of w and x is \00"
@.str.7 = [30 x i8] c"The product of w, x and y is \00"
@.str.8 = [33 x i8] c"The product of w, x, y and z is \00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 10)
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @product to i32 (i32, i32, i32, ...)*)(i32 2, i32 37, i32 22)
%3 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @product to i32 (i32, i32, i32, i32, ...)*)(i32 3, i32 37, i32 22, i32 1)
%4 = tail call i32 (i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @product to i32 (i32, i32, i32, i32, i32, ...)*)(i32 4, i32 37, i32 22, i32 1, i32 10)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i32 %4)
ret i32 0
}