#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 MaxDC(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ max1(int *, int, int);
int max2(int *, int);
int /*<<< orphan*/ printf(char *, int);
int rand();
int main() {
  int vetor[10];
  for (int i = 0; i < 10; ++i) {
    vetor[i] = (rand() % 90) + 10;
    printf("%d, ", vetor[i]);
  }
  max1(vetor, vetor[0], 1);
  printf("\nMax2: %d\n", max2(vetor, 10));
  printf("\nMaxDC: %d\n\n", MaxDC(vetor, 0, 10 - 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    11ac <main+0x5c>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x5a,%ecx
cltd
idiv   %ecx
add    $0xa,%edx
movslq -0x34(%rbp),%rax
mov    %edx,-0x30(%rbp,%rax,4)
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1166 <main+0x16>
lea    -0x30(%rbp),%rdi
mov    -0x30(%rbp),%esi
mov    $0x1,%edx
call   1050 <max1@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <max2@plt>
mov    %eax,%esi
lea    0xe31(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1060 <MaxDC@plt>
mov    %eax,%esi
lea    0xe1e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
imul   $0x5a,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0xa,%ebp
mov    %ebp,(%rsp)
lea    0xe75(%rip),%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
imul   $0x5a,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0xa,%esi
mov    %esi,0x4(%rsp)
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
imul   $0x5a,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0xa,%esi
mov    %esi,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
imul   $0x5a,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0xa,%esi
mov    %esi,0xc(%rsp)
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
imul   $0x5a,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0xa,%esi
mov    %esi,0x10(%rsp)
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
imul   $0x5a,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0xa,%esi
mov    %esi,0x14(%rsp)
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
imul   $0x5a,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0xa,%esi
mov    %esi,0x18(%rsp)
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
imul   $0x5a,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0xa,%esi
mov    %esi,0x1c(%rsp)
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
imul   $0x5a,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0xa,%esi
mov    %esi,0x20(%rsp)
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
imul   $0x5a,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0xa,%esi
mov    %esi,0x24(%rsp)
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
call   1050 <max1@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <max2@plt>
lea    0xc5b(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1060 <MaxDC@plt>
lea    0xc49(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d, \00"
@.str.1 = [11 x i8] c"\0AMax2: %d\0A\00"
@.str.2 = [13 x i8] c"\0AMaxDC: %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %19, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %22
7: ; preds = %4
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 90
%10 = add nsw i32 %9, 10
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %12
store i32 %10, i32* %13
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %7
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %4
22: ; preds = %4
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%25 = load i32, i32* %24
%26 = call i32 @max1(i32* %23, i32 %25, i32 1)
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%28 = call i32 @max2(i32* %27, i32 10)
%29 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%31 = call i32 @MaxDC(i32* %30, i32 0, i32 9)
%32 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %31)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
@.str.1 = [11 x i8] c"\0AMax2: %d\0A\00"
@.str.2 = [13 x i8] c"\0AMaxDC: %d\0A\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 90
%5 = add nsw i32 %4, 10
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
store i32 %5, i32* %6
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 90
%10 = add nsw i32 %9, 10
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
store i32 %10, i32* %11
%12 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
%13 = tail call i32 (...) @rand()
%14 = srem i32 %13, 90
%15 = add nsw i32 %14, 10
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
store i32 %15, i32* %16
%17 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %15)
%18 = tail call i32 (...) @rand()
%19 = srem i32 %18, 90
%20 = add nsw i32 %19, 10
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
store i32 %20, i32* %21
%22 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %20)
%23 = tail call i32 (...) @rand()
%24 = srem i32 %23, 90
%25 = add nsw i32 %24, 10
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
store i32 %25, i32* %26
%27 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %25)
%28 = tail call i32 (...) @rand()
%29 = srem i32 %28, 90
%30 = add nsw i32 %29, 10
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
store i32 %30, i32* %31
%32 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %30)
%33 = tail call i32 (...) @rand()
%34 = srem i32 %33, 90
%35 = add nsw i32 %34, 10
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
store i32 %35, i32* %36
%37 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %35)
%38 = tail call i32 (...) @rand()
%39 = srem i32 %38, 90
%40 = add nsw i32 %39, 10
%41 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
store i32 %40, i32* %41
%42 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %40)
%43 = tail call i32 (...) @rand()
%44 = srem i32 %43, 90
%45 = add nsw i32 %44, 10
%46 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
store i32 %45, i32* %46
%47 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %45)
%48 = tail call i32 (...) @rand()
%49 = srem i32 %48, 90
%50 = add nsw i32 %49, 10
%51 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
store i32 %50, i32* %51
%52 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %50)
%53 = call i32 @max1(i32* %6, i32 %5, i32 1)
%54 = call i32 @max2(i32* %6, i32 10)
%55 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %54)
%56 = call i32 @MaxDC(i32* %6, i32 0, i32 9)
%57 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %56)
ret i32 0
}