#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*/ printf(char *, int, int const);
void funcao_T(const int mensagens_por_user[1000],
              const int n_mensagens_mais_ativo) {
  int i;
  for (i = 0; i < 1000; ++i)
    if (mensagens_por_user[i] == n_mensagens_mais_ativo)
      printf("*MOST ACTIVE USER:%d:%d\n", i, n_mensagens_mais_ativo);
}


x86 assembly (clang, -O0):
<funcao_T>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3e8,-0x10(%rbp)
jge    116c <funcao_T+0x5c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0xc(%rbp),%eax
jne    1159 <funcao_T+0x49>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    115e <funcao_T+0x4e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <funcao_T+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcao_T>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xedb(%rip),%r15
jmp    113d <funcao_T+0x2d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0x3e8,%rbx
je     1151 <funcao_T+0x41>
cmp    %ebp,(%r14,%rbx,4)
jne    1130 <funcao_T+0x20>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
jmp    1130 <funcao_T+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"*MOST ACTIVE USER:%d:%d\0A\00"
define void @funcao_T(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %22, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 1000
br i1 %8, label %9, label %25
9: ; preds = %6
%10 = load i32*, i32** %3
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
%15 = load i32, i32* %4
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %9
%18 = load i32, i32* %5
%19 = load i32, i32* %4
%20 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %19)
br label %21
21: ; preds = %17, %9
br label %22
22: ; preds = %21
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %6
25: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"*MOST ACTIVE USER:%d:%d\0A\00"
define void @funcao_T(i32* nocapture %0, i32 %1) {
br label %3
3: ; preds = %2, %11
%4 = phi i64 [ 0, %2 ], [ %12, %11 ]
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, %1
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = trunc i64 %4 to i32
%10 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %1)
br label %11
11: ; preds = %3, %8
%12 = add nuw nsw i64 %4, 1
%13 = icmp eq i64 %12, 1000
br i1 %13, label %14, label %3
14: ; preds = %11
ret void
}