#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 addition(int, int);
int /*<<< orphan*/ getchar();
int multiplication(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, sum, mult;
  printf("Add and multiply two numbers!\n");
  printf("Enter first number ");
  scanf("%d", &a);
  printf("Enter second number ");
  scanf("%d", &b);
  sum = addition(a, b);
  printf("\nSum of two numbers is %d", sum);
  mult = multiplication(a, b);
  printf("\nMultiplication of two numbers is %d", mult);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xee4(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <addition@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <multiplication@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xefc(%rip),%rdi
call   1040 <puts@plt>
lea    0xe88(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xeba(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
lea    0xe7a(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1030 <addition@plt>
lea    0xe67(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1050 <multiplication@plt>
lea    0xe64(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Add and multiply two numbers!\0A\00"
@.str.1 = [20 x i8] c"Enter first number \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [21 x i8] c"Enter second number \00"
@.str.4 = [26 x i8] c"\0ASum of two numbers is %d\00"
@.str.5 = [37 x i8] c"\0AMultiplication of two numbers is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 @addition(i32 %10, i32 %11)
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = call i32 @multiplication(i32 %15, i32 %16)
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 %18)
%20 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"Enter first number \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [21 x i8] c"Enter second number \00"
@.str.4 = [26 x i8] c"\0ASum of two numbers is %d\00"
@.str.5 = [37 x i8] c"\0AMultiplication of two numbers is %d\00"
@str = [30 x i8] c"Add and multiply two numbers!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 @addition(i32 %10, i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = call i32 @multiplication(i32 %14, i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 %16)
%18 = call i32 (...) @getchar()
ret i32 0
}