#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 /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int x, y;
  printf("Enter Two 2-Digit Number: ");
  scanf("%d %d", &x, &y);
  printf("%23d\n", x);
  printf("%11c%12d\n", 'X', y);
  printf("%10c-------------\n", ' ');
  printf("%d x %d is%14d\n", (y % 10), x, (x * (y % 10)));
  printf("%d x %d is%14d\n", (y - y % 10) / 10, x, (x * (y - y % 10) / 10));
  printf("%10c-------------\n", ' ');
  printf("Add Them:%14d\n", x * y);
  printf("%10c-------------\n", ' ');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%edx
lea    0xebb(%rip),%rdi
mov    $0x58,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
mov    $0xa,%edi
cltd
idiv   %edi
mov    %edx,%eax
mov    -0x1c(%rbp),%edx
imul   %eax,%ecx
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%eax
sub    %edx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0xc(%rbp),%eax
mov    $0xa,%edi
cltd
idiv   %edi
mov    -0x14(%rbp),%eax
sub    %edx,%ecx
imul   %ecx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe0b(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
imul   -0xc(%rbp),%esi
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xde3(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%edx
lea    0xec5(%rip),%rdi
mov    $0x58,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebc(%rip),%r14
mov    %r14,%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movslq (%rsp),%rsi
imul   $0x66666667,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%esi
mov    0x4(%rsp),%edx
mov    %edx,%ecx
imul   %esi,%ecx
lea    0xe91(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movslq (%rsp),%rax
imul   $0x66666667,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x22,%rsi
add    %eax,%esi
mov    0x4(%rsp),%edx
mov    %esi,%eax
imul   %edx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x22,%rcx
add    %eax,%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%esi
imul   0x4(%rsp),%esi
lea    0xe33(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Enter Two 2-Digit Number: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [6 x i8] c"%23d\0A\00"
@.str.3 = [10 x i8] c"%11c%12d\0A\00"
@.str.4 = [19 x i8] c"%10c-------------\0A\00"
@.str.5 = [16 x i8] c"%d x %d is%14d\0A\00"
@.str.6 = [15 x i8] c"Add Them:%14d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 88, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 32)
%11 = load i32, i32* %3
%12 = srem i32 %11, 10
%13 = load i32, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = srem i32 %15, 10
%17 = mul nsw i32 %14, %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %12, i32 %13, i32 %17)
%19 = load i32, i32* %3
%20 = load i32, i32* %3
%21 = srem i32 %20, 10
%22 = sub nsw i32 %19, %21
%23 = sdiv i32 %22, 10
%24 = load i32, i32* %2
%25 = load i32, i32* %2
%26 = load i32, i32* %3
%27 = load i32, i32* %3
%28 = srem i32 %27, 10
%29 = sub nsw i32 %26, %28
%30 = mul nsw i32 %25, %29
%31 = sdiv i32 %30, 10
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %23, i32 %24, i32 %31)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 32)
%34 = load i32, i32* %2
%35 = load i32, i32* %3
%36 = mul nsw i32 %34, %35
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 32)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Enter Two 2-Digit Number: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [6 x i8] c"%23d\0A\00"
@.str.3 = [10 x i8] c"%11c%12d\0A\00"
@.str.4 = [19 x i8] c"%10c-------------\0A\00"
@.str.5 = [16 x i8] c"%d x %d is%14d\0A\00"
@.str.6 = [15 x i8] c"Add Them:%14d\0A\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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 88, i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 32)
%12 = load i32, i32* %2
%13 = srem i32 %12, 10
%14 = load i32, i32* %1
%15 = mul nsw i32 %14, %13
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %13, i32 %14, i32 %15)
%17 = load i32, i32* %2
%18 = srem i32 %17, 10
%19 = sub nsw i32 %17, %18
%20 = sdiv i32 %17, 10
%21 = load i32, i32* %1
%22 = mul nsw i32 %19, %21
%23 = sdiv i32 %22, 10
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %20, i32 %21, i32 %23)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 32)
%26 = load i32, i32* %1
%27 = load i32, i32* %2
%28 = mul nsw i32 %27, %26
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %28)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 32)
ret i32 0
}