#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 expt(int, int);
int mult(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("2 * 2 = %i", mult(2, 2));
  printf("3 * 9 = %i", mult(3, 9));
  printf("-3 * 9 = %i", mult(-3, 9));
  printf("3 * -9 = %i", mult(3, -9));
  printf("-3 * -9 = %i", mult(-3, -9));
  printf("2^8 = %i", expt(2, 8));
  printf("2^3 = %i", expt(2, 3));
  printf("(-2)^3 = %i", expt(-2, 3));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%esi
mov    %esi,%edi
call   1050 <mult@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
mov    $0x9,%esi
call   1050 <mult@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    $0xfffffffd,%edi
mov    $0x9,%esi
call   1050 <mult@plt>
mov    %eax,%esi
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
mov    $0xfffffff7,%esi
call   1050 <mult@plt>
mov    %eax,%esi
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
mov    $0xfffffffd,%edi
mov    $0xfffffff7,%esi
call   1050 <mult@plt>
mov    %eax,%esi
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
mov    $0x8,%esi
call   1040 <expt@plt>
mov    %eax,%esi
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <expt@plt>
mov    %eax,%esi
lea    0xe36(%rip),%rdi
call   1030 <printf@plt>
mov    $0xfffffffe,%edi
mov    $0x3,%esi
call   1040 <expt@plt>
mov    %eax,%esi
lea    0xe22(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x2,%esi
call   1050 <mult@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x3,%edi
mov    $0x9,%esi
call   1050 <mult@plt>
lea    0xea8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xfffffffd,%edi
mov    $0x9,%esi
call   1050 <mult@plt>
lea    0xe8a(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x3,%edi
mov    $0xfffffff7,%esi
call   1050 <mult@plt>
lea    0xe7a(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xfffffffd,%edi
mov    $0xfffffff7,%esi
call   1050 <mult@plt>
lea    0xe5c(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2,%edi
mov    $0x8,%esi
call   1040 <expt@plt>
lea    0xe4c(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <expt@plt>
lea    0xe38(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xfffffffe,%edi
mov    $0x3,%esi
call   1040 <expt@plt>
lea    0xe24(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"2 * 2 = %i\00"
@.str.1 = [11 x i8] c"3 * 9 = %i\00"
@.str.2 = [12 x i8] c"-3 * 9 = %i\00"
@.str.3 = [12 x i8] c"3 * -9 = %i\00"
@.str.4 = [13 x i8] c"-3 * -9 = %i\00"
@.str.5 = [9 x i8] c"2^8 = %i\00"
@.str.6 = [9 x i8] c"2^3 = %i\00"
@.str.7 = [12 x i8] c"(-2)^3 = %i\00"
define i32 @main() {
%1 = call i32 @mult(i32 2, i32 2)
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @mult(i32 3, i32 9)
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @mult(i32 -3, i32 9)
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 @mult(i32 3, i32 -9)
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = call i32 @mult(i32 -3, i32 -9)
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = call i32 @expt(i32 2, i32 8)
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = call i32 @expt(i32 2, i32 3)
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %13)
%15 = call i32 @expt(i32 -2, i32 3)
%16 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"2 * 2 = %i\00"
@.str.1 = [11 x i8] c"3 * 9 = %i\00"
@.str.2 = [12 x i8] c"-3 * 9 = %i\00"
@.str.3 = [12 x i8] c"3 * -9 = %i\00"
@.str.4 = [13 x i8] c"-3 * -9 = %i\00"
@.str.5 = [9 x i8] c"2^8 = %i\00"
@.str.6 = [9 x i8] c"2^3 = %i\00"
@.str.7 = [12 x i8] c"(-2)^3 = %i\00"
define i32 @main() {
%1 = tail call i32 @mult(i32 2, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @mult(i32 3, i32 9)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @mult(i32 -3, i32 9)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 @mult(i32 3, i32 -9)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = tail call i32 @mult(i32 -3, i32 -9)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = tail call i32 @expt(i32 2, i32 8)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = tail call i32 @expt(i32 2, i32 3)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %13)
%15 = tail call i32 @expt(i32 -2, i32 3)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %15)
ret i32 0
}