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

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ slist_free(struct slist *);
int slist_front(struct slist *, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                void **);
int /*<<< orphan*/ slist_pop_front(struct slist *);
void _sconfig_free_items(struct slist *items) {
  void *value;
  while (slist_front(items, NULL, NULL, &value) != -1) {
    free(value);
    slist_pop_front(items);
  }
  slist_free(items);
}


x86 assembly (clang, -O0):
<_sconfig_free_items>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%edx
lea    -0x10(%rbp),%rcx
mov    %rdx,%rsi
call   1040 <slist_front@plt>
cmp    $0xffffffff,%eax
je     1180 <_sconfig_free_items+0x40>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1060 <slist_pop_front@plt>
jmp    114c <_sconfig_free_items+0xc>
mov    -0x8(%rbp),%rdi
call   1050 <slist_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sconfig_free_items>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%rcx
xor    %esi,%esi
xor    %edx,%edx
call   1040 <slist_front@plt>
cmp    $0xffffffff,%eax
je     1185 <_sconfig_free_items+0x45>
mov    %rsp,%r14
nopl   0x0(%rax,%rax,1)
mov    (%rsp),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1060 <slist_pop_front@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    %r14,%rcx
call   1040 <slist_front@plt>
cmp    $0xffffffff,%eax
jne    1160 <_sconfig_free_items+0x20>
mov    %rbx,%rdi
call   1050 <slist_free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.slist = type { i32 }
define void @_sconfig_free_items(%struct.slist* %0) {
%2 = alloca %struct.slist*
%3 = alloca i8*
store %struct.slist* %0, %struct.slist** %2
br label %4
4: ; preds = %8, %1
%5 = load %struct.slist*, %struct.slist** %2
%6 = call i32 @slist_front(%struct.slist* %5, i32* null, i32* null, i8** %3)
%7 = icmp ne i32 %6, -1
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load %struct.slist*, %struct.slist** %2
%12 = call i32 @slist_pop_front(%struct.slist* %11)
br label %4
13: ; preds = %4
%14 = load %struct.slist*, %struct.slist** %2
%15 = call i32 @slist_free(%struct.slist* %14)
ret void
}

LLVM IR (-O2):
%struct.slist = type { i32 }
define void @_sconfig_free_items(%struct.slist* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @slist_front(%struct.slist* %0, i32* null, i32* null, i8** %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %1, %6
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
%9 = call i32 @slist_pop_front(%struct.slist* %0)
%10 = call i32 @slist_front(%struct.slist* %0, i32* null, i32* null, i8** %2)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %6
12: ; preds = %6, %1
%13 = call i32 @slist_free(%struct.slist* %0)
ret void
}