#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 *);
int XFreeFontNames(char **list) {
  if (list) {
    if (!*(list[0] - 1)) {
      register char **names;
      for (names = list + 1; *names; names++)
        free((*names));
    }
    free((list[0] - 1));
    free(((char *)list));
  }
  return 1;
}


x86 assembly (clang, -O0):
<XFreeFontNames>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     118d <XFreeFontNames+0x7d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmpb   $0x0,-0x1(%rax)
jne    1174 <XFreeFontNames+0x64>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     116f <XFreeFontNames+0x5f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1144 <XFreeFontNames+0x34>
jmp    1174 <XFreeFontNames+0x64>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
add    $0xffffffffffffffff,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XFreeFontNames>:
test   %rdi,%rdi
je     116f <XFreeFontNames+0x5f>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rax
cmpb   $0x0,-0x1(%rax)
jne    1154 <XFreeFontNames+0x44>
mov    0x8(%r14),%rdi
test   %rdi,%rdi
je     1154 <XFreeFontNames+0x44>
lea    0x10(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1140 <XFreeFontNames+0x30>
mov    (%r14),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @XFreeFontNames(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = icmp ne i8** %4, null
br i1 %5, label %6, label %37
6: ; preds = %1
%7 = load i8**, i8*** %2
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i64 -1
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %28, label %13
13: ; preds = %6
%14 = load i8**, i8*** %2
%15 = getelementptr inbounds i8*, i8** %14, i64 1
store i8** %15, i8*** %3
br label %16
16: ; preds = %24, %13
%17 = load i8**, i8*** %3
%18 = load i8*, i8** %17
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %27
20: ; preds = %16
%21 = load i8**, i8*** %3
%22 = load i8*, i8** %21
%23 = call i32 @free(i8* %22)
br label %24
24: ; preds = %20
%25 = load i8**, i8*** %3
%26 = getelementptr inbounds i8*, i8** %25, i32 1
store i8** %26, i8*** %3
br label %16
27: ; preds = %16
br label %28
28: ; preds = %27, %6
%29 = load i8**, i8*** %2
%30 = getelementptr inbounds i8*, i8** %29, i64 0
%31 = load i8*, i8** %30
%32 = getelementptr inbounds i8, i8* %31, i64 -1
%33 = call i32 @free(i8* %32)
%34 = load i8**, i8*** %2
%35 = bitcast i8** %34 to i8*
%36 = call i32 @free(i8* %35)
br label %37
37: ; preds = %28, %1
ret i32 1
}

LLVM IR (-O2):
define i32 @XFreeFontNames(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %27, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %21
8: ; preds = %3
%9 = getelementptr inbounds i8*, i8** %0, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %21, label %12
12: ; preds = %8, %12
%13 = phi i8* [ %17, %12 ], [ %10, %8 ]
%14 = phi i8** [ %16, %12 ], [ %9, %8 ]
%15 = tail call i32 @free(i8* %13)
%16 = getelementptr inbounds i8*, i8** %14, i64 1
%17 = load i8*, i8** %16
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %12
19: ; preds = %12
%20 = load i8*, i8** %0
br label %21
21: ; preds = %19, %8, %3
%22 = phi i8* [ %20, %19 ], [ %4, %8 ], [ %4, %3 ]
%23 = getelementptr inbounds i8, i8* %22, i64 -1
%24 = tail call i32 @free(i8* %23)
%25 = bitcast i8** %0 to i8*
%26 = tail call i32 @free(i8* %25)
br label %27
27: ; preds = %21, %1
ret i32 1
}