#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(struct sll_item *);
scalar_t__ malloc(int);
int main() {
  typedef struct sll_item sll_item_t;
  struct sll_item {
    sll_item_t *next;
  };
  sll_item_t array_static[7];
  sll_item_t *array_dynamic = (sll_item_t *)malloc(7 * sizeof(sll_item_t));
  {
    int i;
    for (i = 0; i <= 7; ++i) {
      array_static[i].next = NULL;
      array_dynamic[i].next = NULL;
    }
  }
  free(array_dynamic);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x38,%edi
call   1040 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
cmpl   $0x7,-0x4c(%rbp)
jg     1179 <main+0x59>
movslq -0x4c(%rbp),%rax
movq   $0x0,-0x40(%rbp,%rax,8)
mov    -0x48(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1144 <main+0x24>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x38,%edi
call   1040 <malloc@plt>
xorps  %xmm0,%xmm0
movups %xmm0,(%rax)
movups %xmm0,0x10(%rax)
movups %xmm0,0x20(%rax)
movups %xmm0,0x30(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sll_item = type { %struct.sll_item* }
%struct.sll_item.0 = type opaque
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x %struct.sll_item]
%3 = alloca %struct.sll_item*
%4 = alloca i32
store i32 0, i32* %1
%5 = call i64 @malloc(i32 56)
%6 = inttoptr i64 %5 to %struct.sll_item*
store %struct.sll_item* %6, %struct.sll_item** %3
store i32 0, i32* %4
br label %7
7: ; preds = %20, %0
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 7
br i1 %9, label %10, label %23
10: ; preds = %7
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [7 x %struct.sll_item], [7 x %struct.sll_item]* %2, i64 0, i64 %12
%14 = getelementptr inbounds %struct.sll_item, %struct.sll_item* %13, i32 0, i32 0
store %struct.sll_item* null, %struct.sll_item** %14
%15 = load %struct.sll_item*, %struct.sll_item** %3
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds %struct.sll_item, %struct.sll_item* %15, i64 %17
%19 = getelementptr inbounds %struct.sll_item, %struct.sll_item* %18, i32 0, i32 0
store %struct.sll_item* null, %struct.sll_item** %19
br label %20
20: ; preds = %10
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %7
23: ; preds = %7
%24 = load %struct.sll_item*, %struct.sll_item** %3
%25 = bitcast %struct.sll_item* %24 to %struct.sll_item.0*
%26 = call i32 @free(%struct.sll_item.0* %25)
ret i32 0
}

LLVM IR (-O2):
%struct.sll_item.0 = type opaque
define i32 @main() {
%1 = tail call i64 @malloc(i32 56)
%2 = inttoptr i64 %1 to i8*
%3 = inttoptr i64 %1 to %struct.sll_item.0*
%4 = tail call i32 @free(%struct.sll_item.0* %3)
ret i32 0
}