#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*/ display(unsigned int *, int);
int /*<<< orphan*/ multiply(unsigned int *, unsigned int *, unsigned int *);
int /*<<< orphan*/ printf(char *);
int main() {
  unsigned int a[10] = {0, 0, 0, 0, 0, 0, 0, 0, 2, 1};
  unsigned int b[5] = {1, 0, 0, 0, 0};
  unsigned int c[15] = {0};
  int i;
  printf("\n Multiplying ");
  display(a, 10);
  printf("\n and ");
  display(b, 5);
  multiply(a, b, c);
  display(c, 15);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
movl   $0x2,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
mov    0xe90(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe8d(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe8b(%rip),%eax
mov    %eax,-0x40(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x3c,%edx
call   1060 <memset@plt>
lea    0xe72(%rip),%rdi
call   1050 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <display@plt>
lea    0xe67(%rip),%rdi
call   1050 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    $0x5,%esi
call   1040 <display@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x90(%rbp),%rdx
call   1030 <multiply@plt>
lea    -0x90(%rbp),%rdi
mov    $0xf,%esi
call   1040 <display@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x90,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movabs $0x100000002,%rax
mov    %rax,0x40(%rsp)
mov    0xeb2(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xe97(%rip),%xmm1
movaps %xmm1,(%rsp)
movups %xmm0,0x7c(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
lea    0xe8c(%rip),%rdi
call   1050 <printf@plt>
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0xa,%esi
call   1040 <display@plt>
lea    0xe7d(%rip),%rdi
call   1050 <printf@plt>
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x5,%esi
call   1040 <display@plt>
lea    0x50(%rsp),%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <multiply@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
call   1040 <display@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.b = [5 x i32] [i32 1, i32 0, i32 0, i32 0, i32 0]
@.str = [15 x i8] c"\0A Multiplying \00"
@.str.1 = [7 x i8] c"\0A and \00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [5 x i32]
%3 = alloca [15 x i32]
%4 = alloca i32
%5 = bitcast [10 x i32]* %1 to i8*
%6 = bitcast i8* %5 to [10 x i32]*
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i32 0, i32 8
store i32 2, i32* %7
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i32 0, i32 9
store i32 1, i32* %8
%9 = bitcast [5 x i32]* %2 to i8*
%10 = bitcast [15 x i32]* %3 to i8*
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%13 = call i32 @display(i32* %12, i32 10)
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%15 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%16 = call i32 @display(i32* %15, i32 5)
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%19 = getelementptr inbounds [15 x i32], [15 x i32]* %3, i64 0, i64 0
%20 = call i32 @multiply(i32* %17, i32* %18, i32* %19)
%21 = getelementptr inbounds [15 x i32], [15 x i32]* %3, i64 0, i64 0
%22 = call i32 @display(i32* %21, i32 15)
ret i32 0
}

LLVM IR (-O2):
@__const.main.b = [5 x i32] [i32 1, i32 0, i32 0, i32 0, i32 0]
@.str = [15 x i8] c"\0A Multiplying \00"
@.str.1 = [7 x i8] c"\0A and \00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [5 x i32]
%3 = alloca [15 x i32]
%4 = bitcast [10 x i32]* %1 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
store i32 2, i32* %5
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
store i32 1, i32* %6
%7 = bitcast [5 x i32]* %2 to i8*
%8 = bitcast [15 x i32]* %3 to i8*
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%11 = call i32 @display(i32* %10, i32 10)
%12 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%14 = call i32 @display(i32* %13, i32 5)
%15 = getelementptr inbounds [15 x i32], [15 x i32]* %3, i64 0, i64 0
%16 = call i32 @multiply(i32* %10, i32* %13, i32* %15)
%17 = call i32 @display(i32* %15, i32 15)
ret i32 0
}