#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*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ syscall_exit(int /*<<< orphan*/);
int main() {
  char *data[10];
  int j;
  for (j = 0; j < 50; j++) {
    int i;
    for (i = 0; i < 10; i++) {
      data[i] = (char *)malloc(15000);
      data[i][i * 1003] = '!';
    }
    for (i = 0; i < 10; i++) {
      if (data[i][i * 1003] != '!') {
        return 1;
      }
    }
    free(data[0]);
    free(data[3]);
    free(data[1]);
    free(data[5]);
    free(data[9]);
    free(data[2]);
    free(data[7]);
    free(data[6]);
    free(data[8]);
    free(data[4]);
  }
  syscall_exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x64(%rbp)
cmpl   $0x32,-0x64(%rbp)
jge    1254 <main+0x124>
movl   $0x0,-0x68(%rbp)
cmpl   $0xa,-0x68(%rbp)
jge    119c <main+0x6c>
mov    $0x3a98,%edi
call   1050 <malloc@plt>
mov    %rax,%rcx
movslq -0x68(%rbp),%rax
mov    %rcx,-0x60(%rbp,%rax,8)
movslq -0x68(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rax
imul   $0x3eb,-0x68(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x21,(%rax,%rcx,1)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1157 <main+0x27>
movl   $0x0,-0x68(%rbp)
cmpl   $0xa,-0x68(%rbp)
jge    11ec <main+0xbc>
movslq -0x68(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rax
imul   $0x3eb,-0x68(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x21,%eax
je     11d9 <main+0xa9>
movl   $0x1,-0x4(%rbp)
jmp    1262 <main+0x132>
jmp    11de <main+0xae>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    11a3 <main+0x73>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1146 <main+0x16>
xor    %edi,%edi
call   1040 <syscall_exit@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    $0x32,%eax
mov    %eax,0xc(%rsp)
mov    $0x3a98,%edi
call   1050 <malloc@plt>
mov    %rax,%r13
movb   $0x21,(%rax)
mov    $0x3a98,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movb   $0x21,0x3eb(%rax)
mov    $0x3a98,%edi
call   1050 <malloc@plt>
mov    %rax,0x20(%rsp)
movb   $0x21,0x7d6(%rax)
mov    $0x3a98,%edi
call   1050 <malloc@plt>
mov    %rax,%rbp
movb   $0x21,0xbc1(%rax)
mov    $0x3a98,%edi
call   1050 <malloc@plt>
mov    %rax,0x18(%rsp)
movb   $0x21,0xfac(%rax)
mov    $0x3a98,%edi
call   1050 <malloc@plt>
mov    %rax,%r15
movb   $0x21,0x1397(%rax)
mov    $0x3a98,%edi
call   1050 <malloc@plt>
mov    %rax,0x10(%rsp)
movb   $0x21,0x1782(%rax)
mov    $0x3a98,%edi
call   1050 <malloc@plt>
mov    %rax,%r12
movb   $0x21,0x1b6d(%rax)
mov    $0x3a98,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
movb   $0x21,0x1f58(%rax)
mov    $0x3a98,%edi
call   1050 <malloc@plt>
mov    %r13,%rdi
movb   $0x21,0x2343(%rax)
mov    $0x1,%ecx
cmpb   $0x21,0x0(%r13)
jne    12fc <main+0x1cc>
cmpb   $0x21,0x3eb(%rbx)
jne    12fc <main+0x1cc>
mov    %rax,%r13
mov    0x20(%rsp),%rax
cmpb   $0x21,0x7d6(%rax)
jne    12fc <main+0x1cc>
cmpb   $0x21,0xbc1(%rbp)
jne    12fc <main+0x1cc>
mov    0x18(%rsp),%rax
cmpb   $0x21,0xfac(%rax)
jne    12fc <main+0x1cc>
cmpb   $0x21,0x1397(%r15)
21
jne    12fc <main+0x1cc>
mov    0x10(%rsp),%rax
cmpb   $0x21,0x1782(%rax)
jne    12fc <main+0x1cc>
cmpb   $0x21,0x1b6d(%r12)
jne    12fc <main+0x1cc>
cmpb   $0x21,0x1f58(%r14)
21
jne    12fc <main+0x1cc>
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
jne    1143 <main+0x13>
xor    %edi,%edi
call   1040 <syscall_exit@plt>
xor    %ecx,%ecx
mov    %ecx,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8*]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %5
5: ; preds = %81, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 50
br i1 %7, label %8, label %84
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %26, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %29
12: ; preds = %9
%13 = call i64 @malloc(i32 15000)
%14 = inttoptr i64 %13 to i8*
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 %16
store i8* %14, i8** %17
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 %19
%21 = load i8*, i8** %20
%22 = load i32, i32* %4
%23 = mul nsw i32 %22, 1003
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %21, i64 %24
store i8 33, i8* %25
br label %26
26: ; preds = %12
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %9
29: ; preds = %9
store i32 0, i32* %4
br label %30
30: ; preds = %47, %29
%31 = load i32, i32* %4
%32 = icmp slt i32 %31, 10
br i1 %32, label %33, label %50
33: ; preds = %30
%34 = load i32, i32* %4
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 %35
%37 = load i8*, i8** %36
%38 = load i32, i32* %4
%39 = mul nsw i32 %38, 1003
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %37, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp ne i32 %43, 33
br i1 %44, label %45, label %46
45: ; preds = %33
store i32 1, i32* %1
br label %86
46: ; preds = %33
br label %47
47: ; preds = %46
%48 = load i32, i32* %4
%49 = add nsw i32 %48, 1
store i32 %49, i32* %4
br label %30
50: ; preds = %30
%51 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%52 = load i8*, i8** %51
%53 = call i32 @free(i8* %52)
%54 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 3
%55 = load i8*, i8** %54
%56 = call i32 @free(i8* %55)
%57 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 1
%58 = load i8*, i8** %57
%59 = call i32 @free(i8* %58)
%60 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 5
%61 = load i8*, i8** %60
%62 = call i32 @free(i8* %61)
%63 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 9
%64 = load i8*, i8** %63
%65 = call i32 @free(i8* %64)
%66 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 2
%67 = load i8*, i8** %66
%68 = call i32 @free(i8* %67)
%69 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 7
%70 = load i8*, i8** %69
%71 = call i32 @free(i8* %70)
%72 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 6
%73 = load i8*, i8** %72
%74 = call i32 @free(i8* %73)
%75 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 8
%76 = load i8*, i8** %75
%77 = call i32 @free(i8* %76)
%78 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 4
%79 = load i8*, i8** %78
%80 = call i32 @free(i8* %79)
br label %81
81: ; preds = %50
%82 = load i32, i32* %3
%83 = add nsw i32 %82, 1
store i32 %83, i32* %3
br label %5
84: ; preds = %5
%85 = call i32 @syscall_exit(i32 0)
store i32 0, i32* %1
br label %86
86: ; preds = %84, %45
%87 = load i32, i32* %1
ret i32 %87
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %58
%2 = phi i32 [ 0, %0 ], [ %69, %58 ]
%3 = tail call i64 @malloc(i32 15000)
%4 = inttoptr i64 %3 to i8*
store i8 33, i8* %4
%5 = tail call i64 @malloc(i32 15000)
%6 = inttoptr i64 %5 to i8*
%7 = getelementptr inbounds i8, i8* %6, i64 1003
store i8 33, i8* %7
%8 = tail call i64 @malloc(i32 15000)
%9 = inttoptr i64 %8 to i8*
%10 = getelementptr inbounds i8, i8* %9, i64 2006
store i8 33, i8* %10
%11 = tail call i64 @malloc(i32 15000)
%12 = inttoptr i64 %11 to i8*
%13 = getelementptr inbounds i8, i8* %12, i64 3009
store i8 33, i8* %13
%14 = tail call i64 @malloc(i32 15000)
%15 = inttoptr i64 %14 to i8*
%16 = getelementptr inbounds i8, i8* %15, i64 4012
store i8 33, i8* %16
%17 = tail call i64 @malloc(i32 15000)
%18 = inttoptr i64 %17 to i8*
%19 = getelementptr inbounds i8, i8* %18, i64 5015
store i8 33, i8* %19
%20 = tail call i64 @malloc(i32 15000)
%21 = inttoptr i64 %20 to i8*
%22 = getelementptr inbounds i8, i8* %21, i64 6018
store i8 33, i8* %22
%23 = tail call i64 @malloc(i32 15000)
%24 = inttoptr i64 %23 to i8*
%25 = getelementptr inbounds i8, i8* %24, i64 7021
store i8 33, i8* %25
%26 = tail call i64 @malloc(i32 15000)
%27 = inttoptr i64 %26 to i8*
%28 = getelementptr inbounds i8, i8* %27, i64 8024
store i8 33, i8* %28
%29 = tail call i64 @malloc(i32 15000)
%30 = inttoptr i64 %29 to i8*
%31 = getelementptr inbounds i8, i8* %30, i64 9027
store i8 33, i8* %31
%32 = load i8, i8* %4
%33 = icmp eq i8 %32, 33
br i1 %33, label %34, label %73
34: ; preds = %1
%35 = load i8, i8* %7
%36 = icmp eq i8 %35, 33
br i1 %36, label %37, label %73
37: ; preds = %34
%38 = load i8, i8* %10
%39 = icmp eq i8 %38, 33
br i1 %39, label %40, label %73
40: ; preds = %37
%41 = load i8, i8* %13
%42 = icmp eq i8 %41, 33
br i1 %42, label %43, label %73
43: ; preds = %40
%44 = load i8, i8* %16
%45 = icmp eq i8 %44, 33
br i1 %45, label %46, label %73
46: ; preds = %43
%47 = load i8, i8* %19
%48 = icmp eq i8 %47, 33
br i1 %48, label %49, label %73
49: ; preds = %46
%50 = load i8, i8* %22
%51 = icmp eq i8 %50, 33
br i1 %51, label %52, label %73
52: ; preds = %49
%53 = load i8, i8* %25
%54 = icmp eq i8 %53, 33
br i1 %54, label %55, label %73
55: ; preds = %52
%56 = load i8, i8* %28
%57 = icmp eq i8 %56, 33
br i1 %57, label %58, label %73
58: ; preds = %55
%59 = tail call i32 @free(i8* %4)
%60 = tail call i32 @free(i8* %12)
%61 = tail call i32 @free(i8* %6)
%62 = tail call i32 @free(i8* %18)
%63 = tail call i32 @free(i8* %30)
%64 = tail call i32 @free(i8* %9)
%65 = tail call i32 @free(i8* %24)
%66 = tail call i32 @free(i8* %21)
%67 = tail call i32 @free(i8* %27)
%68 = tail call i32 @free(i8* %15)
%69 = add nuw nsw i32 %2, 1
%70 = icmp eq i32 %69, 50
br i1 %70, label %71, label %1
71: ; preds = %58
%72 = tail call i32 @syscall_exit(i32 0)
br label %73
73: ; preds = %1, %34, %37, %40, %43, %46, %49, %52, %55, %71
%74 = phi i32 [ 0, %71 ], [ 1, %55 ], [ 1, %52 ], [ 1, %49 ], [ 1, %46 ], [ 1, %43 ], [ 1, %40 ], [ 1, %37 ], [ 1, %34 ], [ 1, %1 ]
ret i32 %74
}