#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 */
struct chromosome {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mutateslot(struct chromosome *, int **, int, int);
void mutate(struct chromosome **generation, int POPSIZE, int mutationprob,
            int timeslots, int **conflictmatrix) {
  int k;
  for (k = 0; k < POPSIZE; k++) {
    mutateslot(generation[k], conflictmatrix, timeslots, mutationprob);
  }
}


x86 assembly (clang, -O0):
<mutate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1165 <mutate+0x55>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <mutateslot@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1130 <mutate+0x20>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    114c <mutate+0x3c>
mov    %r8,%r14
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %rdi,%r13
mov    %esi,%ebx
xor    %ebp,%ebp
nop
mov    0x0(%r13,%rbp,8),%rdi
mov    %r14,%rsi
mov    %r15d,%edx
mov    %r12d,%ecx
call   1030 <mutateslot@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <mutate+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.chromosome = type { i32 }
define void @mutate(%struct.chromosome** nocapture %0, i32 %1, i32 %2, i32 %3, i32** %4) {
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %16
7: ; preds = %5
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %14, %9 ]
%11 = getelementptr inbounds %struct.chromosome*, %struct.chromosome** %0, i64 %10
%12 = load %struct.chromosome*, %struct.chromosome** %11
%13 = tail call i32 @mutateslot(%struct.chromosome* %12, i32** %4, i32 %3, i32 %2)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %8
br i1 %15, label %16, label %9
16: ; preds = %9, %5
ret void
}