#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int const);
int /*<<< orphan*/ square_and_cube(int *, int *, int const);
int main(void) {
  const int number = -2;
  int square = 0;
  int cube = 0;
  square_and_cube(&square, &cube, number);
  printf("number = %2d\n", number);
  printf("square = %2d\n", square);
  printf("cube   = %2d\n", cube);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffffe,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0xfffffffe,%edx
call   1030 <square_and_cube@plt>
lea    0xe93(%rip),%rdi
mov    $0xfffffffe,%esi
call   1040 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e44(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0xfffffffe,%edx
call   1030 <square_and_cube@plt>
lea    0xea7(%rip),%rdi
mov    $0xfffffffe,%esi
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    (%rsp),%esi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"number = %2d\0A\00"
@.str.1 = [14 x i8] c"square = %2d\0A\00"
@.str.2 = [14 x i8] c"cube = %2d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 -2, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = call i32 @square_and_cube(i32* %3, i32* %4, i32 -2)
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 -2)
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"number = %2d\0A\00"
@.str.1 = [14 x i8] c"square = %2d\0A\00"
@.str.2 = [14 x i8] c"cube = %2d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @square_and_cube(i32* %1, i32* %2, i32 -2)
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 -2)
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
%12 = call i32 @exit(i32 %11)
unreachable
}