#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 s_map {
  int dummy;
};

/* Variables and functions */
int mapGetMapSize(struct s_map *);
int /*<<< orphan*/ mapInit(struct s_map *);
void mapTestsuiteRWDInit(struct s_map *map, int *states) {
  int j;
  for (j = 0; j < mapGetMapSize(map); j++)
    states[j] = 0;
  mapInit(map);
}


x86 assembly (clang, -O0):
<mapTestsuiteRWDInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mapGetMapSize@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1170 <mapTestsuiteRWDInit+0x50>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <mapTestsuiteRWDInit+0x17>
mov    -0x8(%rbp),%rdi
call   1030 <mapInit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapTestsuiteRWDInit>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <mapGetMapSize@plt>
test   %eax,%eax
jle    115b <mapTestsuiteRWDInit+0x3b>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movl   $0x0,(%r14,%rbx,4)
add    $0x1,%rbx
mov    %r15,%rdi
call   1040 <mapGetMapSize@plt>
cltq
cmp    %rax,%rbx
jl     1140 <mapTestsuiteRWDInit+0x20>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <mapInit@plt>

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

LLVM IR (-O2):
%struct.s_map = type { i32 }
define void @mapTestsuiteRWDInit(%struct.s_map* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @mapGetMapSize(%struct.s_map* %0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ 0, %2 ]
%7 = getelementptr inbounds i32, i32* %1, i64 %6
store i32 0, i32* %7
%8 = add nuw nsw i64 %6, 1
%9 = tail call i32 @mapGetMapSize(%struct.s_map* %0)
%10 = sext i32 %9 to i64
%11 = icmp slt i64 %8, %10
br i1 %11, label %5, label %12
12: ; preds = %5, %2
%13 = tail call i32 @mapInit(%struct.s_map* %0)
ret void
}