void list_delete(struct list *list) {
  ((void)((list) ? 0
                 : (_zlog_assert_failed(
                        "list",
                        "/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/"
                        "AirbornWdd/qpimd/refs/heads/master/lib/linklist.c",
                        228, __func__),
                    0)));
  list_delete_all_node(list);
  list_free(list);
}


x86 assembly (clang, -O0):
<list_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <list_delete+0x1c>
jmp    116d <list_delete+0x3d>
lea    0xead(%rip),%rdi
lea    0xeab(%rip),%rsi
mov    $0xe4,%edx
lea    0xf2b(%rip),%rcx
mov    $0x0,%al
call   1050 <_zlog_assert_failed@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <list_delete_all_node@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <list_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_delete>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    115a <list_delete+0x2a>
lea    0xec0(%rip),%rdi
lea    0xebe(%rip),%rsi
lea    0xf43(%rip),%rcx
mov    $0xe4,%edx
xor    %eax,%eax
call   1050 <_zlog_assert_failed@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <list_delete_all_node@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <list_free@plt>

LLVM IR (-O0):
%struct.list = type opaque
@.str = [5 x i8] c"list\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AirbornWdd/qpimd/refs/heads/master/lib/linklist.c\00"
@__func__.list_delete = [12 x i8] c"list_delete\00"
define void @list_delete(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
%3 = load %struct.list*, %struct.list** %2
%4 = icmp ne %struct.list* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_zlog_assert_failed to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 228, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.list_delete, i64 0, i64 0))
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 0, %5 ], [ 0, %6 ]
%10 = load %struct.list*, %struct.list** %2
%11 = call i32 (%struct.list*, ...) bitcast (i32 (...)* @list_delete_all_node to i32 (%struct.list*, ...)*)(%struct.list* %10)
%12 = load %struct.list*, %struct.list** %2
%13 = call i32 (%struct.list*, ...) bitcast (i32 (...)* @list_free to i32 (%struct.list*, ...)*)(%struct.list* %12)
ret void
}

LLVM IR (-O2):
%struct.list = type opaque
@.str = [5 x i8] c"list\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AirbornWdd/qpimd/refs/heads/master/lib/linklist.c\00"
@__func__.list_delete = [12 x i8] c"list_delete\00"
define void @list_delete(%struct.list* %0) {
%2 = icmp eq %struct.list* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @_zlog_assert_failed to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 228, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.list_delete, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
%6 = tail call i32 (%struct.list*, ...) bitcast (i32 (...)* @list_delete_all_node to i32 (%struct.list*, ...)*)(%struct.list* %0)
%7 = tail call i32 (%struct.list*, ...) bitcast (i32 (...)* @list_free to i32 (%struct.list*, ...)*)(%struct.list* %0)
ret void
}