#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 */
char *int_to_string(int);
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ readStr();
int str_to_int(int /*<<< orphan*/);
void multiply() {
  print("\nNum 1 :");
  int num1 = str_to_int(readStr());
  print("\nNum 2 :");
  int num2 = str_to_int(readStr());
  print("\nResult : ");
  print(int_to_string(num1 * num2));
  print("\n");
}


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <print@plt>
mov    $0x0,%al
call   1050 <readStr@plt>
mov    %eax,%edi
call   1030 <str_to_int@plt>
mov    %eax,-0x4(%rbp)
lea    0xe9d(%rip),%rdi
call   1040 <print@plt>
mov    $0x0,%al
call   1050 <readStr@plt>
mov    %eax,%edi
call   1030 <str_to_int@plt>
mov    %eax,-0x8(%rbp)
lea    0xe89(%rip),%rdi
call   1040 <print@plt>
mov    -0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
call   1060 <int_to_string@plt>
mov    %rax,%rdi
call   1040 <print@plt>
lea    0xe74(%rip),%rdi
call   1040 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
push   %rbp
push   %rbx
push   %rax
lea    0xeb6(%rip),%rdi
call   1040 <print@plt>
xor    %eax,%eax
call   1050 <readStr@plt>
mov    %eax,%edi
call   1030 <str_to_int@plt>
mov    %eax,%ebx
lea    0xea3(%rip),%rdi
call   1040 <print@plt>
xor    %eax,%eax
call   1050 <readStr@plt>
mov    %eax,%edi
call   1030 <str_to_int@plt>
mov    %eax,%ebp
lea    0xe90(%rip),%rdi
call   1040 <print@plt>
imul   %ebx,%ebp
mov    %ebp,%edi
call   1060 <int_to_string@plt>
mov    %rax,%rdi
call   1040 <print@plt>
lea    0xe7d(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <print@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\0ANum 1 :\00"
@.str.1 = [9 x i8] c"\0ANum 2 :\00"
@.str.2 = [11 x i8] c"\0AResult : \00"
@.str.3 = [2 x i8] c"\0A\00"
define void @multiply() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @readStr()
%5 = call i32 @str_to_int(i32 %4)
store i32 %5, i32* %1
%6 = call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @readStr()
%8 = call i32 @str_to_int(i32 %7)
store i32 %8, i32* %2
%9 = call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = mul nsw i32 %10, %11
%13 = call i8* @int_to_string(i32 %12)
%14 = call i32 @print(i8* %13)
%15 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\0ANum 1 :\00"
@.str.1 = [9 x i8] c"\0ANum 2 :\00"
@.str.2 = [11 x i8] c"\0AResult : \00"
@.str.3 = [2 x i8] c"\0A\00"
define void @multiply() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @readStr()
%3 = tail call i32 @str_to_int(i32 %2)
%4 = tail call i32 @print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (...) @readStr()
%6 = tail call i32 @str_to_int(i32 %5)
%7 = tail call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%8 = mul nsw i32 %6, %3
%9 = tail call i8* @int_to_string(i32 %8)
%10 = tail call i32 @print(i8* %9)
%11 = tail call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}