#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, int *, int *);
int main(int argc, char *argv[]) {
  int m, n;
  if (scanf("%d %d", &m, &n) != 2)
    return EXIT_FAILURE;
  int product = m * n;
  int is_start_num = 0;
  if (product == 0) {
    printf("0");
  } else {
    while (product > 0) {
      int reminder = product % 10;
      if (reminder > 0) {
        is_start_num = 1;
      }
      if (is_start_num == 1) {
        printf("%d", reminder);
      }
      product /= 10;
    }
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1164 <main+0x44>
mov    0x2e86(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11ff <main+0xdf>
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1192 <main+0x72>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f3 <main+0xd3>
jmp    1197 <main+0x77>
cmpl   $0x0,-0x1c(%rbp)
jle    11ee <main+0xce>
mov    -0x1c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    11c0 <main+0xa0>
movl   $0x1,-0x20(%rbp)
cmpl   $0x1,-0x20(%rbp)
jne    11db <main+0xbb>
mov    -0x24(%rbp),%esi
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
jmp    1197 <main+0x77>
jmp    11f3 <main+0xd3>
mov    0x2dde(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
jne    11b3 <main+0x83>
mov    (%rsp),%ebp
imul   0x4(%rsp),%ebp
test   %ebp,%ebp
je     11bc <main+0x8c>
mov    0x2e71(%rip),%rax
jle    11cd <main+0x9d>
mov    $0xcccccccd,%r12d
mov    $0x1,%r13d
lea    0xe87(%rip),%r15
xor    %ebx,%ebx
jmp    1188 <main+0x58>
cmp    $0x9,%ebp
mov    %r14d,%ebp
jbe    11c6 <main+0x96>
mov    %ebp,%r14d
imul   %r12,%r14
shr    $0x23,%r14
lea    (%r14,%r14,1),%eax
lea    (%rax,%rax,4),%eax
mov    %ebp,%esi
sub    %eax,%esi
cmovne %r13d,%ebx
cmp    $0x1,%ebx
jne    1180 <main+0x50>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1180 <main+0x50>
mov    0x2e26(%rip),%rax
jmp    11cd <main+0x9d>
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    0x2e0b(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7)
%12 = icmp ne i32 %11, 2
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32, i32* @EXIT_FAILURE
store i32 %14, i32* %3
br label %45
15: ; preds = %2
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = mul nsw i32 %16, %17
store i32 %18, i32* %8
store i32 0, i32* %9
%19 = load i32, i32* %8
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %15
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %43
23: ; preds = %15
br label %24
24: ; preds = %39, %23
%25 = load i32, i32* %8
%26 = icmp sgt i32 %25, 0
br i1 %26, label %27, label %42
27: ; preds = %24
%28 = load i32, i32* %8
%29 = srem i32 %28, 10
store i32 %29, i32* %10
%30 = load i32, i32* %10
%31 = icmp sgt i32 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %27
store i32 1, i32* %9
br label %33
33: ; preds = %32, %27
%34 = load i32, i32* %9
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %39
36: ; preds = %33
%37 = load i32, i32* %10
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %37)
br label %39
39: ; preds = %36, %33
%40 = load i32, i32* %8
%41 = sdiv i32 %40, 10
store i32 %41, i32* %8
br label %24
42: ; preds = %24
br label %43
43: ; preds = %42, %21
%44 = load i32, i32* @EXIT_SUCCESS
store i32 %44, i32* %3
br label %45
45: ; preds = %43, %13
%46 = load i32, i32* %3
ret i32 %46
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %30
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = mul nsw i32 %11, %10
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %9
%15 = icmp sgt i32 %12, 0
br i1 %15, label %18, label %30
16: ; preds = %9
%17 = call i32 @putchar(i32 48)
br label %30
18: ; preds = %14, %28
%19 = phi i32 [ %24, %28 ], [ 0, %14 ]
%20 = phi i32 [ %22, %28 ], [ %12, %14 ]
%21 = urem i32 %20, 10
%22 = udiv i32 %20, 10
%23 = icmp eq i32 %21, 0
%24 = select i1 %23, i32 %19, i32 1
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %28
26: ; preds = %18
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %21)
br label %28
28: ; preds = %26, %18
%29 = icmp ult i32 %20, 10
br i1 %29, label %30, label %18
30: ; preds = %28, %14, %16, %2
%31 = phi i32* [ @EXIT_FAILURE, %2 ], [ @EXIT_SUCCESS, %16 ], [ @EXIT_SUCCESS, %14 ], [ @EXIT_SUCCESS, %28 ]
%32 = load i32, i32* %31
ret i32 %32
}