#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*/ getdigits(int *, char *);
int /*<<< orphan*/ multiply(int *, int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  int a[100], b[100], c[2 * 100];
  char s1[100], s2[100];
  int j = 2 * 100 - 1;
  int i;
  printf("Input the first number:");
  scanf("%s", s1);
  printf("/nInput the second number:");
  scanf("%s", s2);
  getdigits(a, s1);
  getdigits(b, s2);
  multiply(a, b, c);
  while (c[j] == 0)
    j--;
  for (i = j; i >= 0; --i)
    printf("%d", c[i]);
  printf("/n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x740,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc7,-0x734(%rbp)
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x6c0(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1050 <scanf@plt>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x730(%rbp),%rsi
lea    0xe7f(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x1a0(%rbp),%rdi
lea    -0x6c0(%rbp),%rsi
call   1060 <getdigits@plt>
lea    -0x330(%rbp),%rdi
lea    -0x730(%rbp),%rsi
call   1060 <getdigits@plt>
lea    -0x1a0(%rbp),%rdi
lea    -0x330(%rbp),%rsi
lea    -0x650(%rbp),%rdx
call   1030 <multiply@plt>
movslq -0x734(%rbp),%rax
cmpl   $0x0,-0x650(%rbp,%rax,4)
jne    1207 <main+0xc7>
mov    -0x734(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x734(%rbp)
jmp    11de <main+0x9e>
mov    -0x734(%rbp),%eax
mov    %eax,-0x738(%rbp)
cmpl   $0x0,-0x738(%rbp)
jl     1250 <main+0x110>
movslq -0x738(%rbp),%rax
mov    -0x650(%rbp,%rax,4),%esi
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x738(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x738(%rbp)
jmp    1213 <main+0xd3>
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x740,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x728,%rsp
lea    0xeab(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb5(%rip),%rbx
lea    0x70(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
lea    0xea1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
lea    0x590(%rsp),%r12
mov    %r12,%rdi
mov    %r14,%rsi
call   1060 <getdigits@plt>
lea    0x400(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <getdigits@plt>
lea    0xe0(%rsp),%rdx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <multiply@plt>
mov    $0xc8,%eax
nopl   (%rax)
cmpl   $0x0,0xdc(%rsp,%rax,4)
lea    -0x1(%rax),%rax
je     11d0 <main+0x90>
test   $0x80000000,%eax
jne    1207 <main+0xc7>
mov    %eax,%ebx
lea    0xe48(%rip),%r14
xchg   %ax,%ax
mov    0xe0(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffffffffffff,%rbx
jb     11f0 <main+0xb0>
lea    0xe2b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x728,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Input the first number:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [27 x i8] c"/nInput the second number:\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [3 x i8] c"/n\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca [100 x i32]
%4 = alloca [200 x i32]
%5 = alloca [100 x i8]
%6 = alloca [100 x i8]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 199, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%17 = call i32 @getdigits(i32* %15, i8* %16)
%18 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%20 = call i32 @getdigits(i32* %18, i8* %19)
%21 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%22 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%23 = getelementptr inbounds [200 x i32], [200 x i32]* %4, i64 0, i64 0
%24 = call i32 @multiply(i32* %21, i32* %22, i32* %23)
br label %25
25: ; preds = %31, %0
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [200 x i32], [200 x i32]* %4, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %25
%32 = load i32, i32* %7
%33 = add nsw i32 %32, -1
store i32 %33, i32* %7
br label %25
34: ; preds = %25
%35 = load i32, i32* %7
store i32 %35, i32* %8
br label %36
36: ; preds = %45, %34
%37 = load i32, i32* %8
%38 = icmp sge i32 %37, 0
br i1 %38, label %39, label %48
39: ; preds = %36
%40 = load i32, i32* %8
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [200 x i32], [200 x i32]* %4, i64 0, i64 %41
%43 = load i32, i32* %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %39
%46 = load i32, i32* %8
%47 = add nsw i32 %46, -1
store i32 %47, i32* %8
br label %36
48: ; preds = %36
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Input the first number:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [27 x i8] c"/nInput the second number:\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [3 x i8] c"/n\00"
define i32 @main() {
%1 = alloca [100 x i32]
%2 = alloca [100 x i32]
%3 = alloca [200 x i32]
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
%6 = bitcast [100 x i32]* %1 to i8*
%7 = bitcast [100 x i32]* %2 to i8*
%8 = bitcast [200 x i32]* %3 to i8*
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%15 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%16 = call i32 @getdigits(i32* %15, i8* %9)
%17 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%18 = call i32 @getdigits(i32* %17, i8* %10)
%19 = getelementptr inbounds [200 x i32], [200 x i32]* %3, i64 0, i64 0
%20 = call i32 @multiply(i32* %15, i32* %17, i32* %19)
br label %21
21: ; preds = %21, %0
%22 = phi i64 [ %26, %21 ], [ 199, %0 ]
%23 = getelementptr inbounds [200 x i32], [200 x i32]* %3, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = icmp eq i32 %24, 0
%26 = add i64 %22, -1
br i1 %25, label %21, label %27
27: ; preds = %21
%28 = and i64 %22, 2147483648
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %39
30: ; preds = %27
%31 = and i64 %22, 4294967295
br label %32
32: ; preds = %30, %32
%33 = phi i64 [ %31, %30 ], [ %37, %32 ]
%34 = getelementptr inbounds [200 x i32], [200 x i32]* %3, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%37 = add nsw i64 %33, -1
%38 = icmp eq i64 %33, 0
br i1 %38, label %39, label %32
39: ; preds = %32, %27
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}