void create_win_list(win_list, map, data, ivars, total_units,
                     samples) int *win_list,
    total_units, samples, ivars;
float **map, **data;
{
  int i, find_winner();
  for (i = 1; i <= samples; i++)
    win_list[i] = find_winner(map, data, i, ivars, total_units);
}


x86 assembly (clang, -O0):
<create_win_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     1176 <create_win_list+0x66>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    $0x0,%al
call   1030 <find_winner@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1136 <create_win_list+0x26>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_win_list>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,(%rsp)
test   %r9d,%r9d
jle    1174 <create_win_list+0x64>
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %rdx,%r13
mov    %rsi,%rbp
mov    %rdi,%rbx
mov    (%rsp),%rax
add    $0x1,%eax
mov    %rax,(%rsp)
mov    $0x1,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %r14d,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
xor    %eax,%eax
call   1030 <find_winner@plt>
mov    %eax,(%rbx,%r14,4)
add    $0x1,%r14
cmp    %r14,(%rsp)
jne    1150 <create_win_list+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @create_win_list(i32* %0, float** %1, float** %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca float**
%9 = alloca float**
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32* %0, i32** %7
store float** %1, float*** %8
store float** %2, float*** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
store i32 1, i32* %13
br label %14
14: ; preds = %29, %6
%15 = load i32, i32* %13
%16 = load i32, i32* %12
%17 = icmp sle i32 %15, %16
br i1 %17, label %18, label %32
18: ; preds = %14
%19 = load float**, float*** %8
%20 = load float**, float*** %9
%21 = load i32, i32* %13
%22 = load i32, i32* %10
%23 = load i32, i32* %11
%24 = call i32 (float**, float**, i32, i32, i32, ...) bitcast (i32 (...)* @find_winner to i32 (float**, float**, i32, i32, i32, ...)*)(float** %19, float** %20, i32 %21, i32 %22, i32 %23)
%25 = load i32*, i32** %7
%26 = load i32, i32* %13
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
store i32 %24, i32* %28
br label %29
29: ; preds = %18
%30 = load i32, i32* %13
%31 = add nsw i32 %30, 1
store i32 %31, i32* %13
br label %14
32: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @create_win_list(i32* nocapture writeonly %0, float** %1, float** %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp slt i32 %5, 1
br i1 %7, label %18, label %8
8: ; preds = %6
%9 = add nuw i32 %5, 1
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %8, %11
%12 = phi i64 [ 1, %8 ], [ %16, %11 ]
%13 = trunc i64 %12 to i32
%14 = tail call i32 (float**, float**, i32, i32, i32, ...) bitcast (i32 (...)* @find_winner to i32 (float**, float**, i32, i32, i32, ...)*)(float** %1, float** %2, i32 %13, i32 %3, i32 %4)
%15 = getelementptr inbounds i32, i32* %0, i64 %12
store i32 %14, i32* %15
%16 = add nuw nsw i64 %12, 1
%17 = icmp eq i64 %16, %10
br i1 %17, label %18, label %11
18: ; preds = %11, %6
ret void
}