#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 */
typedef int /*<<< orphan*/ vetor;

/* Variables and functions */
int RandomInteger(int /*<<< orphan*/, int);
int min(int, int *);
int /*<<< orphan*/ printf(char *, int);
void main(void) {
  int vetor[6];
  for (int i = 0; i < 6; i++) {
    vetor[i] = RandomInteger(0, 99);
  }
  int y = sizeof(vetor) / sizeof(int);
  printf("O menor elemento é %d\n", min(y, vetor));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x24(%rbp)
cmpl   $0x6,-0x24(%rbp)
jge    116d <main+0x3d>
xor    %edi,%edi
mov    $0x63,%esi
call   1050 <RandomInteger@plt>
mov    %eax,%ecx
movslq -0x24(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    113f <main+0xf>
movl   $0x6,-0x28(%rbp)
mov    -0x28(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1040 <min@plt>
mov    %eax,%esi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xor    %edi,%edi
mov    $0x63,%esi
call   1050 <RandomInteger@plt>
mov    %eax,(%rsp)
xor    %edi,%edi
mov    $0x63,%esi
call   1050 <RandomInteger@plt>
mov    %eax,0x4(%rsp)
xor    %edi,%edi
mov    $0x63,%esi
call   1050 <RandomInteger@plt>
mov    %eax,0x8(%rsp)
xor    %edi,%edi
mov    $0x63,%esi
call   1050 <RandomInteger@plt>
mov    %eax,0xc(%rsp)
xor    %edi,%edi
mov    $0x63,%esi
call   1050 <RandomInteger@plt>
mov    %eax,0x10(%rsp)
xor    %edi,%edi
mov    $0x63,%esi
call   1050 <RandomInteger@plt>
mov    %eax,0x14(%rsp)
mov    %rsp,%rsi
mov    $0x6,%edi
call   1040 <min@plt>
lea    0xe59(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"O menor elemento \C3\A9 %d\0A\00"
define void @main() {
%1 = alloca [6 x i32]
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 6
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = call i32 @RandomInteger(i32 0, i32 99)
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 %10
store i32 %8, i32* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %4
15: ; preds = %4
store i32 6, i32* %3
%16 = load i32, i32* %3
%17 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%18 = call i32 @min(i32 %16, i32* %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"O menor elemento \C3\A9 %d\0A\00"
define void @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = tail call i32 @RandomInteger(i32 0, i32 99)
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
store i32 %3, i32* %4
%5 = tail call i32 @RandomInteger(i32 0, i32 99)
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 1
store i32 %5, i32* %6
%7 = tail call i32 @RandomInteger(i32 0, i32 99)
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 2
store i32 %7, i32* %8
%9 = tail call i32 @RandomInteger(i32 0, i32 99)
%10 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 3
store i32 %9, i32* %10
%11 = tail call i32 @RandomInteger(i32 0, i32 99)
%12 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 4
store i32 %11, i32* %12
%13 = tail call i32 @RandomInteger(i32 0, i32 99)
%14 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 5
store i32 %13, i32* %14
%15 = call i32 @min(i32 6, i32* %4)
%16 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %15)
ret void
}