#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*/ ex_product1(int *, int);
int /*<<< orphan*/ ex_product2(int *, int);
int /*<<< orphan*/ ex_product3(int *, int);
int /*<<< orphan*/ ex_product_lessOpt(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int list[100];
  int i, len;
  printf("Enter the size of the list : ");
  scanf("%d", &len);
  for (i = 0; i < len; i++)
    scanf("%d", (list + i));
  ex_product1(list, len);
  ex_product2(list, len);
  ex_product3(list, len);
  ex_product_lessOpt(list, len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
lea    0xe92(%rip),%rdi
lea    -0x1a8(%rbp),%rsi
call   1080 <scanf@plt>
movl   $0x0,-0x1a4(%rbp)
mov    -0x1a4(%rbp),%eax
cmp    -0x1a8(%rbp),%eax
jge    11e9 <main+0x89>
lea    -0x1a0(%rbp),%rsi
movslq -0x1a4(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe4e(%rip),%rdi
call   1080 <scanf@plt>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    11a2 <main+0x42>
lea    -0x1a0(%rbp),%rdi
mov    -0x1a8(%rbp),%esi
call   1060 <ex_product1@plt>
lea    -0x1a0(%rbp),%rdi
mov    -0x1a8(%rbp),%esi
call   1030 <ex_product2@plt>
lea    -0x1a0(%rbp),%rdi
mov    -0x1a8(%rbp),%esi
call   1070 <ex_product3@plt>
lea    -0x1a0(%rbp),%rdi
mov    -0x1a8(%rbp),%esi
call   1050 <ex_product_lessOpt@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x1a0,%rsp
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9f(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1080 <scanf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
jle    11bd <main+0x5d>
lea    0x10(%rsp),%r15
xor    %ebx,%ebx
lea    0xe7f(%rip),%r14
nop
mov    %r14,%rdi
mov    %r15,%rsi
call   1080 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rsi
add    $0x4,%r15
cmp    %rsi,%rbx
jl     11a0 <main+0x40>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <ex_product1@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <ex_product2@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1070 <ex_product3@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1050 <ex_product_lessOpt@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Enter the size of the list : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i32]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
store i32 0, i32* %7
br label %11
11: ; preds = %21, %2
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %24
15: ; preds = %11
%16 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 0
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %19)
br label %21
21: ; preds = %15
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %11
24: ; preds = %11
%25 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 0
%26 = load i32, i32* %8
%27 = call i32 @ex_product1(i32* %25, i32 %26)
%28 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 0
%29 = load i32, i32* %8
%30 = call i32 @ex_product2(i32* %28, i32 %29)
%31 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 0
%32 = load i32, i32* %8
%33 = call i32 @ex_product3(i32* %31, i32 %32)
%34 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 0
%35 = load i32, i32* %8
%36 = call i32 @ex_product_lessOpt(i32* %34, i32 %35)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Enter the size of the list : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i32]
%4 = alloca i32
%5 = bitcast [100 x i32]* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %2, %11
%12 = phi i64 [ %15, %11 ], [ 0, %2 ]
%13 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %12
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%15 = add nuw nsw i64 %12, 1
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = icmp slt i64 %15, %17
br i1 %18, label %11, label %19
19: ; preds = %11, %2
%20 = phi i32 [ %9, %2 ], [ %16, %11 ]
%21 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%22 = call i32 @ex_product1(i32* %21, i32 %20)
%23 = load i32, i32* %4
%24 = call i32 @ex_product2(i32* %21, i32 %23)
%25 = load i32, i32* %4
%26 = call i32 @ex_product3(i32* %21, i32 %25)
%27 = load i32, i32* %4
%28 = call i32 @ex_product_lessOpt(i32* %21, i32 %27)
ret i32 0
}