#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 mul(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  printf("10 * 57 = %i\n", mul(10, 57));
  printf("57 * 10 = %i\n", mul(57, 10));
  printf("100 * 100 = %i\n", mul(100, 100));
  printf("3 * 4 = %i\n", mul(3, 4));
  printf("-4 * 3 = %i\n", mul(-4, 3));
  printf("-4 * -3 = %i\n", mul(-4, -3));
  printf("0 * 0 = %i\n", mul(0, 0));
  printf("42 * 42 = %i\n", mul(42, 42));
  int a, b;
  printf("Your turn, enter two [not-so-big] integers: \n");
  scanf("%i %i", &a, &b);
  printf("%i * %i = %i\n", a, b, mul(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
mov    $0x39,%esi
call   1050 <mul@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x39,%edi
mov    $0xa,%esi
call   1050 <mul@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x64,%esi
mov    %esi,%edi
call   1050 <mul@plt>
mov    %eax,%esi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1050 <mul@plt>
mov    %eax,%esi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfffffffc,%edi
mov    $0x3,%esi
call   1050 <mul@plt>
mov    %eax,%esi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfffffffc,%edi
mov    $0xfffffffd,%esi
call   1050 <mul@plt>
mov    %eax,%esi
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1050 <mul@plt>
mov    %eax,%esi
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x2a,%esi
mov    %esi,%edi
call   1050 <mul@plt>
mov    %eax,%esi
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe5b(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <mul@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0xa,%edi
mov    $0x39,%esi
call   1060 <mul@plt>
lea    0xea7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x39,%edi
mov    $0xa,%esi
call   1060 <mul@plt>
lea    0xe96(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x64,%edi
mov    $0x64,%esi
call   1060 <mul@plt>
lea    0xe85(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x3,%edi
mov    $0x4,%esi
call   1060 <mul@plt>
lea    0xe76(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xfffffffc,%edi
mov    $0x3,%esi
call   1060 <mul@plt>
lea    0xe63(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xfffffffc,%edi
mov    $0xfffffffd,%esi
call   1060 <mul@plt>
lea    0xe51(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1060 <mul@plt>
lea    0xe46(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2a,%edi
mov    $0x2a,%esi
call   1060 <mul@plt>
lea    0xe33(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe45(%rip),%rdi
call   1030 <puts@plt>
lea    0xe25(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    (%rsp),%ebp
mov    %ebx,%edi
mov    %ebp,%esi
call   1060 <mul@plt>
lea    0xe07(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"10 * 57 = %i\0A\00"
@.str.1 = [14 x i8] c"57 * 10 = %i\0A\00"
@.str.2 = [16 x i8] c"100 * 100 = %i\0A\00"
@.str.3 = [12 x i8] c"3 * 4 = %i\0A\00"
@.str.4 = [13 x i8] c"-4 * 3 = %i\0A\00"
@.str.5 = [14 x i8] c"-4 * -3 = %i\0A\00"
@.str.6 = [12 x i8] c"0 * 0 = %i\0A\00"
@.str.7 = [14 x i8] c"42 * 42 = %i\0A\00"
@.str.8 = [46 x i8] c"Your turn, enter two [not-so-big] integers: \0A\00"
@.str.9 = [6 x i8] c"%i %i\00"
@.str.10 = [14 x i8] c"%i * %i = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @mul(i32 10, i32 57)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @mul(i32 57, i32 10)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 @mul(i32 100, i32 100)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = call i32 @mul(i32 3, i32 4)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = call i32 @mul(i32 -4, i32 3)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%14 = call i32 @mul(i32 -4, i32 -3)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %14)
%16 = call i32 @mul(i32 0, i32 0)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %16)
%18 = call i32 @mul(i32 42, i32 42)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0))
%21 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32* %2, i32* %3)
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = call i32 @mul(i32 %24, i32 %25)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i32 %22, i32 %23, i32 %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"10 * 57 = %i\0A\00"
@.str.1 = [14 x i8] c"57 * 10 = %i\0A\00"
@.str.2 = [16 x i8] c"100 * 100 = %i\0A\00"
@.str.3 = [12 x i8] c"3 * 4 = %i\0A\00"
@.str.4 = [13 x i8] c"-4 * 3 = %i\0A\00"
@.str.5 = [14 x i8] c"-4 * -3 = %i\0A\00"
@.str.6 = [12 x i8] c"0 * 0 = %i\0A\00"
@.str.7 = [14 x i8] c"42 * 42 = %i\0A\00"
@.str.9 = [6 x i8] c"%i %i\00"
@.str.10 = [14 x i8] c"%i * %i = %i\0A\00"
@str = [45 x i8] c"Your turn, enter two [not-so-big] integers: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32 @mul(i32 10, i32 57)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @mul(i32 57, i32 10)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @mul(i32 100, i32 100)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = tail call i32 @mul(i32 3, i32 4)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%11 = tail call i32 @mul(i32 -4, i32 3)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %11)
%13 = tail call i32 @mul(i32 -4, i32 -3)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %13)
%15 = tail call i32 @mul(i32 0, i32 0)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %15)
%17 = tail call i32 @mul(i32 42, i32 42)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %17)
%19 = bitcast i32* %1 to i8*
%20 = bitcast i32* %2 to i8*
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32* %1, i32* %2)
%23 = load i32, i32* %1
%24 = load i32, i32* %2
%25 = call i32 @mul(i32 %23, i32 %24)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i32 %23, i32 %24, i32 %25)
ret i32 0
}