#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*/ printf(char *, ...);
int rusa(int, int);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int main() {
  int a, b, resp;
  printf("* * * * * * * * * * * * * * * * * * *\n");
  printf("*        Multiplicacion Rusa        *\n");
  printf("* * * * * * * * * * * * * * * * * * *\n");
  printf("Ingrese un numero: ");
  scanf("%d", &a);
  printf("Ingrese otro numero: ");
  scanf("%d", &b);
  system("clear");
  resp = rusa(a, b);
  printf("* * * * * * * * * * * * * * * * * * *\n");
  printf("*        El resultado es: %8d  *\n", resp);
  printf("* * * * * * * * * * * * * * * * * * *\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xebf(%rip),%rdi
call   1040 <system@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <rusa@plt>
mov    %eax,-0x10(%rbp)
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xf20(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xe82(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe88(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xe77(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xe74(%rip),%rdi
call   1050 <system@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1040 <rusa@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xe58(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [39 x i8] c"* * * * * * * * * * * * * * * * * * *\0A\00"
@.str.1 = [39 x i8] c"* Multiplicacion Rusa *\0A\00"
@.str.2 = [20 x i8] c"Ingrese un numero: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [22 x i8] c"Ingrese otro numero: \00"
@.str.5 = [6 x i8] c"clear\00"
@.str.6 = [34 x i8] c"* El resultado es: %8d *\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%12 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @rusa(i32 %13, i32 %14)
store i32 %15, i32* %4
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* %4
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [20 x i8] c"Ingrese un numero: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [22 x i8] c"Ingrese otro numero: \00"
@.str.5 = [6 x i8] c"clear\00"
@.str.6 = [34 x i8] c"* El resultado es: %8d *\0A\00"
@str.7 = [38 x i8] c"* Multiplicacion Rusa *\00"
@str.10 = [38 x i8] c"* * * * * * * * * * * * * * * * * * *\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 ([38 x i8], [38 x i8]* @str.10, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.7, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.10, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%12 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = call i32 @rusa(i32 %13, i32 %14)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.10, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %15)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.10, i64 0, i64 0))
ret i32 0
}