#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*/ fillArray(int *, int *, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int blockId[64];
  int threadId[64];
  int i;
  for (i = 0; i < 64; i++) {
    blockId[i] = 0;
    threadId[i] = 0;
  }
  printf("Initial state of the array blockId:\n");
  for (i = 0; i < 64; i++) {
    printf("%d ", blockId[i]);
  }
  printf("\n");
  printf("Initial state of the array threadId:\n");
  for (i = 0; i < 64; i++) {
    printf("%d ", threadId[i]);
  }
  printf("\n");
  fillArray(blockId, threadId, 64);
  printf("Final state of the array blockId:\n");
  for (i = 0; i < 64; i++) {
    printf("%d ", blockId[i]);
  }
  printf("\n");
  printf("Initial state of the array threadId:\n");
  for (i = 0; i < 64; i++) {
    printf("%d ", threadId[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x214(%rbp)
cmpl   $0x40,-0x214(%rbp)
jge    1188 <main+0x68>
movslq -0x214(%rbp),%rax
movl   $0x0,-0x110(%rbp,%rax,4)
movslq -0x214(%rbp),%rax
movl   $0x0,-0x210(%rbp,%rax,4)
mov    -0x214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x214(%rbp)
jmp    1143 <main+0x23>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x214(%rbp)
cmpl   $0x40,-0x214(%rbp)
jge    11dd <main+0xbd>
movslq -0x214(%rbp),%rax
mov    -0x110(%rbp,%rax,4),%esi
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x214(%rbp)
jmp    11a0 <main+0x80>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x214(%rbp)
cmpl   $0x40,-0x214(%rbp)
jge    1240 <main+0x120>
movslq -0x214(%rbp),%rax
mov    -0x210(%rbp,%rax,4),%esi
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x214(%rbp)
jmp    1203 <main+0xe3>
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
mov    $0x40,%edx
call   1040 <fillArray@plt>
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x214(%rbp)
cmpl   $0x40,-0x214(%rbp)
jge    12bb <main+0x19b>
movslq -0x214(%rbp),%rax
mov    -0x110(%rbp,%rax,4),%esi
lea    0xd85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x214(%rbp)
jmp    127e <main+0x15e>
lea    0xd8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x214(%rbp)
cmpl   $0x40,-0x214(%rbp)
jge    131e <main+0x1fe>
movslq -0x214(%rbp),%rax
mov    -0x210(%rbp,%rax,4),%esi
lea    0xd22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x214(%rbp)
jmp    12e1 <main+0x1c1>
lea    0xd28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x208,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x1b0(%rsp)
movaps %xmm0,0x1c0(%rsp)
movaps %xmm0,0x1d0(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1f0(%rsp)
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xf0(%rsp)
lea    0xdc9(%rip),%rdi
call   1040 <puts@plt>
lea    0xdb9(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    0x100(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    1260 <main+0x120>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdbe(%rip),%rdi
call   1040 <puts@plt>
lea    0xd68(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    (%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    12b0 <main+0x170>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x100(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x40,%edx
call   1060 <fillArray@plt>
lea    0xd3b(%rip),%rdi
call   1040 <puts@plt>
lea    0xd07(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    0x100(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    1300 <main+0x1c0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd1e(%rip),%rdi
call   1040 <puts@plt>
lea    0xcc8(%rip),%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    1340 <main+0x200>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d \00"
@str = [36 x i8] c"Initial state of the array blockId:\00"
@str.6 = [34 x i8] c"Final state of the array blockId:\00"
@str.7 = [37 x i8] c"Initial state of the array threadId:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [64 x i32]
%4 = bitcast [64 x i32]* %3 to i8*
%5 = alloca [64 x i32]
%6 = bitcast [64 x i32]* %5 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
br label %9
9: ; preds = %2, %9
%10 = phi i64 [ 1, %2 ], [ %14, %9 ]
%11 = getelementptr inbounds [64 x i32], [64 x i32]* %3, i64 0, i64 %10
%12 = load i32, i32* %11
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, 64
br i1 %15, label %16, label %9
16: ; preds = %9
%17 = tail call i32 @putchar(i32 10)
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.7, i64 0, i64 0))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
br label %20
20: ; preds = %16, %20
%21 = phi i64 [ 1, %16 ], [ %25, %20 ]
%22 = getelementptr inbounds [64 x i32], [64 x i32]* %5, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%25 = add nuw nsw i64 %21, 1
%26 = icmp eq i64 %25, 64
br i1 %26, label %27, label %20
27: ; preds = %20
%28 = tail call i32 @putchar(i32 10)
%29 = getelementptr inbounds [64 x i32], [64 x i32]* %3, i64 0, i64 0
%30 = getelementptr inbounds [64 x i32], [64 x i32]* %5, i64 0, i64 0
%31 = call i32 @fillArray(i32* %29, i32* %30, i32 64)
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.6, i64 0, i64 0))
br label %33
33: ; preds = %27, %33
%34 = phi i64 [ 0, %27 ], [ %38, %33 ]
%35 = getelementptr inbounds [64 x i32], [64 x i32]* %3, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %36)
%38 = add nuw nsw i64 %34, 1
%39 = icmp eq i64 %38, 64
br i1 %39, label %40, label %33
40: ; preds = %33
%41 = call i32 @putchar(i32 10)
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.7, i64 0, i64 0))
br label %43
43: ; preds = %40, %43
%44 = phi i64 [ 0, %40 ], [ %48, %43 ]
%45 = getelementptr inbounds [64 x i32], [64 x i32]* %5, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %46)
%48 = add nuw nsw i64 %44, 1
%49 = icmp eq i64 %48, 64
br i1 %49, label %50, label %43
50: ; preds = %43
%51 = call i32 @putchar(i32 10)
ret i32 0
}