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

/* Variables and functions */
int list_count(struct list_t *);
int /*<<< orphan*/ list_free(struct list_t *);
char *list_get(struct list_t *, int);
int /*<<< orphan*/ str_free(char *);
void str_token_list_free(struct list_t *token_list) {
  int i;
  char *token;
  for ((i) = 0; (i) < list_count((token_list)); (i)++) {
    token = list_get(token_list, i);
    str_free(token);
  }
  list_free(token_list);
}


x86 assembly (clang, -O0):
<str_token_list_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <list_count@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    1196 <str_token_list_free+0x56>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <list_get@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <str_free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <str_token_list_free+0x13>
mov    -0x8(%rbp),%rdi
call   1040 <list_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_token_list_free>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1060 <list_count@plt>
test   %eax,%eax
jle    1181 <str_token_list_free+0x41>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <list_get@plt>
mov    %rax,%rdi
call   1050 <str_free@plt>
add    $0x1,%ebp
mov    %rbx,%rdi
call   1060 <list_count@plt>
cmp    %eax,%ebp
jl     1160 <str_token_list_free+0x20>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <list_free@plt>

LLVM IR (-O0):
%struct.list_t = type { i32 }
define void @str_token_list_free(%struct.list_t* %0) {
%2 = alloca %struct.list_t*
%3 = alloca i32
%4 = alloca i8*
store %struct.list_t* %0, %struct.list_t** %2
store i32 0, i32* %3
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %3
%7 = load %struct.list_t*, %struct.list_t** %2
%8 = call i32 @list_count(%struct.list_t* %7)
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %19
10: ; preds = %5
%11 = load %struct.list_t*, %struct.list_t** %2
%12 = load i32, i32* %3
%13 = call i8* @list_get(%struct.list_t* %11, i32 %12)
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = call i32 @str_free(i8* %14)
br label %16
16: ; preds = %10
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %5
19: ; preds = %5
%20 = load %struct.list_t*, %struct.list_t** %2
%21 = call i32 @list_free(%struct.list_t* %20)
ret void
}

LLVM IR (-O2):
%struct.list_t = type { i32 }
define void @str_token_list_free(%struct.list_t* %0) {
%2 = tail call i32 @list_count(%struct.list_t* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = tail call i8* @list_get(%struct.list_t* %0, i32 %5)
%7 = tail call i32 @str_free(i8* %6)
%8 = add nuw nsw i32 %5, 1
%9 = tail call i32 @list_count(%struct.list_t* %0)
%10 = icmp slt i32 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %4, %1
%12 = tail call i32 @list_free(%struct.list_t* %0)
ret void
}