void UI_LoadTeams(void) {
  char teamList[4096];
  char *teamName;
  int i, len, count;
  count = trap_FS_GetFileList("", "team", teamList, 4096);
  if (count) {
    teamName = teamList;
    for (i = 0; i < count; i++) {
      len = strlen(teamName);
      UI_ParseTeamInfo(teamName);
      teamName += len + 1;
    }
  }
}


x86 assembly (clang, -O0):
<UI_LoadTeams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
lea    -0x1000(%rbp),%rdx
lea    0xebb(%rip),%rdi
lea    0xeb0(%rip),%rsi
mov    $0x1000,%ecx
mov    $0x0,%al
call   1030 <trap_FS_GetFileList@plt>
mov    %eax,-0x1014(%rbp)
cmpl   $0x0,-0x1014(%rbp)
je     11ef <UI_LoadTeams+0xbf>
lea    -0x1000(%rbp),%rax
mov    %rax,-0x1008(%rbp)
movl   $0x0,-0x100c(%rbp)
mov    -0x100c(%rbp),%eax
cmp    -0x1014(%rbp),%eax
jge    11ea <UI_LoadTeams+0xba>
mov    -0x1008(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1010(%rbp)
mov    -0x1008(%rbp),%rdi
mov    $0x0,%al
call   1050 <UI_ParseTeamInfo@plt>
mov    -0x1010(%rbp),%ecx
add    $0x1,%ecx
mov    -0x1008(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x1008(%rbp)
mov    -0x100c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100c(%rbp)
jmp    1187 <UI_LoadTeams+0x57>
jmp    11ef <UI_LoadTeams+0xbf>
add    $0x1020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_LoadTeams>:
push   %rbp
push   %r14
push   %rbx
sub    $0x1000,%rsp
lea    0xec2(%rip),%rdi
lea    0xeb7(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdx
mov    $0x1000,%ecx
xor    %eax,%eax
call   1030 <trap_FS_GetFileList@plt>
test   %eax,%eax
jle    1194 <UI_LoadTeams+0x64>
mov    %eax,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <UI_ParseTeamInfo@plt>
add    $0x1,%ebp
movslq %ebp,%rax
add    %rax,%rbx
add    $0xffffffff,%r14d
jne    1170 <UI_LoadTeams+0x40>
add    $0x1000,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"team\00"
define void @UI_LoadTeams() {
%1 = alloca [4096 x i8]
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%7 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @trap_FS_GetFileList to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %6, i32 4096)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %31
10: ; preds = %0
%11 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
store i8* %11, i8** %2
store i32 0, i32* %3
br label %12
12: ; preds = %27, %10
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %30
16: ; preds = %12
%17 = load i8*, i8** %2
%18 = call i64 @strlen(i8* %17)
%19 = trunc i64 %18 to i32
store i32 %19, i32* %4
%20 = load i8*, i8** %2
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @UI_ParseTeamInfo to i32 (i8*, ...)*)(i8* %20)
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
%24 = load i8*, i8** %2
%25 = sext i32 %23 to i64
%26 = getelementptr inbounds i8, i8* %24, i64 %25
store i8* %26, i8** %2
br label %27
27: ; preds = %16
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %12
30: ; preds = %12
br label %31
31: ; preds = %30, %0
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"team\00"
define void @UI_LoadTeams() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @trap_FS_GetFileList to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 4096)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %16
5: ; preds = %0, %5
%6 = phi i8* [ %13, %5 ], [ %2, %0 ]
%7 = phi i32 [ %14, %5 ], [ 0, %0 ]
%8 = call i64 @strlen(i8* dereferenceable(1) %6)
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @UI_ParseTeamInfo to i32 (i8*, ...)*)(i8* %6)
%10 = shl i64 %8, 32
%11 = add i64 %10, 4294967296
%12 = ashr exact i64 %11, 32
%13 = getelementptr inbounds i8, i8* %6, i64 %12
%14 = add nuw nsw i32 %7, 1
%15 = icmp eq i32 %14, %3
br i1 %15, label %16, label %5
16: ; preds = %5, %0
ret void
}