#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 */
double div(int, int);
int multi(int, int);
int /*<<< orphan*/ printf(char *, int);
int sub(int, int);
int sum(int, int);
int main() {
  int add = sum(2, 3);
  int minus = sub(2, 3);
  double divide = div(2, 3);
  int mult = multi(2, 3);
  printf("The addition of 2 and 3 is : %i \n", add);
  printf("The subtraction of 2 and 3 is : %i \n", minus);
  printf("The division of 2 and 3 is : %f \n", divide);
  printf("The multiply of 2 and 3 is: %i \n", mult);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1050 <sum@plt>
mov    %eax,-0x8(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1070 <sub@plt>
mov    %eax,-0xc(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1060 <div@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <multi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
cvttsd2si -0x18(%rbp),%esi
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x3,%esi
call   1050 <sum@plt>
mov    %eax,%ebx
mov    $0x2,%edi
mov    $0x3,%esi
call   1070 <sub@plt>
mov    %eax,%ebp
mov    $0x2,%edi
mov    $0x3,%esi
call   1060 <div@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <multi@plt>
mov    %eax,%r14d
lea    0xe58(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xe6c(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
cvttsd2si 0x8(%rsp),%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
lea    0xe93(%rip),%rdi
mov    %r14d,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"The addition of 2 and 3 is : %i \0A\00"
@.str.1 = [37 x i8] c"The subtraction of 2 and 3 is : %i \0A\00"
@.str.2 = [34 x i8] c"The division of 2 and 3 is : %f \0A\00"
@.str.3 = [33 x i8] c"The multiply of 2 and 3 is: %i \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @sum(i32 2, i32 3)
store i32 %6, i32* %2
%7 = call i32 @sub(i32 2, i32 3)
store i32 %7, i32* %3
%8 = call double @div(i32 2, i32 3)
store double %8, double* %4
%9 = call i32 @multi(i32 2, i32 3)
store i32 %9, i32* %5
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load double, double* %4
%15 = fptosi double %14 to i32
%16 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %5
%18 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"The addition of 2 and 3 is : %i \0A\00"
@.str.1 = [37 x i8] c"The subtraction of 2 and 3 is : %i \0A\00"
@.str.2 = [34 x i8] c"The division of 2 and 3 is : %f \0A\00"
@.str.3 = [33 x i8] c"The multiply of 2 and 3 is: %i \0A\00"
define i32 @main() {
%1 = tail call i32 @sum(i32 2, i32 3)
%2 = tail call i32 @sub(i32 2, i32 3)
%3 = tail call double @div(i32 2, i32 3)
%4 = tail call i32 @multi(i32 2, i32 3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%7 = fptosi double %3 to i32
%8 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %4)
ret i32 0
}