#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*/ EXIT_FAILURE;
int errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *,
                           int);
char **realloc(char **, size_t const);
int /*<<< orphan*/ stderr;
char *strerror(int);
char **stringlist_list_reallocate(char **list, const size_t capacity) {
  char **new_list = realloc(list, capacity * sizeof *new_list);
  if (!new_list) {
    fprintf(stderr,
            "Error: couldn't resize string list: "
            "%s, line %d\n    %s (%d)\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/paulgriffiths/pgutils/refs/heads/master/"
            "datastruct/stringlist.c",
            209, strerror(errno), errno);
    exit(EXIT_FAILURE);
  }
  return new_list;
}


x86 assembly (clang, -O0):
<stringlist_list_reallocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
shl    $0x3,%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11c0 <stringlist_list_reallocate+0x80>
mov    0x2e69(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    %rax,%r8
mov    0x2e41(%rip),%rax
mov    (%rax),%r9d
lea    0xe5f(%rip),%rsi
lea    0xe95(%rip),%rdx
mov    $0xd1,%ecx
call   1030 <fprintf@plt>
mov    0x2e17(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringlist_list_reallocate>:
push   %r14
push   %rbx
push   %rax
shl    $0x3,%rsi
call   1040 <realloc@plt>
test   %rax,%rax
je     115a <stringlist_list_reallocate+0x1a>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e7f(%rip),%rax
mov    (%rax),%ebx
mov    0x2e6e(%rip),%r14
mov    (%r14),%edi
call   1060 <strerror@plt>
mov    (%r14),%r9d
lea    0xe84(%rip),%rsi
lea    0xeba(%rip),%rdx
mov    %ebx,%edi
mov    $0xd1,%ecx
mov    %rax,%r8
call   1030 <fprintf@plt>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [61 x i8] c"Error: couldn't resize string list: %s, line %d\0A %s (%d)\0A\00"
@.str.1 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/paulgriffiths/pgutils/refs/heads/master/datastruct/stringlist.c\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define i8** @stringlist_list_reallocate(i8** %0, i64 %1) {
%3 = alloca i8**
%4 = alloca i64
%5 = alloca i8**
store i8** %0, i8*** %3
store i64 %1, i64* %4
%6 = load i8**, i8*** %3
%7 = load i64, i64* %4
%8 = mul i64 %7, 8
%9 = call i8** @realloc(i8** %6, i64 %8)
store i8** %9, i8*** %5
%10 = load i8**, i8*** %5
%11 = icmp ne i8** %10, null
br i1 %11, label %20, label %12
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i32, i32* @errno
%15 = call i8* @strerror(i32 %14)
%16 = load i32, i32* @errno
%17 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.1, i64 0, i64 0), i32 209, i8* %15, i32 %16)
%18 = load i32, i32* @EXIT_FAILURE
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %2
%21 = load i8**, i8*** %5
ret i8** %21
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [61 x i8] c"Error: couldn't resize string list: %s, line %d\0A %s (%d)\0A\00"
@.str.1 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/paulgriffiths/pgutils/refs/heads/master/datastruct/stringlist.c\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define noalias i8** @stringlist_list_reallocate(i8** nocapture %0, i64 %1) {
%3 = shl i64 %1, 3
%4 = tail call i8** @realloc(i8** %0, i64 %3)
%5 = icmp eq i8** %4, null
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i32, i32* @errno
%9 = tail call i8* @strerror(i32 %8)
%10 = load i32, i32* @errno
%11 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.1, i64 0, i64 0), i32 209, i8* %9, i32 %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = tail call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
ret i8** %4
}