#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*/ free(unsigned char *);
scalar_t__ malloc(int);
int multiplication(unsigned char *, int, unsigned char *, int /*<<< orphan*/,
                   unsigned char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ realloc(unsigned char *, int);
int /*<<< orphan*/ scanf(char *, unsigned char *);
int strlen(unsigned char *);
main() {
  int i = 0, j = 0, k;
  int a_sign_fig, b_sign_fig, mul_len = 0, a_add_len = 0, b_add_len = 0;
  unsigned char *test;
  unsigned char *a_array, *b_array;
  unsigned char *ten;
  unsigned char *onedigit;
  unsigned char *multires;
  unsigned char *a_addres, *b_addres;
  printf("enter your operands:\n");
  a_array = (unsigned char *)malloc(100);
  b_array = (unsigned char *)malloc(100);
  ten = (unsigned char *)malloc(1);
  ten[0] = 255;
  onedigit = (unsigned char *)malloc(1);
  onedigit[0] = 0;
  a_addres = (unsigned char *)malloc(1);
  b_addres = (unsigned char *)malloc(1);
  scanf("%s", a_array);
  scanf("%s", b_array);
  a_sign_fig = strlen(a_array);
  b_sign_fig = strlen(b_array);
  realloc(a_array, a_sign_fig);
  realloc(b_array, b_sign_fig);
  a_addres[0] = 255;
  { mul_len = multiplication(a_addres, a_add_len, ten, 0, multires); }
  free(a_array);
  free(b_array);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xe57(%rip),%rdi
call   1060 <printf@plt>
mov    $0x64,%edi
call   1070 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    $0x64,%edi
call   1070 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    $0x1,%edi
call   1070 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movb   $0xff,(%rax)
mov    $0x1,%edi
call   1070 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
movb   $0x0,(%rax)
mov    $0x1,%edi
call   1070 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    $0x1,%edi
call   1070 <malloc@plt>
mov    %rax,-0x68(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xdfb(%rip),%rdi
call   1090 <scanf@plt>
mov    -0x40(%rbp),%rsi
lea    0xdeb(%rip),%rdi
call   1090 <scanf@plt>
mov    -0x38(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x40(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1080 <realloc@plt>
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1080 <realloc@plt>
mov    -0x60(%rbp),%rax
movb   $0xff,(%rax)
mov    -0x60(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x48(%rbp),%rdx
mov    -0x58(%rbp),%r8
xor    %ecx,%ecx
call   1050 <multiplication@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe81(%rip),%rdi
call   1040 <puts@plt>
mov    $0x64,%edi
call   1070 <malloc@plt>
mov    %rax,%r14
mov    $0x64,%edi
call   1070 <malloc@plt>
mov    %rax,%r15
mov    $0x1,%edi
call   1070 <malloc@plt>
mov    %rax,(%rsp)
movb   $0xff,(%rax)
mov    $0x1,%edi
call   1070 <malloc@plt>
movb   $0x0,(%rax)
mov    $0x1,%edi
call   1070 <malloc@plt>
mov    %rax,%r12
mov    $0x1,%edi
call   1070 <malloc@plt>
lea    0xe23(%rip),%r13
mov    %r13,%rdi
mov    %r14,%rsi
call   1090 <scanf@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1090 <scanf@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
call   1080 <realloc@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1080 <realloc@plt>
movb   $0xff,(%r12)
mov    %r12,%rdi
xor    %esi,%esi
mov    (%rsp),%rdx
xor    %ecx,%ecx
call   1060 <multiplication@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"enter your operands:\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
%18 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%19 = call i64 @malloc(i32 100)
%20 = inttoptr i64 %19 to i8*
store i8* %20, i8** %11
%21 = call i64 @malloc(i32 100)
%22 = inttoptr i64 %21 to i8*
store i8* %22, i8** %12
%23 = call i64 @malloc(i32 1)
%24 = inttoptr i64 %23 to i8*
store i8* %24, i8** %13
%25 = load i8*, i8** %13
%26 = getelementptr inbounds i8, i8* %25, i64 0
store i8 -1, i8* %26
%27 = call i64 @malloc(i32 1)
%28 = inttoptr i64 %27 to i8*
store i8* %28, i8** %14
%29 = load i8*, i8** %14
%30 = getelementptr inbounds i8, i8* %29, i64 0
store i8 0, i8* %30
%31 = call i64 @malloc(i32 1)
%32 = inttoptr i64 %31 to i8*
store i8* %32, i8** %16
%33 = call i64 @malloc(i32 1)
%34 = inttoptr i64 %33 to i8*
store i8* %34, i8** %17
%35 = load i8*, i8** %11
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %35)
%37 = load i8*, i8** %12
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %37)
%39 = load i8*, i8** %11
%40 = call i32 @strlen(i8* %39)
store i32 %40, i32* %5
%41 = load i8*, i8** %12
%42 = call i32 @strlen(i8* %41)
store i32 %42, i32* %6
%43 = load i8*, i8** %11
%44 = load i32, i32* %5
%45 = call i32 @realloc(i8* %43, i32 %44)
%46 = load i8*, i8** %12
%47 = load i32, i32* %6
%48 = call i32 @realloc(i8* %46, i32 %47)
%49 = load i8*, i8** %16
%50 = getelementptr inbounds i8, i8* %49, i64 0
store i8 -1, i8* %50
%51 = load i8*, i8** %16
%52 = load i32, i32* %8
%53 = load i8*, i8** %13
%54 = load i8*, i8** %15
%55 = call i32 @multiplication(i8* %51, i32 %52, i8* %53, i32 0, i8* %54)
store i32 %55, i32* %7
%56 = load i8*, i8** %11
%57 = call i32 @free(i8* %56)
%58 = load i8*, i8** %12
%59 = call i32 @free(i8* %58)
ret i32 1
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [21 x i8] c"enter your operands:\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 @malloc(i32 100)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i64 @malloc(i32 100)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i64 @malloc(i32 1)
%7 = inttoptr i64 %6 to i8*
store i8 -1, i8* %7
%8 = tail call i64 @malloc(i32 1)
%9 = inttoptr i64 %8 to i8*
store i8 0, i8* %9
%10 = tail call i64 @malloc(i32 1)
%11 = inttoptr i64 %10 to i8*
%12 = tail call i64 @malloc(i32 1)
%13 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%14 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%15 = tail call i32 @strlen(i8* %3)
%16 = tail call i32 @strlen(i8* %5)
%17 = tail call i32 @realloc(i8* %3, i32 %15)
%18 = tail call i32 @realloc(i8* %5, i32 %16)
store i8 -1, i8* %11
%19 = tail call i32 @multiplication(i8* %11, i32 0, i8* %7, i32 0, i8* undef)
%20 = tail call i32 @free(i8* %3)
%21 = tail call i32 @free(i8* %5)
ret i32 1
}