#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 lerpontuacoes(char **, int *);
int /*<<< orphan*/ primeiroUltimo(char **, int *, int, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int n, pontos[20] = {};
  char clubes[20][50] = {}, primeiro[50] = {}, ultimo[50] = {};
  n = lerpontuacoes(clubes, pontos);
  primeiroUltimo(clubes, pontos, n, primeiro, ultimo);
  printf("Classificacao de %d Clubes\n", n);
  printf("Campeao: %s\n", primeiro);
  printf("Ultimo classificado: %s\n", ultimo);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4d0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1050 <memset@plt>
lea    -0x450(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1050 <memset@plt>
lea    -0x490(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1050 <memset@plt>
lea    -0x4d0(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1050 <memset@plt>
lea    -0x450(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1060 <lerpontuacoes@plt>
mov    %eax,-0x8(%rbp)
lea    -0x450(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x8(%rbp),%edx
lea    -0x490(%rbp),%rcx
lea    -0x4d0(%rbp),%r8
call   1030 <primeiroUltimo@plt>
mov    -0x8(%rbp),%esi
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x490(%rbp),%rsi
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x4d0(%rbp),%rsi
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x4d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x4c0,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
lea    0xd0(%rsp),%r14
mov    $0x3e8,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movw   $0x0,0x70(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movw   $0x0,0x30(%rsp)
lea    0x80(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <lerpontuacoes@plt>
mov    %eax,%ebp
lea    0x40(%rsp),%r15
mov    %rsp,%r12
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
mov    %r15,%rcx
mov    %r12,%r8
call   1030 <primeiroUltimo@plt>
lea    0xe0a(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe16(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe12(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x4c0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Classificacao de %d Clubes\0A\00"
@.str.1 = [13 x i8] c"Campeao: %s\0A\00"
@.str.2 = [25 x i8] c"Ultimo classificado: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [20 x i32]
%4 = alloca [20 x [50 x i8]]
%5 = alloca [50 x i8]
%6 = alloca [50 x i8]
store i32 0, i32* %1
%7 = bitcast [20 x i32]* %3 to i8*
%8 = bitcast [20 x [50 x i8]]* %4 to i8*
%9 = bitcast [50 x i8]* %5 to i8*
%10 = bitcast [50 x i8]* %6 to i8*
%11 = getelementptr inbounds [20 x [50 x i8]], [20 x [50 x i8]]* %4, i64 0, i64 0
%12 = bitcast [50 x i8]* %11 to i8**
%13 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%14 = call i32 @lerpontuacoes(i8** %12, i32* %13)
store i32 %14, i32* %2
%15 = getelementptr inbounds [20 x [50 x i8]], [20 x [50 x i8]]* %4, i64 0, i64 0
%16 = bitcast [50 x i8]* %15 to i8**
%17 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%18 = load i32, i32* %2
%19 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%20 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%21 = call i32 @primeiroUltimo(i8** %16, i32* %17, i32 %18, i8* %19, i8* %20)
%22 = load i32, i32* %2
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %24)
%26 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Classificacao de %d Clubes\0A\00"
@.str.1 = [13 x i8] c"Campeao: %s\0A\00"
@.str.2 = [25 x i8] c"Ultimo classificado: %s\0A\00"
define i32 @main() {
%1 = alloca [20 x i32]
%2 = alloca [20 x [50 x i8]]
%3 = alloca [50 x i8]
%4 = alloca [50 x i8]
%5 = bitcast [20 x i32]* %1 to i8*
%6 = getelementptr inbounds [20 x [50 x i8]], [20 x [50 x i8]]* %2, i64 0, i64 0, i64 0
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%9 = bitcast [20 x [50 x i8]]* %2 to i8**
%10 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%11 = call i32 @lerpontuacoes(i8** %9, i32* %10)
%12 = call i32 @primeiroUltimo(i8** %9, i32* %10, i32 %11, i8* %7, i8* %8)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %11)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %8)
ret i32 0
}